Skip to content

Commit

Permalink
Allow user-defined file names for input template files (#717)
Browse files Browse the repository at this point in the history
* Allow multiple template names

* parameterize file_TMPL_FN and add a we2e test

* Increase maxtries_task for make_grid/orog/sfc_climo

* Modify file name and description
  • Loading branch information
chan-hoo authored Apr 4, 2022
1 parent 17f0c03 commit b9b0a1a
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# TEST PURPOSE/DESCRIPTION:
# ------------------------
#
# This test checks the capability of the workflow to use user-defined
# template files.
#

RUN_ENVIR="community"
PREEXISTING_DIR_METHOD="rename"

PREDEF_GRID_NAME="RRFS_CONUS_25km"
CCPP_PHYS_SUITE="FV3_GFS_v15p2"

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"

DATA_TABLE_TMPL_FN="data_table"
DIAG_TABLE_TMPL_FN="diag_table"
FIELD_TABLE_TMPL_FN="field_table"
MODEL_CONFIG_TMPL_FN="model_configure"
NEMS_CONFIG_TMPL_FN="nems.configure"
58 changes: 32 additions & 26 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,28 +343,34 @@ DOT_OR_USCORE="_"
# from which the namelist files for each of the enesemble members are
# generated.
#
# DIAG_TABLE_FN:
# Name of file that specifies the fields that the forecast model will
# output.
#
# FIELD_TABLE_FN:
# Name of file that specifies the tracers that the forecast model will
# read in from the IC/LBC files.
#
# DATA_TABLE_FN:
# Name of file that specifies ???
#
# MODEL_CONFIG_FN:
# Name of file that specifies ???
#
# NEMS_CONFIG_FN:
# Name of file that specifies ???
#
# FV3_EXEC_FN:
# Name to use for the forecast model executable when it is copied from
# the directory in which it is created in the build step to the executables
# directory (EXECDIR; this is set during experiment generation).
#
# DIAG_TABLE_TMPL_FN:
# Name of a template file that specifies the output fields of the forecast
# model (ufs-weather-model: diag_table) followed by [dot_ccpp_phys_suite].
# Its default value is the name of the file that the ufs weather model
# expects to read in.
#
# FIELD_TABLE_TMPL_FN:
# Name of a template file that specifies the tracers in IC/LBC files of the
# forecast model (ufs-weather-mode: field_table) followed by [dot_ccpp_phys_suite].
# Its default value is the name of the file that the ufs weather model expects
# to read in.
#
# MODEL_CONFIG_TMPL_FN:
# Name of a template file that contains settings and configurations for the
# NUOPC/ESMF main component (ufs-weather-model: model_config). Its default
# value is the name of the file that the ufs weather model expects to read in.
#
# NEMS_CONFIG_TMPL_FN:
# Name of a template file that contains information about the various NEMS
# components and their run sequence (ufs-weather-model: nems.configure).
# Its default value is the name of the file that the ufs weather model expects
# to read in.
#
# FCST_MODEL:
# Name of forecast model (default=ufs-weather-model)
#
Expand Down Expand Up @@ -409,18 +415,18 @@ EXPT_CONFIG_FN="config.sh"

RGNL_GRID_NML_FN="regional_grid.nml"

DATA_TABLE_FN="data_table"
DIAG_TABLE_FN="diag_table"
FIELD_TABLE_FN="field_table"
FV3_NML_BASE_SUITE_FN="input.nml.FV3"
FV3_NML_YAML_CONFIG_FN="FV3.input.yml"
FV3_NML_BASE_ENS_FN="input.nml.base_ens"
MODEL_CONFIG_FN="model_configure"
NEMS_CONFIG_FN="nems.configure"
FV3_EXEC_FN="ufs_model"

FCST_MODEL="ufs-weather-model"
DATA_TABLE_TMPL_FN=""
DIAG_TABLE_TMPL_FN=""
FIELD_TABLE_TMPL_FN=""
MODEL_CONFIG_TMPL_FN=""
NEMS_CONFIG_TMPL_FN=""

FCST_MODEL="ufs-weather-model"
WFLOW_XML_FN="FV3LAM_wflow.xml"
GLOBAL_VAR_DEFNS_FN="var_defns.sh"
EXTRN_MDL_ICS_VAR_DEFNS_FN="extrn_mdl_ics_var_defns.sh"
Expand Down Expand Up @@ -1646,9 +1652,9 @@ WTIME_VX_ENSPOINT_PROB="01:00:00"
#
# Maximum number of attempts.
#
MAXTRIES_MAKE_GRID="1"
MAXTRIES_MAKE_OROG="1"
MAXTRIES_MAKE_SFC_CLIMO="1"
MAXTRIES_MAKE_GRID="2"
MAXTRIES_MAKE_OROG="2"
MAXTRIES_MAKE_SFC_CLIMO="2"
MAXTRIES_GET_EXTRN_ICS="1"
MAXTRIES_GET_EXTRN_LBCS="1"
MAXTRIES_MAKE_ICS="1"
Expand Down
27 changes: 22 additions & 5 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1216,11 +1216,22 @@ fi
#
dot_ccpp_phys_suite_or_null=".${CCPP_PHYS_SUITE}"

DATA_TABLE_TMPL_FN="${DATA_TABLE_FN}"
DIAG_TABLE_TMPL_FN="${DIAG_TABLE_FN}${dot_ccpp_phys_suite_or_null}"
FIELD_TABLE_TMPL_FN="${FIELD_TABLE_FN}${dot_ccpp_phys_suite_or_null}"
MODEL_CONFIG_TMPL_FN="${MODEL_CONFIG_FN}"
NEMS_CONFIG_TMPL_FN="${NEMS_CONFIG_FN}"
# Names of input files that the forecast model (ufs-weather-model) expects
# to read in. These should only be changed if the input file names in the
# forecast model code are changed.
#----------------------------------
DATA_TABLE_FN="data_table"
DIAG_TABLE_FN="diag_table"
FIELD_TABLE_FN="field_table"
MODEL_CONFIG_FN="model_configure"
NEMS_CONFIG_FN="nems.configure"
#----------------------------------

DATA_TABLE_TMPL_FN="${DATA_TABLE_TMPL_FN:-${DATA_TABLE_FN}}"
DIAG_TABLE_TMPL_FN="${DIAG_TABLE_TMPL_FN:-${DIAG_TABLE_FN}}${dot_ccpp_phys_suite_or_null}"
FIELD_TABLE_TMPL_FN="${FIELD_TABLE_TMPL_FN:-${FIELD_TABLE_FN}}${dot_ccpp_phys_suite_or_null}"
MODEL_CONFIG_TMPL_FN="${MODEL_CONFIG_TMPL_FN:-${MODEL_CONFIG_FN}}"
NEMS_CONFIG_TMPL_FN="${NEMS_CONFIG_TMPL_FN:-${NEMS_CONFIG_FN}}"

DATA_TABLE_TMPL_FP="${TEMPLATE_DIR}/${DATA_TABLE_TMPL_FN}"
DIAG_TABLE_TMPL_FP="${TEMPLATE_DIR}/${DIAG_TABLE_TMPL_FN}"
Expand Down Expand Up @@ -2429,6 +2440,12 @@ FV3_NML_ENSMEM_FPS=${fv3_nml_ensmem_fps_str}
#
GLOBAL_VAR_DEFNS_FP='${GLOBAL_VAR_DEFNS_FP}'
DATA_TABLE_FN='${DATA_TABLE_FN}'
DIAG_TABLE_FN='${DIAG_TABLE_FN}'
FIELD_TABLE_FN='${FIELD_TABLE_FN}'
MODEL_CONFIG_FN='${MODEL_CONFIG_FN}'
NEMS_CONFIG_FN='${NEMS_CONFIG_FN}'
DATA_TABLE_TMPL_FN='${DATA_TABLE_TMPL_FN}'
DIAG_TABLE_TMPL_FN='${DIAG_TABLE_TMPL_FN}'
FIELD_TABLE_TMPL_FN='${FIELD_TABLE_TMPL_FN}'
Expand Down

0 comments on commit b9b0a1a

Please sign in to comment.