Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notes and extracted hard-coding of fre/cmor/cmor_mixer.py #232

Open
ilaflott opened this issue Oct 30, 2024 · 1 comment · May be fixed by #227
Open

notes and extracted hard-coding of fre/cmor/cmor_mixer.py #232

ilaflott opened this issue Oct 30, 2024 · 1 comment · May be fixed by #227
Assignees

Comments

@ilaflott
Copy link
Member

as of this commit, some of the notes/details you see below are actually being used by being defined
in comment form, if you will....

# ------ \start assumptions / potential future configuration thingies.                                                                                              
# GLOBAL hardcoded assumption: netcdf files always have an ending of '.nc'                                                                                          
#                              many implicit assumptions regarding the presence of metadata in the input netcdf file name                                           
#                                  e.g. datetime, variable name, name_of_set are all assumed to be at particular spots                                              
#                              utf8 encoding                                                                                                                        
#                              MINOR: opening netcdf files in append or write or read                                                                               
#                              MINOR: key names in certain input configuration files- these are tightly controlled                                                  
#                                                                                                                                                                   
# for check_dataset_for_ocean_grids:                                                                                                                                
#                                    input reading/checking hardcode - dataset doesn't have a variable named 'xh'                                                   
# for get_vertical_dimension:                                                                                                                                       
#                             input reading/checking hardcode - dataset has dimension/axis name 'Z'                                                                 
# for create_tmp_dir:                                                                                                                                               
#                     input reading/checking hardcode - check output directory for specific drives local2, work, net                                                
#                     output moving/writing hardcode - tmpdir name is 'tmp' if condition met                                                                        
#                                                                                                                                                                   
# for rewrite_netcdf_file_var:                                                                                                                                      
#                              input reading/checking hardcode - dimensions named 'lat', 'lon', 'time'                                                              
#                              input reading/checking hardcode - "bounds" for above, named 'lat_bnds', 'lon_bnds', 'time_bnds'                                      
#                              input reading/checking hardcode - check that var_dim is 3 or 4                                                                       
#                              input reading/checking hardcode - check that var_dim is 3 --> simple 3 dim subcase                                                   
#                              input reading/checking hardcode - if var_dim is 4, vert_dim must be one of the following:                                            
#                                                                "plev30", "plev19", "plev8","height2m", "level", "lev", "levhalf"                                  
#                              input reading/checking hardcode -     then subcases are relevant as follows:                                                         
#                                                                    if   vert_dim in ["plev30", "plev19", "plev8", "height2m"] --> SUBCASE                         
#                                                                    elif vert_dim in ["level", "lev", "levhalf"] --> DISTINCT SUBCASE                              
#                                                                        pressure input file is tagged with 'ps' potentially nearby                                 
#                                                                        sub_sub_case --> if vert_dim is lev_half                                                   
#                                                                            input ds has zfactor values as 'ap_bnds', 'b_bnds'                                     
#                              output moving/writing hardcode -              output zfactors have names "ap_half", "b_half",                                        
#                                                                            output vertical level axis name "alternate_hybrid_sigma_half"                          
#                                                                        sub_sub_case --> else                                                                      
#                                                                            input ds has zfactor values as 'ap' and 'b', and zfactor bnds as 'ap_bnds', 'b_bnds'   
#                              output moving/writing hardcode -              output zfactors have names "ap", "b",                                                  
#                                                                            output vertical level axis name "alternate_hybrid_sigma"                               
#                              output moving/writing hardcode -          output interpolated pressures have name "ps", units "Pa"                                   
#                              output moving/writing hardcode -  cmor setup parameters                                                                              
#                              output moving/writing hardcode -  lat/lon axies named "latitude"/"longitude" with units "degrees_N" "degrees_E"                      
#                                                                                                                                                                   
# for cmorize_target_var_files:                                                                                                                                     
#                               input reading/checking hardcode - pressure input file is tagged with 'ps' potentially nearby                                        
#                               output moving/writing hardcode -  pressure out file is named with 'ps'                                                              
#                                                                                                                                                                   
                                                                                                                                                                    
                                                                                                                                                                    
                                                                                                                                                                                                                                      

in const form

# ----- \start consts                                                                                                                                               
DEBUG_MODE_RUN_ONE = True                                                                                                                                           
                                                                                                                                                                    
#                                                                                                                                                                   
INPUT_READ_PS_FILE_VAR_NAME = 'ps'                                                                                                                                  
INPUT_READDIR_NAME_CHECKS = [ [ 'contains', '/work'],                                                                                                               
                              ['contains', '/net'],                                                                                                                 
                              ['equal', '/local2']  ]                                                                                                               
                                                                                                                                                                    
#                                                                                                                                                                   
OUTPUT_TEMP_DIR_NAME = 'tmp'                                                                                                                                        
                                                                                                                                                                    
#                                                                                                                                                                   
INPUT_READ_OCEAN_GRID_VAR_NAME = 'xh'                                                                                                                               
INPUT_READ_Z_AXIS_NAME = 'Z'                                                                                                                                        
                                                                                                                                                                    
#                                                                                                                                                                   
INPUT_READ_LAT_DIM = 'lat'                                                                                                                                          
INPUT_READ_LAT_BNDS = 'lat_bnds'                                                                                                                                    
INPUT_READ_LON_DIM = 'lon'                                                                                                                                          
INPUT_READ_LON_BNDS = 'lon_bnds'                                                                                                                                    
INPUT_READ_TIME_DIM = 'time'                                                                                                                                        
INPUT_READ_TIME_BNDS = 'time_bnds'                                                                                                                                  
                                                                                                                                                                    
#                                                                                                                                                                   
INPUT_ACCEPT_VAR_DIMS = [3,4]                                                                                                                                       
INPUT_ACCEPT_VERT_DIMS = ["plev30", "plev19", "plev8","height2m", "level", "lev", "levhalf"]                                                                        
                                                                                                                                                                    
# ----                                                                                                                                                              
#INPUT_SUBCASE1_VAR_VERT_DIMS = { "4": [ "plev30", "plev19", "plev8", "height2m" ] }                                                                                
                                                                                                                                                                    
# ----                                                                                                                                                              
INPUT_SUBCASE2_VAR_VERT_DIMS = { "4": [ "level", "lev", "levhalf" ] }                                                                                               
#-                                                                                                                                                                  
OUTPUT_SUBCASE2_PS_VAR_NAME = 'ps'                                                                                                                                  
OUTPUT_SUBCASE2_PS_VAR_UNIT = 'Pa'                                                                                                                                  
                                                                                                                                                                    
# --- ---                                                                                                                                                           
INPUT_SUBCASE2_0_VAR_VERT_DIMS = { "4": [ "levhalf" ] }                                                                                                             
INPUT_SUBCASE2_0_ZFACT_VALS = ['ap_bnds','b_bnds']                                                                                                                  
#-                                                                                                                                                                  
OUTPUT_SUBCASE2_0_ZFACT_VAL_NAMES = ['ap_half','b_half']                                                                                                            
OUTPUT_SUBCASE2_0_VERT_LVL_NAME = 'altername_hybrid_sigma_half'                                                                                                     
                                                                                                                                                                    
# --- ---                                                                                                                                                           
INPUT_SUBCASE2_1_VAR_VERT_DIMS = { "4": [ "level", "lev" ] }                                                                                                        
INPUT_SUBCASE2_1_ZFACT_VALS = ['ap','b']                                                                                                                            
INPUT_SUBCASE2_1_ZFACT_BNDS = ['ap_bnds','b_bnds']                                                                                                                  
#-                                                                                                                                                                  
OUTPUT_SUBCASE2_0_ZFACT_VAL_NAMES = ['ap','b']                                                                                                                      
OUTPUT_SUBCASE2_0_VERT_LVL_NAME = 'altername_hybrid_sigma'         
@ilaflott ilaflott self-assigned this Oct 30, 2024
@ilaflott ilaflott linked a pull request Oct 30, 2024 that will close this issue
@ilaflott ilaflott added enhancement New feature or request discussion Discuss an issue and it's solutions clean up priority: MEDIUM labels Oct 30, 2024
@ceblanton
Copy link
Collaborator

Interesting to see all the conventions together. Some of them are CF conventions, such as the units of latitude, that can be relied on in this world of ours. Others are de-facto conventions that could be rephrased if needed (but it's not really needed), lat_bnds, etc. The remainders after those two are CMIP7-particular conventions.

@ilaflott ilaflott removed enhancement New feature or request discussion Discuss an issue and it's solutions clean up priority: MEDIUM labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants