Skip to content

Commit

Permalink
Enhancement to the workflow for: (NOAA-EMC#493)
Browse files Browse the repository at this point in the history
* Enhancement to the workflow for:
1) configure sub-hour model output and generate the right list for running post jobs.
2) turn on DO_SPPT and DO_SKEB and match the namelist requirements
3) add setups for get ics and lbcs to run rertos on WCOSS2.

* Add note to len_fhr in run_post.
  • Loading branch information
hu5970 authored Mar 16, 2023
1 parent 490994d commit 5546c86
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 39 deletions.
6 changes: 6 additions & 0 deletions jobs/JREGIONAL_GET_EXTRN_MDL_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
lbs_spec_intvl_hrs="${LBC_SPEC_INTVL_HRS}"
boundary_len_hrs="${BOUNDARY_LEN}"
fi
if [ "${DO_RETRO}" = "TRUE" ]; then
retro_or_realtime="RETRO"
else
retro_or_realtime="REALTIME"
fi
#
#-----------------------------------------------------------------------
#
Expand All @@ -210,6 +215,7 @@ cd_vrfy "${extrn_mdl_staging_dir}"
get_extrn_mdl_file_dir_info \
extrn_mdl_name="${EXTRN_MDL_NAME}" \
anl_or_fcst="${anl_or_fcst}" \
retro_or_realtime="${retro_or_realtime}" \
cdate_FV3LAM="${CDATE}" \
lbs_spec_intvl_hrs="${lbs_spec_intvl_hrs}" \
boundary_len_hrs="${boundary_len_hrs}"\
Expand Down
8 changes: 6 additions & 2 deletions scripts/exregional_make_ics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,12 @@ case "${EXTRN_MDL_NAME_ICS}" in
input_type="grib2"
convert_nst=False
if [ "$MACHINE" == "WCOSS2" ]; then
fn_atm_nemsio="${EXTRN_MDL_FNS[0]}"
fn_sfc_nemsio="${EXTRN_MDL_FNS[1]}"
if [ "${DO_RETRO}" = "TRUE" ]; then
fn_atm_nemsio="${EXTRN_MDL_FNS[0]}"
else
fn_atm_nemsio="${EXTRN_MDL_FNS[0]}"
fn_sfc_nemsio="${EXTRN_MDL_FNS[1]}"
fi
fi
elif [ "${FV3GFS_FILE_FMT_ICS}" = "netcdf" ]; then
tracers_input="[\"spfh\",\"clwmr\",\"o3mr\",\"icmr\",\"rwmr\",\"snmr\",\"grle\"]"
Expand Down
14 changes: 14 additions & 0 deletions scripts/exregional_run_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@ zero exit code."
# A separate ${subh_fhr} is needed for subhour post.
#-----------------------------------------------------------------------
#
# get the length of the fhr string to decide format of forecast time stamp.
# 9 is sub-houry forecast and 3 is full hour forecast only.
len_fhr=${#fhr}
if [ ${len_fhr} -eq 9 ]; then
post_min=${fhr:4:2}
if [ ${post_min} -lt 15 ]; then
post_min=00
fi
else
post_min=00
fi

subh_fhr=${fhr}
if [ ${len_fhr} -eq 2 ]; then
post_fhr=${fhr}
Expand Down Expand Up @@ -328,6 +339,9 @@ The \${fhr} variable contains too few or too many characters:
fhr = \"$fhr\""
fi

# replace fhr with subh_fhr
echo "fhr=${fhr} and subh_fhr=${subh_fhr}"
fhr=${subh_fhr}

gridname=""
if [ ${PREDEF_GRID_NAME} = "RRFS_CONUS_3km" ]; then
Expand Down
11 changes: 9 additions & 2 deletions ush/config.sh.rrfs_a_c3
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,21 @@ fi

FCST_LEN_HRS="18"
FCST_LEN_HRS_SPINUP="1"
POSTPROC_LEN_HRS="18"
POSTPROC_LONG_LEN_HRS="60"
#FCST_LEN_HRS_CYCLES=(48 18 18 18 18 18 48 18 18 18 18 18 48 18 18 18 18 18 48 18 18 18 18 18)
for i in {0..23}; do FCST_LEN_HRS_CYCLES[$i]=18; done
for i in {0..23..6}; do FCST_LEN_HRS_CYCLES[$i]=60; done
DA_CYCLE_INTERV="1"
RESTART_INTERVAL="1 2"
RESTART_INTERVAL_LONG="1 2"
## set up post
POSTPROC_LEN_HRS="18"
POSTPROC_LONG_LEN_HRS="60"
NFHOUT_HF="1"
# 15 min output upto 18 hours
NFHMAX_HF="18"
NFHOUT="1"
NSOUT="15"
NSOUT_MIN="15"

USE_RRFSE_ENS="TRUE"
CYCL_HRS_HYB_FV3LAM_ENS=("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23")
Expand Down
16 changes: 12 additions & 4 deletions ush/config.sh_rrfs_a_enkf_c3
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ RESTART_INTERVAL="1"
RESTART_INTERVAL_LONG="1"
netcdf_diag=.true.
binary_diag=.false.

## set up post
NFHOUT_HF="1"
NFHMAX_HF="18"
NFHOUT="3"
NFHMAX_HF="12"

WTIME_RUN_FCST="00:30:00"
WTIME_RUN_FCST_LONG="03:45:00"
Expand Down Expand Up @@ -159,19 +162,24 @@ if [[ ${DO_ENSEMBLE} == "TRUE" ]]; then
NUM_ENS_MEMBERS_FCST=9
if [[ ${DO_ENSFCST} == "TRUE" ]] ; then
NUM_ENS_MEMBERS=${NUM_ENS_MEMBERS_FCST}
# DO_SPPT=TRUE
DO_SPP=TRUE
# SPPT_MAG=0.5
WTIME_RUN_FCST="04:45:00"
WTIME_MAKE_LBCS="01:30:00"
TAG="cefcst38"

LAYOUT_X="31"
LAYOUT_Y="32"
NNODES_RUN_FCST="16"

DO_SPP="TRUE"
DO_SPPT="TRUE"
DO_SKEB="TRUE"
SPPT_MAG="0.6"
DO_LSM_SPP="TRUE"

fi
fi

RUN_ensctrl="rrfs"
RUN="enkfrrfs"
TAG="c3enkf40"
if [[ ${DO_ENSFCST} == "TRUE" ]] ; then
Expand Down
118 changes: 118 additions & 0 deletions ush/config.sh_rrfs_a_n3r
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
MACHINE="wcoss2"
version="v0.4.1"
ACCOUNT="RRFS_DEV"
#RESERVATION="rrfsdet"
EXPT_BASEDIR="/lfs/h2/emc/lam/noscrub/emc.lam/rrfs/${version}"
EXPT_SUBDIR="rrfs_na"

PREDEF_GRID_NAME="RRFS_NA_3km"

. set_rrfs_config_general.sh
. set_rrfs_config_SDL_VDL_MixEn.sh

#DO_ENSEMBLE="TRUE"
#DO_ENSFCST="TRUE"
DO_DACYCLE="TRUE"
DO_SURFACE_CYCLE="TRUE"
DO_SPINUP="TRUE"
DO_SAVE_INPUT="TRUE"
DO_POST_SPINUP="FALSE"
DO_POST_PROD="TRUE"
DO_RETRO="TRUE"
DO_NONVAR_CLDANAL="TRUE"
DO_ENVAR_RADAR_REF="TRUE"
DO_SMOKE_DUST="TRUE"
DO_REFL2TTEN="FALSE"
RADARREFL_TIMELEVEL=(0)
FH_DFI_RADAR="0.0,0.25,0.5"
DO_SOIL_ADJUST="TRUE"
DO_RADDA="TRUE"
DO_BUFRSND="TRUE"
USE_FVCOM="TRUE"
PREP_FVCOM="TRUE"
DO_PARALLEL_PRDGEN="TRUE"

EXTRN_MDL_ICS_OFFSET_HRS="3"
LBC_SPEC_INTVL_HRS="1"
EXTRN_MDL_LBCS_OFFSET_HRS="6"
BOUNDARY_LEN_HRS="72"
BOUNDARY_PROC_GROUP_NUM="72"

# avaialble retro period:
# 20210511-20210531; 20210718-20210801
DATE_FIRST_CYCL="20220720"
DATE_LAST_CYCL="20230721"
CYCL_HRS=( "00" "12" )
CYCL_HRS_SPINSTART=("03" "15")
CYCL_HRS_PRODSTART=("09" "21")
CYCLEMONTH="07"
CYCLEDAY="20-21"

STARTYEAR=${DATE_FIRST_CYCL:0:4}
STARTMONTH=${DATE_FIRST_CYCL:4:2}
STARTDAY=${DATE_FIRST_CYCL:6:2}
STARTHOUR="00"
ENDYEAR=${DATE_LAST_CYCL:0:4}
ENDMONTH=${DATE_LAST_CYCL:4:2}
ENDDAY=${DATE_LAST_CYCL:6:2}
ENDHOUR="23"

PREEXISTING_DIR_METHOD="upgrade"
INITIAL_CYCLEDEF="${DATE_FIRST_CYCL}0300 ${DATE_LAST_CYCL}2300 12:00:00"
BOUNDARY_CYCLEDEF="${DATE_FIRST_CYCL}0000 ${DATE_LAST_CYCL}2300 06:00:00"
PROD_CYCLEDEF="00 01-05,07-11,13-17,19-23 ${CYCLEDAY} ${CYCLEMONTH} ${STARTYEAR} *"
PRODLONG_CYCLEDEF="00 00,06,12,18 ${CYCLEDAY} ${CYCLEMONTH} ${STARTYEAR} *"
#ARCHIVE_CYCLEDEF="${DATE_FIRST_CYCL}1400 ${DATE_LAST_CYCL}2300 24:00:00"
if [[ $DO_SPINUP == "TRUE" ]] ; then
SPINUP_CYCLEDEF="00 03-08,15-20 ${CYCLEDAY} ${CYCLEMONTH} ${STARTYEAR} *"
fi

FCST_LEN_HRS="18"
FCST_LEN_HRS_SPINUP="1"
POSTPROC_LEN_HRS="18"
POSTPROC_LONG_LEN_HRS="60"
#FCST_LEN_HRS_CYCLES=(21 21 21 63 21 21 21 21 21 63 21 21 21 21 21 63 21 21 21 21 21 63 21 21)
for i in {0..23}; do FCST_LEN_HRS_CYCLES[$i]=18; done
for i in {0..23..6}; do FCST_LEN_HRS_CYCLES[$i]=60; done
DA_CYCLE_INTERV="1"
RESTART_INTERVAL="1"
RESTART_INTERVAL_LONG="1"

USE_RRFSE_ENS="FALSE"
CYCL_HRS_HYB_FV3LAM_ENS=("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23")

SST_update_hour=01
GVF_update_hour=04
SNOWICE_update_hour=00
netcdf_diag=.true.
binary_diag=.false.

regional_ensemble_option=1

EXTRN_MDL_NAME_ICS="FV3GFS"
EXTRN_MDL_NAME_LBCS="FV3GFS"
FV3GFS_FILE_FMT_ICS="grib2"
FV3GFS_FILE_FMT_LBCS="grib2"

PRINT_DIFF_PGR="TRUE"
envir="para"

NET="rrfs_a"
TAG="n3v41"

ARCHIVEDIR="/NCEPDEV/emc-meso/1year/emc.lam"
NCL_REGION="conus"
MODEL="rrfs_a"
RUN="rrfs"

. set_rrfs_config.sh

STMP="/lfs/h2/emc/stmp/emc.lam/rrfs/${version}" # Path to directory STMP that mostly contains input files.
PTMP="/lfs/h2/emc/ptmp/emc.lam/rrfs/${version}" # Path to directory STMP that mostly contains input files.
NWGES="/lfs/h2/emc/ptmp/emc.lam/rrfs/${version}/nwges" # Path to directory NWGES that save boundary, cold initial, restart files
if [[ ${regional_ensemble_option} == "5" ]]; then
RRFSE_NWGES="/lfs/h2/emc/ptmp/emc.lam/rrfs/${version}/nwges" # Path to RRFSE directory NWGES that mostly contains ensemble restart files for GSI hybrid.
NUM_ENS_MEMBERS=30 # FV3LAM ensemble size for GSI hybrid analysis
CYCL_HRS_PRODSTART_ENS=( "19" )
DO_ENVAR_RADAR_REF="TRUE"
fi
4 changes: 2 additions & 2 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2230,8 +2230,8 @@ ISEED_SPP=( "4" "5" "6" "7" "8" )
# at the moment, and is used for each pattern.
#
DO_LSM_SPP="FALSE" #If true, sets lndp_type=2
LSM_SPP_TSCALE=( "21600" "21600" "21600" "21600" "21600" "21600" "21600" )
LSM_SPP_LSCALE=( "150000" "150000" "150000" "150000" "150000" "150000" "150000" )
LSM_SPP_TSCALE=( "21600" "21600" "21600" "21600" "21600" )
LSM_SPP_LSCALE=( "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" )
Expand Down
22 changes: 21 additions & 1 deletion ush/generate_FV3LAM_wflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ settings="\
'postproc_len_hrs': ${POSTPROC_LEN_HRS}
'postproc_long_len_hrs': ${POSTPROC_LONG_LEN_HRS}
'postproc_nsout_min': ${NSOUT_MIN}
'postproc_nfhmax_hrs': ${NFHMAX_HF}
'postproc_nfhout_hrs': ${NFHOUT}
'postproc_nfhout_hf_hrs': ${NFHOUT_HF}
'boundary_proc_group_num': ${BOUNDARY_PROC_GROUP_NUM}
#
# Ensemble-related parameters.
Expand Down Expand Up @@ -756,7 +759,7 @@ fi
In order to be able to generate a forecast experiment in NCO mode (i.e.
when RUN_ENVIR set to \"nco\"), the path specified by FIXam after resolving
all symlinks (path_resolved) must be an existing directory (but in this
case isn't):
case is not):
RUN_ENVIR = \"${RUN_ENVIR}\"
FIXam = \"$FIXam\"
path_resolved = \"${path_resolved}\"
Expand Down Expand Up @@ -876,6 +879,20 @@ if [ "${EXTRN_MDL_NAME_ICS}" = "HRRR" -o \
[ "${SDF_USES_RUC_LSM}" = "TRUE" ]; then
lsoil="9"
fi
#
# fhzero = 0.25
# get time-max fields like UH to reset at 15-minute intervals
#
# avg_max_length=900, sec,
# for needing restart files also output at higher frequency
# or other time-max fields output at high frequency
#
avg_max_length="3600.0"
fhzero="1.0"
if [ "${NSOUT_MIN}" = "15" ]; then
avg_max_length="900.0"
fhzero="0.25"
fi
#
# Create a multiline variable that consists of a yaml-compliant string
# specifying the values that the namelist variables that are physics-
Expand All @@ -896,6 +913,7 @@ fi
#
settings="\
'atmos_model_nml': {
'avg_max_length': ${avg_max_length},
'blocksize': $BLOCKSIZE,
'ccpp_suite': ${CCPP_PHYS_SUITE},
}
Expand All @@ -921,6 +939,7 @@ settings="\
'bc_update_interval': ${LBC_SPEC_INTVL_HRS},
}
'gfs_physics_nml': {
'fhzero':${fhzero},
'kice': ${kice:-null},
'lsoil': ${lsoil:-null},
'print_diff_pgr': ${PRINT_DIFF_PGR},
Expand Down Expand Up @@ -1162,6 +1181,7 @@ settings="$settings
if [ "${DO_LSM_SPP}" = "TRUE" ]; then
settings="$settings
'lndp_type': ${LNDP_TYPE},
'lndp_model_type': ${LNDP_TYPE},
'lndp_tau': [ $( printf "%s, " "${LSM_SPP_TSCALE[@]}" ) ],
'lndp_lscale': [ $( printf "%s, " "${LSM_SPP_LSCALE[@]}" ) ],
'iseed_lndp': [ $( printf "%s, " "${ISEED_LSM_SPP[@]}" ) ],
Expand Down
17 changes: 15 additions & 2 deletions ush/get_extrn_mdl_file_dir_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function get_extrn_mdl_file_dir_info() {
local valid_args=( \
"extrn_mdl_name" \
"anl_or_fcst" \
"retro_or_realtime" \
"cdate_FV3LAM" \
"lbs_spec_intvl_hrs" \
"boundary_len_hrs" \
Expand Down Expand Up @@ -97,7 +98,7 @@ function get_extrn_mdl_file_dir_info() {
#
if [ 0 = 1 ]; then

if [ "$#" -ne "13" ]; then
if [ "$#" -ne "14" ]; then

print_err_msg_exit "
Incorrect number of arguments specified:
Expand All @@ -110,6 +111,7 @@ Usage:
${func_name} \
extrn_mdl_name \
anl_or_fcst \
retro_or_realtime \
cdate_FV3LAM \
lbs_spec_intvl_hrs \
boundary_len_hrs \
Expand Down Expand Up @@ -399,6 +401,9 @@ fi
else
fns_on_disk=( "gfs.t${hh}z.pgrb2.0p25.f0${fcst_hh}" "gfs.t${hh}z.sfcf0${fcst_hh}.nc") # use netcdf
fi
if [ "${MACHINE}" = "WCOSS2" ] && [ "${retro_or_realtime}" = "RETRO" ]; then
fns_on_disk=( "${yy}${ddd}${hh}0${fcst_mn}0${fcst_hh}" )
fi
fns_in_arcv=( "gfs.t${hh}z.pgrb2.0p25.f0${fcst_hh}" ) # Get only 0.25 degree files for now.

elif [ "${fv3gfs_file_fmt}" = "netcdf" ]; then
Expand Down Expand Up @@ -520,6 +525,10 @@ and analysis or forecast (anl_or_fcst):
fns_on_disk=( "${fcst_hhh[@]/#/$prefix}" )
fns_in_arcv=( "${fcst_hhh[@]/#/$prefix}" )
fi
if [ "${MACHINE}" = "WCOSS2" ] && [ "${retro_or_realtime}" = "RETRO" ]; then
prefix=( "${yy}${ddd}${hh}${fcst_mn}0" )
fns_on_disk=( "${fcst_hhh[@]/#/$prefix}" )
fi
elif [ "${fv3gfs_file_fmt}" = "netcdf" ]; then
fcst_hhh=( $( printf "%03d " "${lbc_spec_fhrs[@]}" ) )
postfix=".nc"
Expand Down Expand Up @@ -673,7 +682,11 @@ has not been specified for this external model and machine combination:
"FV3GFS")
case "$MACHINE" in
"WCOSS2")
sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos"
if [ "${retro_or_realtime}" = "RETRO" ]; then
sysdir="$sysbasedir"
else
sysdir="$sysbasedir/gfs.${yyyymmdd}/${hh}/atmos"
fi
;;
"HERA")
sysdir="$sysbasedir"
Expand Down
Loading

0 comments on commit 5546c86

Please sign in to comment.