diff --git a/modulefiles/tasks/jet/miniconda_regional_workflow b/modulefiles/tasks/jet/miniconda_regional_workflow index 011a832c9..48de7a99b 100644 --- a/modulefiles/tasks/jet/miniconda_regional_workflow +++ b/modulefiles/tasks/jet/miniconda_regional_workflow @@ -1,5 +1,5 @@ #%Module -module use -a /contrib/miniconda3/modulefiles -module load miniconda3 +module use /contrib/miniconda3/modulefiles +module load miniconda3/4.5.12 setenv SRW_ENV regional_workflow diff --git a/scripts/exregional_make_ics.sh b/scripts/exregional_make_ics.sh index fcfefd646..7af832c4c 100755 --- a/scripts/exregional_make_ics.sh +++ b/scripts/exregional_make_ics.sh @@ -518,7 +518,6 @@ fi # settings=" 'config': { - 'fix_dir_input_grid': ${FIXgsm}, 'fix_dir_target_grid': ${FIXLAM}, 'mosaic_file_target_grid': ${FIXLAM}/${CRES}${DOT_OR_USCORE}mosaic.halo$((10#${NH4})).nc, 'orog_dir_target_grid': ${FIXLAM}, diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index 70ba51176..a98ab354d 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -442,7 +442,6 @@ list file has not specified for this external LBC model (EXTRN_MDL_NAME_LBCS): # settings=" 'config': { - 'fix_dir_input_grid': ${FIXgsm}, 'fix_dir_target_grid': ${FIXLAM}, 'mosaic_file_target_grid': ${FIXLAM}/${CRES}${DOT_OR_USCORE}mosaic.halo$((10#${NH4})).nc, 'orog_dir_target_grid': ${FIXLAM}, diff --git a/tests/WE2E/get_WE2Etest_names_subdirs_descs.sh b/tests/WE2E/get_WE2Etest_names_subdirs_descs.sh index d0db858b3..c2a6f72fc 100755 --- a/tests/WE2E/get_WE2Etest_names_subdirs_descs.sh +++ b/tests/WE2E/get_WE2Etest_names_subdirs_descs.sh @@ -27,29 +27,29 @@ # Optional verbosity flag. Should be set to "TRUE" or "FALSE". Default # is "FALSE". # -# output_varname_test_configs_basedir: +# outvarname_test_configs_basedir: # Name of output variable in which to return the base directory of the # WE2E test configuration files. # -# output_varname_test_names: +# outvarname_test_names: # Name of output array variable in which to return the names of the WE2E # tests. # -# output_varname_test_subdirs: +# outvarname_test_subdirs: # Name of output array variable in which to return the category subdirectories # in which the WE2E tests are located. # -# output_varname_test_ids: +# outvarname_test_ids: # Name of output array variable in which to return the IDs of the WE2E # tests. # -# output_varname_test_descs: +# outvarname_test_descs: # Name of output array variable in which to return the descriptions of # the WE2E tests. # # Note that any input argument that is not specified in the call to this # function gets set to a null string in the body of the function. In -# particular, if any of the arguments that start with "output_varname_" +# particular, if any of the arguments that start with "outvarname_" # (indicating that they specify the name of an output variable) are not # set in the call, the values corresponding to those variables are not # returned to the calling script or function. @@ -61,10 +61,10 @@ # # test_configs_basedir="${WE2Edir}/test_configs" # -# If the argument output_varname_test_configs_basedir is specified in -# the call to this function, then the value of test_configs_basedir will -# be returned to the calling script or function (in the variable specified -# by output_varname_test_configs_basedir). +# If the argument outvarname_test_configs_basedir is specified in the +# call to this function, then the value of test_configs_basedir will be +# returned to the calling script or function (in the variable specified +# by outvarname_test_configs_basedir). # # The WE2E test configuration files are located in subdirectories under # the base directory. This function sets the names of these subdirectories @@ -170,8 +170,8 @@ # in which the test configuration files corresponding to each test # name are located. # 3) The IDs corresponding to each of the test names. -# 4) The test descriptions (if output_varname_test_descs is specified in -# the call to this function or if generate_csv_file is or gets set to +# 4) The test descriptions (if outvarname_test_descs is specified in the +# call to this function or if generate_csv_file is or gets set to # "TRUE"; see below). # # These local arrays are sorted in order of increasing test ID. Within @@ -189,10 +189,10 @@ # the arrays in which each of the quantities listed above should be # returned (to the calling script or function): # -# output_varname_test_names -# output_varname_test_subdirs -# output_varname_test_ids -# output_varname_test_descs +# outvarname_test_names +# outvarname_test_subdirs +# outvarname_test_ids +# outvarname_test_descs # # If any of these is not specified in the call to this function, then # the corresponding quantity will not be returned to the calling script @@ -206,7 +206,7 @@ # 1) The user explicitly asks for the descriptions to be returned by # specifying in the call to this function the name of the array in # which to return them (by setting a value for the argument -# output_varname_test_descs). +# outvarname_test_descs). # 2) A CSV file summarizing the WE2E tests will be generated (see below) # # For convenience, this function can generate a CSV (comma-separated @@ -267,11 +267,11 @@ function get_WE2Etest_names_subdirs_descs() { "WE2Edir" \ "generate_csv_file" \ "verbose" \ - "output_varname_test_configs_basedir" \ - "output_varname_test_names" \ - "output_varname_test_subdirs" \ - "output_varname_test_ids" \ - "output_varname_test_descs" \ + "outvarname_test_configs_basedir" \ + "outvarname_test_names" \ + "outvarname_test_subdirs" \ + "outvarname_test_ids" \ + "outvarname_test_descs" \ ) process_args "valid_args" "$@" # @@ -294,7 +294,7 @@ function get_WE2Etest_names_subdirs_descs() { # verbose=${verbose:-"FALSE"} check_var_valid_value "verbose" "valid_vals_BOOLEAN" - verbose=$(boolify $verbose) + verbose=$(boolify "$verbose") # #----------------------------------------------------------------------- # @@ -302,7 +302,9 @@ function get_WE2Etest_names_subdirs_descs() { # #----------------------------------------------------------------------- # - local all_items \ + local abs_cost_ref \ + ac \ + all_items \ alt_test_name \ alt_test_names \ alt_test_names_subdirs \ @@ -316,11 +318,15 @@ function get_WE2Etest_names_subdirs_descs() { column_titles \ config_fn \ crnt_item \ + crnt_title \ csv_delimiter \ csv_fn \ csv_fp \ cwd \ default_val \ + dt_atmos \ + fcst_len_hrs \ + get_test_descs \ hash_or_null \ i \ ii \ @@ -331,6 +337,7 @@ function get_WE2Etest_names_subdirs_descs() { mod_time_csv \ mod_time_subdir \ msg \ + nf \ num_alt_tests \ num_category_subdirs \ num_cdates \ @@ -338,20 +345,25 @@ function get_WE2Etest_names_subdirs_descs() { num_days \ num_fcsts \ num_fcsts_orig \ + num_grid_pts \ num_items \ num_occurrences \ num_prim_tests \ num_tests \ + num_time_steps \ num_vars_to_extract \ prim_array_names_vars_to_extract \ prim_test_descs \ + prim_test_dt_atmos \ prim_test_ids \ prim_test_name_subdir \ prim_test_names \ prim_test_num_fcsts \ + prim_test_rel_cost \ prim_test_subdirs \ - get_test_descs \ + rc \ regex_search \ + rel_cost \ row_content \ sort_inds \ stripped_line \ @@ -386,11 +398,49 @@ function get_WE2Etest_names_subdirs_descs() { test_subdirs_orig \ test_subdirs_str \ test_type \ + units \ + ushdir \ val \ - valid_vals_generate_csv_file \ var_name \ var_name_at \ vars_to_extract + + local grid_gen_method \ + \ + gfdlgrid_lon_t6_ctr \ + gfdlgrid_lat_t6_ctr \ + gfdlgrid_res \ + gfdlgrid_stretch_fac \ + gfdlgrid_refine_ratio \ + gfdlgrid_istart_of_rgnl_dom_on_t6g \ + gfdlgrid_iend_of_rgnl_dom_on_t6g \ + gfdlgrid_jstart_of_rgnl_dom_on_t6g \ + gfdlgrid_jend_of_rgnl_dom_on_t6g \ + \ + esggrid_lon_ctr \ + esggrid_lat_ctr \ + esggrid_nx \ + esggrid_ny \ + esggrid_pazi \ + esggrid_wide_halo_width \ + esggrid_delx \ + esggrid_dely \ + \ + nx \ + ny \ + dta +# +#----------------------------------------------------------------------- +# +# Source files. +# +#----------------------------------------------------------------------- +# + ushdir=$( readlink -f "$WE2Edir/../../ush" ) + . $ushdir/constants.sh + . $ushdir/set_predef_grid_params.sh + . $ushdir/set_gridparams_GFDLgrid.sh + . $ushdir/set_gridparams_ESGgrid.sh # #----------------------------------------------------------------------- # @@ -410,17 +460,8 @@ function get_WE2Etest_names_subdirs_descs() { # if [ ! -z "${generate_csv_file}" ]; then - valid_vals_generate_csv_file=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") - check_var_valid_value "generate_csv_file" "valid_vals_generate_csv_file" - - generate_csv_file=${generate_csv_file^^} - if [ "${generate_csv_file}" = "TRUE" ] || \ - [ "${generate_csv_file}" = "YES" ]; then - generate_csv_file="TRUE" - elif [ "${generate_csv_file}" = "FALSE" ] || \ - [ "${generate_csv_file}" = "NO" ]; then - generate_csv_file="FALSE" - fi + check_var_valid_value "generate_csv_file" "valid_vals_BOOLEAN" + generate_csv_file=$(boolify "${generate_csv_file}") # # If generate_csv_file was not specified as an input argument in the # call to this function, then it will have been set above to a null @@ -521,6 +562,8 @@ information on all WE2E tests: prim_test_ids=() prim_test_subdirs=() prim_test_num_fcsts=() + prim_test_dt_atmos=() + prim_test_rel_cost=() alt_test_names=() alt_test_subdirs=() @@ -859,18 +902,18 @@ they correspond to unique test names and rerun." # #----------------------------------------------------------------------- # -# If the input argument output_varname_test_descs is not set to a null -# string (meaning that the name of the array in which to return the WE2E -# test descriptions is specified in the call to this function), or if -# the flag generate_csv_file is set to "TRUE", we need to obtain the -# WE2E test descriptions from the test configuration files. In these -# cases, set the local variable get_test_descs to "TRUE". Otherwise, -# set it to "FALSE". +# If the input argument outvarname_test_descs is not set to a null string +# (meaning that the name of the array in which to return the WE2E test +# descriptions is specified in the call to this function), or if the flag +# generate_csv_file is set to "TRUE", we need to obtain the WE2E test +# descriptions from the test configuration files. In these cases, set +# the local variable get_test_descs to "TRUE". Otherwise, set it to +# "FALSE". # #----------------------------------------------------------------------- # get_test_descs="FALSE" - if [ ! -z "${output_varname_test_descs}" ] || \ + if [ ! -z "${outvarname_test_descs}" ] || \ [ "${generate_csv_file}" = "TRUE" ]; then get_test_descs="TRUE" fi @@ -924,9 +967,9 @@ they correspond to unique test names and rerun." prim_array_names_vars_to_extract=( $( printf "prim_test_%s_vals " "${vars_to_extract[@]}" ) ) array_names_vars_to_extract=( $( printf "%s_vals " "${vars_to_extract[@]}" ) ) for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do - cmd="${prim_array_names_vars_to_extract[$k]}=()" + cmd="local ${prim_array_names_vars_to_extract[$k]}=()" eval $cmd - cmd="${array_names_vars_to_extract[$k]}=()" + cmd="local ${array_names_vars_to_extract[$k]}=()" eval $cmd done @@ -1117,20 +1160,224 @@ ${test_desc}${stripped_line} " # # Calculate the number of forecasts that will be launched by the current # test. The "10#" forces bash to treat the following number as a decimal -# (not hexadecimal, etc). +# (not hexadecimal, etc). Note that INCR_CYCL_FREQ is in units of hours, +# so the factor of 24 is needed to convert the number of days to hours. # num_cycles_per_day=${#CYCL_HRS[@]} num_days=$(( (${DATE_LAST_CYCL} - ${DATE_FIRST_CYCL} + 1)*24/10#${INCR_CYCL_FREQ} )) num_cdates=$(( ${num_cycles_per_day}*${num_days} )) nf=$(( ${num_cdates}*10#${NUM_ENS_MEMBERS} )) # -# In the following, the single quote at the beginning forces Google Sheets -# to interpret this quantity as a string. This prevents any automatic -# number fomatting from being applied when the CSV file is imported into -# Google Sheets. +# Save the number of forecasts launched by the current test in an +# appropriately named array. In the following, the single quote at the +# beginning forces Google Sheets to interpret this quantity as a string. +# This prevents any automatic number fomatting from being applied when +# the CSV file is imported into Google Sheets. # prim_test_num_fcsts+=( "'$nf" ) # +#----------------------------------------------------------------------- +# +# Calculate the relative dynamics cost of the test, i.e. the relative +# cost of running only the dynamics portion of the forecast model. Here, +# we define the absolute cost of running the dynamics as +# +# abs_cost = nx*ny*num_time_steps*num_fcsts +# +# where nx and ny are the horizontal dimensions of the grid, num_time_steps +# is the number of time steps that need to be taken to complete one +# forecast within the test, and num_fcsts are the number of forecasts +# the test makes (e.g. if the test performs an ensemble forecast, the +# value of this parameter will be greater than 1). +# +# The relative cost is obtained by dividing the absolute cost of a test +# by the absolute cost of a reference 6-hour forecast on the RRFS_CONUS_25km +# predefined grid using the default time step for that grid. This is +# calculated later below and saved in the variable abs_cost_ref. Thus, +# the relative cost is given by +# +# rel_cost = abs_cost/abs_cost_ref +# +# defined as abs_cost_ref. +# +# Note that the (absolute or relative) cost defined here does not take +# into account the costs of running different physics suites, nor does +# it take into account the costs of workflow tasks other than the forecast +# task (e.g. generation of initial and boundary conditions, post processing, +# verification, etc; that is why it is referred to as the relative DYNAMICS +# cost). Note also that if in the future the number of levels in the +# vertical becomes a user-specified parameter, that will also have to be +# added to the definition of the cost. +# +#----------------------------------------------------------------------- +# + +# +# To calculate the absolute cost as defined above, we need the number of +# points in the two horizontal directions, nx and ny. Also, to calculate +# the number of time steps, we need the size of the time step (dt_atmos). +# These depend on the grid being used and must be extracted from the grid +# parameters. The way the latter are obtained depends on whether or not +# a predefined grid is being used. +# +# If using a predefined grid, call the set_predef_grid_params() function +# to get the grid parameters. +# + if [ ! -z "${PREDEF_GRID_NAME}" ]; then +# +# Note: +# Can set "quilting" to "FALSE" in the following argument list because +# the write-component parameters are not needed below; only those of the +# native grid are needed. +# + set_predef_grid_params \ + predef_grid_name="${PREDEF_GRID_NAME}" \ + quilting="FALSE" \ + outvarname_grid_gen_method="grid_gen_method" \ + outvarname_esggrid_lon_ctr="esggrid_lon_ctr" \ + outvarname_esggrid_lat_ctr="esggrid_lat_ctr" \ + outvarname_esggrid_delx="esggrid_delx" \ + outvarname_esggrid_dely="esggrid_dely" \ + outvarname_esggrid_nx="esggrid_nx" \ + outvarname_esggrid_ny="esggrid_ny" \ + outvarname_esggrid_pazi="esggrid_pazi" \ + outvarname_esggrid_wide_halo_width="esggrid_wide_halo_width" \ + outvarname_gfdlgrid_lon_t6_ctr="gfdlgrid_lon_t6_ctr" \ + outvarname_gfdlgrid_lat_t6_ctr="gfdlgrid_lat_t6_ctr" \ + outvarname_gfdlgrid_stretch_fac="gfdlgrid_stretch_fac" \ + outvarname_gfdlgrid_res="gfdlgrid_res" \ + outvarname_gfdlgrid_refine_ratio="gfdlgrid_refine_ratio" \ + outvarname_gfdlgrid_istart_of_rgnl_dom_on_t6g="gfdlgrid_istart_of_rgnl_dom_on_t6g" \ + outvarname_gfdlgrid_iend_of_rgnl_dom_on_t6g="gfdlgrid_iend_of_rgnl_dom_on_t6g" \ + outvarname_gfdlgrid_jstart_of_rgnl_dom_on_t6g="gfdlgrid_jstart_of_rgnl_dom_on_t6g" \ + outvarname_gfdlgrid_jend_of_rgnl_dom_on_t6g="gfdlgrid_jend_of_rgnl_dom_on_t6g" \ + outvarname_dt_atmos="dta" +# +# If using a custom grid, the test's configuration file should contain +# the grid parameters. Source this file and set the values of the grid +# parameters it contains to local variables. +# + else + + . ./${config_fn} + grid_gen_method="${GRID_GEN_METHOD}" + if [ "${grid_gen_method}" = "GFDLgrid" ]; then + gfdlgrid_lon_t6_ctr="${GFDLgrid_LON_T6_CTR}" + gfdlgrid_lat_t6_ctr="${GFDLgrid_LAT_T6_CTR}" + gfdlgrid_res="${GFDLgrid_RES}" + gfdlgrid_stretch_fac="${GFDLgrid_STRETCH_FAC}" + gfdlgrid_refine_ratio="${GFDLgrid_REFINE_RATIO}" + gfdlgrid_istart_of_rgnl_dom_on_t6g="${GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G}" + gfdlgrid_iend_of_rgnl_dom_on_t6g="${GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G}" + gfdlgrid_jstart_of_rgnl_dom_on_t6g="${GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G}" + gfdlgrid_jend_of_rgnl_dom_on_t6g="${GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G}" + elif [ "${grid_gen_method}" = "ESGgrid" ]; then + esggrid_lon_ctr="${ESGgrid_LON_CTR}" + esggrid_lat_ctr="${ESGgrid_LAT_CTR}" + esggrid_delx="${ESGgrid_DELX}" + esggrid_dely="${ESGgrid_DELY}" + esggrid_nx="${ESGgrid_NX}" + esggrid_ny="${ESGgrid_NY}" + esggrid_pazi="${ESGgrid_PAZI}" + esggrid_wide_halo_width="${ESGgrid_WIDE_HALO_WIDTH}" + fi + dta="${DT_ATMOS}" + + fi +# +# Save the value of dta (which is just dt_atmos) in an array. The single +# quote at the beginning forces Google Sheets to interpret this quantity +# as a string. This prevents any automatic number fomatting from being +# applied when the CSV file is imported into Google Sheets. +# + prim_test_dt_atmos+=( "'${dta}" ) +# +# The way the number of grid points in the horizontal directions (nx and +# ny) are calculated depends on the method used to generate the grid as +# well as the grid parameters for that method. +# + if [ "${grid_gen_method}" = "GFDLgrid" ]; then +# +# Note: +# The workflow generation mode (run_envir) can be set to "community" here +# since this does not affect the values of nx and ny. +# + set_gridparams_GFDLgrid \ + lon_of_t6_ctr="${gfdlgrid_lon_t6_ctr}" \ + lat_of_t6_ctr="${gfdlgrid_lat_t6_ctr}" \ + res_of_t6g="${gfdlgrid_res}" \ + stretch_factor="${gfdlgrid_stretch_fac}" \ + refine_ratio_t6g_to_t7g="${gfdlgrid_refine_ratio}" \ + istart_of_t7_on_t6g="${gfdlgrid_istart_of_rgnl_dom_on_t6g}" \ + iend_of_t7_on_t6g="${gfdlgrid_iend_of_rgnl_dom_on_t6g}" \ + jstart_of_t7_on_t6g="${gfdlgrid_jstart_of_rgnl_dom_on_t6g}" \ + jend_of_t7_on_t6g="${gfdlgrid_jend_of_rgnl_dom_on_t6g}" \ + verbose="$verbose" \ + outvarname_nx_of_t7_on_t7g="nx" \ + outvarname_ny_of_t7_on_t7g="ny" + + elif [ "${grid_gen_method}" = "ESGgrid" ]; then + + set_gridparams_ESGgrid \ + lon_ctr="${esggrid_lon_ctr}" \ + lat_ctr="${esggrid_lat_ctr}" \ + nx="${esggrid_nx}" \ + ny="${esggrid_ny}" \ + pazi="${esggrid_pazi}" \ + halo_width="${esggrid_wide_halo_width}" \ + delx="${esggrid_delx}" \ + dely="${esggrid_dely}" \ + outvarname_nx="nx" \ + outvarname_ny="ny" + + fi +# +# Calculate the total number of horizontal grid points. +# + num_grid_pts=$(( nx*ny )) +# +# Calculate the number of time steps for the test. Note that FCST_LEN_HRS +# is in units of hours while dta is in units of seconds. Also, the factor +# dta - 1 in the numerator is to cause the division to round up to the +# nearest integer (adding the denominator minus one to the numerator will +# make this happen). +# + num_time_steps=$(( (FCST_LEN_HRS*3600 + dta - 1)/dta )) +# +# Calculate the absolute cost of the test. +# + ac=$(( num_grid_pts*num_time_steps*nf )) +# +# Unset all grid paramters so that they are not accidentally reused for +# the next test. +# + unset gfdlgrid_lon_t6_ctr \ + gfdlgrid_lat_t6_ctr \ + gfdlgrid_res \ + gfdlgrid_stretch_fac \ + gfdlgrid_refine_ratio \ + gfdlgrid_istart_of_rgnl_dom_on_t6g \ + gfdlgrid_iend_of_rgnl_dom_on_t6g \ + gfdlgrid_jstart_of_rgnl_dom_on_t6g \ + gfdlgrid_jend_of_rgnl_dom_on_t6g \ + esggrid_lon_ctr \ + esggrid_lat_ctr \ + esggrid_nx \ + esggrid_ny \ + esggrid_pazi \ + esggrid_wide_halo_width \ + esggrid_delx \ + esggrid_dely \ + dta \ + nx \ + ny +# +# Save the absolute cost for this test in the array that will eventually +# contain the relative cost. The values in this array will be divided +# by abs_cost_ref later below to obtain relative costs. +# + prim_test_rel_cost+=( "$ac" ) +# # Unset the experiment variables defined for the current test so that # they are not accidentally used for the next one. # @@ -1140,6 +1387,37 @@ ${test_desc}${stripped_line} " eval $cmd done + done # End loop over primary tests +# +#----------------------------------------------------------------------- +# +# Normalize the absolute costs calculated above for each test by the +# absolute cost of a reference 6-hour forecast on the RRFS_CONUS_25km +# predefined grid (using the default time step for that grid). +# +#----------------------------------------------------------------------- +# + set_predef_grid_params \ + predef_grid_name="RRFS_CONUS_25km" \ + quilting="FALSE" \ + outvarname_esggrid_nx="nx" \ + outvarname_esggrid_ny="ny" \ + outvarname_dt_atmos="dta" + + num_grid_pts=$(( nx*ny )) + fcst_len_hrs="6" + num_time_steps=$(( (fcst_len_hrs*3600 + dta - 1)/dta )) + abs_cost_ref=$(( num_grid_pts*num_time_steps )) + + for (( i=0; i<=$((num_prim_tests-1)); i++ )); do +# +# In the following, the single quote at the beginning forces Google Sheets +# to interpret this quantity as a string. This prevents any automatic +# number fomatting from being applied when the CSV file is imported into +# Google Sheets. +# + prim_test_rel_cost[$i]="'"$( printf "%g" \ + $( bc -l <<< " ${prim_test_rel_cost[$i]}/${abs_cost_ref}" ) ) done fi @@ -1158,6 +1436,8 @@ ${test_desc}${stripped_line} " if [ "${get_test_descs}" = "TRUE" ]; then test_descs=("${prim_test_descs[@]}") num_fcsts=("${prim_test_num_fcsts[@]}") + dt_atmos=("${prim_test_dt_atmos[@]}") + rel_cost=("${prim_test_rel_cost[@]}") for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do cmd="${array_names_vars_to_extract[$k]}=(\"\${${prim_array_names_vars_to_extract[$k]}[@]}\")" eval $cmd @@ -1187,6 +1467,8 @@ ${test_desc}${stripped_line} " if [ "${get_test_descs}" = "TRUE" ]; then test_descs+=("${prim_test_descs[$j]}") num_fcsts+=("${prim_test_num_fcsts[$j]}") + dt_atmos+=("${prim_test_dt_atmos[$j]}") + rel_cost+=("${prim_test_rel_cost[$j]}") for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do cmd="${array_names_vars_to_extract[$k]}+=(\"\${${prim_array_names_vars_to_extract[$k]}[$j]}\")" eval $cmd @@ -1266,9 +1548,9 @@ Please correct and rerun." sed -n -r -e "s/${regex_search}/\2/p" ) done - test_names_orig=( "${test_names[@]}" ) - test_subdirs_orig=( "${test_subdirs[@]}" ) - test_ids_orig=( "${test_ids[@]}" ) + local test_names_orig=( "${test_names[@]}" ) + local test_subdirs_orig=( "${test_subdirs[@]}" ) + local test_ids_orig=( "${test_ids[@]}" ) for (( i=0; i<=$((num_tests-1)); i++ )); do ii="${sort_inds[$i]}" test_names[$i]="${test_names_orig[$ii]}" @@ -1278,10 +1560,12 @@ Please correct and rerun." if [ "${get_test_descs}" = "TRUE" ]; then - test_descs_orig=( "${test_descs[@]}" ) - num_fcsts_orig=( "${num_fcsts[@]}" ) + local test_descs_orig=( "${test_descs[@]}" ) + local num_fcsts_orig=( "${num_fcsts[@]}" ) + local dt_atmos_orig=( "${dt_atmos[@]}" ) + local rel_cost_orig=( "${rel_cost[@]}" ) for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do - cmd="${array_names_vars_to_extract[$k]}_orig=(\"\${${array_names_vars_to_extract[$k]}[@]}\")" + cmd="local ${array_names_vars_to_extract[$k]}_orig=(\"\${${array_names_vars_to_extract[$k]}[@]}\")" eval $cmd done @@ -1289,6 +1573,8 @@ Please correct and rerun." ii="${sort_inds[$i]}" test_descs[$i]="${test_descs_orig[$ii]}" num_fcsts[$i]="${num_fcsts_orig[$ii]}" + dt_atmos[$i]="${dt_atmos_orig[$ii]}" + rel_cost[$i]="${rel_cost_orig[$ii]}" for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do cmd="${array_names_vars_to_extract[$k]}[$i]=\"\${${array_names_vars_to_extract[$k]}_orig[$ii]}\"" eval $cmd @@ -1325,14 +1611,44 @@ Please correct and rerun." # detail further below. # column_titles="\ -\"Test Name (Subdirectory)\" ${csv_delimiter} \ -\"Alternate Test Names (Subdirectories)\" ${csv_delimiter} \ +\"Test Name +(Subdirectory)\" ${csv_delimiter} \ +\"Alternate Test Names +(Subdirectories)\" ${csv_delimiter} \ \"Test Purpose/Description\" ${csv_delimiter} \ +\"Relative Cost of Running Dynamics +(1 corresponds to running a 6-hour forecast on the RRFS_CONUS_25km predefined grid using the default time step)\" ${csv_delimiter} \ \"Number of Forecast Model Runs\"" for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do - column_titles="\ -${column_titles} ${csv_delimiter} \ -\"${vars_to_extract[$k]}\"" + + crnt_title="${vars_to_extract[$k]}" + # + # Add units for select fields. + # + units="" + case "${vars_to_extract[$k]}" in + "INCR_CYCL_FREQ") + units="[hr]" + ;; + "FCST_LEN_HRS") + units="[hr]" + ;; + "LBC_SPEC_INTVL_HRS") + units="[hr]" + ;; + esac + crnt_title="${crnt_title}${units:+ $units}" + + column_titles="${column_titles} ${csv_delimiter} \"${crnt_title}\"" + # + # Insert a column for DT_ATMOS right after the one for FCST_LEN_HRS. + # + if [ "${vars_to_extract[$k]}" = "FCST_LEN_HRS" ]; then + units="[sec]" + crnt_title="DT_ATMOS${units:+ $units}" + column_titles="${column_titles} ${csv_delimiter} \"${crnt_title}\"" + fi + done printf "%s\n" "${column_titles}" >> "${csv_fp}" # @@ -1349,7 +1665,7 @@ ${column_titles} ${csv_delimiter} \ # Get the primary name of the test and the category subdirectory in which # it is located. # - prim_test_name_subdir="${test_names[$j]} (${test_subdirs[$j]})" + prim_test_name_subdir="${test_names[$j]}"$'\n'"(${test_subdirs[$j]})" # # Get the test ID. # @@ -1365,8 +1681,15 @@ ${column_titles} ${csv_delimiter} \ # test_desc=$( printf "%s" "${test_desc}" | sed -r -e "s/\"/\"\"/g" ) # -# Get the number of forecasts (number of times the forcast model is run, -# due to a unique starting date, an ensemble member, etc). +# Get the time step. +# + dta="${dt_atmos[$j]}" +# +# Get the relative cost. +# + rc="${rel_cost[$j]}" +# +# Get the number of forecasts (number of times the forcast model is run). # nf="${num_fcsts[$j]}" # @@ -1382,15 +1705,15 @@ ${column_titles} ${csv_delimiter} \ while [ "$jp1" -lt "${num_tests}" ]; do test_id_next="${test_ids[$jp1]}" if [ "${test_id_next}" -eq "${test_id}" ]; then - alt_test_names_subdirs="\ -${alt_test_names_subdirs} -${test_names[$jp1]} (${test_subdirs[$jp1]})" + alt_test_names_subdirs="${alt_test_names_subdirs}${test_names[$jp1]}"$'\n'"(${test_subdirs[$jp1]})"$'\n' j="$jp1" jp1=$((j+1)) else break fi done +# Remove trailing newline. + alt_test_names_subdirs="${alt_test_names_subdirs%$'\n'}" # # Write a line to the CSV file representing a single row of the spreadsheet. # This row contains the following columns: @@ -1400,35 +1723,54 @@ ${test_names[$jp1]} (${test_subdirs[$jp1]})" # located in (the latter in parentheses). # # Column 2: -# The alternate test names (if any) followed by their subdirectories -# (in parentheses). Each alternate test name and subdirectory pair is -# followed by a newline, but all lines will appear in a single cell of -# the spreadsheet. +# Any alternate test names followed by their category subdirectories (in +# parentheses). Each alternate test name and subdirectory pair is followed +# by a newline, but all lines will appear in a single cell of the spreadsheet. # # Column 3: # The test description. # # Column 4: -# The number of times the forecast model will be run by the test. This -# has been calculated above using the quantities that go in Columns 5, -# 6, .... +# The relative cost of running the dynamics in the test. See above for +# details. # -# Columns 5...: -# The values of the experiment variables specified in vars_to_extract. +# Column 5: +# The number of times the forecast model will be run by the test. This +# is calculated using quantities such as the number of cycle dates (i.e. +# forecast model start dates) and the number of of ensemble members (which +# is greater than 1 if running ensemble forecasts and 1 otherwise). The +# latter are in turn obtained directly or indirectly from the quantities +# in Columns 6, 7, .... +# +# Columns 6, 7, ...: +# The values of the experiment variables specified in vars_to_extract, +# plus DT_ATMOS (included right after FCST_LEN_HRS). Note that DT_ATMOS +# cannot be included in vars_to_extract because it is usually not in the +# WE2E test configuration file where this script looks for these variables +# (because most of the tests use predefined grids, and for those cases, +# DT_ATMOS is defined in the same file/script where the other grid +# parameters are defined). # row_content="\ \"${prim_test_name_subdir}\" ${csv_delimiter} \ \"${alt_test_names_subdirs}\" ${csv_delimiter} \ \"${test_desc}\" ${csv_delimiter} \ +\"${rc}\" ${csv_delimiter} \ \"${nf}\"" for (( k=0; k<=$((num_vars_to_extract-1)); k++ )); do + unset "val" cmd="val=\"\${${array_names_vars_to_extract[$k]}[$j]}\"" eval $cmd - row_content="\ -${row_content} ${csv_delimiter} \ -\"${val}\"" + row_content="${row_content} ${csv_delimiter} \"${val}\"" +# +# Insert value of DT_ATMOS right after value of FCST_LEN_HRS. +# + if [ "${vars_to_extract[$k]}" = "FCST_LEN_HRS" ]; then + row_content="${row_content} ${csv_delimiter} \"${dta}\"" + fi + done printf "%s\n" "${row_content}" >> "${csv_fp}" @@ -1455,41 +1797,40 @@ containing information on all WE2E tests: # #----------------------------------------------------------------------- # - if [ ! -z "${output_varname_test_configs_basedir}" ]; then - eval ${output_varname_test_configs_basedir}="${test_configs_basedir}" + if [ ! -z "${outvarname_test_configs_basedir}" ]; then + eval ${outvarname_test_configs_basedir}="${test_configs_basedir}" fi - if [ ! -z "${output_varname_test_names}" ]; then + if [ ! -z "${outvarname_test_names}" ]; then test_names_str="( "$( printf "\"%s\" " "${test_names[@]}" )")" - eval ${output_varname_test_names}="${test_names_str}" + eval ${outvarname_test_names}="${test_names_str}" fi - if [ ! -z "${output_varname_test_subdirs}" ]; then + if [ ! -z "${outvarname_test_subdirs}" ]; then test_subdirs_str="( "$( printf "\"%s\" " "${test_subdirs[@]}" )")" - eval ${output_varname_test_subdirs}="${test_subdirs_str}" + eval ${outvarname_test_subdirs}="${test_subdirs_str}" fi - if [ ! -z "${output_varname_test_ids}" ]; then + if [ ! -z "${outvarname_test_ids}" ]; then test_ids_str="( "$( printf "\"%s\" " "${test_ids[@]}" )")" - eval ${output_varname_test_ids}="${test_ids_str}" + eval ${outvarname_test_ids}="${test_ids_str}" fi - if [ ! -z "${output_varname_test_descs}" ]; then + if [ ! -z "${outvarname_test_descs}" ]; then # # We want to treat all characters in the test descriptions literally -# when evaluating the array specified by output_varname_test_descs -# below using the eval function because otherwise, characters such as -# "$", "(", ")", etc will be interpreted as indicating the value of a -# variable, the start of an array, the end of an array, etc, and lead to -# errors. Thus, below, when forming the array that will be passed to -# eval, we will surround each element of the local array test_descs -# in single quotes. However, the test descriptions themselves may -# include single quotes (e.g. when a description contains a phrase such -# as "Please see the User's Guide for..."). In order to treat these -# single quotes literally (as opposed to as delimiters indicating the -# start or end of array elements), we have to pass them as separate -# strings by replacing each single quote with the following series of -# characters: +# when evaluating the array specified by outvarname_test_descs below +# using the eval function because otherwise, characters such as "$", +# "(", ")", etc will be interpreted as indicating the value of a variable, +# the start of an array, the end of an array, etc, and lead to errors. +# Thus, below, when forming the array that will be passed to eval, we +# will surround each element of the local array test_descs in single +# quotes. However, the test descriptions themselves may include single +# quotes (e.g. when a description contains a phrase such as "Please see +# the User's Guide for..."). In order to treat these single quotes +# literally (as opposed to as delimiters indicating the start or end of +# array elements), we have to pass them as separate strings by replacing +# each single quote with the following series of characters: # # '"'"' # @@ -1507,8 +1848,8 @@ containing information on all WE2E tests: # # See description of ${DOT_OR_USCORE} in the configuration file. # -# Then, if output_varname_test_descs is set to "some_array", the -# exact string we want to pass to eval is: +# Then, if outvarname_test_descs is set to "some_array", the exact string +# we want to pass to eval is: # # some_array=('Please see the User'"'"'s Guide.' 'See description of ${DOT_OR_USCORE} in the configuration file.') # @@ -1518,7 +1859,7 @@ containing information on all WE2E tests: sed -r -e "s/'/'\"'\"'/g" ) done test_descs_str="( "$( printf "'%s' " "${test_descs_esc_sq[@]}" )")" - eval ${output_varname_test_descs}="${test_descs_str}" + eval ${outvarname_test_descs}="${test_descs_str}" fi # #----------------------------------------------------------------------- diff --git a/tests/WE2E/get_expts_status.sh b/tests/WE2E/get_expts_status.sh index 91de215d2..a17b4e08f 100755 --- a/tests/WE2E/get_expts_status.sh +++ b/tests/WE2E/get_expts_status.sh @@ -79,6 +79,7 @@ Usage: ${scrfunc_fn} \\ expts_basedir=\"...\" \\ + [num_log_lines=\"...\"] \\ [verbose=\"...\"] The arguments in brackets are optional. The arguments are defined as @@ -144,7 +145,7 @@ num_log_lines=${num_log_lines:-"40"} # verbose=${verbose:-"FALSE"} check_var_valid_value "verbose" "valid_vals_BOOLEAN" -verbose=$(boolify $verbose) +verbose=$(boolify "$verbose") # #----------------------------------------------------------------------- # diff --git a/tests/WE2E/run_WE2E_tests.sh b/tests/WE2E/run_WE2E_tests.sh index a11dfaba3..b2c8c537c 100755 --- a/tests/WE2E/run_WE2E_tests.sh +++ b/tests/WE2E/run_WE2E_tests.sh @@ -90,6 +90,7 @@ Usage: [use_cron_to_relaunch=\"...\"] \\ [cron_relaunch_intvl_mnts=\"...\"] \\ [verbose=\"...\"] \\ + [generate_csv_file=\"...\"] \\ [machine_file=\"...\"] \\ [stmp=\"...\"] \\ [ptmp=\"...\"] \\ @@ -117,76 +118,84 @@ run. (A description of ACCOUNT can be found in the default experiment configuration file.) This is a required argument. expt_basedir: -Argument used to explicitly set the experiment variable EXPT_BASEDIR in -the experiment configuration files of all the WE2E tests the user wants -to run. (A description of EXPT_BASEDIR can be found in the default -experiment configuration file.) If expt_basedir is specified in the call -to this script, its value is used to set EXPT_BASEDIR in the configuration -files. If it is not specified, EXPT_BASEDIR is not set in the configuration -files, in which case the workflow generation script sets it to a default -value. Note that if expt_basedir is set to a relative path (e.g. -expt_basedir=\"testset1\" in the call to this script), then the workflow -generation script will set EXPT_BASEDIR for the experiment to a default -absolute path followed by \${expt_basedir}. This feature can be used to -group the WE2E tests into subdirectories for convenience, e.g. a set of -tests under subdirectory testset1, another set of tests under testset2, -etc. +Optional argument used to explicitly set the experiment variable +EXPT_BASEDIR in the experiment configuration files of all the WE2E tests +the user wants to run. (A description of EXPT_BASEDIR can be found in +the default experiment configuration file.) If expt_basedir is specified +in the call to this script, its value is used to set EXPT_BASEDIR in the +configuration files. If it is not specified, EXPT_BASEDIR is not set in +the configuration files, in which case the workflow generation script +sets it to a default value. Note that if expt_basedir is set to a +relative path (e.g. expt_basedir=\"testset1\" in the call to this script), +then the experiment generation script will set EXPT_BASEDIR for the +experiment to a default absolute path followed by \${expt_basedir}. +This feature can be used to group the WE2E tests into subdirectories for +convenience, e.g. a set of tests under subdirectory testset1, another +set of tests under testset2, etc. exec_subdir: -Optional. Argument used to set the EXEC_SUBDIR experiment variable. -Please see the default experiment configuration file \"config_defaults.sh\" -for a full description of EXEC_SUBDIR. +Optional argument used to explicitly set the experiment variable +EXEC_SUBDIR in the experiment configuration files of all the WE2E tests +the user wants to run. See the default experiment configuration file +\"config_defaults.sh\" for a full description of EXEC_SUBDIR. use_cron_to_relaunch: -Argument used to explicitly set the experiment variable USE_CRON_TO_RELAUNCH -in the experiment configuration files of all the WE2E tests the user wants -to run. (A description of USE_CRON_TO_RELAUNCH can be found in the default -experiment configuration file.) If use_cron_to_relaunch is specified in -the call to this script, its value is used to set USE_CRON_TO_RELAUNCH -in the configuration files. If it is not specified, USE_CRON_TO_RELAUNCH -is set to \"TRUE\" in the configuration files, in which case cron jobs -are used to (re)launch the workflows for all tests (one cron job per test). -Thus, use_cron_to_relaunch needs to be specified only if the user wants -to turn off use of cron jobs for all tests (by specifying use_cron_to_relaunch= -\"FALSE\" on the command line). Note that it is not possible to specify -a different value for USE_CRON_TO_RELAUNCH for each test via this argument; -either all tests use cron jobs or none do. +Optional argument used to explicitly set the experiment variable +USE_CRON_TO_RELAUNCH in the experiment configuration files of all the +WE2E tests the user wants to run. (A description of USE_CRON_TO_RELAUNCH +can be found in the default experiment configuration file.) If +use_cron_to_relaunch is specified in the call to this script, its value +is used to set USE_CRON_TO_RELAUNCH in the configuration files. If it +is not specified, USE_CRON_TO_RELAUNCH is set to \"TRUE\" in the +configuration files, in which case cron jobs are used to (re)launch the +workflows for all tests (one cron job per test). Thus, use_cron_to_relaunch +needs to be specified only if the user wants to turn off use of cron jobs +for all tests (by specifying use_cron_to_relaunch=\"FALSE\" on the command +line). Note that it is not possible to specify a different value for +USE_CRON_TO_RELAUNCH for each test via this argument; either all tests +use cron jobs or none do. cron_relaunch_intvl_mnts: -Argument used to explicitly set the experiment variable CRON_RELAUNCH_INTVL_MNTS -in the experiment configuration files of all the WE2E tests the user wants -to run. (A description of CRON_RELAUNCH_INTVL_MNTS can be found in the -default experiment configuration file.) If cron_relaunch_intvl_mnts is -specified in the call to this script, its value is used to set -CRON_RELAUNCH_INTVL_MNTS in the configuration files. If it is not -specified, CRON_RELAUNCH_INTVL_MNTS is set to \"02\" (i.e. two minutes) -in the configuration files. Note that it is not possible to specify a -different value for CRON_RELAUNCH_INTVL_MNTS for each test via this -argument; all tests will use the same value for USE_CRON_TO_RELAUNCH -(either the value specified in the call to this script or the default -value of \"02\"). Note also that the value of this argument matters only -if the argument use_cron_to_relaunch is not explicitly set to \"FALSE\" -in the call to this script. +Optional argument used to explicitly set the experiment variable +CRON_RELAUNCH_INTVL_MNTS in the experiment configuration files of +all the WE2E tests the user wants to run. (A description of +CRON_RELAUNCH_INTVL_MNTS can be found in the default experiment +configuration file.) If cron_relaunch_intvl_mnts is specified in the +call to this script, its value is used to set CRON_RELAUNCH_INTVL_MNTS +in the configuration files. If it is not specified, CRON_RELAUNCH_INTVL_MNTS +is set to \"02\" (i.e. two minutes) in the configuration files. Note +that it is not possible to specify a different value for +CRON_RELAUNCH_INTVL_MNTS for each test via this argument; all tests will +use the same value for USE_CRON_TO_RELAUNCH (either the value specified +in the call to this script or the default value of \"02\"). Note also +that the value of this argument matters only if the argument +use_cron_to_relaunch is not explicitly set to \"FALSE\" in the call to +this script. verbose: -Argument used to explicitly set the experiment variable VERBOSE in the -experiment configuration files of all the WE2E tests the user wants to -run. (A description of VERBOSE can be found in the default experiment -configuration file.) If verbose is specified in the call to this script, -its value is used to set VERBOSE in the configuration files. If it is -not specified, VERBOSE is set to \"TRUE\" in the configuration files. -Note that it is not possible to specify a different value for VERBOSE -for each test via this argument; either all tests will have VERBOSE set -to \"TRUE\" or all will have it set to \"FALSE\". +Optional argument used to explicitly set the experiment variable VERBOSE +in the experiment configuration files of all the WE2E tests the user +wants to run. (A description of VERBOSE can be found in the default +experiment configuration file.) If verbose is specified in the call to +this script, its value is used to set VERBOSE in the configuration files. +If it is not specified, VERBOSE is set to \"TRUE\" in the configuration +files. Note that it is not possible to specify a different value for +VERBOSE for each test via this argument; either all tests will have +VERBOSE set to \"TRUE\" or all will have it set to \"FALSE\". + +generate_csv_file: +Optional argument that specifies whether or not to generate a CSV file +containing summary information about all the tests available in the WE2E +testing system. Default value is \"TRUE\". machine_file: -Optional argument to set the full path to a machine configuration file. -If not set, a supported platform machine file may be used. +Optional argument specifying the full path to a machine configuration +file. If not set, a supported platform machine file may be used. stmp: -Argument used to explicitly set the experiment variable STMP in the -experiment configuration files of all the WE2E tests the user wants to -run that are in NCO mode, i.e. they have test configuration files that +Optional argument used to explicitly set the experiment variable STMP in +the experiment configuration files of all the WE2E tests the user wants +to run that are in NCO mode, i.e. they have test configuration files that set the experiment variable RUN_ENVIR to \"nco\". (A description of STMP can be found in the default experiment configuration file.) If stmp is specified in the call to this script, its value is used to set @@ -208,14 +217,23 @@ Same as the argument \"stmp\" described above but for setting the experiment variable PTMP for all tests that will run in NCO mode. compiler: -Type of compiler to use for the workflow. Options are \"intel\" and \"gnu\". -Default is \"intel\". +Optional argument used to explicitly set the experiment variable COMPILER +in the experiment configuration files of all the WE2E tests the user +wants to run. (A description of COMPILER can be found in the default +experiment configuration file.) If compiler is specified in the call to +this script, its value is used to set COMPILER in the configuration files. +If it is not specified, COMPILER is set to \"intel\" in the configuration +files. Note that it is not possible to specify a different value for +COMPILER for each test via this argument; all tests will use the same +value for COMPILER (either the value specified in the call to this script +or the default value of \"intel\"). build_mod_fn: -Specify the build module files (see ufs-srweather-app/modulefiles) to -use for the workflow. (e.g. build_cheyenne_gnu). If a -\"gnu\" compiler is specified, it must also be specified with -the \"compiler\" option. +Optional argument used to explicitly set the experiment variable +BUILD_MOD_FN in the experiment configuration files of all the WE2E tests +the user wants to run (e.g. \"build_cheyenne_gnu\"). If the string +\"gnu\" appears in this file name, the \"compiler\" option to this +function must also be specified with the value \"gnu\". Usage Examples: @@ -320,6 +338,7 @@ valid_args=( \ "use_cron_to_relaunch" \ "cron_relaunch_intvl_mnts" \ "verbose" \ + "generate_csv_file" \ "machine_file" \ "stmp" \ "ptmp" \ @@ -483,7 +502,7 @@ done < "${user_spec_tests_fp}" # avail_WE2E_test_subdirs[7]="dir1" # avail_WE2E_test_subdirs[8]="dir2" # avail_WE2E_test_subdirs[9]="dir3" -# +# #----------------------------------------------------------------------- # print_info_msg " @@ -491,10 +510,11 @@ Getting information about all available WE2E tests..." get_WE2Etest_names_subdirs_descs \ WE2Edir="${WE2Edir}" \ - output_varname_test_configs_basedir="avail_WE2E_test_configs_basedir" \ - output_varname_test_names="avail_WE2E_test_names" \ - output_varname_test_subdirs="avail_WE2E_test_subdirs" \ - output_varname_test_ids="avail_WE2E_test_ids" + generate_csv_file="${generate_csv_file}" \ + outvarname_test_configs_basedir="avail_WE2E_test_configs_basedir" \ + outvarname_test_names="avail_WE2E_test_names" \ + outvarname_test_subdirs="avail_WE2E_test_subdirs" \ + outvarname_test_ids="avail_WE2E_test_ids" # # Get the total number of available WE2E test names (including alternate # names). @@ -759,6 +779,7 @@ Please correct and rerun." BUILD_MOD_FN=${build_mod_fn:-"build_${machine}_${COMPILER}"} EXPT_BASEDIR="${expt_basedir}" EXPT_SUBDIR="${test_name}" + EXEC_SUBDIR="${exec_subdir}" USE_CRON_TO_RELAUNCH=${use_cron_to_relaunch:-"TRUE"} CRON_RELAUNCH_INTVL_MNTS=${cron_relaunch_intvl_mnts:-"02"} VERBOSE=${verbose:-"TRUE"} @@ -783,9 +804,9 @@ ACCOUNT=\"${ACCOUNT}\" COMPILER=\"${COMPILER}\" BUILD_MOD_FN=\"${BUILD_MOD_FN}\"" - if [ -n "${exec_subdir}" ]; then + if [ -n "${EXEC_SUBDIR}" ]; then expt_config_str=${expt_config_str}" -EXEC_SUBDIR=\"${exec_subdir}\"" +EXEC_SUBDIR=\"${EXEC_SUBDIR}\"" fi if [ -n "${EXPT_BASEDIR}" ]; then diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh new file mode 100644 index 000000000..f85ed71e1 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_13km grid using the HRRR +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_13km" +CCPP_PHYS_SUITE="FV3_HRRR" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..b759b0052 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_13km grid using the RRFS_v1beta +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_13km" +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh new file mode 100644 index 000000000..d8da153c1 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_25km grid using the HRRR +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_25km" +CCPP_PHYS_SUITE="FV3_HRRR" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..2b342d9ee --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_25km grid using the RRFS_v1beta +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_25km" +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh new file mode 100644 index 000000000..0435df0a2 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_3km grid using the HRRR +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_3km" +CCPP_PHYS_SUITE="FV3_HRRR" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..41f4d86a3 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_community/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta.sh @@ -0,0 +1,25 @@ +# +# TEST PURPOSE/DESCRIPTION: +# ------------------------ +# +# This test is to ensure that the workflow running in community mode +# completes successfully on the RRFS_CONUS_3km grid using the RRFS_v1beta +# physics suite with ICs and LBCs derived from the FV3GFS. +# + +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_3km" +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +FCST_LEN_HRS="6" +LBC_SPEC_INTVL_HRS="3" diff --git a/tests/WE2E/test_configs/wflow_features/config.custom_ESGgrid.sh b/tests/WE2E/test_configs/wflow_features/config.custom_ESGgrid.sh index bb8d2bc0c..f78fdf7e0 100644 --- a/tests/WE2E/test_configs/wflow_features/config.custom_ESGgrid.sh +++ b/tests/WE2E/test_configs/wflow_features/config.custom_ESGgrid.sh @@ -36,6 +36,8 @@ ESGgrid_DELY="25000.0" ESGgrid_NX="216" ESGgrid_NY="156" +ESGgrid_PAZI="0.0" + ESGgrid_WIDE_HALO_WIDTH="6" DT_ATMOS="40" diff --git a/ush/Python/plot_allvars.py b/ush/Python/plot_allvars.py index dd4e29786..97a9afdbf 100755 --- a/ush/Python/plot_allvars.py +++ b/ush/Python/plot_allvars.py @@ -26,12 +26,16 @@ # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp # -More information regarding files needed to setup # display maps in Cartopy, see SRW App Users' Guide +# 7. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecast and in constructing the names +# of the post output files. # -# To create plots for forecast hours 20-24 from 5/7 00Z -# cycle with hourly output: +# To create plots for a forecast on the RRFS_CONUS_25km +# grid for hours 20-24 from the 5/7 00Z cycle with +# hourly output: # python plot_allvars.py 2020050700 20 24 1 \ # /path/to/expt_dirs/experiment/name \ -# /path/to/base/cartopy/maps +# /path/to/base/cartopy/maps RRFS_CONUS_25km # # The variable domains in this script can be set to either # 'conus' for a CONUS map or 'regional' where the map @@ -227,6 +231,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): parser.add_argument("Forecast hour increment") parser.add_argument("Path to experiment directory") parser.add_argument("Path to base directory of cartopy shapefiles") +parser.add_argument("Name of native domain used in forecast (and in constructing post file names)") args = parser.parse_args() # Read date/time, forecast hour, and directory paths from command line @@ -252,6 +257,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): EXPT_DIR = str(sys.argv[5]) CARTOPY_DIR = str(sys.argv[6]) +POST_OUTPUT_DOMAIN_NAME = str(sys.argv[7]).lower() # Loop over forecast hours for fhr in fhours: @@ -261,7 +267,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): vtime = ndate(itime,int(fhr)) # Define the location of the input file - data1 = pygrib.open(EXPT_DIR+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslevf'+fhour+'.tm00.grib2') + data1 = pygrib.open(EXPT_DIR+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslev.f'+fhour+'.'+POST_OUTPUT_DOMAIN_NAME+'.grib2') # Get the lats and lons grids = [data1] diff --git a/ush/Python/plot_allvars_diff.py b/ush/Python/plot_allvars_diff.py index 9eddb5e10..fe4cb56eb 100755 --- a/ush/Python/plot_allvars_diff.py +++ b/ush/Python/plot_allvars_diff.py @@ -29,12 +29,17 @@ # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp # -More information regarding files needed to setup # display maps in Cartopy, see SRW App Users' Guide +# 8. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecasts and in constructing the names +# of the post output files. This must be the same +# for both forecasts. # -# To create plots for forecast hours 20-24 from 5/7 00Z -# cycle with hourly output: +# To create difference plots for two forecasts on the +# RRFS_CONUS_25km grid for hours 20-24 from the 5/7 +# 00Z cycle with hourly output: # python plot_allvars_diff.py 2020050700 20 24 1 \ # /path/to/expt_dir_1 /path/to/expt_dir_2 \ -# /path/to/base/cartopy/maps +# /path/to/base/cartopy/maps RRFS_CONUS_25km # # The variable domains in this script can be set to either # 'conus' for a CONUS map or 'regional' where the map @@ -231,6 +236,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): parser.add_argument("Path to experiment 1 directory") parser.add_argument("Path to experiment 2 directory") parser.add_argument("Path to base directory of cartopy shapefiles") +parser.add_argument("Name of native domain used in forecasts (and in constructing post file names)") args = parser.parse_args() # Read date/time, forecast hour, and directory paths from command line @@ -257,6 +263,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): EXPT_DIR_1 = str(sys.argv[5]) EXPT_DIR_2 = str(sys.argv[6]) CARTOPY_DIR = str(sys.argv[7]) +POST_OUTPUT_DOMAIN_NAME = str(sys.argv[8]).lower() # Loop over forecast hours for fhr in fhours: @@ -267,8 +274,8 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): # Define the location of the input files - data1 = pygrib.open(EXPT_DIR_1+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslevf'+fhour+'.tm00.grib2') - data2 = pygrib.open(EXPT_DIR_2+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslevf'+fhour+'.tm00.grib2') + data1 = pygrib.open(EXPT_DIR_1+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslev.f'+fhour+'.'+POST_OUTPUT_DOMAIN_NAME+'.grib2') + data2 = pygrib.open(EXPT_DIR_2+'/'+ymdh+'/postprd/rrfs.t'+cyc+'z.prslev.f'+fhour+'.'+POST_OUTPUT_DOMAIN_NAME+'.grib2') # Get the lats and lons grids = [data1, data2] diff --git a/ush/Python/qsub_job.sh b/ush/Python/qsub_job.sh index 25e881418..464020876 100755 --- a/ush/Python/qsub_job.sh +++ b/ush/Python/qsub_job.sh @@ -35,7 +35,7 @@ export FCST_END=${FCST_LEN_HRS} export FCST_INC=3 # Usage statement: Make sure all the necessary modules can be imported. -# Five command line arguments are needed: +# The following command line arguments are needed: # 1. Cycle date/time in YYYYMMDDHH format # 2. Starting forecast hour in HHH format # 3. Ending forecast hour in HHH format @@ -46,5 +46,10 @@ export FCST_INC=3 # 6. CARTOPY_DIR: Base directory of cartopy shapefiles # -File structure should be: # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp +# 7. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecast and in constructing the names +# of the post output files. -python plot_allvars.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR} ${SHAPE_FILES} + +python plot_allvars.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} \ + ${EXPTDIR} ${SHAPE_FILES} ${POST_OUTPUT_DOMAIN_NAME} diff --git a/ush/Python/qsub_job_diff.sh b/ush/Python/qsub_job_diff.sh index e0a638386..c3f5e4fba 100755 --- a/ush/Python/qsub_job_diff.sh +++ b/ush/Python/qsub_job_diff.sh @@ -28,7 +28,7 @@ ncar_pylib /glade/p/ral/jntp/UFS_SRW_app/ncar_pylib/python_graphics #Cheyenne: SHAPE_FILES=/glade/p/ral/jntp/UFS_SRW_app/tools/NaturalEarth -export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" +export GLOBAL_VAR_DEFNS_FP="${EXPTDIR1}/var_defns.sh" source ${GLOBAL_VAR_DEFNS_FP} export CDATE=${DATE_FIRST_CYCL}${CYCL_HRS} export FCST_START=3 @@ -36,7 +36,7 @@ export FCST_END=${FCST_LEN_HRS} export FCST_INC=3 # Usage statement: Make sure all the necessary modules can be imported. -# Seven command line arguments are needed: +# The following command line arguments are needed: # 1. Cycle date/time in YYYYMMDDHH format # 2. Starting forecast hour in HHH format # 3. Ending forecast hour in HHH format @@ -50,5 +50,12 @@ export FCST_INC=3 # 7. CARTOPY_DIR: Base directory of cartopy shapefiles # -File structure should be: # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp - -python plot_allvars_diff.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR1} ${EXPTDIR2} ${SHAPE_FILES} +# 8. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecasts and in constructing the names +# of the post output files. This must be the same +# for both forecasts. + +python plot_allvars_diff.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} \ + ${EXPTDIR1} ${EXPTDIR2} \ + ${SHAPE_FILES} \ + ${POST_OUTPUT_DOMAIN_NAME} diff --git a/ush/Python/sq_job.sh b/ush/Python/sq_job.sh index 1c594efd4..d4a594746 100755 --- a/ush/Python/sq_job.sh +++ b/ush/Python/sq_job.sh @@ -57,8 +57,8 @@ export FCST_START=6 export FCST_END=${FCST_LEN_HRS} export FCST_INC=6 -# Usage statement: Make sure all the necessary modules can be imported. -# Six command line arguments are needed: +# Usage statement: Make sure all the necessary modules can be imported. +# The following command line arguments are needed: # 1. Cycle date/time in YYYYMMDDHH format # 2. Starting forecast hour in HHH format # 3. Ending forecast hour in HHH format @@ -69,5 +69,10 @@ export FCST_INC=6 # 6. CARTOPY_DIR: Base directory of cartopy shapefiles # -File structure should be: # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp +# 7. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecast and in constructing the names +# of the post output files. -python plot_allvars.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR} ${SHAPE_FILES} + +python plot_allvars.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} \ + ${EXPTDIR} ${SHAPE_FILES} ${POST_OUTPUT_DOMAIN_NAME} diff --git a/ush/Python/sq_job_diff.sh b/ush/Python/sq_job_diff.sh index 84143ffd8..e7be0595f 100755 --- a/ush/Python/sq_job_diff.sh +++ b/ush/Python/sq_job_diff.sh @@ -52,15 +52,15 @@ SHAPE_FILES=/scratch2/BMC/det/UFS_SRW_app/v1p0/fix_files/NaturalEarth #Gaea: #SHAPE_FILES=/lustre/f2/pdata/esrl/gsd/ufs/NaturalEarth -export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" +export GLOBAL_VAR_DEFNS_FP="${EXPTDIR1}/var_defns.sh" source ${GLOBAL_VAR_DEFNS_FP} export CDATE=${DATE_FIRST_CYCL}${CYCL_HRS} export FCST_START=6 export FCST_END=${FCST_LEN_HRS} export FCST_INC=3 -# Usage statement: Make sure all the necessary modules can be imported. -# Seven command line arguments are needed: +# Usage statement: Make sure all the necessary modules can be imported. +# The following command line arguments are needed: # 1. Cycle date/time in YYYYMMDDHH format # 2. Starting forecast hour # 3. Ending forecast hour @@ -74,5 +74,12 @@ export FCST_INC=3 # 7. CARTOPY_DIR: Base directory of cartopy shapefiles # -File structure should be: # CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp +# 8. POST_OUTPUT_DOMAIN_NAME: Name of native domain +# used in forecasts and in constructing the names +# of the post output files. This must be the same +# for both forecasts. -python plot_allvars_diff.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR1} ${EXPTDIR2} ${SHAPE_FILES} +python plot_allvars_diff.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} \ + ${EXPTDIR1} ${EXPTDIR2} \ + ${SHAPE_FILES} \ + ${POST_OUTPUT_DOMAIN_NAME} diff --git a/ush/bash_utils/get_bash_file_contents.sh b/ush/bash_utils/get_bash_file_contents.sh index 3b3ab7b30..fdfb62692 100644 --- a/ush/bash_utils/get_bash_file_contents.sh +++ b/ush/bash_utils/get_bash_file_contents.sh @@ -21,7 +21,7 @@ function get_bash_file_contents() { local valid_args=( \ "fp" \ - "output_varname_contents" \ + "outvarname_contents" \ ) process_args valid_args "$@" print_input_args "valid_args" @@ -63,7 +63,7 @@ read was not specified in the call to this function: # # Set output variables. # - printf -v ${output_varname_contents} "${contents}" + printf -v ${outvarname_contents} "%s" "${contents}" { restore_shell_opts; } > /dev/null 2>&1 diff --git a/ush/check_expt_config_vars.sh b/ush/check_expt_config_vars.sh index 7476de779..c55a39229 100644 --- a/ush/check_expt_config_vars.sh +++ b/ush/check_expt_config_vars.sh @@ -47,10 +47,10 @@ function check_expt_config_vars() { # configuration file. # get_bash_file_contents fp="${default_config_fp}" \ - output_varname_contents="var_list_default" + outvarname_contents="var_list_default" get_bash_file_contents fp="${config_fp}" \ - output_varname_contents="var_list_user" + outvarname_contents="var_list_user" # # Loop through each line/variable in var_list_user. For each line, # extract the the name of the variable that is being set (say VAR) and diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index d304d203a..28d456420 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -74,12 +74,15 @@ RUN_ENVIR="nco" # for supported machines. # # BUILD_MOD_FN: -# Name of alternative build module file to use if using an -# unsupported platform. Is set automatically for supported machines. +# Name of build module file to load before running a workflow task. If +# this is not specified by the user in the experiment configuration file +# (EXPT_CONFIG_FN), it will be set automatically for supported machines. # # WFLOW_MOD_FN: -# Name of alternative workflow module file to use if using an -# unsupported platform. Is set automatically for supported machines. +# Name of workflow module file to load before (re)launching the experiment's +# ROCOTO workflow (using the "rocotorun" command). If this is not specified +# by the user in the experiment configuration file (EXPT_CONFIG_FN), it +# will be set automatically for supported machines. # # SCHED: # The job scheduler to use (e.g. slurm). Set this to an empty string in @@ -307,6 +310,10 @@ DOT_OR_USCORE="_" # EXPT_CONFIG_FN: # Name of the user-specified configuration file for the forecast experiment. # +# CONSTANTS_FN: +# Name of the file containing definitions of various mathematical, physical, +# and SRW App contants. +# # RGNL_GRID_NML_FN: # Name of file containing the namelist settings for the code that generates # a "ESGgrid" type of regional grid. @@ -388,6 +395,7 @@ DOT_OR_USCORE="_" #----------------------------------------------------------------------- # EXPT_CONFIG_FN="config.sh" +CONSTANTS_FN="constants.sh" RGNL_GRID_NML_FN="regional_grid.nml" @@ -411,18 +419,6 @@ WFLOW_LAUNCH_LOG_FN="log.launch_FV3LAM_wflow" # #----------------------------------------------------------------------- # -# Set output file name. Definitions: -# -# POST_OUTPUT_DOMAIN_NAME: -# Domain name used in naming the output files of run_post by UPP or inline post. -# Output file name: $NET.tHHz.[var_name].f###.$POST_OUTPUT_DOMAIN_NAME.grib2 -# -#----------------------------------------------------------------------- -# -POST_OUTPUT_DOMAIN_NAME="" -# -#----------------------------------------------------------------------- -# # Set forecast parameters. Definitions: # # DATE_FIRST_CYCL: @@ -476,8 +472,11 @@ FCST_LEN_HRS="24" # with the prefix "YYYYMMDD.HHmmSS." in the RESTART directory # # WRITE_DOPOST: -# Flag that determines whether or not to use the INLINE POST option -# When TRUE, force to turn off run_post (RUN_TASK_RUN_POST=FALSE) in setup.sh +# Flag that determines whether or not to use the inline post feature +# [i.e. calling the Unified Post Processor (UPP) from within the weather +# model]. If this is set to "TRUE", the RUN_POST_TN task is deactivated +# (i.e. RUN_TASK_RUN_POST is set to "FALSE") to avoid unnecessary +# computations. # #----------------------------------------------------------------------- # @@ -1749,8 +1748,7 @@ DT_SUBHOURLY_POST_MNTS="00" # #----------------------------------------------------------------------- # -# Set parameters associated with defining a customized post configuration -# file. +# Set parameters for customizing the post-processor (UPP). Definitions: # # USE_CUSTOM_POST_CONFIG_FILE: # Flag that determines whether a user-provided custom configuration file @@ -1765,10 +1763,24 @@ DT_SUBHOURLY_POST_MNTS="00" # used for post-processing. This is only used if CUSTOM_POST_CONFIG_FILE # is set to "TRUE". # +# POST_OUTPUT_DOMAIN_NAME: +# Domain name (in lowercase) used in constructing the names of the output +# files generated by UPP [which is called either by running the RUN_POST_TN +# task or by activating the inline post feature (WRITE_DOPOST set to "TRUE")]. +# The post output files are named as follows: +# +# $NET.tHHz.[var_name].f###.${POST_OUTPUT_DOMAIN_NAME}.grib2 +# +# If using a custom grid, POST_OUTPUT_DOMAIN_NAME must be specified by +# the user. If using a predefined grid, POST_OUTPUT_DOMAIN_NAME defaults +# to PREDEF_GRID_NAME. Note that this variable is first changed to lower +# case before being used to construct the file names. +# #----------------------------------------------------------------------- # USE_CUSTOM_POST_CONFIG_FILE="FALSE" CUSTOM_POST_CONFIG_FP="" +POST_OUTPUT_DOMAIN_NAME="" # #----------------------------------------------------------------------- # @@ -1909,7 +1921,7 @@ LSM_SPP_TSCALE=( "21600" "21600" "21600" "21600" "21600" "21600" "21600" ) LSM_SPP_LSCALE=( "150000" "150000" "150000" "150000" "150000" "150000" "150000" ) ISEED_LSM_SPP=( "9" ) LSM_SPP_VAR_LIST=( "smc" "vgf" "alb" "sal" "emi" "zol" "stc" ) -LSM_SPP_MAG_LIST=( "0.2" "0.001" "0.001" "0.001" "0.001" "0.001" "0.2" ) +LSM_SPP_MAG_LIST=( "0.017" "0.001" "0.001" "0.001" "0.001" "0.001" "0.2" ) LSM_SPP_EACH_STEP="true" #Sets lndp_each_step=.true. # #----------------------------------------------------------------------- diff --git a/ush/constants.sh b/ush/constants.sh index 0d68019ae..26f4cb1b3 100644 --- a/ush/constants.sh +++ b/ush/constants.sh @@ -10,16 +10,56 @@ pi_geom="3.14159265358979323846264338327" # Degrees per radian. -degs_per_radian=$( bc -l <<< "360.0/(2.0*$pi_geom)" ) +degs_per_radian=$( bc -l <<< "360.0/(2.0*${pi_geom})" ) # Radius of the Earth in meters. radius_Earth="6371200.0" - # #----------------------------------------------------------------------- # -# Other. +# Valid values that a user may set a boolean variable to (e.g. in the +# SRW App's experiment configuration file). # #----------------------------------------------------------------------- # valid_vals_BOOLEAN=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") +# +#----------------------------------------------------------------------- +# +# Any regional model must be supplied lateral boundary conditions (in +# addition to initial conditions) to be able to perform a forecast. In +# the FV3-LAM model, these boundary conditions (BCs) are supplied using +# a "halo" of grid cells around the regional domain that extend beyond +# the boundary of the domain. The model is formulated such that along +# with files containing these BCs, it needs as input the following files +# (in NetCDF format): +# +# 1) A grid file that includes a halo of 3 cells beyond the boundary of +# the domain. +# 2) A grid file that includes a halo of 4 cells beyond the boundary of +# the domain. +# 3) A (filtered) orography file without a halo, i.e. a halo of width +# 0 cells. +# 4) A (filtered) orography file that includes a halo of 4 cells beyond +# the boundary of the domain. +# +# Note that the regional grid is referred to as "tile 7" in the code. +# We will let: +# +# * NH0 denote the width (in units of number of cells on tile 7) of +# the 0-cell-wide halo, i.e. NH0 = 0; +# +# * NH3 denote the width (in units of number of cells on tile 7) of +# the 3-cell-wide halo, i.e. NH3 = 3; and +# +# * NH4 denote the width (in units of number of cells on tile 7) of +# the 4-cell-wide halo, i.e. NH4 = 4. +# +# We define these variables next. +# +#----------------------------------------------------------------------- +# +NH0=0 +NH3=3 +NH4=4 + diff --git a/ush/get_crontab_contents.sh b/ush/get_crontab_contents.sh index 182cf1936..a7a00854e 100644 --- a/ush/get_crontab_contents.sh +++ b/ush/get_crontab_contents.sh @@ -42,7 +42,7 @@ function get_crontab_contents() { # source $USHDIR/constants.sh check_var_valid_value "called_from_cron" "valid_vals_BOOLEAN" - called_from_cron=$( boolify ${called_from_cron} ) + called_from_cron=$(boolify "${called_from_cron}") if [ "$MACHINE" = "WCOSS_DELL_P3" ]; then __crontab_cmd__="" diff --git a/ush/launch_FV3LAM_wflow.sh b/ush/launch_FV3LAM_wflow.sh index 9184cb0e0..8a4dbe603 100755 --- a/ush/launch_FV3LAM_wflow.sh +++ b/ush/launch_FV3LAM_wflow.sh @@ -121,7 +121,7 @@ print_input_args "valid_args" # called_from_cron=${called_from_cron:-"FALSE"} check_var_valid_value "called_from_cron" "valid_vals_BOOLEAN" -called_from_cron=$(boolify ${called_from_cron}) +called_from_cron=$(boolify "${called_from_cron}") # #----------------------------------------------------------------------- # @@ -151,7 +151,7 @@ expt_name="${EXPT_SUBDIR}" # module use "${SR_WX_APP_TOP_DIR}/modulefiles" module load "${WFLOW_MOD_FN}" > /dev/null 2>&1 || print_err_msg_exit "\ -Loading platform-specific module file (WFLOW_MOD_FN) for the workflow +Loading of platform-specific module file (WFLOW_MOD_FN) for the workflow task failed: WFLOW_MOD_FN = \"${WFLOW_MOD_FN}\"" # diff --git a/ush/load_modules_run_task.sh b/ush/load_modules_run_task.sh index 7a9547fe0..73c7c7eed 100755 --- a/ush/load_modules_run_task.sh +++ b/ush/load_modules_run_task.sh @@ -95,8 +95,8 @@ machine=$(echo_lowercase $MACHINE) source "${SR_WX_APP_TOP_DIR}/etc/lmod-setup.sh" module use "${SR_WX_APP_TOP_DIR}/modulefiles" module load "${BUILD_MOD_FN}" || print_err_msg_exit "\ -Sourcing platform- and compiler-specific module file (BUILD_MOD_FN) for the -workflow task specified by task_name failed: +Loading of platform- and compiler-specific module file (BUILD_MOD_FN) +for the workflow task specified by task_name failed: task_name = \"${task_name}\" BUILD_MOD_FN = \"${BUILD_MOD_FN}\"" # diff --git a/ush/machine/macos.sh b/ush/machine/macos.sh new file mode 100644 index 000000000..42d70c568 --- /dev/null +++ b/ush/machine/macos.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -x + +function file_location() { + + # Return the default location of external model files on disk + + local external_file_fmt external_model location + + external_model=${1} + external_file_fmt=${2} + + case ${external_model} in + + "FV3GFS") + location='/Users/username/DATA/UFS/FV3GFS/' + ;; + *) + print_info_msg"\ + External model \'${external_model}\' does not have a default + location on MacOSX. " + ;; + + esac + echo ${location:-} +} + + +EXTRN_MDL_SYSBASEDIR_ICS=${EXTRN_MDL_SYSBASEDIR_ICS:-$(file_location \ + ${EXTRN_MDL_NAME_ICS} \ + ${FV3GFS_FILE_FMT_ICS})} +EXTRN_MDL_SYSBASEDIR_LBCS=${EXTRN_MDL_SYSBASEDIR_LBCS:-$(file_location \ + ${EXTRN_MDL_NAME_LBCS} \ + ${FV3GFS_FILE_FMT_ICS})} + + System scripts to source to initialize various commands within workflow + scripts (e.g. "module"). +if [ -z ${ENV_INIT_SCRIPTS_FPS:-""} ]; then + ENV_INIT_SCRIPTS_FPS=( "/etc/profile" ) +fi + + +# Commands to run at the start of each workflow task. +PRE_TASK_CMDS='{ ulimit -a; }' + +# Architecture information +WORKFLOW_MANAGER="none" +NCORES_PER_NODE=${NCORES_PER_NODE:-8} +SCHED=${SCHED:-"none"} + +# UFS SRW App specific paths +FIXgsm=${FIXgsm:-"/Users/username/DATA/UFS/fix/fix_am"} +FIXaer=${FIXaer:-"/Users/username/DATA/UFS/fix/fix_aer"} +FIXlut=${FIXlut:-"/Users/username/DATA/UFS/fix/fix_lut"} +TOPO_DIR=${TOPO_DIR:-"/Users/username/DATA/UFS/fix/fix_orog"} +SFC_CLIMO_INPUT_DIR=${SFC_CLIMO_INPUT_DIR:-"/Users/username/DATA/UFS/fix/fix_sfc_climo"} + +# Run commands for executables +RUN_CMD_SERIAL="time" +#Run Commands currently differ for GNU/openmpi +RUN_CMD_UTILS='mpirun -n 4' +RUN_CMD_FCST='mpirun -n ${PE_MEMBER01} ' +RUN_CMD_POST='mpirun -n 4 ' + +# MET Installation Locations + diff --git a/ush/set_gridparams_ESGgrid.sh b/ush/set_gridparams_ESGgrid.sh index 41efbfe58..4b8137771 100644 --- a/ush/set_gridparams_ESGgrid.sh +++ b/ush/set_gridparams_ESGgrid.sh @@ -40,6 +40,23 @@ function set_gridparams_ESGgrid() { # #----------------------------------------------------------------------- # +# Set directories. +# +#----------------------------------------------------------------------- +# + local homerrfs=${scrfunc_dir%/*} + local ushdir="$homerrfs/ush" +# +#----------------------------------------------------------------------- +# +# Source the file containing various mathematical, physical, etc constants. +# +#----------------------------------------------------------------------- +# + . $ushdir/constants.sh +# +#----------------------------------------------------------------------- +# # Specify the set of valid argument names for this script/function. # Then process the arguments provided to this script/function (which # should consist of a set of name-value pairs of the form arg1="value1", @@ -48,25 +65,25 @@ function set_gridparams_ESGgrid() { #----------------------------------------------------------------------- # local valid_args=( \ -"lon_ctr" \ -"lat_ctr" \ -"nx" \ -"ny" \ -"halo_width" \ -"delx" \ -"dely" \ -"pazi" \ -"output_varname_lon_ctr" \ -"output_varname_lat_ctr" \ -"output_varname_nx" \ -"output_varname_ny" \ -"output_varname_pazi" \ -"output_varname_halo_width" \ -"output_varname_stretch_factor" \ -"output_varname_del_angle_x_sg" \ -"output_varname_del_angle_y_sg" \ -"output_varname_neg_nx_of_dom_with_wide_halo" \ -"output_varname_neg_ny_of_dom_with_wide_halo" \ + "lon_ctr" \ + "lat_ctr" \ + "nx" \ + "ny" \ + "halo_width" \ + "delx" \ + "dely" \ + "pazi" \ + "outvarname_lon_ctr" \ + "outvarname_lat_ctr" \ + "outvarname_nx" \ + "outvarname_ny" \ + "outvarname_pazi" \ + "outvarname_halo_width" \ + "outvarname_stretch_factor" \ + "outvarname_del_angle_x_sg" \ + "outvarname_del_angle_y_sg" \ + "outvarname_neg_nx_of_dom_with_wide_halo" \ + "outvarname_neg_ny_of_dom_with_wide_halo" \ ) process_args valid_args "$@" # @@ -78,15 +95,7 @@ function set_gridparams_ESGgrid() { # #----------------------------------------------------------------------- # - print_input_args valid_args -# -#----------------------------------------------------------------------- -# -# Source the file containing various mathematical, physical, etc constants. -# -#----------------------------------------------------------------------- -# - . ${USHDIR}/constants.sh +# print_input_args valid_args # #----------------------------------------------------------------------- # @@ -149,17 +158,49 @@ function set_gridparams_ESGgrid() { # #----------------------------------------------------------------------- # - eval ${output_varname_lon_ctr}="${lon_ctr}" - eval ${output_varname_lat_ctr}="${lat_ctr}" - eval ${output_varname_nx}="${nx}" - eval ${output_varname_ny}="${ny}" - eval ${output_varname_halo_width}="${halo_width}" - eval ${output_varname_stretch_factor}="${stretch_factor}" - eval ${output_varname_pazi}="${pazi}" - eval ${output_varname_del_angle_x_sg}="${del_angle_x_sg}" - eval ${output_varname_del_angle_y_sg}="${del_angle_y_sg}" - eval ${output_varname_neg_nx_of_dom_with_wide_halo}="${neg_nx_of_dom_with_wide_halo}" - eval ${output_varname_neg_ny_of_dom_with_wide_halo}="${neg_ny_of_dom_with_wide_halo}" + if [ ! -z "${outvarname_lon_ctr}" ]; then + printf -v ${outvarname_lon_ctr} "%s" "${lon_ctr}" + fi + + if [ ! -z "${outvarname_lat_ctr}" ]; then + printf -v ${outvarname_lat_ctr} "%s" "${lat_ctr}" + fi + + if [ ! -z "${outvarname_nx}" ]; then + printf -v ${outvarname_nx} "%s" "${nx}" + fi + + if [ ! -z "${outvarname_ny}" ]; then + printf -v ${outvarname_ny} "%s" "${ny}" + fi + + if [ ! -z "${outvarname_halo_width}" ]; then + printf -v ${outvarname_halo_width} "%s" "${halo_width}" + fi + + if [ ! -z "${outvarname_stretch_factor}" ]; then + printf -v ${outvarname_stretch_factor} "%s" "${stretch_factor}" + fi + + if [ ! -z "${outvarname_pazi}" ]; then + printf -v ${outvarname_pazi} "%s" "${pazi}" + fi + + if [ ! -z "${outvarname_del_angle_x_sg}" ]; then + printf -v ${outvarname_del_angle_x_sg} "%s" "${del_angle_x_sg}" + fi + + if [ ! -z "${outvarname_del_angle_y_sg}" ]; then + printf -v ${outvarname_del_angle_y_sg} "%s" "${del_angle_y_sg}" + fi + + if [ ! -z "${outvarname_neg_nx_of_dom_with_wide_halo}" ]; then + printf -v ${outvarname_neg_nx_of_dom_with_wide_halo} "%s" "${neg_nx_of_dom_with_wide_halo}" + fi + + if [ ! -z "${outvarname_neg_ny_of_dom_with_wide_halo}" ]; then + printf -v ${outvarname_neg_ny_of_dom_with_wide_halo} "%s" "${neg_ny_of_dom_with_wide_halo}" + fi # #----------------------------------------------------------------------- # diff --git a/ush/set_gridparams_GFDLgrid.sh b/ush/set_gridparams_GFDLgrid.sh index a76b9a58a..68b6937be 100644 --- a/ush/set_gridparams_GFDLgrid.sh +++ b/ush/set_gridparams_GFDLgrid.sh @@ -40,6 +40,23 @@ function set_gridparams_GFDLgrid() { # #----------------------------------------------------------------------- # +# Set directories. +# +#----------------------------------------------------------------------- +# + local homerrfs=${scrfunc_dir%/*} + local ushdir="$homerrfs/ush" +# +#----------------------------------------------------------------------- +# +# Source the file containing various mathematical, physical, etc constants. +# +#----------------------------------------------------------------------- +# + . $ushdir/constants.sh +# +#----------------------------------------------------------------------- +# # Specify the set of valid argument names for this script/function. # Then process the arguments provided to this script/function (which # should consist of a set of name-value pairs of the form arg1="value1", @@ -48,25 +65,26 @@ function set_gridparams_GFDLgrid() { #----------------------------------------------------------------------- # local valid_args=( \ -"lon_of_t6_ctr" \ -"lat_of_t6_ctr" \ -"res_of_t6g" \ -"stretch_factor" \ -"refine_ratio_t6g_to_t7g" \ -"istart_of_t7_on_t6g" \ -"iend_of_t7_on_t6g" \ -"jstart_of_t7_on_t6g" \ -"jend_of_t7_on_t6g" \ -"output_varname_lon_of_t7_ctr" \ -"output_varname_lat_of_t7_ctr" \ -"output_varname_nx_of_t7_on_t7g" \ -"output_varname_ny_of_t7_on_t7g" \ -"output_varname_halo_width_on_t7g" \ -"output_varname_stretch_factor" \ -"output_varname_istart_of_t7_with_halo_on_t6sg" \ -"output_varname_iend_of_t7_with_halo_on_t6sg" \ -"output_varname_jstart_of_t7_with_halo_on_t6sg" \ -"output_varname_jend_of_t7_with_halo_on_t6sg" \ + "lon_of_t6_ctr" \ + "lat_of_t6_ctr" \ + "res_of_t6g" \ + "stretch_factor" \ + "refine_ratio_t6g_to_t7g" \ + "istart_of_t7_on_t6g" \ + "iend_of_t7_on_t6g" \ + "jstart_of_t7_on_t6g" \ + "jend_of_t7_on_t6g" \ + "verbose" \ + "outvarname_lon_of_t7_ctr" \ + "outvarname_lat_of_t7_ctr" \ + "outvarname_nx_of_t7_on_t7g" \ + "outvarname_ny_of_t7_on_t7g" \ + "outvarname_halo_width_on_t7g" \ + "outvarname_stretch_factor" \ + "outvarname_istart_of_t7_with_halo_on_t6sg" \ + "outvarname_iend_of_t7_with_halo_on_t6sg" \ + "outvarname_jstart_of_t7_with_halo_on_t6sg" \ + "outvarname_jend_of_t7_with_halo_on_t6sg" \ ) process_args valid_args "$@" # @@ -140,7 +158,6 @@ function set_gridparams_GFDLgrid() { # This if-statement can hopefully be removed once EMC agrees to make their # GFDLgrid type grids (tile 7) symmetric about tile 6. -if [ "${RUN_ENVIR}" != "nco" ]; then if [ ${num_left_margin_cells_on_t6g} -ne ${num_right_margin_cells_on_t6g} ]; then print_err_msg_exit "\ In order for tile 7 to be centered in the x direction on tile 6, the x- @@ -159,14 +176,12 @@ ven by: nx_of_t6_on_t6g = ${nx_of_t6_on_t6g} Please reset istart_of_t7_on_t6g and iend_of_t7_on_t6g and rerun." fi -fi num_bot_margin_cells_on_t6g=$(( jstart_of_t7_on_t6g - 1 )) num_top_margin_cells_on_t6g=$(( ny_of_t6_on_t6g - jend_of_t7_on_t6g )) # This if-statement can hopefully be removed once EMC agrees to make their # GFDLgrid type grids (tile 7) symmetric about tile 6. -if [ "${RUN_ENVIR}" != "nco" ]; then if [ ${num_bot_margin_cells_on_t6g} -ne ${num_top_margin_cells_on_t6g} ]; then print_err_msg_exit "\ In order for tile 7 to be centered in the y direction on tile 6, the y- @@ -185,7 +200,6 @@ ven by: ny_of_t6_on_t6g = ${ny_of_t6_on_t6g} Please reset jstart_of_t7_on_t6g and jend_of_t7_on_t6g and rerun." fi -fi lon_of_t7_ctr="${lon_of_t6_ctr}" lat_of_t7_ctr="${lat_of_t6_ctr}" @@ -386,7 +400,7 @@ fi # #----------------------------------------------------------------------- # - print_info_msg "$VERBOSE" " + print_info_msg "$verbose" " Original values of the halo width on the tile 6 supergrid and on the tile 7 grid are: halo_width_on_t6sg = ${halo_width_on_t6sg} @@ -396,7 +410,7 @@ tile 7 grid are: halo_width_on_t6g=$(( halo_width_on_t6sg/2 )) halo_width_on_t7g=$(( halo_width_on_t6g*refine_ratio_t6g_to_t7g )) - print_info_msg "$VERBOSE" " + print_info_msg "$verbose" " Values of the halo width on the tile 6 supergrid and on the tile 7 grid AFTER adjustments are: halo_width_on_t6sg = ${halo_width_on_t6sg} @@ -428,7 +442,7 @@ AFTER adjustments are: prime_factors_nx_of_t7_on_t7g=$( factor ${nx_of_t7_on_t7g} | $SED -r -e 's/^[0-9]+: (.*)/\1/' ) prime_factors_ny_of_t7_on_t7g=$( factor ${ny_of_t7_on_t7g} | $SED -r -e 's/^[0-9]+: (.*)/\1/' ) - print_info_msg "$VERBOSE" " + print_info_msg "$verbose" " The number of cells in the two horizontal directions (x and y) on the parent tile's (tile 6) grid and supergrid are: nx_of_t6_on_t6g = ${nx_of_t6_on_t6g} @@ -489,12 +503,12 @@ determining an MPI task layout): ny_of_t7_with_halo_on_t6g=$(( ny_of_t7_with_halo_on_t6sg/2 )) ny_of_t7_with_halo_on_t7g=$(( ny_of_t7_with_halo_on_t6g*refine_ratio_t6g_to_t7g )) - print_info_msg "$VERBOSE" " + print_info_msg "$verbose" " nx_of_t7_with_halo_on_t7g = ${nx_of_t7_with_halo_on_t7g} \ (istart_of_t7_with_halo_on_t6sg = ${istart_of_t7_with_halo_on_t6sg}, \ iend_of_t7_with_halo_on_t6sg = ${iend_of_t7_with_halo_on_t6sg})" - print_info_msg "$VERBOSE" " + print_info_msg "$verbose" " ny_of_t7_with_halo_on_t7g = ${ny_of_t7_with_halo_on_t7g} \ (jstart_of_t7_with_halo_on_t6sg = ${jstart_of_t7_with_halo_on_t6sg}, \ jend_of_t7_with_halo_on_t6sg = ${jend_of_t7_with_halo_on_t6sg})" @@ -505,16 +519,45 @@ jend_of_t7_with_halo_on_t6sg = ${jend_of_t7_with_halo_on_t6sg})" # #----------------------------------------------------------------------- # - eval ${output_varname_lon_of_t7_ctr}="${lon_of_t7_ctr}" - eval ${output_varname_lat_of_t7_ctr}="${lat_of_t7_ctr}" - eval ${output_varname_nx_of_t7_on_t7g}="${nx_of_t7_on_t7g}" - eval ${output_varname_ny_of_t7_on_t7g}="${ny_of_t7_on_t7g}" - eval ${output_varname_halo_width_on_t7g}="${halo_width_on_t7g}" - eval ${output_varname_stretch_factor}="${stretch_factor}" - eval ${output_varname_istart_of_t7_with_halo_on_t6sg}="${istart_of_t7_with_halo_on_t6sg}" - eval ${output_varname_iend_of_t7_with_halo_on_t6sg}="${iend_of_t7_with_halo_on_t6sg}" - eval ${output_varname_jstart_of_t7_with_halo_on_t6sg}="${jstart_of_t7_with_halo_on_t6sg}" - eval ${output_varname_jend_of_t7_with_halo_on_t6sg}="${jend_of_t7_with_halo_on_t6sg}" + if [ ! -z "${outvarname_lon_of_t7_ctr}" ]; then + printf -v ${outvarname_lon_of_t7_ctr} "%s" "${lon_of_t7_ctr}" + fi + + if [ ! -z "${outvarname_lat_of_t7_ctr}" ]; then + printf -v ${outvarname_lat_of_t7_ctr} "%s" "${lat_of_t7_ctr}" + fi + + if [ ! -z "${outvarname_nx_of_t7_on_t7g}" ]; then + printf -v ${outvarname_nx_of_t7_on_t7g} "%s" "${nx_of_t7_on_t7g}" + fi + + if [ ! -z "${outvarname_ny_of_t7_on_t7g}" ]; then + printf -v ${outvarname_ny_of_t7_on_t7g} "%s" "${ny_of_t7_on_t7g}" + fi + + if [ ! -z "${outvarname_halo_width_on_t7g}" ]; then + printf -v ${outvarname_halo_width_on_t7g} "%s" "${halo_width_on_t7g}" + fi + + if [ ! -z "${outvarname_stretch_factor}" ]; then + printf -v ${outvarname_stretch_factor} "%s" "${stretch_factor}" + fi + + if [ ! -z "${outvarname_istart_of_t7_with_halo_on_t6sg}" ]; then + printf -v ${outvarname_istart_of_t7_with_halo_on_t6sg} "%s" "${istart_of_t7_with_halo_on_t6sg}" + fi + + if [ ! -z "${outvarname_iend_of_t7_with_halo_on_t6sg}" ]; then + printf -v ${outvarname_iend_of_t7_with_halo_on_t6sg} "%s" "${iend_of_t7_with_halo_on_t6sg}" + fi + + if [ ! -z "${outvarname_jstart_of_t7_with_halo_on_t6sg}" ]; then + printf -v ${outvarname_jstart_of_t7_with_halo_on_t6sg} "%s" "${jstart_of_t7_with_halo_on_t6sg}" + fi + + if [ ! -z "${outvarname_jend_of_t7_with_halo_on_t6sg}" ]; then + printf -v ${outvarname_jend_of_t7_with_halo_on_t6sg} "%s" "${jend_of_t7_with_halo_on_t6sg}" + fi # #----------------------------------------------------------------------- # diff --git a/ush/set_predef_grid_params.sh b/ush/set_predef_grid_params.sh index fd4ef530b..71c3d12a7 100644 --- a/ush/set_predef_grid_params.sh +++ b/ush/set_predef_grid_params.sh @@ -15,7 +15,7 @@ function set_predef_grid_params() { # #----------------------------------------------------------------------- # -{ save_shell_opts; set -u +x; } > /dev/null 2>&1 + { save_shell_opts; set -u +x; } > /dev/null 2>&1 # #----------------------------------------------------------------------- # @@ -25,9 +25,9 @@ function set_predef_grid_params() { # #----------------------------------------------------------------------- # -local scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) -local scrfunc_fn=$( basename "${scrfunc_fp}" ) -local scrfunc_dir=$( dirname "${scrfunc_fp}" ) + local scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) + local scrfunc_fn=$( basename "${scrfunc_fp}" ) + local scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # @@ -35,7 +35,16 @@ local scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -local func_name="${FUNCNAME[0]}" + local func_name="${FUNCNAME[0]}" +# +#----------------------------------------------------------------------- +# +# Set directories. +# +#----------------------------------------------------------------------- +# + local homerrfs=${scrfunc_dir%/*} + local ushdir="$homerrfs/ush" # #----------------------------------------------------------------------- # @@ -43,13 +52,142 @@ local func_name="${FUNCNAME[0]}" # #----------------------------------------------------------------------- # -. ${USHDIR}/constants.sh + . $ushdir/constants.sh +# +#----------------------------------------------------------------------- +# +# Specify the set of valid argument names for this script/function. +# Then process the arguments provided to this script/function (which +# should consist of a set of name-value pairs of the form arg1="value1", +# etc). +# +#----------------------------------------------------------------------- +# + local valid_args=( \ + "predef_grid_name" \ + "dt_atmos" \ + "layout_x" \ + "layout_y" \ + "blocksize" \ + "quilting" \ + "outvarname_grid_gen_method" \ + "outvarname_esggrid_lon_ctr" \ + "outvarname_esggrid_lat_ctr" \ + "outvarname_esggrid_delx" \ + "outvarname_esggrid_dely" \ + "outvarname_esggrid_nx" \ + "outvarname_esggrid_ny" \ + "outvarname_esggrid_pazi" \ + "outvarname_esggrid_wide_halo_width" \ + "outvarname_gfdlgrid_lon_t6_ctr" \ + "outvarname_gfdlgrid_lat_t6_ctr" \ + "outvarname_gfdlgrid_stretch_fac" \ + "outvarname_gfdlgrid_res" \ + "outvarname_gfdlgrid_refine_ratio" \ + "outvarname_gfdlgrid_istart_of_rgnl_dom_on_t6g" \ + "outvarname_gfdlgrid_iend_of_rgnl_dom_on_t6g" \ + "outvarname_gfdlgrid_jstart_of_rgnl_dom_on_t6g" \ + "outvarname_gfdlgrid_jend_of_rgnl_dom_on_t6g" \ + "outvarname_gfdlgrid_use_gfdlgrid_res_in_filenames" \ + "outvarname_dt_atmos" \ + "outvarname_layout_x" \ + "outvarname_layout_y" \ + "outvarname_blocksize" \ + "outvarname_wrtcmp_write_groups" \ + "outvarname_wrtcmp_write_tasks_per_group" \ + "outvarname_wrtcmp_output_grid" \ + "outvarname_wrtcmp_cen_lon" \ + "outvarname_wrtcmp_cen_lat" \ + "outvarname_wrtcmp_stdlat1" \ + "outvarname_wrtcmp_stdlat2" \ + "outvarname_wrtcmp_nx" \ + "outvarname_wrtcmp_ny" \ + "outvarname_wrtcmp_lon_lwr_left" \ + "outvarname_wrtcmp_lat_lwr_left" \ + "outvarname_wrtcmp_lon_upr_rght" \ + "outvarname_wrtcmp_lat_upr_rght" \ + "outvarname_wrtcmp_dx" \ + "outvarname_wrtcmp_dy" \ + "outvarname_wrtcmp_dlon" \ + "outvarname_wrtcmp_dlat" \ + ) + process_args "valid_args" "$@" +# +#----------------------------------------------------------------------- +# +# Declare and initialize local variables. +# +#----------------------------------------------------------------------- +# + local __grid_gen_method__="" \ + __esggrid_lon_ctr__="" \ + __esggrid_lat_ctr__="" \ + __esggrid_delx__="" \ + __esggrid_dely__="" \ + __esggrid_nx__="" \ + __esggrid_ny__="" \ + __esggrid_pazi__="" \ + __esggrid_wide_halo_width__="" \ + __gfdlgrid_lon_t6_ctr__="" \ + __gfdlgrid_lat_t6_ctr__="" \ + __gfdlgrid_stretch_fac__="" \ + __gfdlgrid_res__="" \ + __gfdlgrid_refine_ratio__="" \ + __gfdlgrid_istart_of_rgnl_dom_on_t6g__="" \ + __gfdlgrid_iend_of_rgnl_dom_on_t6g__="" \ + __gfdlgrid_jstart_of_rgnl_dom_on_t6g__="" \ + __gfdlgrid_jend_of_rgnl_dom_on_t6g__="" \ + __gfdlgrid_use_gfdlgrid_res_in_filenames__="" \ + __dt_atmos__="" \ + __layout_x__="" \ + __layout_y__="" \ + __blocksize__="" \ + __wrtcmp_write_groups__="" \ + __wrtcmp_write_tasks_per_group__="" \ + __wrtcmp_output_grid__="" \ + __wrtcmp_cen_lon__="" \ + __wrtcmp_cen_lat__="" \ + __wrtcmp_stdlat1__="" \ + __wrtcmp_stdlat2__="" \ + __wrtcmp_nx__="" \ + __wrtcmp_ny__="" \ + __wrtcmp_lon_lwr_left__="" \ + __wrtcmp_lat_lwr_left__="" \ + __wrtcmp_lon_upr_rght__="" \ + __wrtcmp_lat_upr_rght__="" \ + __wrtcmp_dx__="" \ + __wrtcmp_dy__="" \ + __wrtcmp_dlon__="" \ + __wrtcmp_dlat__="" \ + num_margin_cells_T6_left="" \ + num_margin_cells_T6_right="" \ + num_margin_cells_T6_bottom="" \ + num_margin_cells_T6_top="" +# +#----------------------------------------------------------------------- +# +# For debugging purposes, print out values of arguments passed to this +# script. Note that these will be printed out only if VERBOSE is set to +# TRUE. +# +#----------------------------------------------------------------------- +# +# print_input_args valid_args +# +#----------------------------------------------------------------------- +# +# Make sure that the input argument "quilting" is set to a valid value. +# +#----------------------------------------------------------------------- +# + check_var_valid_value "quilting" "valid_vals_BOOLEAN" + quilting=$(boolify "$quilting") # #----------------------------------------------------------------------- # # Set grid and other parameters according to the value of the predefined -# domain (PREDEF_GRID_NAME). Note that the code will enter this script -# only if PREDEF_GRID_NAME has a valid (and non-empty) value. +# domain (predef_grid_name). Note that the code will enter this script +# only if predef_grid_name has a valid (and non-empty) value. # #################### # The following comments need to be updated: @@ -57,7 +195,7 @@ local func_name="${FUNCNAME[0]}" # # 1) Reset the experiment title (expt_title). # 2) Reset the grid parameters. -# 3) If the write component is to be used (i.e. QUILTING is set to +# 3) If the write component is to be used (i.e. "quilting" is set to # "TRUE") and the variable WRTCMP_PARAMS_TMPL_FN containing the name # of the write-component template file is unset or empty, set that # filename variable to the appropriate preexisting template file. @@ -91,7 +229,7 @@ local func_name="${FUNCNAME[0]}" # #----------------------------------------------------------------------- # -case ${PREDEF_GRID_NAME} in + case "${predef_grid_name}" in # #----------------------------------------------------------------------- # @@ -99,91 +237,92 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_CONUS_25km") + "RRFS_CONUS_25km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="25000.0" - ESGgrid_DELY="25000.0" + __esggrid_delx__="25000.0" + __esggrid_dely__="25000.0" - ESGgrid_NX="219" - ESGgrid_NY="131" + __esggrid_nx__="219" + __esggrid_ny__="131" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-40}" + __dt_atmos__="${dt_atmos:-40}" - LAYOUT_X="${LAYOUT_X:-5}" - LAYOUT_Y="${LAYOUT_Y:-2}" - BLOCKSIZE="${BLOCKSIZE:-40}" + __layout_x__="${layout_x:-5}" + __layout_y__="${layout_y:-2}" + __blocksize__="${blocksize:-40}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="2" - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="217" - WRTCMP_ny="128" - WRTCMP_lon_lwr_left="-122.719528" - WRTCMP_lat_lwr_left="21.138123" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="2" + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="217" + __wrtcmp_ny__="128" + __wrtcmp_lon_lwr_left__="-122.719528" + __wrtcmp_lat_lwr_left__="21.138123" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # -# The RRFS CONUS domain with ~25km cells that can be initialized from the HRRR. +# The RRFS CONUS domain with ~25km cells that can be initialized from +# the HRRR. # #----------------------------------------------------------------------- # -"RRFS_CONUScompact_25km") + "RRFS_CONUScompact_25km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="25000.0" - ESGgrid_DELY="25000.0" + __esggrid_delx__="25000.0" + __esggrid_dely__="25000.0" - ESGgrid_NX="202" - ESGgrid_NY="116" + __esggrid_nx__="202" + __esggrid_ny__="116" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-40}" + __dt_atmos__="${dt_atmos:-40}" - LAYOUT_X="${LAYOUT_X:-5}" - LAYOUT_Y="${LAYOUT_Y:-2}" - BLOCKSIZE="${BLOCKSIZE:-40}" + __layout_x__="${layout_x:-5}" + __layout_y__="${layout_y:-2}" + __blocksize__="${blocksize:-40}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="2" - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="199" - WRTCMP_ny="111" - WRTCMP_lon_lwr_left="-121.23349066" - WRTCMP_lat_lwr_left="23.41731593" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="2" + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="199" + __wrtcmp_ny__="111" + __wrtcmp_lon_lwr_left__="-121.23349066" + __wrtcmp_lat_lwr_left__="23.41731593" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -191,45 +330,45 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_CONUS_13km") + "RRFS_CONUS_13km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="13000.0" - ESGgrid_DELY="13000.0" + __esggrid_delx__="13000.0" + __esggrid_dely__="13000.0" - ESGgrid_NX="420" - ESGgrid_NY="252" + __esggrid_nx__="420" + __esggrid_ny__="252" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-45}" + __dt_atmos__="${dt_atmos:-45}" - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-10}" - BLOCKSIZE="${BLOCKSIZE:-32}" + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-10}" + __blocksize__="${blocksize:-32}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="416" - WRTCMP_ny="245" - WRTCMP_lon_lwr_left="-122.719528" - WRTCMP_lat_lwr_left="21.138123" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="416" + __wrtcmp_ny__="245" + __wrtcmp_lon_lwr_left__="-122.719528" + __wrtcmp_lat_lwr_left__="21.138123" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -237,45 +376,45 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_CONUScompact_13km") + "RRFS_CONUScompact_13km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="13000.0" - ESGgrid_DELY="13000.0" + __esggrid_delx__="13000.0" + __esggrid_dely__="13000.0" - ESGgrid_NX="396" - ESGgrid_NY="232" + __esggrid_nx__="396" + __esggrid_ny__="232" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-45}" + __dt_atmos__="${dt_atmos:-45}" - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-10}" - BLOCKSIZE="${BLOCKSIZE:-32}" + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-10}" + __blocksize__="${blocksize:-32}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="393" - WRTCMP_ny="225" - WRTCMP_lon_lwr_left="-121.70231097" - WRTCMP_lat_lwr_left="22.57417972" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="393" + __wrtcmp_ny__="225" + __wrtcmp_lon_lwr_left__="-121.70231097" + __wrtcmp_lat_lwr_left__="22.57417972" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -283,91 +422,92 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_CONUS_3km") + "RRFS_CONUS_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="1820" - ESGgrid_NY="1092" + __esggrid_nx__="1820" + __esggrid_ny__="1092" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-36}" + __dt_atmos__="${dt_atmos:-36}" - LAYOUT_X="${LAYOUT_X:-28}" - LAYOUT_Y="${LAYOUT_Y:-28}" - BLOCKSIZE="${BLOCKSIZE:-29}" + __layout_x__="${layout_x:-28}" + __layout_y__="${layout_y:-28}" + __blocksize__="${blocksize:-29}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="1799" - WRTCMP_ny="1059" - WRTCMP_lon_lwr_left="-122.719528" - WRTCMP_lat_lwr_left="21.138123" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="1799" + __wrtcmp_ny__="1059" + __wrtcmp_lon_lwr_left__="-122.719528" + __wrtcmp_lat_lwr_left__="21.138123" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # -# The RRFS CONUS domain with ~3km cells that can be initialized from the HRRR. +# The RRFS CONUS domain with ~3km cells that can be initialized from +# the HRRR. # #----------------------------------------------------------------------- # -"RRFS_CONUScompact_3km") + "RRFS_CONUScompact_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="1748" - ESGgrid_NY="1038" + __esggrid_nx__="1748" + __esggrid_ny__="1038" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-40}" + __dt_atmos__="${dt_atmos:-40}" - LAYOUT_X="${LAYOUT_X:-30}" - LAYOUT_Y="${LAYOUT_Y:-16}" - BLOCKSIZE="${BLOCKSIZE:-32}" + __layout_x__="${layout_x:-30}" + __layout_y__="${layout_y:-16}" + __blocksize__="${blocksize:-32}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="1746" - WRTCMP_ny="1014" - WRTCMP_lon_lwr_left="-122.17364391" - WRTCMP_lat_lwr_left="21.88588562" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="1746" + __wrtcmp_ny__="1014" + __wrtcmp_lon_lwr_left__="-122.17364391" + __wrtcmp_lat_lwr_left__="21.88588562" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -375,45 +515,45 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_SUBCONUS_3km") + "RRFS_SUBCONUS_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="35.0" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="35.0" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="840" - ESGgrid_NY="600" + __esggrid_nx__="840" + __esggrid_ny__="600" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-40}" + __dt_atmos__="${dt_atmos:-40}" - LAYOUT_X="${LAYOUT_X:-30}" - LAYOUT_Y="${LAYOUT_Y:-24}" - BLOCKSIZE="${BLOCKSIZE:-35}" + __layout_x__="${layout_x:-30}" + __layout_y__="${layout_y:-24}" + __blocksize__="${blocksize:-35}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="837" - WRTCMP_ny="595" - WRTCMP_lon_lwr_left="-109.97410429" - WRTCMP_lat_lwr_left="26.31459843" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="837" + __wrtcmp_ny__="595" + __wrtcmp_lon_lwr_left__="-109.97410429" + __wrtcmp_lat_lwr_left__="26.31459843" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -423,45 +563,45 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"SUBCONUS_Ind_3km") + "SUBCONUS_Ind_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-86.16" - ESGgrid_LAT_CTR="39.77" + __esggrid_lon_ctr__="-86.16" + __esggrid_lat_ctr__="39.77" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="200" - ESGgrid_NY="200" + __esggrid_nx__="200" + __esggrid_ny__="200" - ESGgrid_PAZI="0.0" - - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_pazi__="0.0" - DT_ATMOS="${DT_ATMOS:-40}" + __esggrid_wide_halo_width__="6" - LAYOUT_X="${LAYOUT_X:-5}" - LAYOUT_Y="${LAYOUT_Y:-5}" - BLOCKSIZE="${BLOCKSIZE:-40}" + __dt_atmos__="${dt_atmos:-40}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="197" - WRTCMP_ny="197" - WRTCMP_lon_lwr_left="-89.47120417" - WRTCMP_lat_lwr_left="37.07809642" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + __layout_x__="${layout_x:-5}" + __layout_y__="${layout_y:-5}" + __blocksize__="${blocksize:-40}" + + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="197" + __wrtcmp_ny__="197" + __wrtcmp_lon_lwr_left__="-89.47120417" + __wrtcmp_lat_lwr_left__="37.07809642" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -472,70 +612,71 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_AK_13km") + "RRFS_AK_13km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-161.5" - ESGgrid_LAT_CTR="63.0" + __esggrid_lon_ctr__="-161.5" + __esggrid_lat_ctr__="63.0" - ESGgrid_DELX="13000.0" - ESGgrid_DELY="13000.0" + __esggrid_delx__="13000.0" + __esggrid_dely__="13000.0" - ESGgrid_NX="320" - ESGgrid_NY="240" + __esggrid_nx__="320" + __esggrid_ny__="240" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" -# DT_ATMOS="${DT_ATMOS:-50}" - DT_ATMOS="${DT_ATMOS:-10}" +# __dt_atmos__="${dt_atmos:-50}" + __dt_atmos__="${dt_atmos:-10}" - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-12}" - BLOCKSIZE="${BLOCKSIZE:-40}" + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-12}" + __blocksize__="${blocksize:-40}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" -# The following work. They were obtained using the NCL scripts but only -# after manually modifying the longitutes of two of the 4 corners of the -# domain to add 360.0 to them. Need to automate that procedure. - WRTCMP_nx="318" - WRTCMP_ny="234" -# WRTCMP_lon_lwr_left="-187.76660836" - WRTCMP_lon_lwr_left="172.23339164" - WRTCMP_lat_lwr_left="45.77691870" +# The following works. The numbers were obtained using the NCL scripts +# but only after manually modifying the longitutes of two of the four +# corners of the domain to add 360.0 to them. Need to automate that +# procedure. + __wrtcmp_nx__="318" + __wrtcmp_ny__="234" +# __wrtcmp_lon_lwr_left__="-187.76660836" + __wrtcmp_lon_lwr_left__="172.23339164" + __wrtcmp_lat_lwr_left__="45.77691870" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi # The following rotated_latlon coordinate system parameters were obtained # using the NCL code and work. -# if [ "$QUILTING" = "TRUE" ]; then -# WRTCMP_write_groups="1" -# WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) -# WRTCMP_output_grid="rotated_latlon" -# WRTCMP_cen_lon="${ESGgrid_LON_CTR}" -# WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" -# WRTCMP_lon_lwr_left="-18.47206579" -# WRTCMP_lat_lwr_left="-13.56176982" -# WRTCMP_lon_upr_rght="18.47206579" -# WRTCMP_lat_upr_rght="13.56176982" -## WRTCMP_dlon="0.11691181" -## WRTCMP_dlat="0.11691181" -# WRTCMP_dlon=$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELX}/${radius_Earth})*${degs_per_radian}" ) ) -# WRTCMP_dlat=$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELY}/${radius_Earth})*${degs_per_radian}" ) ) -# fi - ;; +# if [ "$quilting" = "TRUE" ]; then +# __wrtcmp_write_groups__="1" +# __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) +# __wrtcmp_output_grid__="rotated_latlon" +# __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" +# __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" +# __wrtcmp_lon_lwr_left__="-18.47206579" +# __wrtcmp_lat_lwr_left__="-13.56176982" +# __wrtcmp_lon_upr_rght__="18.47206579" +# __wrtcmp_lat_upr_rght__="13.56176982" +## __wrtcmp_dlon__="0.11691181" +## __wrtcmp_dlat__="0.11691181" +# __wrtcmp_dlon__=$( printf "%.9f" $( bc -l <<< "(${esggrid_delx}/${radius_Earth})*${degs_per_radian}" ) ) +# __wrtcmp_dlat__=$( printf "%.9f" $( bc -l <<< "(${esggrid_dely}/${radius_Earth})*${degs_per_radian}" ) ) +# fi + ;; # #----------------------------------------------------------------------- # @@ -546,92 +687,92 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_AK_3km") + "RRFS_AK_3km") -# if [ "${GRID_GEN_METHOD}" = "GFDLgrid" ]; then +# if [ "${grid_gen_method}" = "GFDLgrid" ]; then # -# GFDLgrid_LON_T6_CTR="-160.8" -# GFDLgrid_LAT_T6_CTR="63.0" -# GFDLgrid_STRETCH_FAC="1.161" -# GFDLgrid_RES="768" -# GFDLgrid_REFINE_RATIO="4" +# __gfdlgrid_lon_t6_ctr__="-160.8" +# __gfdlgrid_lat_t6_ctr__="63.0" +# __gfdlgrid_stretch_fac__="1.161" +# __gfdlgrid_res__="768" +# __gfdlgrid_refine_ratio__="4" # -# num_margin_cells_T6_left="204" -# GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_left + 1 )) +# num_margin_cells_T6_left="204" +# __gfdlgrid_istart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_left + 1 )) # -# num_margin_cells_T6_right="204" -# GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_right )) +# num_margin_cells_T6_right="204" +# __gfdlgrid_iend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_right )) # -# num_margin_cells_T6_bottom="249" -# GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_bottom + 1 )) +# num_margin_cells_T6_bottom="249" +# __gfdlgrid_jstart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_bottom + 1 )) # -# num_margin_cells_T6_top="249" -# GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_top )) +# num_margin_cells_T6_top="249" +# __gfdlgrid_jend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_top )) # -# GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES="FALSE" +# __gfdlgrid_use_gfdlgrid_res_in_filenames__="FALSE" # -# DT_ATMOS="${DT_ATMOS:-18}" +# __dt_atmos__="${dt_atmos:-18}" # -# LAYOUT_X="${LAYOUT_X:-24}" -# LAYOUT_Y="${LAYOUT_Y:-24}" -# BLOCKSIZE="${BLOCKSIZE:-15}" +# __layout_x__="${layout_x:-24}" +# __layout_y__="${layout_y:-24}" +# __blocksize__="${blocksize:-15}" # -# if [ "$QUILTING" = "TRUE" ]; then -# WRTCMP_write_groups="1" -# WRTCMP_write_tasks_per_group="2" -# WRTCMP_output_grid="lambert_conformal" -# WRTCMP_cen_lon="${GFDLgrid_LON_T6_CTR}" -# WRTCMP_cen_lat="${GFDLgrid_LAT_T6_CTR}" -# WRTCMP_stdlat1="${GFDLgrid_LAT_T6_CTR}" -# WRTCMP_stdlat2="${GFDLgrid_LAT_T6_CTR}" -# WRTCMP_nx="1320" -# WRTCMP_ny="950" -# WRTCMP_lon_lwr_left="173.734" -# WRTCMP_lat_lwr_left="46.740347" -# WRTCMP_dx="3000.0" -# WRTCMP_dy="3000.0" -# fi +# if [ "$quilting" = "TRUE" ]; then +# __wrtcmp_write_groups__="1" +# __wrtcmp_write_tasks_per_group__="2" +# __wrtcmp_output_grid__="lambert_conformal" +# __wrtcmp_cen_lon__="${__gfdlgrid_lon_t6_ctr__}" +# __wrtcmp_cen_lat__="${__gfdlgrid_lat_t6_ctr__}" +# __wrtcmp_stdlat1__="${__gfdlgrid_lat_t6_ctr__}" +# __wrtcmp_stdlat2__="${__gfdlgrid_lat_t6_ctr__}" +# __wrtcmp_nx__="1320" +# __wrtcmp_ny__="950" +# __wrtcmp_lon_lwr_left__="173.734" +# __wrtcmp_lat_lwr_left__="46.740347" +# __wrtcmp_dx__="3000.0" +# __wrtcmp_dy__="3000.0" +# fi # -# elif [ "${GRID_GEN_METHOD}" = "ESGgrid" ]; then +# elif [ "${grid_gen_method}" = "ESGgrid" ]; then - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-161.5" - ESGgrid_LAT_CTR="63.0" + __esggrid_lon_ctr__="-161.5" + __esggrid_lat_ctr__="63.0" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="1380" - ESGgrid_NY="1020" + __esggrid_nx__="1380" + __esggrid_ny__="1020" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" -# DT_ATMOS="${DT_ATMOS:-50}" - DT_ATMOS="${DT_ATMOS:-10}" +# __dt_atmos__="${dt_atmos:-50}" + __dt_atmos__="${dt_atmos:-10}" - LAYOUT_X="${LAYOUT_X:-30}" - LAYOUT_Y="${LAYOUT_Y:-17}" - BLOCKSIZE="${BLOCKSIZE:-40}" + __layout_x__="${layout_x:-30}" + __layout_y__="${layout_y:-17}" + __blocksize__="${blocksize:-40}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="1379" - WRTCMP_ny="1003" - WRTCMP_lon_lwr_left="-187.89737923" - WRTCMP_lat_lwr_left="45.84576053" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="1379" + __wrtcmp_ny__="1003" + __wrtcmp_lon_lwr_left__="-187.89737923" + __wrtcmp_lat_lwr_left__="45.84576053" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -639,53 +780,53 @@ case ${PREDEF_GRID_NAME} in # # Note: # The WoFS domain will generate a 301 x 301 output grid (WRITE COMPONENT) and -# will eventually be movable (ESGgrid_LON_CTR/ESGgrid_LAT_CTR). A python script +# will eventually be movable (esggrid_lon_ctr/esggrid_lat_ctr). A python script # python_utils/fv3write_parms_lambert will be useful to determine -# WRTCMP_lon_lwr_left and WRTCMP_lat_lwr_left locations (only for Lambert map -# projection currently) of the quilting output when the domain location is +# wrtcmp_lon_lwr_left and wrtcmp_lat_lwr_left locations (only for Lambert map +# projection currently) of the quilting output when the domain location is # moved. Later, it should be integrated into the workflow. # #----------------------------------------------------------------------- # -"WoFS_3km") + "WoFS_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-97.5" - ESGgrid_LAT_CTR="38.5" + __esggrid_lon_ctr__="-97.5" + __esggrid_lat_ctr__="38.5" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="361" - ESGgrid_NY="361" + __esggrid_nx__="361" + __esggrid_ny__="361" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-20}" + __dt_atmos__="${dt_atmos:-20}" - LAYOUT_X="${LAYOUT_X:-18}" - LAYOUT_Y="${LAYOUT_Y:-12}" - BLOCKSIZE="${BLOCKSIZE:-30}" + __layout_x__="${layout_x:-18}" + __layout_y__="${layout_y:-12}" + __blocksize__="${blocksize:-30}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="301" - WRTCMP_ny="301" - WRTCMP_lon_lwr_left="-102.3802487" - WRTCMP_lat_lwr_left="34.3407918" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="301" + __wrtcmp_ny__="301" + __wrtcmp_lon_lwr_left__="-102.3802487" + __wrtcmp_lat_lwr_left__="34.3407918" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -697,50 +838,50 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"CONUS_25km_GFDLgrid") + "CONUS_25km_GFDLgrid") - GRID_GEN_METHOD="GFDLgrid" + __grid_gen_method__="GFDLgrid" - GFDLgrid_LON_T6_CTR="-97.5" - GFDLgrid_LAT_T6_CTR="38.5" - GFDLgrid_STRETCH_FAC="1.4" - GFDLgrid_RES="96" - GFDLgrid_REFINE_RATIO="3" + __gfdlgrid_lon_t6_ctr__="-97.5" + __gfdlgrid_lat_t6_ctr__="38.5" + __gfdlgrid_stretch_fac__="1.4" + __gfdlgrid_res__="96" + __gfdlgrid_refine_ratio__="3" - num_margin_cells_T6_left="12" - GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_left + 1 )) + num_margin_cells_T6_left="12" + __gfdlgrid_istart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_left + 1 )) - num_margin_cells_T6_right="12" - GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_right )) + num_margin_cells_T6_right="12" + __gfdlgrid_iend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_right )) - num_margin_cells_T6_bottom="16" - GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_bottom + 1 )) + num_margin_cells_T6_bottom="16" + __gfdlgrid_jstart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_bottom + 1 )) - num_margin_cells_T6_top="16" - GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_top )) + num_margin_cells_T6_top="16" + __gfdlgrid_jend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_top )) - GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES="TRUE" + __gfdlgrid_use_gfdlgrid_res_in_filenames__="TRUE" - DT_ATMOS="${DT_ATMOS:-225}" + __dt_atmos__="${dt_atmos:-225}" - LAYOUT_X="${LAYOUT_X:-6}" - LAYOUT_Y="${LAYOUT_Y:-4}" - BLOCKSIZE="${BLOCKSIZE:-36}" + __layout_x__="${layout_x:-6}" + __layout_y__="${layout_y:-4}" + __blocksize__="${blocksize:-36}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="rotated_latlon" - WRTCMP_cen_lon="${GFDLgrid_LON_T6_CTR}" - WRTCMP_cen_lat="${GFDLgrid_LAT_T6_CTR}" - WRTCMP_lon_lwr_left="-24.40085141" - WRTCMP_lat_lwr_left="-19.65624142" - WRTCMP_lon_upr_rght="24.40085141" - WRTCMP_lat_upr_rght="19.65624142" - WRTCMP_dlon="0.22593381" - WRTCMP_dlat="0.22593381" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="rotated_latlon" + __wrtcmp_cen_lon__="${__gfdlgrid_lon_t6_ctr__}" + __wrtcmp_cen_lat__="${__gfdlgrid_lat_t6_ctr__}" + __wrtcmp_lon_lwr_left__="-24.40085141" + __wrtcmp_lat_lwr_left__="-19.65624142" + __wrtcmp_lon_upr_rght__="24.40085141" + __wrtcmp_lat_upr_rght__="19.65624142" + __wrtcmp_dlon__="0.22593381" + __wrtcmp_dlat__="0.22593381" + fi + ;; # #----------------------------------------------------------------------- # @@ -752,50 +893,50 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"CONUS_3km_GFDLgrid") + "CONUS_3km_GFDLgrid") - GRID_GEN_METHOD="GFDLgrid" + __grid_gen_method__="GFDLgrid" - GFDLgrid_LON_T6_CTR="-97.5" - GFDLgrid_LAT_T6_CTR="38.5" - GFDLgrid_STRETCH_FAC="1.5" - GFDLgrid_RES="768" - GFDLgrid_REFINE_RATIO="3" + __gfdlgrid_lon_t6_ctr__="-97.5" + __gfdlgrid_lat_t6_ctr__="38.5" + __gfdlgrid_stretch_fac__="1.5" + __gfdlgrid_res__="768" + __gfdlgrid_refine_ratio__="3" - num_margin_cells_T6_left="69" - GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_left + 1 )) + num_margin_cells_T6_left="69" + __gfdlgrid_istart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_left + 1 )) - num_margin_cells_T6_right="69" - GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_right )) + num_margin_cells_T6_right="69" + __gfdlgrid_iend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_right )) - num_margin_cells_T6_bottom="164" - GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_bottom + 1 )) + num_margin_cells_T6_bottom="164" + __gfdlgrid_jstart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_bottom + 1 )) - num_margin_cells_T6_top="164" - GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_top )) + num_margin_cells_T6_top="164" + __gfdlgrid_jend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_top )) - GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES="TRUE" + __gfdlgrid_use_gfdlgrid_res_in_filenames__="TRUE" - DT_ATMOS="${DT_ATMOS:-18}" + __dt_atmos__="${dt_atmos:-18}" - LAYOUT_X="${LAYOUT_X:-30}" - LAYOUT_Y="${LAYOUT_Y:-22}" - BLOCKSIZE="${BLOCKSIZE:-35}" + __layout_x__="${layout_x:-30}" + __layout_y__="${layout_y:-22}" + __blocksize__="${blocksize:-35}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group=$(( 1*LAYOUT_Y )) - WRTCMP_output_grid="rotated_latlon" - WRTCMP_cen_lon="${GFDLgrid_LON_T6_CTR}" - WRTCMP_cen_lat="${GFDLgrid_LAT_T6_CTR}" - WRTCMP_lon_lwr_left="-25.23144805" - WRTCMP_lat_lwr_left="-15.82130419" - WRTCMP_lon_upr_rght="25.23144805" - WRTCMP_lat_upr_rght="15.82130419" - WRTCMP_dlon="0.02665763" - WRTCMP_dlat="0.02665763" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__=$(( 1*__layout_y__ )) + __wrtcmp_output_grid__="rotated_latlon" + __wrtcmp_cen_lon__="${__gfdlgrid_lon_t6_ctr__}" + __wrtcmp_cen_lat__="${__gfdlgrid_lat_t6_ctr__}" + __wrtcmp_lon_lwr_left__="-25.23144805" + __wrtcmp_lat_lwr_left__="-15.82130419" + __wrtcmp_lon_upr_rght__="25.23144805" + __wrtcmp_lat_upr_rght__="15.82130419" + __wrtcmp_dlon__="0.02665763" + __wrtcmp_dlat__="0.02665763" + fi + ;; # #----------------------------------------------------------------------- # @@ -803,9 +944,9 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"EMC_AK") + "EMC_AK") -# if [ "${GRID_GEN_METHOD}" = "GFDLgrid" ]; then +# if [ "${grid_gen_method}" = "GFDLgrid" ]; then # Values from an EMC script. @@ -841,61 +982,61 @@ case ${PREDEF_GRID_NAME} in #dlon=0.03 #dlat=0.03 -# GFDLgrid_LON_T6_CTR="-153.0" -# GFDLgrid_LAT_T6_CTR="61.0" -# GFDLgrid_STRETCH_FAC="1.0" # ??? -# GFDLgrid_RES="768" -# GFDLgrid_REFINE_RATIO="3" # ??? +# __gfdlgrid_lon_t6_ctr__="-153.0" +# __gfdlgrid_lat_t6_ctr__="61.0" +# __gfdlgrid_stretch_fac__="1.0" # ??? +# __gfdlgrid_res__="768" +# __gfdlgrid_refine_ratio__="3" # ??? # -# num_margin_cells_T6_left="61" -# GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_left + 1 )) +# num_margin_cells_T6_left="61" +# __gfdlgrid_istart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_left + 1 )) # -# num_margin_cells_T6_right="67" -# GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_right )) +# num_margin_cells_T6_right="67" +# __gfdlgrid_iend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_right )) # -# num_margin_cells_T6_bottom="165" -# GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G=$(( num_margin_cells_T6_bottom + 1 )) +# num_margin_cells_T6_bottom="165" +# __gfdlgrid_jstart_of_rgnl_dom_on_t6g__=$(( num_margin_cells_T6_bottom + 1 )) # -# num_margin_cells_T6_top="171" -# GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G=$(( GFDLgrid_RES - num_margin_cells_T6_top )) +# num_margin_cells_T6_top="171" +# __gfdlgrid_jend_of_rgnl_dom_on_t6g__=$(( __gfdlgrid_res__ - num_margin_cells_T6_top )) # -# GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES="TRUE" +# __gfdlgrid_use_gfdlgrid_res_in_filenames__="TRUE" # -# DT_ATMOS="${DT_ATMOS:-18}" +# __dt_atmos__="${dt_atmos:-18}" # -# LAYOUT_X="${LAYOUT_X:-16}" -# LAYOUT_Y="${LAYOUT_Y:-48}" -# WRTCMP_write_groups="2" -# WRTCMP_write_tasks_per_group="24" -# BLOCKSIZE="${BLOCKSIZE:-32}" +# __layout_x__="${layout_x:-16}" +# __layout_y__="${layout_y:-48}" +# __wrtcmp_write_groups__="2" +# __wrtcmp_write_tasks_per_group__="24" +# __blocksize__="${blocksize:-32}" # -# elif [ "${GRID_GEN_METHOD}" = "ESGgrid" ]; then +# elif [ "${grid_gen_method}" = "ESGgrid" ]; then - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" # Values taken from pre-generated files in /scratch4/NCEPDEV/fv3-cam/save/Benjamin.Blake/regional_workflow/fix/fix_sar # With move to Hera, those files were lost; a backup can be found here: /scratch2/BMC/det/kavulich/fix/fix_sar # Longitude and latitude for center of domain - ESGgrid_LON_CTR="-153.0" - ESGgrid_LAT_CTR="61.0" + __esggrid_lon_ctr__="-153.0" + __esggrid_lat_ctr__="61.0" # Projected grid spacing in meters...in the static files (e.g. "C768_grid.tile7.nc"), the "dx" is actually the resolution # of the supergrid, which is HALF of this dx - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" # Number of x and y points for your domain (halo not included); # Divide "supergrid" values from /scratch2/BMC/det/kavulich/fix/fix_sar/ak/C768_grid.tile7.halo4.nc by 2 and subtract 8 to eliminate halo - ESGgrid_NX="1344" # Supergrid value 2704 - ESGgrid_NY="1152" # Supergrid value 2320 + __esggrid_nx__="1344" # Supergrid value 2704 + __esggrid_ny__="1152" # Supergrid value 2320 # Rotation of the ESG grid in degrees. - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" # Number of halo points for a wide grid (before trimming)...this should almost always be 6 for now # Within the model we actually have a 4-point halo and a 3-point halo - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" # Side note: FV3 is lagrangian and vertical coordinates are dynamically remapped during model integration # 'ksplit' is the factor that determines the timestep for this process (divided @@ -906,41 +1047,41 @@ case ${PREDEF_GRID_NAME} in # # Preliminary standard values: 18 for 3-km runs, 90 for 13-km runs per config_defaults.sh - DT_ATMOS="${DT_ATMOS:-18}" + __dt_atmos__="${dt_atmos:-18}" -#Factors for MPI decomposition. ESGgrid_NX must be divisible by LAYOUT_X, ESGgrid_NY must be divisible by LAYOUT_Y - LAYOUT_X="${LAYOUT_X:-28}" - LAYOUT_Y="${LAYOUT_Y:-16}" +#Factors for MPI decomposition. esggrid_nx must be divisible by layout_x, esggrid_ny must be divisible by layout_y + __layout_x__="${layout_x:-28}" + __layout_y__="${layout_y:-16}" #Take number of points on a tile (nx/lx*ny/ly), must divide by block size to get an integer. #This integer must be small enough to fit into a processor's cache, so it is machine-dependent magic # For Theia, must be ~40 or less # Check setup.sh for more details - BLOCKSIZE="${BLOCKSIZE:-24}" + __blocksize__="${blocksize:-24}" #This section is all for the write component, which you need for output during model integration - if [ "$QUILTING" = "TRUE" ]; then + if [ "$quilting" = "TRUE" ]; then #Write component reserves MPI tasks for writing output. The number of "groups" is usually 1, but if you have a case where group 1 is not done writing before the next write step, you need group 2, etc. - WRTCMP_write_groups="1" -#Number of tasks per write group. Ny must be divisible my this number. LAYOUT_Y is usually a good value - WRTCMP_write_tasks_per_group="24" + __wrtcmp_write_groups__="1" +#Number of tasks per write group. Ny must be divisible my this number. layout_y is usually a good value + __wrtcmp_write_tasks_per_group__="24" #lambert_conformal or rotated_latlon. lambert_conformal not well tested and probably doesn't work for our purposes - WRTCMP_output_grid="lambert_conformal" + __wrtcmp_output_grid__="lambert_conformal" #These should always be set the same as compute grid - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" #Write component grid must always be <= compute grid (without haloes) - WRTCMP_nx="1344" - WRTCMP_ny="1152" + __wrtcmp_nx__="1344" + __wrtcmp_ny__="1152" #Lower left latlon (southwest corner) - WRTCMP_lon_lwr_left="-177.0" - WRTCMP_lat_lwr_left="42.5" - WRTCMP_dx="$ESGgrid_DELX" - WRTCMP_dy="$ESGgrid_DELY" - fi - ;; + __wrtcmp_lon_lwr_left__="-177.0" + __wrtcmp_lat_lwr_left__="42.5" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -948,32 +1089,32 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"EMC_HI") + "EMC_HI") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" # Values taken from pre-generated files in /scratch4/NCEPDEV/fv3-cam/save/Benjamin.Blake/regional_workflow/fix/fix_sar/hi/C768_grid.tile7.nc # With move to Hera, those files were lost; a backup can be found here: /scratch2/BMC/det/kavulich/fix/fix_sar # Longitude and latitude for center of domain - ESGgrid_LON_CTR="-157.0" - ESGgrid_LAT_CTR="20.0" + __esggrid_lon_ctr__="-157.0" + __esggrid_lat_ctr__="20.0" # Projected grid spacing in meters...in the static files (e.g. "C768_grid.tile7.nc"), the "dx" is actually the resolution # of the supergrid, which is HALF of this dx (plus or minus some grid stretch factor) - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" # Number of x and y points for your domain (halo not included); # Divide "supergrid" values from /scratch2/BMC/det/kavulich/fix/fix_sar/hi/C768_grid.tile7.halo4.nc by 2 and subtract 8 to eliminate halo - ESGgrid_NX="432" # Supergrid value 880 - ESGgrid_NY="360" # Supergrid value 736 + __esggrid_nx__="432" # Supergrid value 880 + __esggrid_ny__="360" # Supergrid value 736 # Rotation of the ESG grid in degrees. - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" # Number of halo points for a wide grid (before trimming)...this should almost always be 6 for now # Within the model we actually have a 4-point halo and a 3-point halo - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" # Side note: FV3 is lagrangian and vertical coordinates are dynamically remapped during model integration # 'ksplit' is the factor that determines the timestep for this process (divided @@ -984,41 +1125,41 @@ case ${PREDEF_GRID_NAME} in # # Preliminary standard values: 18 for 3-km runs, 90 for 13-km runs per config_defaults.sh - DT_ATMOS="${DT_ATMOS:-18}" + __dt_atmos__="${dt_atmos:-18}" -#Factors for MPI decomposition. ESGgrid_NX must be divisible by LAYOUT_X, ESGgrid_NY must be divisible by LAYOUT_Y - LAYOUT_X="${LAYOUT_X:-8}" - LAYOUT_Y="${LAYOUT_Y:-8}" +#Factors for MPI decomposition. esggrid_nx must be divisible by layout_x, esggrid_ny must be divisible by layout_y + __layout_x__="${layout_x:-8}" + __layout_y__="${layout_y:-8}" #Take number of points on a tile (nx/lx*ny/ly), must divide by block size to get an integer. #This integer must be small enough to fit into a processor's cache, so it is machine-dependent magic # For Theia, must be ~40 or less # Check setup.sh for more details - BLOCKSIZE="${BLOCKSIZE:-27}" + __blocksize__="${blocksize:-27}" #This section is all for the write component, which you need for output during model integration - if [ "$QUILTING" = "TRUE" ]; then + if [ "$quilting" = "TRUE" ]; then #Write component reserves MPI tasks for writing output. The number of "groups" is usually 1, but if you have a case where group 1 is not done writing before the next write step, you need group 2, etc. - WRTCMP_write_groups="1" -#Number of tasks per write group. Ny must be divisible my this number. LAYOUT_Y is usually a good value - WRTCMP_write_tasks_per_group="8" + __wrtcmp_write_groups__="1" +#Number of tasks per write group. Ny must be divisible my this number. layout_y is usually a good value + __wrtcmp_write_tasks_per_group__="8" #lambert_conformal or rotated_latlon. lambert_conformal not well tested and probably doesn't work for our purposes - WRTCMP_output_grid="lambert_conformal" + __wrtcmp_output_grid__="lambert_conformal" #These should usually be set the same as compute grid - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" #Write component grid should be close to the ESGgrid values unless you are doing something weird - WRTCMP_nx="420" - WRTCMP_ny="348" + __wrtcmp_nx__="420" + __wrtcmp_ny__="348" #Lower left latlon (southwest corner) - WRTCMP_lon_lwr_left="-162.8" - WRTCMP_lat_lwr_left="15.2" - WRTCMP_dx="$ESGgrid_DELX" - WRTCMP_dy="$ESGgrid_DELY" - fi - ;; + __wrtcmp_lon_lwr_left__="-162.8" + __wrtcmp_lat_lwr_left__="15.2" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -1026,32 +1167,32 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"EMC_PR") + "EMC_PR") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" # Values taken from pre-generated files in /scratch4/NCEPDEV/fv3-cam/save/Benjamin.Blake/regional_workflow/fix/fix_sar/pr/C768_grid.tile7.nc # With move to Hera, those files were lost; a backup can be found here: /scratch2/BMC/det/kavulich/fix/fix_sar # Longitude and latitude for center of domain - ESGgrid_LON_CTR="-69.0" - ESGgrid_LAT_CTR="18.0" + __esggrid_lon_ctr__="-69.0" + __esggrid_lat_ctr__="18.0" # Projected grid spacing in meters...in the static files (e.g. "C768_grid.tile7.nc"), the "dx" is actually the resolution # of the supergrid, which is HALF of this dx (plus or minus some grid stretch factor) - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" # Number of x and y points for your domain (halo not included); # Divide "supergrid" values from /scratch2/BMC/det/kavulich/fix/fix_sar/pr/C768_grid.tile7.halo4.nc by 2 and subtract 8 to eliminate halo - ESGgrid_NX="576" # Supergrid value 1168 - ESGgrid_NY="432" # Supergrid value 880 + __esggrid_nx__="576" # Supergrid value 1168 + __esggrid_ny__="432" # Supergrid value 880 # Rotation of the ESG grid in degrees. - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" # Number of halo points for a wide grid (before trimming)...this should almost always be 6 for now # Within the model we actually have a 4-point halo and a 3-point halo - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" # Side note: FV3 is lagrangian and vertical coordinates are dynamically remapped during model integration # 'ksplit' is the factor that determines the timestep for this process (divided @@ -1062,41 +1203,41 @@ case ${PREDEF_GRID_NAME} in # # Preliminary standard values: 18 for 3-km runs, 90 for 13-km runs per config_defaults.sh - DT_ATMOS="${DT_ATMOS:-18}" + __dt_atmos__="${dt_atmos:-18}" -#Factors for MPI decomposition. ESGgrid_NX must be divisible by LAYOUT_X, ESGgrid_NY must be divisible by LAYOUT_Y - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-8}" +#Factors for MPI decomposition. esggrid_nx must be divisible by layout_x, esggrid_ny must be divisible by layout_y + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-8}" #Take number of points on a tile (nx/lx*ny/ly), must divide by block size to get an integer. #This integer must be small enough to fit into a processor's cache, so it is machine-dependent magic # For Theia, must be ~40 or less # Check setup.sh for more details - BLOCKSIZE="${BLOCKSIZE:-24}" + __blocksize__="${blocksize:-24}" #This section is all for the write component, which you need for output during model integration - if [ "$QUILTING" = "TRUE" ]; then + if [ "$quilting" = "TRUE" ]; then #Write component reserves MPI tasks for writing output. The number of "groups" is usually 1, but if you have a case where group 1 is not done writing before the next write step, you need group 2, etc. - WRTCMP_write_groups="1" -#Number of tasks per write group. Ny must be divisible my this number. LAYOUT_Y is usually a good value - WRTCMP_write_tasks_per_group="24" + __wrtcmp_write_groups__="1" +#Number of tasks per write group. Ny must be divisible my this number. layout_y is usually a good value + __wrtcmp_write_tasks_per_group__="24" #lambert_conformal or rotated_latlon. lambert_conformal not well tested and probably doesn't work for our purposes - WRTCMP_output_grid="lambert_conformal" + __wrtcmp_output_grid__="lambert_conformal" #These should always be set the same as compute grid - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" #Write component grid must always be <= compute grid (without haloes) - WRTCMP_nx="576" - WRTCMP_ny="432" + __wrtcmp_nx__="576" + __wrtcmp_ny__="432" #Lower left latlon (southwest corner) - WRTCMP_lon_lwr_left="-77" - WRTCMP_lat_lwr_left="12" - WRTCMP_dx="$ESGgrid_DELX" - WRTCMP_dy="$ESGgrid_DELY" - fi - ;; + __wrtcmp_lon_lwr_left__="-77" + __wrtcmp_lat_lwr_left__="12" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -1104,32 +1245,32 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"EMC_GU") + "EMC_GU") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" # Values taken from pre-generated files in /scratch4/NCEPDEV/fv3-cam/save/Benjamin.Blake/regional_workflow/fix/fix_sar/guam/C768_grid.tile7.nc # With move to Hera, those files were lost; a backup can be found here: /scratch2/BMC/det/kavulich/fix/fix_sar # Longitude and latitude for center of domain - ESGgrid_LON_CTR="146.0" - ESGgrid_LAT_CTR="15.0" + __esggrid_lon_ctr__="146.0" + __esggrid_lat_ctr__="15.0" # Projected grid spacing in meters...in the static files (e.g. "C768_grid.tile7.nc"), the "dx" is actually the resolution # of the supergrid, which is HALF of this dx (plus or minus some grid stretch factor) - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" # Number of x and y points for your domain (halo not included); # Divide "supergrid" values from /scratch2/BMC/det/kavulich/fix/fix_sar/guam/C768_grid.tile7.halo4.nc by 2 and subtract 8 to eliminate halo - ESGgrid_NX="432" # Supergrid value 880 - ESGgrid_NY="360" # Supergrid value 736 + __esggrid_nx__="432" # Supergrid value 880 + __esggrid_ny__="360" # Supergrid value 736 # Rotation of the ESG grid in degrees. - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" # Number of halo points for a wide grid (before trimming)...this should almost always be 6 for now # Within the model we actually have a 4-point halo and a 3-point halo - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" # Side note: FV3 is lagrangian and vertical coordinates are dynamically remapped during model integration # 'ksplit' is the factor that determines the timestep for this process (divided @@ -1140,40 +1281,40 @@ case ${PREDEF_GRID_NAME} in # # Preliminary standard values: 18 for 3-km runs, 90 for 13-km runs per config_defaults.sh - DT_ATMOS="${DT_ATMOS:-18}" + __dt_atmos__="${dt_atmos:-18}" -#Factors for MPI decomposition. ESGgrid_NX must be divisible by LAYOUT_X, ESGgrid_NY must be divisible by LAYOUT_Y - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-12}" +#Factors for MPI decomposition. esggrid_nx must be divisible by layout_x, esggrid_ny must be divisible by layout_y + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-12}" #Take number of points on a tile (nx/lx*ny/ly), must divide by block size to get an integer. #This integer must be small enough to fit into a processor's cache, so it is machine-dependent magic # For Theia, must be ~40 or less # Check setup.sh for more details - BLOCKSIZE="${BLOCKSIZE:-27}" + __blocksize__="${blocksize:-27}" #This section is all for the write component, which you need for output during model integration - if [ "$QUILTING" = "TRUE" ]; then + if [ "$quilting" = "TRUE" ]; then #Write component reserves MPI tasks for writing output. The number of "groups" is usually 1, but if you have a case where group 1 is not done writing before the next write step, you need group 2, etc. - WRTCMP_write_groups="1" -#Number of tasks per write group. Ny must be divisible my this number. LAYOUT_Y is usually a good value - WRTCMP_write_tasks_per_group="24" + __wrtcmp_write_groups__="1" +#Number of tasks per write group. Ny must be divisible my this number. layout_y is usually a good value + __wrtcmp_write_tasks_per_group__="24" #lambert_conformal or rotated_latlon. lambert_conformal not well tested and probably doesn't work for our purposes - WRTCMP_output_grid="lambert_conformal" + __wrtcmp_output_grid__="lambert_conformal" #These should always be set the same as compute grid - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" #Write component grid must always be <= compute grid (without haloes) - WRTCMP_nx="420" - WRTCMP_ny="348" + __wrtcmp_nx__="420" + __wrtcmp_ny__="348" #Lower left latlon (southwest corner) Used /scratch2/NCEPDEV/fv3-cam/Dusan.Jovic/dbrowse/fv3grid utility to find best value - WRTCMP_lon_lwr_left="140" - WRTCMP_lat_lwr_left="10" - WRTCMP_dx="$ESGgrid_DELX" - WRTCMP_dy="$ESGgrid_DELY" - fi - ;; + __wrtcmp_lon_lwr_left__="140" + __wrtcmp_lat_lwr_left__="10" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -1181,43 +1322,43 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"GSL_HAFSV0.A_25km") + "GSL_HAFSV0.A_25km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-62.0" - ESGgrid_LAT_CTR="22.0" + __esggrid_lon_ctr__="-62.0" + __esggrid_lat_ctr__="22.0" - ESGgrid_DELX="25000.0" - ESGgrid_DELY="25000.0" + __esggrid_delx__="25000.0" + __esggrid_dely__="25000.0" - ESGgrid_NX="345" - ESGgrid_NY="230" + __esggrid_nx__="345" + __esggrid_ny__="230" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-300}" + __dt_atmos__="${dt_atmos:-300}" - LAYOUT_X="${LAYOUT_X:-5}" - LAYOUT_Y="${LAYOUT_Y:-5}" - BLOCKSIZE="${BLOCKSIZE:-6}" + __layout_x__="${layout_x:-5}" + __layout_y__="${layout_y:-5}" + __blocksize__="${blocksize:-6}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="32" - WRTCMP_output_grid="regional_latlon" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="25.0" - WRTCMP_lon_lwr_left="-114.5" - WRTCMP_lat_lwr_left="-5.0" - WRTCMP_lon_upr_rght="-9.5" - WRTCMP_lat_upr_rght="55.0" - WRTCMP_dlon="0.25" - WRTCMP_dlat="0.25" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="32" + __wrtcmp_output_grid__="regional_latlon" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="25.0" + __wrtcmp_lon_lwr_left__="-114.5" + __wrtcmp_lat_lwr_left__="-5.0" + __wrtcmp_lon_upr_rght__="-9.5" + __wrtcmp_lat_upr_rght__="55.0" + __wrtcmp_dlon__="0.25" + __wrtcmp_dlat__="0.25" + fi + ;; # #----------------------------------------------------------------------- # @@ -1225,43 +1366,43 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"GSL_HAFSV0.A_13km") + "GSL_HAFSV0.A_13km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-62.0" - ESGgrid_LAT_CTR="22.0" + __esggrid_lon_ctr__="-62.0" + __esggrid_lat_ctr__="22.0" - ESGgrid_DELX="13000.0" - ESGgrid_DELY="13000.0" + __esggrid_delx__="13000.0" + __esggrid_dely__="13000.0" - ESGgrid_NX="665" - ESGgrid_NY="444" + __esggrid_nx__="665" + __esggrid_ny__="444" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-180}" + __dt_atmos__="${dt_atmos:-180}" - LAYOUT_X="${LAYOUT_X:-19}" - LAYOUT_Y="${LAYOUT_Y:-12}" - BLOCKSIZE="${BLOCKSIZE:-35}" + __layout_x__="${layout_x:-19}" + __layout_y__="${layout_y:-12}" + __blocksize__="${blocksize:-35}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="32" - WRTCMP_output_grid="regional_latlon" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="25.0" - WRTCMP_lon_lwr_left="-114.5" - WRTCMP_lat_lwr_left="-5.0" - WRTCMP_lon_upr_rght="-9.5" - WRTCMP_lat_upr_rght="55.0" - WRTCMP_dlon="0.13" - WRTCMP_dlat="0.13" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="32" + __wrtcmp_output_grid__="regional_latlon" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="25.0" + __wrtcmp_lon_lwr_left__="-114.5" + __wrtcmp_lat_lwr_left__="-5.0" + __wrtcmp_lon_upr_rght__="-9.5" + __wrtcmp_lat_upr_rght__="55.0" + __wrtcmp_dlon__="0.13" + __wrtcmp_dlat__="0.13" + fi + ;; # #----------------------------------------------------------------------- # @@ -1269,43 +1410,43 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"GSL_HAFSV0.A_3km") + "GSL_HAFSV0.A_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-62.0" - ESGgrid_LAT_CTR="22.0" + __esggrid_lon_ctr__="-62.0" + __esggrid_lat_ctr__="22.0" - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX="2880" - ESGgrid_NY="1920" + __esggrid_nx__="2880" + __esggrid_ny__="1920" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-40}" + __dt_atmos__="${dt_atmos:-40}" - LAYOUT_X="${LAYOUT_X:-32}" - LAYOUT_Y="${LAYOUT_Y:-24}" - BLOCKSIZE="${BLOCKSIZE:-32}" + __layout_x__="${layout_x:-32}" + __layout_y__="${layout_y:-24}" + __blocksize__="${blocksize:-32}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="32" - WRTCMP_output_grid="regional_latlon" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="25.0" - WRTCMP_lon_lwr_left="-114.5" - WRTCMP_lat_lwr_left="-5.0" - WRTCMP_lon_upr_rght="-9.5" - WRTCMP_lat_upr_rght="55.0" - WRTCMP_dlon="0.03" - WRTCMP_dlat="0.03" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="32" + __wrtcmp_output_grid__="regional_latlon" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="25.0" + __wrtcmp_lon_lwr_left__="-114.5" + __wrtcmp_lat_lwr_left__="-5.0" + __wrtcmp_lon_upr_rght__="-9.5" + __wrtcmp_lat_upr_rght__="55.0" + __wrtcmp_dlon__="0.03" + __wrtcmp_dlat__="0.03" + fi + ;; # #----------------------------------------------------------------------- # @@ -1313,45 +1454,45 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"GSD_HRRR_AK_50km") + "GSD_HRRR_AK_50km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-163.5" - ESGgrid_LAT_CTR="62.8" + __esggrid_lon_ctr__="-163.5" + __esggrid_lat_ctr__="62.8" - ESGgrid_DELX="50000.0" - ESGgrid_DELY="50000.0" + __esggrid_delx__="50000.0" + __esggrid_dely__="50000.0" - ESGgrid_NX="74" - ESGgrid_NY="51" + __esggrid_nx__="74" + __esggrid_ny__="51" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-600}" + __dt_atmos__="${dt_atmos:-600}" - LAYOUT_X="${LAYOUT_X:-2}" - LAYOUT_Y="${LAYOUT_Y:-3}" - BLOCKSIZE="${BLOCKSIZE:-37}" + __layout_x__="${layout_x:-2}" + __layout_y__="${layout_y:-3}" + __blocksize__="${blocksize:-37}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="1" - WRTCMP_output_grid="lambert_conformal" - WRTCMP_cen_lon="${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" - WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="70" - WRTCMP_ny="45" - WRTCMP_lon_lwr_left="172.0" - WRTCMP_lat_lwr_left="49.0" - WRTCMP_dx="${ESGgrid_DELX}" - WRTCMP_dy="${ESGgrid_DELY}" - fi - ;; + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="1" + __wrtcmp_output_grid__="lambert_conformal" + __wrtcmp_cen_lon__="${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat1__="${__esggrid_lat_ctr__}" + __wrtcmp_stdlat2__="${__esggrid_lat_ctr__}" + __wrtcmp_nx__="70" + __wrtcmp_ny__="45" + __wrtcmp_lon_lwr_left__="172.0" + __wrtcmp_lat_lwr_left__="49.0" + __wrtcmp_dx__="${__esggrid_delx__}" + __wrtcmp_dy__="${__esggrid_dely__}" + fi + ;; # #----------------------------------------------------------------------- # @@ -1359,44 +1500,43 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_NA_13km") + "RRFS_NA_13km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR="-112.5" - ESGgrid_LAT_CTR="55.0" + __esggrid_lon_ctr__="-112.5" + __esggrid_lat_ctr__="55.0" - ESGgrid_DELX="13000.0" - ESGgrid_DELY="13000.0" + __esggrid_delx__="13000.0" + __esggrid_dely__="13000.0" - ESGgrid_NX="912" - ESGgrid_NY="623" + __esggrid_nx__="912" + __esggrid_ny__="623" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH="6" + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-50}" + __dt_atmos__="${dt_atmos:-50}" - LAYOUT_X="${LAYOUT_X:-16}" - LAYOUT_Y="${LAYOUT_Y:-16}" - BLOCKSIZE="${BLOCKSIZE:-30}" - - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="16" - WRTCMP_output_grid="rotated_latlon" - WRTCMP_cen_lon="-113.0" #"${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="55.0" #"${ESGgrid_LAT_CTR}" - WRTCMP_lon_lwr_left="-61.0" - WRTCMP_lat_lwr_left="-37.0" - WRTCMP_lon_upr_rght="61.0" - WRTCMP_lat_upr_rght="37.0" - WRTCMP_dlon=$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELX}/${radius_Earth})*${degs_per_radian}" ) ) - WRTCMP_dlat=$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELY}/${radius_Earth})*${degs_per_radian}" ) ) - fi - ;; + __layout_x__="${layout_x:-16}" + __layout_y__="${layout_y:-16}" + __blocksize__="${blocksize:-30}" + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="16" + __wrtcmp_output_grid__="rotated_latlon" + __wrtcmp_cen_lon__="-113.0" #"${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="55.0" #"${__esggrid_lat_ctr__}" + __wrtcmp_lon_lwr_left__="-61.0" + __wrtcmp_lat_lwr_left__="-37.0" + __wrtcmp_lon_upr_rght__="61.0" + __wrtcmp_lat_upr_rght__="37.0" + __wrtcmp_dlon__=$( printf "%.9f" $( bc -l <<< "(${__esggrid_delx__}/${radius_Earth})*${degs_per_radian}" ) ) + __wrtcmp_dlat__=$( printf "%.9f" $( bc -l <<< "(${__esggrid_dely__}/${radius_Earth})*${degs_per_radian}" ) ) + fi + ;; # #----------------------------------------------------------------------- # @@ -1404,61 +1544,222 @@ case ${PREDEF_GRID_NAME} in # #----------------------------------------------------------------------- # -"RRFS_NA_3km") + "RRFS_NA_3km") - GRID_GEN_METHOD="ESGgrid" + __grid_gen_method__="ESGgrid" - ESGgrid_LON_CTR=-112.5 - ESGgrid_LAT_CTR=55.0 + __esggrid_lon_ctr__=-112.5 + __esggrid_lat_ctr__=55.0 - ESGgrid_DELX="3000.0" - ESGgrid_DELY="3000.0" + __esggrid_delx__="3000.0" + __esggrid_dely__="3000.0" - ESGgrid_NX=3950 - ESGgrid_NY=2700 + __esggrid_nx__="3950" + __esggrid_ny__="2700" - ESGgrid_PAZI="0.0" + __esggrid_pazi__="0.0" - ESGgrid_WIDE_HALO_WIDTH=6 + __esggrid_wide_halo_width__="6" - DT_ATMOS="${DT_ATMOS:-36}" + __dt_atmos__="${dt_atmos:-36}" - LAYOUT_X="${LAYOUT_X:-20}" # 40 - EMC operational configuration - LAYOUT_Y="${LAYOUT_Y:-35}" # 45 - EMC operational configuration - BLOCKSIZE="${BLOCKSIZE:-28}" + __layout_x__="${layout_x:-20}" # 40 - EMC operational configuration + __layout_y__="${layout_y:-35}" # 45 - EMC operational configuration + __blocksize__="${blocksize:-28}" - if [ "$QUILTING" = "TRUE" ]; then - WRTCMP_write_groups="1" - WRTCMP_write_tasks_per_group="144" - WRTCMP_output_grid="rotated_latlon" - WRTCMP_cen_lon="-113.0" #"${ESGgrid_LON_CTR}" - WRTCMP_cen_lat="55.0" #"${ESGgrid_LAT_CTR}" - WRTCMP_lon_lwr_left="-61.0" - WRTCMP_lat_lwr_left="-37.0" - WRTCMP_lon_upr_rght="61.0" - WRTCMP_lat_upr_rght="37.0" - WRTCMP_dlon="0.025" #$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELX}/${radius_Earth})*${degs_per_radian}" ) ) - WRTCMP_dlat="0.025" #$( printf "%.9f" $( bc -l <<< "(${ESGgrid_DELY}/${radius_Earth})*${degs_per_radian}" ) ) - fi - ;; -esac + if [ "$quilting" = "TRUE" ]; then + __wrtcmp_write_groups__="1" + __wrtcmp_write_tasks_per_group__="144" + __wrtcmp_output_grid__="rotated_latlon" + __wrtcmp_cen_lon__="-113.0" #"${__esggrid_lon_ctr__}" + __wrtcmp_cen_lat__="55.0" #"${__esggrid_lat_ctr__}" + __wrtcmp_lon_lwr_left__="-61.0" + __wrtcmp_lat_lwr_left__="-37.0" + __wrtcmp_lon_upr_rght__="61.0" + __wrtcmp_lat_upr_rght__="37.0" + __wrtcmp_dlon__="0.025" #$( printf "%.9f" $( bc -l <<< "(${__esggrid_delx__}/${radius_Earth})*${degs_per_radian}" ) ) + __wrtcmp_dlat__="0.025" #$( printf "%.9f" $( bc -l <<< "(${__esggrid_dely__}/${radius_Earth})*${degs_per_radian}" ) ) + fi + ;; + + esac # #----------------------------------------------------------------------- # -# Restore the shell options saved at the beginning of this script/func- -# tion. +# Use the printf utility with the -v flag to set this function's output +# variables. Note that each of these is set only if the corresponding +# input variable specifying the name to use for the output variable is +# not empty. # #----------------------------------------------------------------------- # -{ restore_shell_opts; } > /dev/null 2>&1 + if [ ! -z "${outvarname_grid_gen_method}" ]; then + printf -v ${outvarname_grid_gen_method} "%s" "${__grid_gen_method__}" + fi -} + if [ ! -z "${outvarname_esggrid_lon_ctr}" ]; then + printf -v ${outvarname_esggrid_lon_ctr} "%s" "${__esggrid_lon_ctr__}" + fi + + if [ ! -z "${outvarname_esggrid_lat_ctr}" ]; then + printf -v ${outvarname_esggrid_lat_ctr} "%s" "${__esggrid_lat_ctr__}" + fi + + if [ ! -z "${outvarname_esggrid_delx}" ]; then + printf -v ${outvarname_esggrid_delx} "%s" "${__esggrid_delx__}" + fi + + if [ ! -z "${outvarname_esggrid_dely}" ]; then + printf -v ${outvarname_esggrid_dely} "%s" "${__esggrid_dely__}" + fi + + if [ ! -z "${outvarname_esggrid_nx}" ]; then + printf -v ${outvarname_esggrid_nx} "%s" "${__esggrid_nx__}" + fi + + if [ ! -z "${outvarname_esggrid_ny}" ]; then + printf -v ${outvarname_esggrid_ny} "%s" "${__esggrid_ny__}" + fi + + if [ ! -z "${outvarname_esggrid_pazi}" ]; then + printf -v ${outvarname_esggrid_pazi} "%s" "${__esggrid_pazi__}" + fi + + if [ ! -z "${outvarname_esggrid_wide_halo_width}" ]; then + printf -v ${outvarname_esggrid_wide_halo_width} "%s" "${__esggrid_wide_halo_width__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_lon_t6_ctr}" ]; then + printf -v ${outvarname_gfdlgrid_lon_t6_ctr} "%s" "${__gfdlgrid_lon_t6_ctr__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_lat_t6_ctr}" ]; then + printf -v ${outvarname_gfdlgrid_lat_t6_ctr} "%s" "${__gfdlgrid_lat_t6_ctr__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_stretch_fac}" ]; then + printf -v ${outvarname_gfdlgrid_stretch_fac} "%s" "${__gfdlgrid_stretch_fac__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_res}" ]; then + printf -v ${outvarname_gfdlgrid_res} "%s" "${__gfdlgrid_res__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_refine_ratio}" ]; then + printf -v ${outvarname_gfdlgrid_refine_ratio} "%s" "${__gfdlgrid_refine_ratio__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_istart_of_rgnl_dom_on_t6g}" ]; then + printf -v ${outvarname_gfdlgrid_istart_of_rgnl_dom_on_t6g} "%s" "${__gfdlgrid_istart_of_rgnl_dom_on_t6g__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_iend_of_rgnl_dom_on_t6g}" ]; then + printf -v ${outvarname_gfdlgrid_iend_of_rgnl_dom_on_t6g} "%s" "${__gfdlgrid_iend_of_rgnl_dom_on_t6g__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_jstart_of_rgnl_dom_on_t6g}" ]; then + printf -v ${outvarname_gfdlgrid_jstart_of_rgnl_dom_on_t6g} "%s" "${__gfdlgrid_jstart_of_rgnl_dom_on_t6g__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_jend_of_rgnl_dom_on_t6g}" ]; then + printf -v ${outvarname_gfdlgrid_jend_of_rgnl_dom_on_t6g} "%s" "${__gfdlgrid_jend_of_rgnl_dom_on_t6g__}" + fi + + if [ ! -z "${outvarname_gfdlgrid_use_gfdlgrid_res_in_filenames}" ]; then + printf -v ${outvarname_gfdlgrid_use_gfdlgrid_res_in_filenames} "%s" "${__gfdlgrid_use_gfdlgrid_res_in_filenames__}" + fi + + if [ ! -z "${outvarname_dt_atmos}" ]; then + printf -v ${outvarname_dt_atmos} "%s" "${__dt_atmos__}" + fi + + if [ ! -z "${outvarname_layout_x}" ]; then + printf -v ${outvarname_layout_x} "%s" "${__layout_x__}" + fi + + if [ ! -z "${outvarname_layout_y}" ]; then + printf -v ${outvarname_layout_y} "%s" "${__layout_y__}" + fi + + if [ ! -z "${outvarname_blocksize}" ]; then + printf -v ${outvarname_blocksize} "%s" "${__blocksize__}" + fi + + if [ ! -z "${outvarname_wrtcmp_write_groups}" ]; then + printf -v ${outvarname_wrtcmp_write_groups} "%s" "${__wrtcmp_write_groups__}" + fi + + if [ ! -z "${outvarname_wrtcmp_write_tasks_per_group}" ]; then + printf -v ${outvarname_wrtcmp_write_tasks_per_group} "%s" "${__wrtcmp_write_tasks_per_group__}" + fi + + if [ ! -z "${outvarname_wrtcmp_output_grid}" ]; then + printf -v ${outvarname_wrtcmp_output_grid} "%s" "${__wrtcmp_output_grid__}" + fi + + if [ ! -z "${outvarname_wrtcmp_cen_lon}" ]; then + printf -v ${outvarname_wrtcmp_cen_lon} "%s" "${__wrtcmp_cen_lon__}" + fi + + if [ ! -z "${outvarname_wrtcmp_cen_lat}" ]; then + printf -v ${outvarname_wrtcmp_cen_lat} "%s" "${__wrtcmp_cen_lat__}" + fi + + if [ ! -z "${outvarname_wrtcmp_stdlat1}" ]; then + printf -v ${outvarname_wrtcmp_stdlat1} "%s" "${__wrtcmp_stdlat1__}" + fi + + if [ ! -z "${outvarname_wrtcmp_stdlat2}" ]; then + printf -v ${outvarname_wrtcmp_stdlat2} "%s" "${__wrtcmp_stdlat2__}" + fi + + if [ ! -z "${outvarname_wrtcmp_nx}" ]; then + printf -v ${outvarname_wrtcmp_nx} "%s" "${__wrtcmp_nx__}" + fi + + if [ ! -z "${outvarname_wrtcmp_ny}" ]; then + printf -v ${outvarname_wrtcmp_ny} "%s" "${__wrtcmp_ny__}" + fi + + if [ ! -z "${outvarname_wrtcmp_lon_lwr_left}" ]; then + printf -v ${outvarname_wrtcmp_lon_lwr_left} "%s" "${__wrtcmp_lon_lwr_left__}" + fi + + if [ ! -z "${outvarname_wrtcmp_lat_lwr_left}" ]; then + printf -v ${outvarname_wrtcmp_lat_lwr_left} "%s" "${__wrtcmp_lat_lwr_left__}" + fi + + if [ ! -z "${outvarname_wrtcmp_lon_upr_rght}" ]; then + printf -v ${outvarname_wrtcmp_lon_upr_rght} "%s" "${__wrtcmp_lon_upr_rght__}" + fi + + if [ ! -z "${outvarname_wrtcmp_lat_upr_rght}" ]; then + printf -v ${outvarname_wrtcmp_lat_upr_rght} "%s" "${__wrtcmp_lat_upr_rght__}" + fi + + if [ ! -z "${outvarname_wrtcmp_dx}" ]; then + printf -v ${outvarname_wrtcmp_dx} "%s" "${__wrtcmp_dx__}" + fi + + if [ ! -z "${outvarname_wrtcmp_dy}" ]; then + printf -v ${outvarname_wrtcmp_dy} "%s" "${__wrtcmp_dy__}" + fi + + if [ ! -z "${outvarname_wrtcmp_dlon}" ]; then + printf -v ${outvarname_wrtcmp_dlon} "%s" "${__wrtcmp_dlon__}" + fi + + if [ ! -z "${outvarname_wrtcmp_dlat}" ]; then + printf -v ${outvarname_wrtcmp_dlat} "%s" "${__wrtcmp_dlat__}" + fi # #----------------------------------------------------------------------- # -# Call the function defined above. +# Restore the shell options saved at the beginning of this script/func- +# tion. # #----------------------------------------------------------------------- # -set_predef_grid_params + { restore_shell_opts; } > /dev/null 2>&1 +} diff --git a/ush/setup.sh b/ush/setup.sh index a5e0f15fd..49153fc68 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -66,6 +66,7 @@ Starting function ${func_name}() in \"${scrfunc_fn}\"... # . ./check_expt_config_vars.sh . ./set_cycle_dates.sh +. ./set_predef_grid_params.sh . ./set_gridparams_GFDLgrid.sh . ./set_gridparams_ESGgrid.sh . ./link_fix.sh @@ -136,17 +137,20 @@ fi # Make sure that user-defined variables are set to valid values # # Set binary switch variables to either "TRUE" or "FALSE" by calling -# boolify so we don't have to consider other valid values later on +# boolify so we don't have to consider other valid values later on. # #----------------------------------------------------------------------- # check_var_valid_value "RUN_ENVIR" "valid_vals_RUN_ENVIR" -check_var_valid_value "VERBOSE" "valid_vals_VERBOSE" -VERBOSE=$(boolify $VERBOSE) +check_var_valid_value "VERBOSE" "valid_vals_BOOLEAN" +VERBOSE=$(boolify "$VERBOSE") -check_var_valid_value "DEBUG" "valid_vals_DEBUG" -DEBUG=$(boolify $DEBUG) +check_var_valid_value "DEBUG" "valid_vals_BOOLEAN" +DEBUG=$(boolify "$DEBUG") + +check_var_valid_value "USE_CRON_TO_RELAUNCH" "valid_vals_BOOLEAN" +USE_CRON_TO_RELAUNCH=$(boolify "${USE_CRON_TO_RELAUNCH}") # #----------------------------------------------------------------------- # @@ -160,53 +164,78 @@ if [ "$DEBUG" = "TRUE" ]; then Setting VERBOSE to \"TRUE\" because DEBUG has been set to \"TRUE\"..." VERBOSE="TRUE" fi +# +#----------------------------------------------------------------------- +# +# Check flags that turn on/off various workflow tasks. +# +#----------------------------------------------------------------------- +# +check_var_valid_value "RUN_TASK_MAKE_GRID" "valid_vals_BOOLEAN" +RUN_TASK_MAKE_GRID=$(boolify "${RUN_TASK_MAKE_GRID}") -check_var_valid_value "USE_CRON_TO_RELAUNCH" "valid_vals_USE_CRON_TO_RELAUNCH" -USE_CRON_TO_RELAUNCH=$(boolify $USE_CRON_TO_RELAUNCH) +check_var_valid_value "RUN_TASK_MAKE_OROG" "valid_vals_BOOLEAN" +RUN_TASK_MAKE_OROG=$(boolify "${RUN_TASK_MAKE_OROG}") -check_var_valid_value "RUN_TASK_MAKE_GRID" "valid_vals_RUN_TASK_MAKE_GRID" -RUN_TASK_MAKE_GRID=$(boolify $RUN_TASK_MAKE_GRID) +check_var_valid_value "RUN_TASK_MAKE_SFC_CLIMO" "valid_vals_BOOLEAN" +RUN_TASK_MAKE_SFC_CLIMO=$(boolify "${RUN_TASK_MAKE_SFC_CLIMO}") -check_var_valid_value "RUN_TASK_MAKE_OROG" "valid_vals_RUN_TASK_MAKE_OROG" -RUN_TASK_MAKE_OROG=$(boolify $RUN_TASK_MAKE_OROG) +check_var_valid_value "RUN_TASK_GET_EXTRN_ICS" "valid_vals_BOOLEAN" +RUN_TASK_GET_EXTRN_ICS=$(boolify "${RUN_TASK_GET_EXTRN_ICS}") -check_var_valid_value \ - "RUN_TASK_MAKE_SFC_CLIMO" "valid_vals_RUN_TASK_MAKE_SFC_CLIMO" -RUN_TASK_MAKE_SFC_CLIMO=$(boolify $RUN_TASK_MAKE_SFC_CLIMO) +check_var_valid_value "RUN_TASK_GET_EXTRN_LBCS" "valid_vals_BOOLEAN" +RUN_TASK_GET_EXTRN_LBCS=$(boolify "${RUN_TASK_GET_EXTRN_LBCS}") -check_var_valid_value \ - "RUN_TASK_RUN_POST" "valid_vals_RUN_TASK_RUN_POST" -RUN_TASK_RUN_POST=$(boolify $RUN_TASK_RUN_POST) +check_var_valid_value "RUN_TASK_RUN_FCST" "valid_vals_BOOLEAN" +RUN_TASK_RUN_FCST=$(boolify "${RUN_TASK_RUN_FCST}") -check_var_valid_value "RUN_TASK_VX_GRIDSTAT" "valid_vals_RUN_TASK_VX_GRIDSTAT" -RUN_TASK_VX_GRIDSTAT=$(boolify $RUN_TASK_VX_GRIDSTAT) +check_var_valid_value "RUN_TASK_RUN_POST" "valid_vals_BOOLEAN" +RUN_TASK_RUN_POST=$(boolify "${RUN_TASK_RUN_POST}") -check_var_valid_value "RUN_TASK_VX_POINTSTAT" "valid_vals_RUN_TASK_VX_POINTSTAT" -RUN_TASK_VX_POINTSTAT=$(boolify $RUN_TASK_VX_POINTSTAT) +check_var_valid_value "RUN_TASK_GET_OBS_CCPA" "valid_vals_BOOLEAN" +RUN_TASK_GET_OBS_CCPA=$(boolify "${RUN_TASK_GET_OBS_CCPA}") -check_var_valid_value "RUN_TASK_VX_ENSGRID" "valid_vals_RUN_TASK_VX_ENSGRID" -RUN_TASK_VX_ENSGRID=$(boolify $RUN_TASK_VX_ENSGRID) +check_var_valid_value "RUN_TASK_GET_OBS_MRMS" "valid_vals_BOOLEAN" +RUN_TASK_GET_OBS_MRMS=$(boolify "${RUN_TASK_GET_OBS_MRMS}") -check_var_valid_value "RUN_TASK_VX_ENSPOINT" "valid_vals_RUN_TASK_VX_ENSPOINT" -RUN_TASK_VX_ENSPOINT=$(boolify $RUN_TASK_VX_ENSPOINT) +check_var_valid_value "RUN_TASK_GET_OBS_NDAS" "valid_vals_BOOLEAN" +RUN_TASK_GET_OBS_NDAS=$(boolify "${RUN_TASK_GET_OBS_NDAS}") -check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM" -USE_FVCOM=$(boolify $USE_FVCOM) +check_var_valid_value "RUN_TASK_VX_GRIDSTAT" "valid_vals_BOOLEAN" +RUN_TASK_VX_GRIDSTAT=$(boolify "${RUN_TASK_VX_GRIDSTAT}") -check_var_valid_value "DO_SHUM" "valid_vals_DO_SHUM" -DO_SHUM=$(boolify $DO_SHUM) +check_var_valid_value "RUN_TASK_VX_POINTSTAT" "valid_vals_BOOLEAN" +RUN_TASK_VX_POINTSTAT=$(boolify "${RUN_TASK_VX_POINTSTAT}") -check_var_valid_value "DO_SPPT" "valid_vals_DO_SPPT" -DO_SPPT=$(boolify $DO_SPPT) +check_var_valid_value "RUN_TASK_VX_ENSGRID" "valid_vals_BOOLEAN" +RUN_TASK_VX_ENSGRID=$(boolify "${RUN_TASK_VX_ENSGRID}") -check_var_valid_value "DO_SKEB" "valid_vals_DO_SKEB" -DO_SKEB=$(boolify $DO_SKEB) +check_var_valid_value "RUN_TASK_VX_ENSPOINT" "valid_vals_BOOLEAN" +RUN_TASK_VX_ENSPOINT=$(boolify "${RUN_TASK_VX_ENSPOINT}") +# +#----------------------------------------------------------------------- +# +# Check stochastic physcs flags. +# +#----------------------------------------------------------------------- +# +check_var_valid_value "DO_SHUM" "valid_vals_BOOLEAN" +DO_SHUM=$(boolify "${DO_SHUM}") + +check_var_valid_value "DO_SPPT" "valid_vals_BOOLEAN" +DO_SPPT=$(boolify "${DO_SPPT}") + +check_var_valid_value "DO_SKEB" "valid_vals_BOOLEAN" +DO_SKEB=$(boolify "${DO_SKEB}") + +check_var_valid_value "DO_SPP" "valid_vals_BOOLEAN" +DO_SPP=$(boolify "${DO_SPP}") -check_var_valid_value "DO_SPP" "valid_vals_DO_SPP" -DO_SPP=$(boolify $DO_SPP) +check_var_valid_value "DO_LSM_SPP" "valid_vals_BOOLEAN" +DO_LSM_SPP=$(boolify "${DO_LSM_SPP}") -check_var_valid_value "DO_LSM_SPP" "valid_vals_DO_LSM_SPP" -DO_LSM_SPP=$(boolify $DO_LSM_SPP) +check_var_valid_value "USE_ZMTNBLCK" "valid_vals_BOOLEAN" +USE_ZMTNBLCK=$(boolify "${USE_ZMTNBLCK}") # #----------------------------------------------------------------------- # @@ -310,11 +339,6 @@ fi # #----------------------------------------------------------------------- # -check_var_valid_value "SUB_HOURLY_POST" "valid_vals_SUB_HOURLY_POST" -SUB_HOURLY_POST=$(boolify $SUB_HOURLY_POST) -# -#----------------------------------------------------------------------- -# # Make sure that DOT_OR_USCORE is set to a valid value. # #----------------------------------------------------------------------- @@ -330,8 +354,9 @@ check_var_valid_value "DOT_OR_USCORE" "valid_vals_DOT_OR_USCORE" # #----------------------------------------------------------------------- # -check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM" -USE_FVCOM=$(boolify $USE_FVCOM) +check_var_valid_value "USE_FVCOM" "valid_vals_BOOLEAN" +USE_FVCOM=$(boolify "${USE_FVCOM}") + check_var_valid_value "FVCOM_WCSTART" "valid_vals_FVCOM_WCSTART" FVCOM_WCSTART=$(echo_lowercase $FVCOM_WCSTART) # @@ -461,7 +486,6 @@ The base directory in which the UPP source code should be located Please clone the external repository containing the code in this directory, build the executable, and then rerun the workflow." fi - # # Define some other useful paths # @@ -477,7 +501,6 @@ TEMPLATE_DIR="$USHDIR/templates" VX_CONFIG_DIR="$TEMPLATE_DIR/parm" METPLUS_CONF="$TEMPLATE_DIR/parm/metplus" MET_CONFIG="$TEMPLATE_DIR/parm/met" - # #----------------------------------------------------------------------- # @@ -518,15 +541,22 @@ One or more fix file directories have not been specified for this machine: DOMAIN_PREGEN_BASEDIR = \"${DOMAIN_PREGEN_BASEDIR:-\"\"} You can specify the missing location(s) in ${machine_file}" fi - - # #----------------------------------------------------------------------- # -# Set the names of the build and workflow module files (if not -# already specified by the user). These are the files that need to be -# sourced before building the component SRW App codes and running various -# workflow scripts, respectively. +# Make sure COMPILER is set to a valid value. +# +#----------------------------------------------------------------------- +# +COMPILER=$(echo_lowercase $COMPILER) +check_var_valid_value "COMPILER" "valid_vals_COMPILER" +# +#----------------------------------------------------------------------- +# +# Set the names of the build and workflow module files (if not already +# specified by the user). These are the files that need to be loaded +# before building the component SRW App codes and running various workflow +# scripts, respectively. # #----------------------------------------------------------------------- # @@ -547,7 +577,7 @@ PPN_RUN_FCST=${PPN_RUN_FCST:-${ppn_run_fcst_default}} # #----------------------------------------------------------------------- # -# Make sure that the job scheduler set above is valid. +# Make sure SCHED is set to a valid value. # #----------------------------------------------------------------------- # @@ -634,12 +664,8 @@ check_var_valid_value \ # #----------------------------------------------------------------------- # -check_var_valid_value "USE_MERRA_CLIMO" "valid_vals_USE_MERRA_CLIMO" -# -# Set USE_MERRA_CLIMO to either "TRUE" or "FALSE" so we don't -# have to consider other valid values later on. -# -USE_MERRA_CLIMO=$(boolify $USE_MERRA_CLIMO) +check_var_valid_value "USE_MERRA_CLIMO" "valid_vals_BOOLEAN" +USE_MERRA_CLIMO=$(boolify "${USE_MERRA_CLIMO}") # Force to "TRUE" in case of FV3_GFS_v15_thompson_mynn_lam3km: if [ "${CCPP_PHYS_SUITE}" = "FV3_GFS_v15_thompson_mynn_lam3km" ]; then USE_MERRA_CLIMO="TRUE" @@ -814,6 +840,9 @@ fi # #----------------------------------------------------------------------- # +check_var_valid_value "USE_CUSTOM_POST_CONFIG_FILE" "valid_vals_BOOLEAN" +USE_CUSTOM_POST_CONFIG_FILE=$(boolify "${USE_CUSTOM_POST_CONFIG_FILE}") + if [ ${USE_CUSTOM_POST_CONFIG_FILE} = "TRUE" ]; then if [ ! -f "${CUSTOM_POST_CONFIG_FP}" ]; then print_err_msg_exit " @@ -825,12 +854,16 @@ fi # #----------------------------------------------------------------------- # -# If using external CRTM fix files to allow post-processing of synthetic -# satellite products from the UPP, then make sure the fix file directory -# exists. +# Ensure that USE_CRTM is set to a valid value. Then, if it is set to +# "TRUE" (i.e. if using external CRTM fix files to allow post-processing +# of synthetic satellite products from the UPP, make sure that the fix +# file directory exists. # #----------------------------------------------------------------------- # +check_var_valid_value "USE_CRTM" "valid_vals_BOOLEAN" +USE_CRTM=$(boolify "${USE_CRTM}") + if [ ${USE_CRTM} = "TRUE" ]; then if [ ! -d "${CRTM_DIR}" ]; then print_err_msg_exit " @@ -889,13 +922,62 @@ LBC_SPEC_FCST_HRS=($( seq ${LBC_SPEC_INTVL_HRS} ${LBC_SPEC_INTVL_HRS} \ # #----------------------------------------------------------------------- # -# If PREDEF_GRID_NAME is set to a non-empty string, set or reset parameters -# according to the predefined domain specified. +# If PREDEF_GRID_NAME is set to a non-empty string, set or reset native +# and write-component grid parameters according to the specified predefined +# domain. # #----------------------------------------------------------------------- # if [ ! -z "${PREDEF_GRID_NAME}" ]; then - . $USHDIR/set_predef_grid_params.sh + + set_predef_grid_params \ + predef_grid_name="${PREDEF_GRID_NAME}" \ + dt_atmos="${DT_ATMOS}" \ + layout_x="${LAYOUT_X}" \ + layout_y="${LAYOUT_Y}" \ + blocksize="${BLOCKSIZE}" \ + quilting="${QUILTING}" \ + outvarname_grid_gen_method="GRID_GEN_METHOD" \ + outvarname_esggrid_lon_ctr="ESGgrid_LON_CTR" \ + outvarname_esggrid_lat_ctr="ESGgrid_LAT_CTR" \ + outvarname_esggrid_delx="ESGgrid_DELX" \ + outvarname_esggrid_dely="ESGgrid_DELY" \ + outvarname_esggrid_nx="ESGgrid_NX" \ + outvarname_esggrid_ny="ESGgrid_NY" \ + outvarname_esggrid_pazi="ESGgrid_PAZI" \ + outvarname_esggrid_wide_halo_width="ESGgrid_WIDE_HALO_WIDTH" \ + outvarname_gfdlgrid_lon_t6_ctr="GFDLgrid_LON_T6_CTR" \ + outvarname_gfdlgrid_lat_t6_ctr="GFDLgrid_LAT_T6_CTR" \ + outvarname_gfdlgrid_stretch_fac="GFDLgrid_STRETCH_FAC" \ + outvarname_gfdlgrid_res="GFDLgrid_RES" \ + outvarname_gfdlgrid_refine_ratio="GFDLgrid_REFINE_RATIO" \ + outvarname_gfdlgrid_istart_of_rgnl_dom_on_t6g="GFDLgrid_ISTART_OF_RGNL_DOM_ON_T6G" \ + outvarname_gfdlgrid_iend_of_rgnl_dom_on_t6g="GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G" \ + outvarname_gfdlgrid_jstart_of_rgnl_dom_on_t6g="GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G" \ + outvarname_gfdlgrid_jend_of_rgnl_dom_on_t6g="GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G" \ + outvarname_gfdlgrid_use_gfdlgrid_res_in_filenames="GFDLgrid_USE_GFDLgrid_RES_IN_FILENAMES" \ + outvarname_dt_atmos="DT_ATMOS" \ + outvarname_layout_x="LAYOUT_X" \ + outvarname_layout_y="LAYOUT_Y" \ + outvarname_blocksize="BLOCKSIZE" \ + outvarname_wrtcmp_write_groups="WRTCMP_write_groups" \ + outvarname_wrtcmp_write_tasks_per_group="WRTCMP_write_tasks_per_group" \ + outvarname_wrtcmp_output_grid="WRTCMP_output_grid" \ + outvarname_wrtcmp_cen_lon="WRTCMP_cen_lon" \ + outvarname_wrtcmp_cen_lat="WRTCMP_cen_lat" \ + outvarname_wrtcmp_stdlat1="WRTCMP_stdlat1" \ + outvarname_wrtcmp_stdlat2="WRTCMP_stdlat2" \ + outvarname_wrtcmp_nx="WRTCMP_nx" \ + outvarname_wrtcmp_ny="WRTCMP_ny" \ + outvarname_wrtcmp_lon_lwr_left="WRTCMP_lon_lwr_left" \ + outvarname_wrtcmp_lat_lwr_left="WRTCMP_lat_lwr_left" \ + outvarname_wrtcmp_lon_upr_rght="WRTCMP_lon_upr_rght" \ + outvarname_wrtcmp_lat_upr_rght="WRTCMP_lat_upr_rght" \ + outvarname_wrtcmp_dx="WRTCMP_dx" \ + outvarname_wrtcmp_dy="WRTCMP_dy" \ + outvarname_wrtcmp_dlon="WRTCMP_dlon" \ + outvarname_wrtcmp_dlat="WRTCMP_dlat" + fi # #----------------------------------------------------------------------- @@ -982,6 +1064,9 @@ fi # #----------------------------------------------------------------------- # +check_var_valid_value "SUB_HOURLY_POST" "valid_vals_BOOLEAN" +SUB_HOURLY_POST=$(boolify "${SUB_HOURLY_POST}") + if [ "${SUB_HOURLY_POST}" = "TRUE" ]; then # # Check that DT_SUBHOURLY_POST_MNTS is a string consisting of one or two @@ -1155,9 +1240,6 @@ check_for_preexist_dir_file "$EXPTDIR" "${PREEXISTING_DIR_METHOD}" # # COMOUT_BASEDIR is not used by the workflow in community mode. # -# POST_OUTPUT_DOMAIN_NAME: -# The PREDEF_GRID_NAME is set by default. -# #----------------------------------------------------------------------- # LOGDIR="${EXPTDIR}/log" @@ -1177,8 +1259,20 @@ else COMROOT="" COMOUT_BASEDIR="" fi - +# +#----------------------------------------------------------------------- +# +# +# If POST_OUTPUT_DOMAIN_NAME has not been specified by the user, set it +# to PREDEF_GRID_NAME (which won't be empty if using a predefined grid). +# Then change it to lowercase. Finally, ensure that it does not end up +# getting set to an empty string. +# +#----------------------------------------------------------------------- +# POST_OUTPUT_DOMAIN_NAME="${POST_OUTPUT_DOMAIN_NAME:-${PREDEF_GRID_NAME}}" +POST_OUTPUT_DOMAIN_NAME=$(echo_lowercase ${POST_OUTPUT_DOMAIN_NAME}) + if [ -z "${POST_OUTPUT_DOMAIN_NAME}" ]; then print_err_msg_exit "\ The domain name used in naming the run_post output files (POST_OUTPUT_DOMAIN_NAME) @@ -1188,7 +1282,6 @@ If this experiment is not using a predefined grid (i.e. if PREDEF_GRID_NAME is set to a null string), POST_OUTPUT_DOMAIN_NAME must be set in the SRW App's configuration file (\"${EXPT_CONFIG_FN}\")." fi -POST_OUTPUT_DOMAIN_NAME=$(echo_lowercase ${POST_OUTPUT_DOMAIN_NAME}) # #----------------------------------------------------------------------- # @@ -1351,11 +1444,6 @@ FIELD_TABLE_FP="${EXPTDIR}/${FIELD_TABLE_FN}" FV3_NML_FN="${FV3_NML_BASE_SUITE_FN%.*}" FV3_NML_FP="${EXPTDIR}/${FV3_NML_FN}" NEMS_CONFIG_FP="${EXPTDIR}/${NEMS_CONFIG_FN}" - - -check_var_valid_value "USE_USER_STAGED_EXTRN_FILES" "valid_vals_USE_USER_STAGED_EXTRN_FILES" -USE_USER_STAGED_EXTRN_FILES=$(boolify $USE_USER_STAGED_EXTRN_FILES) - # #----------------------------------------------------------------------- # @@ -1365,6 +1453,9 @@ USE_USER_STAGED_EXTRN_FILES=$(boolify $USE_USER_STAGED_EXTRN_FILES) # #----------------------------------------------------------------------- # +check_var_valid_value "USE_USER_STAGED_EXTRN_FILES" "valid_vals_BOOLEAN" +USE_USER_STAGED_EXTRN_FILES=$(boolify "${USE_USER_STAGED_EXTRN_FILES}") + if [ "${USE_USER_STAGED_EXTRN_FILES}" = "TRUE" ]; then # Check for the base directory up to the first templated field. @@ -1383,6 +1474,9 @@ external model files for generating LBCs should be located does not exist: fi fi + +check_var_valid_value "NOMADS" "valid_vals_BOOLEAN" +NOMADS=$(boolify "${NOMADS}") # #----------------------------------------------------------------------- # @@ -1393,8 +1487,8 @@ fi # #----------------------------------------------------------------------- # -check_var_valid_value "DO_ENSEMBLE" "valid_vals_DO_ENSEMBLE" -DO_ENSEMBLE=$(boolify $DO_ENSEMBLE) +check_var_valid_value "DO_ENSEMBLE" "valid_vals_BOOLEAN" +DO_ENSEMBLE=$(boolify "${DO_ENSEMBLE}") NDIGITS_ENSMEM_NAMES="0" ENSMEM_NAMES=("") @@ -1796,45 +1890,6 @@ fi # #----------------------------------------------------------------------- # -# Any regional model must be supplied lateral boundary conditions (in -# addition to initial conditions) to be able to perform a forecast. In -# the FV3-LAM model, these boundary conditions (BCs) are supplied using a -# "halo" of grid cells around the regional domain that extend beyond the -# boundary of the domain. The model is formulated such that along with -# files containing these BCs, it needs as input the following files (in -# NetCDF format): -# -# 1) A grid file that includes a halo of 3 cells beyond the boundary of -# the domain. -# 2) A grid file that includes a halo of 4 cells beyond the boundary of -# the domain. -# 3) A (filtered) orography file without a halo, i.e. a halo of width -# 0 cells. -# 4) A (filtered) orography file that includes a halo of 4 cells beyond -# the boundary of the domain. -# -# Note that the regional grid is referred to as "tile 7" in the code. -# We will let: -# -# * NH0 denote the width (in units of number of cells on tile 7) of -# the 0-cell-wide halo, i.e. NH0 = 0; -# -# * NH3 denote the width (in units of number of cells on tile 7) of -# the 3-cell-wide halo, i.e. NH3 = 3; and -# -# * NH4 denote the width (in units of number of cells on tile 7) of -# the 4-cell-wide halo, i.e. NH4 = 4. -# -# We define these variables next. -# -#----------------------------------------------------------------------- -# -NH0=0 -NH3=3 -NH4=4 -# -#----------------------------------------------------------------------- -# # Set parameters according to the type of horizontal grid generation # method specified. First consider GFDL's global-parent-grid based # method. @@ -1853,16 +1908,17 @@ if [ "${GRID_GEN_METHOD}" = "GFDLgrid" ]; then iend_of_t7_on_t6g="${GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G}" \ jstart_of_t7_on_t6g="${GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G}" \ jend_of_t7_on_t6g="${GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G}" \ - output_varname_lon_of_t7_ctr="LON_CTR" \ - output_varname_lat_of_t7_ctr="LAT_CTR" \ - output_varname_nx_of_t7_on_t7g="NX" \ - output_varname_ny_of_t7_on_t7g="NY" \ - output_varname_halo_width_on_t7g="NHW" \ - output_varname_stretch_factor="STRETCH_FAC" \ - output_varname_istart_of_t7_with_halo_on_t6sg="ISTART_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ - output_varname_iend_of_t7_with_halo_on_t6sg="IEND_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ - output_varname_jstart_of_t7_with_halo_on_t6sg="JSTART_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ - output_varname_jend_of_t7_with_halo_on_t6sg="JEND_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" + verbose="${VERBOSE}" \ + outvarname_lon_of_t7_ctr="LON_CTR" \ + outvarname_lat_of_t7_ctr="LAT_CTR" \ + outvarname_nx_of_t7_on_t7g="NX" \ + outvarname_ny_of_t7_on_t7g="NY" \ + outvarname_halo_width_on_t7g="NHW" \ + outvarname_stretch_factor="STRETCH_FAC" \ + outvarname_istart_of_t7_with_halo_on_t6sg="ISTART_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ + outvarname_iend_of_t7_with_halo_on_t6sg="IEND_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ + outvarname_jstart_of_t7_with_halo_on_t6sg="JSTART_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" \ + outvarname_jend_of_t7_with_halo_on_t6sg="JEND_OF_RGNL_DOM_WITH_WIDE_HALO_ON_T6SG" # #----------------------------------------------------------------------- # @@ -1881,17 +1937,17 @@ elif [ "${GRID_GEN_METHOD}" = "ESGgrid" ]; then halo_width="${ESGgrid_WIDE_HALO_WIDTH}" \ delx="${ESGgrid_DELX}" \ dely="${ESGgrid_DELY}" \ - output_varname_lon_ctr="LON_CTR" \ - output_varname_lat_ctr="LAT_CTR" \ - output_varname_nx="NX" \ - output_varname_ny="NY" \ - output_varname_pazi="PAZI" \ - output_varname_halo_width="NHW" \ - output_varname_stretch_factor="STRETCH_FAC" \ - output_varname_del_angle_x_sg="DEL_ANGLE_X_SG" \ - output_varname_del_angle_y_sg="DEL_ANGLE_Y_SG" \ - output_varname_neg_nx_of_dom_with_wide_halo="NEG_NX_OF_DOM_WITH_WIDE_HALO" \ - output_varname_neg_ny_of_dom_with_wide_halo="NEG_NY_OF_DOM_WITH_WIDE_HALO" + outvarname_lon_ctr="LON_CTR" \ + outvarname_lat_ctr="LAT_CTR" \ + outvarname_nx="NX" \ + outvarname_ny="NY" \ + outvarname_pazi="PAZI" \ + outvarname_halo_width="NHW" \ + outvarname_stretch_factor="STRETCH_FAC" \ + outvarname_del_angle_x_sg="DEL_ANGLE_X_SG" \ + outvarname_del_angle_y_sg="DEL_ANGLE_Y_SG" \ + outvarname_neg_nx_of_dom_with_wide_halo="NEG_NX_OF_DOM_WITH_WIDE_HALO" \ + outvarname_neg_ny_of_dom_with_wide_halo="NEG_NY_OF_DOM_WITH_WIDE_HALO" fi # @@ -2027,12 +2083,8 @@ fi # #----------------------------------------------------------------------- # -check_var_valid_value "WRITE_DOPOST" "valid_vals_WRITE_DOPOST" -# -# Set WRITE_DOPOST to either "TRUE" or "FALSE" so we don't have to consider -# other valid values later on. -# -WRITE_DOPOST=$(boolify $WRITE_DOPOST) +check_var_valid_value "WRITE_DOPOST" "valid_vals_BOOLEAN" +WRITE_DOPOST=$(boolify "${WRITE_DOPOST}") if [ "$WRITE_DOPOST" = "TRUE" ] ; then @@ -2046,11 +2098,11 @@ SUB_HOURLY_POST is NOT available with Inline Post yet." fi fi -check_var_valid_value "QUILTING" "valid_vals_QUILTING" -QUILTING=$(boolify $QUILTING) +check_var_valid_value "QUILTING" "valid_vals_BOOLEAN" +QUILTING=$(boolify "$QUILTING") -check_var_valid_value "PRINT_ESMF" "valid_vals_PRINT_ESMF" -PRINT_ESMF=$(boolify $PRINT_ESMF) +check_var_valid_value "PRINT_ESMF" "valid_vals_BOOLEAN" +PRINT_ESMF=$(boolify "${PRINT_ESMF}") # #----------------------------------------------------------------------- @@ -2166,6 +2218,27 @@ GLOBAL_VAR_DEFNS_FP="$EXPTDIR/${GLOBAL_VAR_DEFNS_FN}" # #----------------------------------------------------------------------- # +# Get the list of constants and their values. The result is saved in +# the variable "constant_defns". This will be written to the experiment's +# variable defintions file later below. +# +#----------------------------------------------------------------------- +# +print_info_msg " +Creating list of constants..." + +get_bash_file_contents fp="$USHDIR/${CONSTANTS_FN}" \ + outvarname_contents="constant_defns" + +print_info_msg "$DEBUG" " +The variable \"constant_defns\" containing definitions of various +constants is set as follows: + +${constant_defns} +" +# +#----------------------------------------------------------------------- +# # Get the list of primary experiment variables and their default values # from the default experiment configuration file (EXPT_DEFAULT_CONFIG_FN). # By "primary", we mean those variables that are defined in the default @@ -2180,7 +2253,7 @@ print_info_msg " Creating list of default experiment variable definitions..." get_bash_file_contents fp="$USHDIR/${EXPT_DEFAULT_CONFIG_FN}" \ - output_varname_contents="default_var_defns" + outvarname_contents="default_var_defns" print_info_msg "$DEBUG" " The variable \"default_var_defns\" containing default values of primary @@ -2294,9 +2367,9 @@ var_name = \"${var_name}\"" else var_value="" - printf -v "var_value" "${escbksl_nl_or_null}" + printf -v "var_value" "%s${escbksl_nl_or_null}" "" for (( i=0; i<${num_elems}; i++ )); do - printf -v "var_value" "${var_value}\"${array[$i]}\" ${escbksl_nl_or_null}" + printf -v "var_value" "%s${escbksl_nl_or_null}" "${var_value}\"${array[$i]}\" " done rhs="( ${var_value})" @@ -2323,7 +2396,7 @@ Setting its value in the variable definitions file to an empty string." # to the list of all variable definitions. # var_defn="${var_name}=$rhs" - printf -v "var_defns" "${var_defns}${var_defn}\n" + printf -v "var_defns" "%s\n" "${var_defns}${var_defn}" # # If var_name is empty, then a variable name was not found on the current # line in default_var_defns. In this case, print out a warning and move @@ -2366,6 +2439,16 @@ var_defns_file_contents="\ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # Section 1: +# This section contains definitions of the various constants defined in +# the file ${CONSTANTS_FN}. +#----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# +${constant_defns} +# +#----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# Section 2: # This section contains (most of) the primary experiment variables, i.e. # those variables that are defined in the default configuration file # (${EXPT_DEFAULT_CONFIG_FN}) and that can be reset via the user-specified @@ -2388,7 +2471,7 @@ var_defns_file_contents=${var_defns_file_contents}"\ # #----------------------------------------------------------------------- #----------------------------------------------------------------------- -# Section 2: +# Section 3: # This section defines variables that have been derived from the primary # set of experiment variables above (we refer to these as \"derived\" or # \"secondary\" variables). @@ -2531,9 +2614,6 @@ SDF_USES_THOMPSON_MP='${SDF_USES_THOMPSON_MP}' # GTYPE='$GTYPE' TILE_RGNL='${TILE_RGNL}' -NH0='${NH0}' -NH3='${NH3}' -NH4='${NH4}' LON_CTR='${LON_CTR}' LAT_CTR='${LAT_CTR}' diff --git a/ush/templates/diag_table.FV3_GFS_2017_gfdlmp b/ush/templates/diag_table.FV3_GFS_2017_gfdlmp index 1b46eeb99..8b64d1ee9 100755 --- a/ush/templates/diag_table.FV3_GFS_2017_gfdlmp +++ b/ush/templates/diag_table.FV3_GFS_2017_gfdlmp @@ -140,7 +140,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_GFS_2017_gfdlmp_regional b/ush/templates/diag_table.FV3_GFS_2017_gfdlmp_regional index f94509ac7..dbcfbb1f6 100644 --- a/ush/templates/diag_table.FV3_GFS_2017_gfdlmp_regional +++ b/ush/templates/diag_table.FV3_GFS_2017_gfdlmp_regional @@ -175,7 +175,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_GFS_v15_thompson_mynn_lam3km b/ush/templates/diag_table.FV3_GFS_v15_thompson_mynn_lam3km index 84acd3caf..6f3218958 100644 --- a/ush/templates/diag_table.FV3_GFS_v15_thompson_mynn_lam3km +++ b/ush/templates/diag_table.FV3_GFS_v15_thompson_mynn_lam3km @@ -169,7 +169,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_GFS_v15p2 b/ush/templates/diag_table.FV3_GFS_v15p2 index d4b1af532..129061171 100755 --- a/ush/templates/diag_table.FV3_GFS_v15p2 +++ b/ush/templates/diag_table.FV3_GFS_v15p2 @@ -140,7 +140,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_GFS_v16 b/ush/templates/diag_table.FV3_GFS_v16 index d4b1af532..129061171 100755 --- a/ush/templates/diag_table.FV3_GFS_v16 +++ b/ush/templates/diag_table.FV3_GFS_v16 @@ -140,7 +140,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_HRRR b/ush/templates/diag_table.FV3_HRRR index fa16a7e10..45d5c87d1 100755 --- a/ush/templates/diag_table.FV3_HRRR +++ b/ush/templates/diag_table.FV3_HRRR @@ -152,7 +152,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_RRFS_v0 b/ush/templates/diag_table.FV3_RRFS_v0 index 99b765291..a3cb733d5 100644 --- a/ush/templates/diag_table.FV3_RRFS_v0 +++ b/ush/templates/diag_table.FV3_RRFS_v0 @@ -152,7 +152,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_RRFS_v1alpha b/ush/templates/diag_table.FV3_RRFS_v1alpha index 0bc7e358d..b97d67f61 100755 --- a/ush/templates/diag_table.FV3_RRFS_v1alpha +++ b/ush/templates/diag_table.FV3_RRFS_v1alpha @@ -152,7 +152,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/templates/diag_table.FV3_RRFS_v1beta b/ush/templates/diag_table.FV3_RRFS_v1beta index 03ce373f4..00690a549 100755 --- a/ush/templates/diag_table.FV3_RRFS_v1beta +++ b/ush/templates/diag_table.FV3_RRFS_v1beta @@ -152,7 +152,7 @@ "gfs_phys", "hpbl", "hpbl", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "lhtfl_ave", "lhtfl_ave", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "shtfl_ave", "shtfl_ave", "fv3_history2d", "all", .false., "none", 2 -"gfs_phys", "pwat", "pwatclm", "fv3_history2d", "all", .false., "none", 2 +"gfs_phys", "pwat", "pwat", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "soilm", "soilm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_aveclm", "tcdc_aveclm", "fv3_history2d", "all", .false., "none", 2 "gfs_phys", "TCDC_avebndcl", "tcdc_avebndcl", "fv3_history2d", "all", .false., "none", 2 diff --git a/ush/valid_param_vals.sh b/ush/valid_param_vals.sh index 69c08984e..c3b0fe8f9 100644 --- a/ush/valid_param_vals.sh +++ b/ush/valid_param_vals.sh @@ -1,9 +1,11 @@ # +# Source file containing useful constants. +# +. ./constants.sh +# # Define valid values for various global experiment/workflow variables. # valid_vals_RUN_ENVIR=("nco" "community") -valid_vals_VERBOSE=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DEBUG=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_MACHINE=("WCOSS_DELL_P3" "HERA" "ORION" "JET" "ODIN" "CHEYENNE" "STAMPEDE" "LINUX" "MACOS" "NOAACLOUD" "SINGULARITY" "GAEA") valid_vals_SCHED=("slurm" "pbspro" "lsf" "lsfcray" "none") valid_vals_FCST_MODEL=("ufs-weather-model" "fv3gfs_aqm") @@ -46,40 +48,13 @@ valid_vals_CCPP_PHYS_SUITE=( \ valid_vals_GFDLgrid_RES=("48" "96" "192" "384" "768" "1152" "3072") valid_vals_EXTRN_MDL_NAME_ICS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM") valid_vals_EXTRN_MDL_NAME_LBCS=("GSMGFS" "FV3GFS" "RAP" "HRRR" "NAM") -valid_vals_USE_USER_STAGED_EXTRN_FILES=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_FV3GFS_FILE_FMT_ICS=("nemsio" "grib2" "netcdf") valid_vals_FV3GFS_FILE_FMT_LBCS=("nemsio" "grib2" "netcdf") valid_vals_GRID_GEN_METHOD=("GFDLgrid" "ESGgrid") valid_vals_PREEXISTING_DIR_METHOD=("delete" "rename" "quit") valid_vals_GTYPE=("regional") valid_vals_WRTCMP_output_grid=("rotated_latlon" "lambert_conformal" "regional_latlon") -valid_vals_RUN_TASK_MAKE_GRID=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_MAKE_OROG=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_MAKE_SFC_CLIMO=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_RUN_POST=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_WRITE_DOPOST=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_VX_GRIDSTAT=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_VX_POINTSTAT=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_VX_ENSGRID=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_RUN_TASK_VX_ENSPOINT=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_QUILTING=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_PRINT_ESMF=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_USE_CRON_TO_RELAUNCH=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_DOT_OR_USCORE=("." "_") -valid_vals_NOMADS=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_NOMADS_file_type=("GRIB2" "grib2" "NEMSIO" "nemsio") -valid_vals_DO_ENSEMBLE=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_USE_CUSTOM_POST_CONFIG_FILE=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_USE_CRTM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DO_SHUM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DO_SPPT=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DO_SPP=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DO_LSM_SPP=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_DO_SKEB=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_USE_ZMTNBLCK=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") -valid_vals_USE_FVCOM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_FVCOM_WCSTART=("warm" "WARM" "cold" "COLD") valid_vals_COMPILER=("intel" "gnu") -valid_vals_SUB_HOURLY_POST=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_DT_SUBHOURLY_POST_MNTS=("1" "01" "2" "02" "3" "03" "4" "04" "5" "05" "6" "06" "10" "12" "15" "20" "30") -valid_vals_USE_MERRA_CLIMO=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")