diff --git a/parm/config/gefs/config.base.emc.dyn b/parm/config/gefs/config.base.emc.dyn index 08516dbbc7..b9e640d732 100644 --- a/parm/config/gefs/config.base.emc.dyn +++ b/parm/config/gefs/config.base.emc.dyn @@ -138,10 +138,8 @@ export DO_WAVE="NO" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" -export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" -export cplwav2atm=".false." export FRAC_GRID=".true." # Set operational resolution @@ -183,17 +181,14 @@ export ICERES=${OCNRES} case "${APP}" in ATM) - export confignamevarforufs="atm" ;; ATMA) export DO_AERO="YES" - export confignamevarforufs="atm_aero" ;; ATMW) export DO_COUPLED="YES" export DO_WAVE="YES" export WAVE_CDUMP="both" - export confignamevarforufs="leapfrog_atm_wav" ;; NG-GODAS) export DO_ATM="NO" @@ -204,19 +199,15 @@ case "${APP}" in export DO_COUPLED="YES" export DO_OCN="YES" export DO_ICE="YES" - export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8 on L141 - export confignamevarforufs="cpld" if [[ "${APP}" =~ A$ ]]; then export DO_AERO="YES" - export confignamevarforufs="${confignamevarforufs}_aero" fi if [[ "${APP}" =~ ^S2SW ]]; then export DO_WAVE="YES" export WAVE_CDUMP="both" export cplwav2atm=".true." - export confignamevarforufs="${confignamevarforufs}_outerwave" fi ;; *) diff --git a/parm/config/gefs/config.efcs b/parm/config/gefs/config.efcs index 86526c208f..a6d093968d 100644 --- a/parm/config/gefs/config.efcs +++ b/parm/config/gefs/config.efcs @@ -14,9 +14,10 @@ export DO_WAVE=${DO_WAVE_ENKF:-${DO_WAVE:-"NO"}} # Source model specific information that is resolution dependent string="--fv3 ${CASE_ENS}" # Ocean/Ice/Waves ensemble configurations are identical to deterministic member -[[ ${DO_OCN} == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ ${DO_ICE} == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ ${DO_WAVE} == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" +[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" +[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_AERO}" == "YES" ]] && string="${string} --gocart" # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gefs/config.fcst b/parm/config/gefs/config.fcst index 331dcd5a78..e36e023652 100644 --- a/parm/config/gefs/config.fcst +++ b/parm/config/gefs/config.fcst @@ -13,20 +13,14 @@ esac # Source model specific information that is resolution dependent string="--fv3 ${CASE}" -[[ ${DO_OCN} == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ ${DO_ICE} == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ ${DO_WAVE} == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" +[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" +[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_AERO}" == "YES" ]] && string="${string} --gocart" # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} -# Source component configs if necessary -for component in WAVE OCN ICE AERO; do - control="DO_${component}" - if [[ ${!control} == "YES" ]]; then - source "${EXPDIR}/config.${component,,}" - fi -done # Get task specific resources source "${EXPDIR}/config.resources" fcst @@ -41,35 +35,6 @@ export esmf_profile=".false." export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_ON_ERROR, ESMF_LOGKIND_MULTI, ESMF_LOGKIND_NONE -####################################################################### -# COUPLING COMPONENTS - -# cpl defaults -export cpl=".false." -export cplflx=".false." -export cplice=".false." -export cplchm=".false." -export cplwav=".false." - -# cpl changes based on APP - -if [[ "${DO_COUPLED}" == "YES" ]]; then - export cpl=".true." -fi -if [[ "${DO_AERO}" == "YES" ]]; then - export cplchm=".true." -fi -if [[ "${DO_ICE}" == "YES" ]]; then - export cplice=".true." - export cplflx=".true." -fi -if [[ "${DO_OCN}" == "YES" ]]; then - export cplflx=".true." -fi -if [[ "${DO_WAVE}" == "YES" ]]; then - export cplwav=".true." -fi - ####################################################################### export FORECASTSH="${HOMEgfs}/scripts/exglobal_forecast.sh" @@ -286,11 +251,6 @@ export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table" # Write gfs restart files to rerun fcst from any break point export restart_interval=${restart_interval_gfs:-12} -# Choose coupling with wave -if [[ "${DO_WAVE}" = "YES" ]]; then - export cplwav=".true." -fi - # Turn off dry mass adjustment in GFS export adjust_dry_mass=".false." @@ -301,17 +261,6 @@ else export io_layout="1,1" fi -if [[ "${DO_AERO}" = "YES" ]]; then # temporary settings for aerosol coupling - export AERO_DIAG_TABLE="${AERO_DIAG_TABLE:-${HOMEgfs}/parm/ufs/fv3/diag_table.aero}" - export AERO_FIELD_TABLE="${AERO_FIELD_TABLE:-${HOMEgfs}/parm/ufs/fv3/field_table.aero}" - AERO_EMIS_FIRE="${AERO_EMIS_FIRE:-none}" - export AERO_EMIS_FIRE=${AERO_EMIS_FIRE,,} - export AERO_CONFIG_DIR="${AERO_CONFIG_DIR:-${HOMEgfs}/parm/ufs/chem}" - export AERO_INPUTS_DIR="${AERO_INPUTS_DIR:-}" - export fscav_aero="${aero_conv_scav_factors:-${fscav_aero}}" - export dnats_aero="${aero_diag_tracers:-0}" -fi - # Remember config.efcs will over-ride these values for ensemble forecasts # if these variables are re-defined there. # Otherwise, the ensemble forecast will inherit from config.fcst diff --git a/parm/config/gefs/config.ufs b/parm/config/gefs/config.ufs index 8418459cc3..db0589ab6a 100644 --- a/parm/config/gefs/config.ufs +++ b/parm/config/gefs/config.ufs @@ -8,7 +8,7 @@ echo "BEGIN: config.ufs" -if [ $# -le 1 ]; then +if (( $# <= 1 )); then echo "Must specify an input resolution argument to set variables!" echo "argument can be any one of the following:" @@ -16,6 +16,7 @@ if [ $# -le 1 ]; then echo "--mom6 500|100|025" echo "--cice6 500|100|025" echo "--ww3 gnh_10m;aoc_9km;gsh_15m|gwes_30m|glo_025|glo_200|glo_500|mx025" + echo "--gocart" exit 1 @@ -25,26 +26,34 @@ fi skip_mom6=true skip_cice6=true skip_ww3=true +skip_gocart=true skip_mediator=true # Loop through named arguments -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do key="$1" case "${key}" in "--fv3") fv3_res="$2" + shift ;; "--mom6") mom6_res="$2" skip_mom6=false + shift ;; "--cice6") cice6_res="$2" skip_cice6=false + shift ;; "--ww3") ww3_res="$2" skip_ww3=false + shift + ;; + "--gocart") + skip_gocart=false ;; *) # unknown option echo "FATAL ERROR: Unknown option: ${key}, ABORT!" @@ -52,7 +61,6 @@ while [[ $# -gt 0 ]]; do ;; esac shift - shift done # Mediator is required if any of the non-ATM components are used @@ -98,6 +106,10 @@ case "${machine}" in ;; esac ;; + *) + echo "FATAL ERROR: Unrecognized machine ${machine}" + exit 14 + ;; esac export npe_node_max @@ -249,13 +261,28 @@ case ${fv3_res} in esac export OUTPUT_FILETYPE_ATM OUTPUT_FILETYPE_SFC +# cpl defaults +export cpl=".false." +export cplflx=".false." +export cplice=".false." +export cplchm=".false." +export cplwav=".false." +export cplwav2atm=".false." +export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" +model_list="atm" + # Mediator specific settings if [[ "${skip_mediator}" == "false" ]]; then + export cpl=".true." export nthreads_mediator=${nthreads_fv3} # Use same threads as FV3 + export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8? fi # MOM6 specific settings if [[ "${skip_mom6}" == "false" ]]; then + source "${EXPDIR}/config.ocn" + export cplflx=".true." + model_list="${model_list}.ocean" nthreads_mom6=1 case "${mom6_res}" in "500") @@ -362,6 +389,9 @@ fi # CICE6 specific settings if [[ "${skip_cice6}" == "false" ]]; then + source "${EXPDIR}/config.ice" + export cplice=".true." + model_list="${model_list}.ice" # Ensure we sourced the MOM6 section if [[ "${skip_mom6}" == "true" ]]; then echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!" @@ -398,6 +428,10 @@ fi # WW3 specific settings if [[ "${skip_ww3}" == "false" ]]; then + source "${EXPDIR}/config.wave" + export cplwav=".true." + export cplwav2atm=".true." + model_list="${model_list}.wave" nthreads_ww3=2 case "${ww3_res}" in "gnh_10m;aoc_9km;gsh_15m") @@ -428,4 +462,47 @@ if [[ "${skip_ww3}" == "false" ]]; then export ntasks_ww3 nthreads_ww3 fi +# GOCART specific settings +if [[ "${skip_gocart}" == "false" ]]; then + source "${EXPDIR}/config.aero" + export cplchm=".true." + model_list="${model_list}.aero" +fi + +# Set the name of the UFS (previously nems) configure template to use +case "${model_list}" in + atm) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN" + ;; + atm.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm_aero.IN" + ;; + atm.wave) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN" + ;; + atm.ocean.ice) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld.IN" + ;; + atm.ocean.ice.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero.IN" + ;; + atm.ocean.ice.wave) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_outerwave.IN" + ;; + atm.ocean.ice.wave.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero_outerwave.IN" + ;; + *) + echo "FATAL ERROR: Unable to determine appropriate UFS configure template for ${model_list}" + exit 16 + ;; +esac + +if [[ ! -r "${ufs_configure_template}" ]]; then + echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable." + exit 17 +fi + +unset model_list + echo "END: config.ufs" diff --git a/parm/config/gfs/config.aero b/parm/config/gfs/config.aero index fbd2d86ac8..23d738c642 100644 --- a/parm/config/gfs/config.aero +++ b/parm/config/gfs/config.aero @@ -5,8 +5,6 @@ # Turn off warnings about unused variables # shellcheck disable=SC2034 -# Directory containing GOCART configuration files. Defaults to parm/ufs/chem if unset. -AERO_CONFIG_DIR=${HOMEgfs}/parm/ufs/chem # Path to the input data tree case ${machine} in @@ -30,14 +28,19 @@ case ${machine} in exit 2 ;; esac +export AERO_INPUTS_DIR -# Biomass burning emission dataset. Choose from: GBBEPx, QFED, NONE (default) -AERO_EMIS_FIRE=QFED +export AERO_DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table.aero" +export AERO_FIELD_TABLE="${HOMEgfs}/parm/ufs/fv3/field_table.aero" +# Biomass burning emission dataset. Choose from: gbbepx, qfed, none +export AERO_EMIS_FIRE="qfed" +# Directory containing GOCART configuration files +export AERO_CONFIG_DIR="${HOMEgfs}/parm/ufs/gocart" # Aerosol convective scavenging factors (list of string array elements) # Element syntax: ':'. Use = * to set default factor for all aerosol tracers # Scavenging factors are set to 0 (no scavenging) if unset -aero_conv_scav_factors="'*:0.3','so2:0.0','msa:0.0','dms:0.0','nh3:0.4','nh4:0.6','bc1:0.6','bc2:0.6','oc1:0.4','oc2:0.4','dust1:0.6','dust2:0.6', 'dust3:0.6','dust4:0.6','dust5:0.6','seas1:0.5','seas2:0.5','seas3:0.5','seas4:0.5','seas5:0.5'" +export fscav_aero="'*:0.3','so2:0.0','msa:0.0','dms:0.0','nh3:0.4','nh4:0.6','bc1:0.6','bc2:0.6','oc1:0.4','oc2:0.4','dust1:0.6','dust2:0.6', 'dust3:0.6','dust4:0.6','dust5:0.6','seas1:0.5','seas2:0.5','seas3:0.5','seas4:0.5','seas5:0.5'" # # Number of diagnostic aerosol tracers (default: 0) -aero_diag_tracers=2 +export dnats_aero=2 diff --git a/parm/config/gfs/config.base.emc.dyn b/parm/config/gfs/config.base.emc.dyn index b3e16fe4f8..adfa0257ab 100644 --- a/parm/config/gfs/config.base.emc.dyn +++ b/parm/config/gfs/config.base.emc.dyn @@ -151,10 +151,8 @@ export DO_WAVE="NO" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" -export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" -export cplwav2atm=".false." export FRAC_GRID=".true." # Set operational resolution @@ -196,17 +194,14 @@ export ICERES=${OCNRES} case "${APP}" in ATM) - export confignamevarforufs="atm" ;; ATMA) export DO_AERO="YES" - export confignamevarforufs="atm_aero" ;; ATMW) export DO_COUPLED="YES" export DO_WAVE="YES" export WAVE_CDUMP="both" - export confignamevarforufs="leapfrog_atm_wav" ;; NG-GODAS) export DO_ATM="NO" @@ -217,21 +212,15 @@ case "${APP}" in export DO_COUPLED="YES" export DO_OCN="YES" export DO_ICE="YES" - export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8 on L149 - export confignamevarforufs="cpld" if [[ "${APP}" =~ A$ ]]; then export DO_AERO="YES" - export confignamevarforufs="${confignamevarforufs}_aero" fi if [[ "${APP}" =~ ^S2SW ]]; then export DO_WAVE="YES" export WAVE_CDUMP="both" - export cplwav2atm=".true." - export confignamevarforufs="${confignamevarforufs}_outerwave" fi - ;; *) echo "Unrecognized APP: '${APP}'" diff --git a/parm/config/gfs/config.efcs b/parm/config/gfs/config.efcs index 2cb0ff1344..283ec3ab7e 100644 --- a/parm/config/gfs/config.efcs +++ b/parm/config/gfs/config.efcs @@ -14,9 +14,10 @@ export DO_WAVE=${DO_WAVE_ENKF:-${DO_WAVE:-"NO"}} # Source model specific information that is resolution dependent string="--fv3 ${CASE_ENS}" # Ocean/Ice/Waves ensemble configurations are identical to deterministic member -[[ ${DO_OCN} == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ ${DO_ICE} == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ ${DO_WAVE} == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" +[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" +[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_AERO}" == "YES" ]] && string="${string} --gocart" # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} diff --git a/parm/config/gfs/config.fcst b/parm/config/gfs/config.fcst index 4cecf27a34..3f63578d76 100644 --- a/parm/config/gfs/config.fcst +++ b/parm/config/gfs/config.fcst @@ -13,20 +13,14 @@ esac # Source model specific information that is resolution dependent string="--fv3 ${CASE}" -[[ ${DO_OCN} == "YES" ]] && string="${string} --mom6 ${OCNRES}" -[[ ${DO_ICE} == "YES" ]] && string="${string} --cice6 ${ICERES}" -[[ ${DO_WAVE} == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_OCN}" == "YES" ]] && string="${string} --mom6 ${OCNRES}" +[[ "${DO_ICE}" == "YES" ]] && string="${string} --cice6 ${ICERES}" +[[ "${DO_WAVE}" == "YES" ]] && string="${string} --ww3 ${waveGRD// /;}" +[[ "${DO_AERO}" == "YES" ]] && string="${string} --gocart" # We are counting on $string being multiple arguments # shellcheck disable=SC2086 source "${EXPDIR}/config.ufs" ${string} -# Source component configs if necessary -for component in WAVE OCN ICE AERO; do - control="DO_${component}" - if [[ ${!control} == "YES" ]]; then - source "${EXPDIR}/config.${component,,}" - fi -done # Get task specific resources source "${EXPDIR}/config.resources" fcst @@ -41,35 +35,6 @@ export esmf_profile=".false." export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_ON_ERROR, ESMF_LOGKIND_MULTI, ESMF_LOGKIND_NONE -####################################################################### -# COUPLING COMPONENTS - -# cpl defaults -export cpl=".false." -export cplflx=".false." -export cplice=".false." -export cplchm=".false." -export cplwav=".false." - -# cpl changes based on APP - -if [[ "${DO_COUPLED}" == "YES" ]]; then - export cpl=".true." -fi -if [[ "${DO_AERO}" == "YES" ]]; then - export cplchm=".true." -fi -if [[ "${DO_ICE}" == "YES" ]]; then - export cplice=".true." - export cplflx=".true." -fi -if [[ "${DO_OCN}" == "YES" ]]; then - export cplflx=".true." -fi -if [[ "${DO_WAVE}" == "YES" ]]; then - export cplwav=".true." -fi - ####################################################################### export FORECASTSH="${HOMEgfs}/scripts/exglobal_forecast.sh" @@ -285,16 +250,12 @@ if [[ "${CDUMP}" =~ "gdas" ]] ; then # GDAS cycle specific parameters # Variables used in DA cycling export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table_da" - if [[ "${DOIAU}" == "YES" ]]; then export restart_interval="3" else export restart_interval="6" fi - # Choose coupling with wave - if [[ "${DO_WAVE}" == "YES" ]]; then export cplwav=".true." ; fi - # Turn on dry mass adjustment in GDAS export adjust_dry_mass=".true." @@ -306,11 +267,6 @@ elif [[ "${CDUMP}" =~ "gfs" ]] ; then # GFS cycle specific parameters # Write gfs restart files to rerun fcst from any break point export restart_interval=${restart_interval_gfs:-12} - # Choose coupling with wave - if [[ "${DO_WAVE}" = "YES" && "${WAVE_CDUMP}" != "gdas" ]]; then - export cplwav=".true." - fi - # Turn off dry mass adjustment in GFS export adjust_dry_mass=".false." @@ -323,17 +279,6 @@ elif [[ "${CDUMP}" =~ "gfs" ]] ; then # GFS cycle specific parameters fi -if [[ "${DO_AERO}" = "YES" ]]; then # temporary settings for aerosol coupling - export AERO_DIAG_TABLE="${AERO_DIAG_TABLE:-${HOMEgfs}/parm/ufs/fv3/diag_table.aero}" - export AERO_FIELD_TABLE="${AERO_FIELD_TABLE:-${HOMEgfs}/parm/ufs/fv3/field_table.aero}" - AERO_EMIS_FIRE="${AERO_EMIS_FIRE:-none}" - export AERO_EMIS_FIRE=${AERO_EMIS_FIRE,,} - export AERO_CONFIG_DIR="${AERO_CONFIG_DIR:-${HOMEgfs}/parm/ufs/chem}" - export AERO_INPUTS_DIR="${AERO_INPUTS_DIR:-}" - export fscav_aero="${aero_conv_scav_factors:-${fscav_aero}}" - export dnats_aero="${aero_diag_tracers:-0}" -fi - # Remember config.efcs will over-ride these values for ensemble forecasts # if these variables are re-defined there. # Otherwise, the ensemble forecast will inherit from config.fcst diff --git a/parm/config/gfs/config.ufs b/parm/config/gfs/config.ufs index e499d90fdd..33264ba0aa 100644 --- a/parm/config/gfs/config.ufs +++ b/parm/config/gfs/config.ufs @@ -8,7 +8,7 @@ echo "BEGIN: config.ufs" -if [ $# -le 1 ]; then +if (( $# <= 1 )); then echo "Must specify an input resolution argument to set variables!" echo "argument can be any one of the following:" @@ -16,6 +16,7 @@ if [ $# -le 1 ]; then echo "--mom6 500|100|025" echo "--cice6 500|100|025" echo "--ww3 gnh_10m;aoc_9km;gsh_15m|gwes_30m|glo_025|glo_200|glo_500|mx025" + echo "--gocart" exit 1 @@ -25,26 +26,34 @@ fi skip_mom6=true skip_cice6=true skip_ww3=true +skip_gocart=true skip_mediator=true # Loop through named arguments -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do key="$1" case "${key}" in "--fv3") fv3_res="$2" + shift ;; "--mom6") mom6_res="$2" skip_mom6=false + shift ;; "--cice6") cice6_res="$2" skip_cice6=false + shift ;; "--ww3") ww3_res="$2" skip_ww3=false + shift + ;; + "--gocart") + skip_gocart=false ;; *) # unknown option echo "FATAL ERROR: Unknown option: ${key}, ABORT!" @@ -52,7 +61,6 @@ while [[ $# -gt 0 ]]; do ;; esac shift - shift done # Mediator is required if any of the non-ATM components are used @@ -98,6 +106,10 @@ case "${machine}" in ;; esac ;; + *) + echo "FATAL ERROR: Unrecognized machine ${machine}" + exit 14 + ;; esac export npe_node_max @@ -113,7 +125,7 @@ case "${fv3_res}" in export nthreads_fv3_gfs=1 export cdmbgwd="0.071,2.1,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling export cdmbgwd_gsl="40.0,1.77,1.0,1.0" # settings for GSL drag suite - export knob_ugwp_tauamp=6.0e-3 # setting for UGWPv1 non-stationary GWD + export knob_ugwp_tauamp=6.0e-3 # setting for UGWPv1 non-stationary GWD export WRITE_GROUP=1 export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 export WRITE_GROUP_GFS=1 @@ -246,16 +258,35 @@ case ${fv3_res} in OUTPUT_FILETYPE_ATM="netcdf_parallel" OUTPUT_FILETYPE_SFC="netcdf_parallel" ;; + *) + echo "FATAL ERROR: Unrecognized FV3 resolution ${fv3_res}" + exit 15 + ;; esac export OUTPUT_FILETYPE_ATM OUTPUT_FILETYPE_SFC +# cpl defaults +export cpl=".false." +export cplflx=".false." +export cplice=".false." +export cplchm=".false." +export cplwav=".false." +export cplwav2atm=".false." +export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" +model_list="atm" + # Mediator specific settings if [[ "${skip_mediator}" == "false" ]]; then + export cpl=".true." export nthreads_mediator=${nthreads_fv3} # Use same threads as FV3 + export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8? fi # MOM6 specific settings if [[ "${skip_mom6}" == "false" ]]; then + source "${EXPDIR}/config.ocn" + export cplflx=".true." + model_list="${model_list}.ocean" nthreads_mom6=1 case "${mom6_res}" in "500") @@ -364,11 +395,15 @@ fi # CICE6 specific settings if [[ "${skip_cice6}" == "false" ]]; then + source "${EXPDIR}/config.ice" + export cplice=".true." + model_list="${model_list}.ice" # Ensure we sourced the MOM6 section if [[ "${skip_mom6}" == "true" ]]; then echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!" exit 1 fi + nthreads_cice6=${nthreads_mom6} # CICE6 needs to run on same threads as MOM6 case "${cice6_res}" in "500") @@ -400,6 +435,10 @@ fi # WW3 specific settings if [[ "${skip_ww3}" == "false" ]]; then + source "${EXPDIR}/config.wave" + export cplwav=".true." + export cplwav2atm=".true." + model_list="${model_list}.wave" nthreads_ww3=2 case "${ww3_res}" in "gnh_10m;aoc_9km;gsh_15m") @@ -430,4 +469,47 @@ if [[ "${skip_ww3}" == "false" ]]; then export ntasks_ww3 nthreads_ww3 fi +# GOCART specific settings +if [[ "${skip_gocart}" == "false" ]]; then + source "${EXPDIR}/config.aero" + export cplchm=".true." + model_list="${model_list}.aero" +fi + +# Set the name of the UFS (previously nems) configure template to use +case "${model_list}" in + atm) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN" + ;; + atm.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm_aero.IN" + ;; + atm.wave) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN" + ;; + atm.ocean.ice) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld.IN" + ;; + atm.ocean.ice.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero.IN" + ;; + atm.ocean.ice.wave) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_outerwave.IN" + ;; + atm.ocean.ice.wave.aero) + export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero_outerwave.IN" + ;; + *) + echo "FATAL ERROR: Unable to determine appropriate UFS configure template for ${model_list}" + exit 16 + ;; +esac + +if [[ ! -r "${ufs_configure_template}" ]]; then + echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable." + exit 17 +fi + +unset model_list + echo "END: config.ufs" diff --git a/parm/ufs/chem/AERO.rc b/parm/ufs/gocart/AERO.rc similarity index 100% rename from parm/ufs/chem/AERO.rc rename to parm/ufs/gocart/AERO.rc diff --git a/parm/ufs/chem/AERO_HISTORY.rc b/parm/ufs/gocart/AERO_HISTORY.rc similarity index 100% rename from parm/ufs/chem/AERO_HISTORY.rc rename to parm/ufs/gocart/AERO_HISTORY.rc diff --git a/parm/ufs/chem/AGCM.rc b/parm/ufs/gocart/AGCM.rc similarity index 100% rename from parm/ufs/chem/AGCM.rc rename to parm/ufs/gocart/AGCM.rc diff --git a/parm/ufs/chem/CA2G_instance_CA.bc.rc b/parm/ufs/gocart/CA2G_instance_CA.bc.rc similarity index 100% rename from parm/ufs/chem/CA2G_instance_CA.bc.rc rename to parm/ufs/gocart/CA2G_instance_CA.bc.rc diff --git a/parm/ufs/chem/CA2G_instance_CA.br.rc b/parm/ufs/gocart/CA2G_instance_CA.br.rc similarity index 100% rename from parm/ufs/chem/CA2G_instance_CA.br.rc rename to parm/ufs/gocart/CA2G_instance_CA.br.rc diff --git a/parm/ufs/chem/CA2G_instance_CA.oc.rc b/parm/ufs/gocart/CA2G_instance_CA.oc.rc similarity index 100% rename from parm/ufs/chem/CA2G_instance_CA.oc.rc rename to parm/ufs/gocart/CA2G_instance_CA.oc.rc diff --git a/parm/ufs/chem/CAP.rc b/parm/ufs/gocart/CAP.rc similarity index 100% rename from parm/ufs/chem/CAP.rc rename to parm/ufs/gocart/CAP.rc diff --git a/parm/ufs/chem/DU2G_instance_DU.rc b/parm/ufs/gocart/DU2G_instance_DU.rc similarity index 100% rename from parm/ufs/chem/DU2G_instance_DU.rc rename to parm/ufs/gocart/DU2G_instance_DU.rc diff --git a/parm/ufs/chem/ExtData.gbbepx b/parm/ufs/gocart/ExtData.gbbepx similarity index 100% rename from parm/ufs/chem/ExtData.gbbepx rename to parm/ufs/gocart/ExtData.gbbepx diff --git a/parm/ufs/chem/ExtData.none b/parm/ufs/gocart/ExtData.none similarity index 100% rename from parm/ufs/chem/ExtData.none rename to parm/ufs/gocart/ExtData.none diff --git a/parm/ufs/chem/ExtData.other b/parm/ufs/gocart/ExtData.other similarity index 100% rename from parm/ufs/chem/ExtData.other rename to parm/ufs/gocart/ExtData.other diff --git a/parm/ufs/chem/ExtData.qfed b/parm/ufs/gocart/ExtData.qfed similarity index 100% rename from parm/ufs/chem/ExtData.qfed rename to parm/ufs/gocart/ExtData.qfed diff --git a/parm/ufs/chem/GOCART2G_GridComp.rc b/parm/ufs/gocart/GOCART2G_GridComp.rc similarity index 100% rename from parm/ufs/chem/GOCART2G_GridComp.rc rename to parm/ufs/gocart/GOCART2G_GridComp.rc diff --git a/parm/ufs/chem/NI2G_instance_NI.rc b/parm/ufs/gocart/NI2G_instance_NI.rc similarity index 100% rename from parm/ufs/chem/NI2G_instance_NI.rc rename to parm/ufs/gocart/NI2G_instance_NI.rc diff --git a/parm/ufs/chem/SS2G_instance_SS.rc b/parm/ufs/gocart/SS2G_instance_SS.rc similarity index 100% rename from parm/ufs/chem/SS2G_instance_SS.rc rename to parm/ufs/gocart/SS2G_instance_SS.rc diff --git a/parm/ufs/chem/SU2G_instance_SU.rc b/parm/ufs/gocart/SU2G_instance_SU.rc similarity index 100% rename from parm/ufs/chem/SU2G_instance_SU.rc rename to parm/ufs/gocart/SU2G_instance_SU.rc diff --git a/parm/ufs/chem/gocart_tracer.list b/parm/ufs/gocart/gocart_tracer.list similarity index 100% rename from parm/ufs/chem/gocart_tracer.list rename to parm/ufs/gocart/gocart_tracer.list diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 3cc96989eb..49dbaf12cf 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -80,16 +80,12 @@ source "${HOMEgfs}/ush/preamble.sh" # include all subroutines. Executions later. -source "${HOMEgfs}/ush/cplvalidate.sh" # validation of cpl* source "${HOMEgfs}/ush/forecast_predet.sh" # include functions for variable definition source "${HOMEgfs}/ush/forecast_det.sh" # include functions for run type determination source "${HOMEgfs}/ush/forecast_postdet.sh" # include functions for variables after run type determination source "${HOMEgfs}/ush/ufs_configure.sh" # include functions for ufs.configure processing source "${HOMEgfs}/ush/parsing_model_configure_FV3.sh" -# Compset string. For ufs.configure.* template selection. Default ATM only -confignamevarforufs=${confignamevarforufs:-'atm'} - # Coupling control switches, for coupling purpose, off by default cpl=${cpl:-.false.} cplflx=${cplflx:-.false.} # default off,import from outside source @@ -104,10 +100,6 @@ ICETIM=${DELTIM} CPL_SLOW=${CPL_SLOW:-${OCNTIM}} CPL_FAST=${CPL_FAST:-${ICETIM}} -echo "MAIN: Validating '${confignamevarforufs}' with cpl switches" -cplvalidate -echo "MAIN: '${confignamevarforufs}' validated, continue" - echo "MAIN: Loading common variables before determination of run type" common_predet diff --git a/ush/cplvalidate.sh b/ush/cplvalidate.sh deleted file mode 100755 index 4d72a305d0..0000000000 --- a/ush/cplvalidate.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /usr/bin/env bash - -##### -## This script validates $confignamevarforufs -## against cpl** switches to check consistency -## -## This is a child script of modular -## forecast script. This script is a direct execution -##### - -cplvalidate(){ -echo "SUB cplvalidate: validating cpl** switches for ${confignamevarforufs}" -return # TODO: Why are we returning right here? -case ${confignamevarforufs} in - 'atm') combination=.false..false..false..false..false.;; - 'datm') combination=.true..true..false..false..false.;; - 'atm_aero') combination=.true..false..false..false..true.;; - 'med_atm_ocn_ice') combination=.true..true..true..false..false.;; - 'cpld') combination=.true..true..true..false..false.;; - 'blocked_atm_wav') combination=.true..false..false..true..false.;; - 'leapfrog_atm_wav')combination=.true..false..false..true..false.;; - 'med_atm_ocn_ice_wav') combination=.true..true..true..true..false.;; - 'cpld_wave') combination=.true..true..true..true..false.;; - 'cpld_aero_wave') combination=.true..true..true..true..true.;; - 'medcold_atm_ocn_ice_wav') combination=.true..true..true..true..false.;; - 'med_atm_ocn_ice_wav1way') combination=.true..true..true..true..false.;; - 'med_atm_ocn_ice_wav1waywcurr') combination=.true..true..true..true..false.;; - 'medcold_atm_ocn_ice') combination=.true..true..true..false..false.;; - *) echo "SUB cplvalidate: Combination not supported" - exit 1 ;; -esac -control="${cpl}${cplflx}${cplice}${cplwav}${cplchm}" -if [[ "${control}" != "${combination}" ]]; then - echo "SUB cplvalidate: inconsistent cpl setting!" - exit 2 -else - echo "SUB cplvalidate: cpl settings validated!" -fi -} diff --git a/ush/ufs_configure.sh b/ush/ufs_configure.sh index edf2ec9d2f..8898d11162 100755 --- a/ush/ufs_configure.sh +++ b/ush/ufs_configure.sh @@ -89,20 +89,19 @@ if [[ "${cplchm}" = ".true." ]]; then fi # Ensure the template exists -template="${HOMEgfs}/parm/ufs/ufs.configure.${confignamevarforufs}.IN" -if [[ ! -f ${template} ]]; then - echo "FATAL ERROR: template '${template}' does not exist, ABORT!" +if [[ ! -r "${ufs_configure_template}" ]]; then + echo "FATAL ERROR: template '${ufs_configure_template}' does not exist, ABORT!" exit 1 fi source "${HOMEgfs}/ush/atparse.bash" rm -f "${DATA}/ufs.configure" -atparse < "${template}" >> "${DATA}/ufs.configure" +atparse < "${ufs_configure_template}" >> "${DATA}/ufs.configure" echo "Rendered ufs.configure:" cat ufs.configure ${NCP} "${HOMEgfs}/sorc/ufs_model.fd/tests/parm/fd_ufs.yaml" fd_ufs.yaml -echo "SUB ${FUNCNAME[0]}: ufs.configure.sh ends for ${confignamevarforufs}" +echo "SUB ${FUNCNAME[0]}: ufs.configure.sh ends for ${ufs_configure_template}" }