From 1f8c5e7c3ae40651c79e5a301b870f453e54f117 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Wed, 5 Apr 2023 19:48:32 +0000 Subject: [PATCH 01/21] fix time-offset issue on gefs lbcs --- scripts/exregional_aqm_lbcs.sh | 40 +++++++++++++++++++------------- ush/config.aqm.nco.realtime.yaml | 8 +++---- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index 99da094000..d01f3acf58 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -62,13 +62,15 @@ export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} # eval ${PRE_TASK_CMDS} -if [ -z "${RUN_CMD_AQMLBC:-}" ] ; then +nprocs=$(( NNODES_AQM_LBCS*PPN_AQM_LBCS )) + +if [ -z "${RUN_CMD_UTILS:-}" ] ; then print_err_msg_exit "\ Run command was not set in machine file. \ - Please set RUN_CMD_AQM_LBC for your platform" + Please set RUN_CMD_UTILS for your platform" else print_info_msg "$VERBOSE" " - All executables will be submitted with command \'${RUN_CMD_AQMLBC}\'." + All executables will be submitted with command \'${RUN_CMD_UTILS}\'." fi # @@ -88,9 +90,10 @@ cd_vrfy $DATA # #----------------------------------------------------------------------- # -yyyymmdd="${PDY}" -mm="${PDY:4:2}" - +CDATE_MOD=$( $DATE_UTIL --utc --date "${PDY} ${cyc} UTC - ${EXTRN_MDL_LBCS_OFFSET_HRS} hours" "+%Y%m%d%H" ) +yyyymmdd=${CDATE_MOD:0:8} +mm="${CDATE_MOD:4:2}" +hh="${CDATE_MOD:8:2}" if [ "${FCST_LEN_HRS}" = "-1" ]; then CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) @@ -119,7 +122,7 @@ The chemical LBC files do not exist: for hr in 0 ${LBC_SPEC_FCST_HRS[@]}; do fhr=$( printf "%03d" "${hr}" ) if [ -r ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile7.f${fhr}.nc ]; then - ncks -A ${chem_lbcs_fn} ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile7.f${fhr}.nc + ncks -A ${chem_lbcs_fn} ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile7.f${fhr}.nc fi done @@ -136,15 +139,20 @@ fi #----------------------------------------------------------------------- # if [ ${DO_AQM_GEFS_LBCS} = "TRUE" ]; then - - RUN_CYC="${cyc}" - CDATE_MOD=$( $DATE_UTIL --utc --date "${PDY} ${cyc} UTC - ${EXTRN_MDL_LBCS_OFFSET_HRS} hours" "+%Y%m%d%H" ) - PDY_MOD=${CDATE_MOD:0:8} - AQM_GEFS_FILE_CYC=${AQM_GEFS_FILE_CYC:-"${CDATE_MOD:8:2}"} + + PDY_MOD=${yyyymmdd} + AQM_GEFS_FILE_CYC=${AQM_GEFS_FILE_CYC:-"${hh}"} AQM_GEFS_FILE_CYC=$( printf "%02d" "${AQM_GEFS_FILE_CYC}" ) + GEFS_CYC_DIFF=$(( cyc - AQM_GEFS_FILE_CYC )) + if [ "${GEFS_CYC_DIFF}" -lt "0" ]; then + TSTEPDIFF=$( printf "%02d" $(( 24 + ${GEFS_CYC_DIFF} )) ) + else + TSTEPDIFF=$( printf "%02d" ${GEFS_CYC_DIFF} ) + fi + AQM_MOFILE_FN="${AQM_GEFS_FILE_PREFIX}.t${AQM_GEFS_FILE_CYC}z.atmf" - if [ ${DO_REAL_TIME} = "TRUE" ]; then + if [ "${DO_REAL_TIME}" = "TRUE" ]; then AQM_MOFILE_FP="${COMINgefs}/gefs.${PDY_MOD}/${AQM_GEFS_FILE_CYC}/chem/sfcsig/${AQM_MOFILE_FN}" else AQM_MOFILE_FP="${AQM_GEFS_DIR}/${PDY}/${AQM_GEFS_FILE_CYC}/${AQM_MOFILE_FN}" @@ -152,7 +160,8 @@ if [ ${DO_AQM_GEFS_LBCS} = "TRUE" ]; then # Check if GEFS aerosol files exist for hr in 0 ${LBC_SPEC_FCST_HRS[@]}; do - fhr=$( printf "%03d" "${hr}" ) + hr_mod=$(( hr + EXTRN_MDL_LBCS_OFFSET_HRS )) + fhr=$( printf "%03d" "${hr_mod}" ) AQM_MOFILE_FHR_FP="${AQM_MOFILE_FP}${fhr}.nemsio" if [ ! -e "${AQM_MOFILE_FHR_FP}" ]; then print_err_msg_exit "The GEFS file (AQM_MOFILE_FHR_FP) for LBCs does not exist: @@ -160,12 +169,11 @@ if [ ${DO_AQM_GEFS_LBCS} = "TRUE" ]; then fi done - GEFS_CYC_DIFF=$( printf "%02d" "$(( RUN_CYC - AQM_GEFS_FILE_CYC ))" ) NUMTS="$(( FCST_LEN_HRS / LBC_SPEC_INTVL_HRS + 1 ))" cat > gefs2lbc-nemsio.ini < Date: Wed, 5 Apr 2023 19:51:04 +0000 Subject: [PATCH 02/21] remove old change --- scripts/exregional_aqm_lbcs.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index d01f3acf58..db31a9c4ca 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -62,15 +62,13 @@ export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} # eval ${PRE_TASK_CMDS} -nprocs=$(( NNODES_AQM_LBCS*PPN_AQM_LBCS )) - -if [ -z "${RUN_CMD_UTILS:-}" ] ; then +if [ -z "${RUN_CMD_AQMLBC:-}" ] ; then print_err_msg_exit "\ Run command was not set in machine file. \ - Please set RUN_CMD_UTILS for your platform" + Please set RUN_CMD_AQM_LBC for your platform" else print_info_msg "$VERBOSE" " - All executables will be submitted with command \'${RUN_CMD_UTILS}\'." + All executables will be submitted with command \'${RUN_CMD_AQMLBC}\'." fi # From 05db0c2721d0c373b84aabedb7785369f6651a48 Mon Sep 17 00:00:00 2001 From: "Chan-hoo.Jeon" Date: Thu, 6 Apr 2023 20:31:40 +0000 Subject: [PATCH 03/21] fix cyc_idx issue on varying fcst_len_hrs --- scripts/exregional_aqm_lbcs.sh | 12 ++++++------ scripts/exregional_bias_correction_o3.sh | 5 +++-- scripts/exregional_bias_correction_pm25.sh | 5 +++-- scripts/exregional_get_extrn_mdl_files.sh | 5 +++-- scripts/exregional_make_lbcs.sh | 5 +++-- scripts/exregional_nexus_emission.sh | 5 +++-- scripts/exregional_nexus_gfs_sfc.sh | 6 ++++-- scripts/exregional_nexus_post_split.sh | 5 +++-- scripts/exregional_point_source.sh | 5 +++-- scripts/exregional_post_stat_o3.sh | 5 +++-- scripts/exregional_pre_post_stat.sh | 5 +++-- scripts/exregional_run_fcst.sh | 5 +++-- ush/config_defaults.yaml | 1 + ush/setup.py | 3 +++ 14 files changed, 44 insertions(+), 28 deletions(-) diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index db31a9c4ca..fcc2382a7a 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -70,7 +70,7 @@ else print_info_msg "$VERBOSE" " All executables will be submitted with command \'${RUN_CMD_AQMLBC}\'." fi - +set -x # #----------------------------------------------------------------------- # @@ -93,8 +93,9 @@ yyyymmdd=${CDATE_MOD:0:8} mm="${CDATE_MOD:4:2}" hh="${CDATE_MOD:8:2}" -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi LBC_SPEC_FCST_HRS=() @@ -138,7 +139,6 @@ fi # if [ ${DO_AQM_GEFS_LBCS} = "TRUE" ]; then - PDY_MOD=${yyyymmdd} AQM_GEFS_FILE_CYC=${AQM_GEFS_FILE_CYC:-"${hh}"} AQM_GEFS_FILE_CYC=$( printf "%02d" "${AQM_GEFS_FILE_CYC}" ) @@ -151,9 +151,9 @@ if [ ${DO_AQM_GEFS_LBCS} = "TRUE" ]; then AQM_MOFILE_FN="${AQM_GEFS_FILE_PREFIX}.t${AQM_GEFS_FILE_CYC}z.atmf" if [ "${DO_REAL_TIME}" = "TRUE" ]; then - AQM_MOFILE_FP="${COMINgefs}/gefs.${PDY_MOD}/${AQM_GEFS_FILE_CYC}/chem/sfcsig/${AQM_MOFILE_FN}" + AQM_MOFILE_FP="${COMINgefs}/gefs.${yyyymmdd}/${AQM_GEFS_FILE_CYC}/chem/sfcsig/${AQM_MOFILE_FN}" else - AQM_MOFILE_FP="${AQM_GEFS_DIR}/${PDY}/${AQM_GEFS_FILE_CYC}/${AQM_MOFILE_FN}" + AQM_MOFILE_FP="${AQM_GEFS_DIR}/${yyyymmdd}/${AQM_GEFS_FILE_CYC}/${AQM_MOFILE_FN}" fi # Check if GEFS aerosol files exist diff --git a/scripts/exregional_bias_correction_o3.sh b/scripts/exregional_bias_correction_o3.sh index 468d2968cb..083d031f02 100755 --- a/scripts/exregional_bias_correction_o3.sh +++ b/scripts/exregional_bias_correction_o3.sh @@ -105,8 +105,9 @@ if [ "${PREDEF_GRID_NAME}" = "AQM_NA_13km" ]; then id_domain=793 fi -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi diff --git a/scripts/exregional_bias_correction_pm25.sh b/scripts/exregional_bias_correction_pm25.sh index 834d1586f5..8723235fd1 100755 --- a/scripts/exregional_bias_correction_pm25.sh +++ b/scripts/exregional_bias_correction_pm25.sh @@ -104,8 +104,9 @@ yyyymm_m3=${PDYm3:0:6} if [ "${PREDEF_GRID_NAME}" = "AQM_NA_13km" ]; then id_domain=793 fi -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi diff --git a/scripts/exregional_get_extrn_mdl_files.sh b/scripts/exregional_get_extrn_mdl_files.sh index 81f2ae34e3..5aa32127d9 100755 --- a/scripts/exregional_get_extrn_mdl_files.sh +++ b/scripts/exregional_get_extrn_mdl_files.sh @@ -70,8 +70,9 @@ if [ "${ICS_OR_LBCS}" = "ICS" ]; then elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then file_set="fcst" first_time=$((TIME_OFFSET_HRS + LBC_SPEC_INTVL_HRS)) - if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) + if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi last_time=$((TIME_OFFSET_HRS + FCST_LEN_HRS)) diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index bb43a22714..92d6ec3dc9 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -100,8 +100,9 @@ DATA="${DATA}/tmp_LBCS" mkdir_vrfy -p "$DATA" cd_vrfy $DATA -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi LBC_SPEC_FCST_HRS=() diff --git a/scripts/exregional_nexus_emission.sh b/scripts/exregional_nexus_emission.sh index 53c6e6e48e..17c0abb048 100755 --- a/scripts/exregional_nexus_emission.sh +++ b/scripts/exregional_nexus_emission.sh @@ -132,8 +132,9 @@ yyyymmdd="${PDY}" NUM_SPLIT_NEXUS=$( printf "%02d" ${NUM_SPLIT_NEXUS} ) -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index b18dddd3b2..d6863c7715 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -48,6 +48,7 @@ data files from disk or HPSS. # #----------------------------------------------------------------------- # +set -x DATA="${DATA}/tmp_GFS_SFC" mkdir_vrfy -p "$DATA" cd_vrfy $DATA @@ -63,8 +64,9 @@ yyyymm=${GFS_SFC_CDATE:0:6} yyyy=${GFS_SFC_CDATE:0:4} hh=${GFS_SFC_CDATE:8:2} -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi # diff --git a/scripts/exregional_nexus_post_split.sh b/scripts/exregional_nexus_post_split.sh index 29fc57e314..252813ed6e 100755 --- a/scripts/exregional_nexus_post_split.sh +++ b/scripts/exregional_nexus_post_split.sh @@ -71,8 +71,9 @@ yyyymmdd="${PDY}" NUM_SPLIT_NEXUS=$( printf "%02d" ${NUM_SPLIT_NEXUS} ) -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi start_date=$( $DATE_UTIL --utc --date "${yyyymmdd} ${hh} UTC" "+%Y%m%d%H" ) diff --git a/scripts/exregional_point_source.sh b/scripts/exregional_point_source.sh index a5191a1647..df554d4df5 100755 --- a/scripts/exregional_point_source.sh +++ b/scripts/exregional_point_source.sh @@ -53,8 +53,9 @@ This is the ex-script for the task that runs PT_SOURCE. # eval ${PRE_TASK_CMDS} -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi nstep=$(( FCST_LEN_HRS+1 )) diff --git a/scripts/exregional_post_stat_o3.sh b/scripts/exregional_post_stat_o3.sh index 1913038195..8228a3c991 100755 --- a/scripts/exregional_post_stat_o3.sh +++ b/scripts/exregional_post_stat_o3.sh @@ -102,8 +102,9 @@ eval ${RUN_CMD_SERIAL} ${EXECdir}/aqm_post_grib2 ${PDY} ${cyc} ${REDIRECT_OUT_ER Call to executable to run AQM_POST_GRIB2 returned with nonzero exit code." POST_STEP -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index 12bebfd345..32eb5236e7 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -64,8 +64,9 @@ rm_vrfy -r $DATA mkdir_vrfy -p "$DATA" cd_vrfy $DATA -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} post_complete_file=${COMIN}/${TN_RUN_POST}_${PDY}${cyc}_task_complete.txt diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 032f9e9161..ccd30fa69e 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -79,8 +79,9 @@ else All executables will be submitted with command \'${RUN_CMD_FCST}\'." fi -if [ "${FCST_LEN_HRS}" = "-1" ]; then - CYCLE_IDX=$(( ${cyc} / ${INCR_CYCL_FREQ} )) +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi diff --git a/ush/config_defaults.yaml b/ush/config_defaults.yaml index 2ea8fb349e..1d28d1410c 100644 --- a/ush/config_defaults.yaml +++ b/ush/config_defaults.yaml @@ -857,6 +857,7 @@ workflow: FCST_LEN_HRS: 24 FCST_LEN_CYCL: - '{{ FCST_LEN_HRS }}' + NUM_FCST_LEN_CYCL: 1 LONG_FCST_LEN: '{% if FCST_LEN_HRS < 0 %}{{ FCST_LEN_CYCL|max }}{% else %}{{ FCST_LEN_HRS }}{% endif %}' # diff --git a/ush/setup.py b/ush/setup.py index d4ad08d4ab..06737391a0 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -712,6 +712,9 @@ def get_location(xcs, fmt, expt_cfg): # Reset the hours to the short forecast length workflow_config["FCST_LEN_HRS"] = min(fcst_len_cycl) + # Rest the number of the forecast length cycles + workflow_config["NUM_FCST_LEN_CYCL"] = len(fcst_len_cycl) + # Find the entries that match the long forecast, and map them to # their time of day. long_fcst_len = max(fcst_len_cycl) From 44a74dea9753c8eb1a738c991e419240a177e710 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Fri, 7 Apr 2023 15:02:26 +0000 Subject: [PATCH 04/21] fix undefined cycled --- parm/wflow/aqm_all.yaml | 2 +- scripts/exregional_nexus_gfs_sfc.sh | 1 - ush/setup.py | 37 +++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/parm/wflow/aqm_all.yaml b/parm/wflow/aqm_all.yaml index 9e1354dc20..fc7f74942d 100644 --- a/parm/wflow/aqm_all.yaml +++ b/parm/wflow/aqm_all.yaml @@ -117,7 +117,7 @@ task_aqm_ics_ext: task_aqm_ics: <<: *default_aqm attrs: - cycledefs: cycled + cycledefs: cycled_from_second maxtries: '2' command: '&LOAD_MODULES_RUN_TASK_FP; "aqm_ics" "&JOBSdir;/JREGIONAL_AQM_ICS"' envars: diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index d6863c7715..9658d2a448 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -48,7 +48,6 @@ data files from disk or HPSS. # #----------------------------------------------------------------------- # -set -x DATA="${DATA}/tmp_GFS_SFC" mkdir_vrfy -p "$DATA" cd_vrfy $DATA diff --git a/ush/setup.py b/ush/setup.py index 06737391a0..5b8c59847c 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -8,6 +8,7 @@ import traceback import logging from textwrap import dedent +from datetime import timedelta import yaml @@ -33,6 +34,7 @@ get_ini_value, str_to_list, extend_yaml, + date_to_str, ) from set_cycle_dates import set_cycle_dates @@ -44,7 +46,6 @@ from check_ruc_lsm import check_ruc_lsm from set_thompson_mp_fix_files import set_thompson_mp_fix_files - def load_config_for_setup(ushdir, default_config, user_config): """Load in the default, machine, and user configuration files into Python dictionaries. Return the combined experiment dictionary. @@ -673,20 +674,18 @@ def get_location(xcs, fmt, expt_cfg): run_envir = expt_config["user"].get("RUN_ENVIR", "") - # set varying forecast lengths only when fcst_len_hrs=-1 fcst_len_hrs = workflow_config.get("FCST_LEN_HRS") - if fcst_len_hrs == -1: + date_first_cycl = workflow_config.get("DATE_FIRST_CYCL") + date_last_cycl = workflow_config.get("DATE_LAST_CYCL") + incr_cycl_freq = int(workflow_config.get("INCR_CYCL_FREQ")) - # Check that the number of entries divides into a day + # set varying forecast lengths only when fcst_len_hrs=-1 + if fcst_len_hrs == -1: fcst_len_cycl = workflow_config.get("FCST_LEN_CYCL") - incr_cycl_freq = int(workflow_config.get("INCR_CYCL_FREQ")) - - date_first_cycl = workflow_config.get("DATE_FIRST_CYCL") - date_last_cycl = workflow_config.get("DATE_LAST_CYCL") + # Check that the number of entries divides into a day if 24 / incr_cycl_freq != len(fcst_len_cycl): - # Also allow for the possibility that the user is running # cycles for less than a day: num_cycles = len(set_cycle_dates( @@ -712,7 +711,7 @@ def get_location(xcs, fmt, expt_cfg): # Reset the hours to the short forecast length workflow_config["FCST_LEN_HRS"] = min(fcst_len_cycl) - # Rest the number of the forecast length cycles + # Reset the number of the forecast length cycles workflow_config["NUM_FCST_LEN_CYCL"] = len(fcst_len_cycl) # Find the entries that match the long forecast, and map them to @@ -731,6 +730,24 @@ def get_location(xcs, fmt, expt_cfg): rocoto_config['cycledefs']['long_forecast'] = fcst_cdef + # add cycledefs excluding the first cycle for AQM + cpl_aqm = expt_config['cpl_aqm_parm']['CPL_AQM'] + if cpl_aqm: + incr_cycl_freq = int(workflow_config.get("INCR_CYCL_FREQ")) + if date_first_cycl == date_last_cycl: + cycl_next = date_to_str(date_first_cycl, format="%Y%m%d%H") + else: + cycl_next = date_to_str(date_first_cycl + timedelta(hours=incr_cycl_freq), format="%Y%m%d%H") + + first = date_first_cycl.strftime("%Y%m%d%H") + last = date_last_cycl.strftime("%Y%m%d%H") + + cycled_from_second = [] + if cycl_next != first: + cycled_from_second.append(f'{cycl_next}00 {last}00 {incr_cycl_freq}:00:00') + + rocoto_config['cycledefs']['cycled_from_second'] = cycled_from_second + # check the availability of restart intervals for restart capability of forecast do_fcst_restart = fcst_config.get("DO_FCST_RESTART") if do_fcst_restart: From e6f6ebc3783fc7449c66935b44dfaad1cf5f7b3a Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Fri, 7 Apr 2023 16:36:55 +0000 Subject: [PATCH 05/21] fix wrong mv command for aqm --- scripts/exregional_run_fcst.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index ccd30fa69e..98cfa1f577 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -668,7 +668,7 @@ if [ "${CPL_AQM}" = "TRUE" ]; then fi mv_vrfy ${DATA}/${AQM_RC_PRODUCT_FN} ${COMOUT}/${NET}.${cycle}${dot_ensmem}.${AQM_RC_PRODUCT_FN} - + fi # #----------------------------------------------------------------------- @@ -730,16 +730,13 @@ if [ ${WRITE_DOPOST} = "TRUE" ]; then fi done + if [ "${CPL_AQM}" = "TRUE" ]; then + mv_vrfy ${DATA}/dynf${fhr}.nc ${COMIN}/${NET}.${cycle}${dot_ensmem}.dyn.f${fhr}.nc + mv_vrfy ${DATA}/phyf${fhr}.nc ${COMIN}/${NET}.${cycle}${dot_ensmem}.phy.f${fhr}.nc + fi done fi -if [ "${CPL_AQM}" = "TRUE" ]; then - for fhr in $(seq -f "%03g" 0 ${FCST_LEN_HRS}); do - mv_vrfy ${DATA}/dynf${fhr}.nc ${COMIN}/${NET}.${cycle}${dot_ensmem}.dyn.f${fhr}.nc - mv_vrfy ${DATA}/phyf${fhr}.nc ${COMIN}/${NET}.${cycle}${dot_ensmem}.phy.f${fhr}.nc - done -fi - # #----------------------------------------------------------------------- # From 761b9e453c95403dc4841ecdb27ff6bacb1e6799 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Fri, 7 Apr 2023 18:13:34 +0000 Subject: [PATCH 06/21] fix dependecy issue on xml yaml --- parm/wflow/aqm_all.yaml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/parm/wflow/aqm_all.yaml b/parm/wflow/aqm_all.yaml index fc7f74942d..f45cec91cf 100644 --- a/parm/wflow/aqm_all.yaml +++ b/parm/wflow/aqm_all.yaml @@ -154,22 +154,9 @@ task_pre_post_stat: command: '&LOAD_MODULES_RUN_TASK_FP; "pre_post_stat" "&JOBSdir;/JREGIONAL_PRE_POST_STAT"' join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' dependency: - taskdep: + metataskdep: attrs: - task: run_fcst_mem000 - #or_do_post: - # and_inline_post: # If inline post ran, wait on the forecast task to complete - # not: - # taskvalid: - # attrs: - # task: run_post_mem000_f000 - # and_run_post: # If post was meant to run, wait on the whole post metatask - # taskvalid: - # attrs: - # task: run_post_mem000_f000 - # metataskdep: - # attrs: - # metatask: run_post_mem000 + metatask: run_post task_post_stat_o3: <<: *default_aqm @@ -187,6 +174,7 @@ task_post_stat_pm25: join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' memory: 120G dependency: + taskdep: attrs: task: pre_post_stat @@ -196,6 +184,7 @@ task_bias_correction_o3: join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' memory: 120G dependency: + taskdep: attrs: task: pre_post_stat @@ -205,6 +194,7 @@ task_bias_correction_pm25: join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' memory: 120G dependency: + taskdep: attrs: task: pre_post_stat From 2e6dca5863033798d065c6563651c49ae90930f4 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Fri, 7 Apr 2023 23:48:17 +0000 Subject: [PATCH 07/21] fix dependency issue on xml --- jobs/JREGIONAL_RUN_POST | 19 ++++++++----------- parm/wflow/aqm_all.yaml | 13 +++++++------ parm/wflow/coldstart.yaml | 4 ++-- parm/wflow/default_workflow.yaml | 4 ++-- scripts/exregional_pre_post_stat.sh | 2 +- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/jobs/JREGIONAL_RUN_POST b/jobs/JREGIONAL_RUN_POST index 96c4c04aae..cb6f00ac1d 100755 --- a/jobs/JREGIONAL_RUN_POST +++ b/jobs/JREGIONAL_RUN_POST @@ -138,17 +138,14 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed." # #----------------------------------------------------------------------- # -if [ "${FCST_LEN_HRS}" = "-1" ]; then - for i_cdate in "${!ALL_CDATES[@]}"; do - if [ "${ALL_CDATES[$i_cdate]}" = "${PDY}${cyc}" ]; then - FCST_LEN_HRS="${FCST_LEN_CYCL_ALL[$i_cdate]}" - break - fi - done - fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" ) - if [ "${fhr}" = "${fcst_len_hrs}" ]; then - touch "${COMIN}/${TN_RUN_POST}_${PDY}${cyc}_task_complete.txt" - fi +if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) + CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) + FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} +fi +fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" ) +if [ "${fhr}" = "${fcst_len_hrs}" ]; then + touch "${COMIN}/post_${PDY}${cyc}_task_complete.txt" fi # #----------------------------------------------------------------------- diff --git a/parm/wflow/aqm_all.yaml b/parm/wflow/aqm_all.yaml index f45cec91cf..e14399c426 100644 --- a/parm/wflow/aqm_all.yaml +++ b/parm/wflow/aqm_all.yaml @@ -36,7 +36,7 @@ task_nexus_gfs_sfc: datadep_gfs: attrs: age: 00:00:00:05 - text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' + text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' streq: left: retro right: '{% if not workflow.DO_REAL_TIME %}retro{% endif %}' @@ -122,7 +122,7 @@ task_aqm_ics: command: '&LOAD_MODULES_RUN_TASK_FP; "aqm_ics" "&JOBSdir;/JREGIONAL_AQM_ICS"' envars: <<: *default_vars - PREV_CYCLE_DIR: '&COMIN_DIR;' + PREV_CYCLE_DIR: '&COMIN_DIR;' join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' dependency: and: @@ -133,11 +133,11 @@ task_aqm_ics: datadep_date_tag_tracer: attrs: age: 00:00:00:05 - text: '&COMIN_DIR;/RESTART/@Y@m@d.@H@M@S.fv_tracer.res.tile1.nc' + text: '&COMIN_DIR;/RESTART/@Y@m@d.@H@M@S.fv_tracer.res.tile1.nc' datadep_tracer: attrs: age: 00:00:00:05 - text: &COMIN_DIR;/RESTART/fv_tracer.res.tile1.nc + text: &COMIN_DIR;/RESTART/fv_tracer.res.tile1.nc task_aqm_lbcs: <<: *default_aqm @@ -154,9 +154,10 @@ task_pre_post_stat: command: '&LOAD_MODULES_RUN_TASK_FP; "pre_post_stat" "&JOBSdir;/JREGIONAL_PRE_POST_STAT"' join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' dependency: - metataskdep: + datadep: attrs: - metatask: run_post + age: 00:00:00:05 + text: !cycstr '&COMIN_DIR;/post_@Y@m@d@H_task_complete.txt' task_post_stat_o3: <<: *default_aqm diff --git a/parm/wflow/coldstart.yaml b/parm/wflow/coldstart.yaml index aae31a07a7..2c34810f5c 100644 --- a/parm/wflow/coldstart.yaml +++ b/parm/wflow/coldstart.yaml @@ -41,7 +41,7 @@ task_get_extrn_ics: datadep_gfs: attrs: age: 00:00:00:05 - text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' + text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' streq: left: retro right: '{% if not workflow.DO_REAL_TIME %}retro{% endif %}' @@ -68,7 +68,7 @@ task_get_extrn_lbcs: datadep_gfs: attrs: age: 00:00:00:05 - text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' + text: '&COMINgfs;/gfs.@Y@m@d/@H/atmos' streq: left: retro right: '{% if not workflow.DO_REAL_TIME %}retro{% endif %}' diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index d882adbcac..ae37f342f1 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -5,7 +5,7 @@ rocoto: entities: ACCOUNT: '{{ user.ACCOUNT }}' CCPA_OBS_DIR: '{{ platform.CCPA_OBS_DIR }}' - COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H {% else %}{{ nco.COMIN_BASEDIR }}/@Y@m@d@H{% endif %}' + COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H {% else %}{{ workflow.EXPTDIR }}/@Y@m@d@H{% endif %}' COMINgfs: '{{ platform.get("COMINgfs") }}' FCST_DIR: '{{ nco.DATAROOT }}/run_fcst.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' GLOBAL_VAR_DEFNS_FP: '{{ workflow.GLOBAL_VAR_DEFNS_FP }}' @@ -31,7 +31,7 @@ rocoto: WARMSTART_CYCLE_DIR: '{{ workflow.WARMSTART_CYCLE_DIR }}' WORKFLOW_ID: '{{ workflow.WORKFLOW_ID }}' attrs: - cyclethrottle: "20" + cyclethrottle: "200" realtime: "F" scheduler: '{{ platform.SCHED }}' taskthrottle: "1000" diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index 32eb5236e7..ae07bdf423 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -69,7 +69,7 @@ if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} - post_complete_file=${COMIN}/${TN_RUN_POST}_${PDY}${cyc}_task_complete.txt + post_complete_file="${COMIN}/post_${PDY}${cyc}_task_complete.txt" if [ -f ${post_complete_file} ] ; then rm_vrfy -f ${post_complete_file} fi From 54b92500926d9c1d7362d0bf9c03c0f32d338e06 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Sat, 8 Apr 2023 14:06:31 +0000 Subject: [PATCH 08/21] remove wrong space from path to comin dir for nco --- parm/wflow/default_workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index ae37f342f1..b7148ebfe7 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -5,7 +5,7 @@ rocoto: entities: ACCOUNT: '{{ user.ACCOUNT }}' CCPA_OBS_DIR: '{{ platform.CCPA_OBS_DIR }}' - COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H {% else %}{{ workflow.EXPTDIR }}/@Y@m@d@H{% endif %}' + COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H{% else %}{{ workflow.EXPTDIR }}/@Y@m@d@H{% endif %}' COMINgfs: '{{ platform.get("COMINgfs") }}' FCST_DIR: '{{ nco.DATAROOT }}/run_fcst.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' GLOBAL_VAR_DEFNS_FP: '{{ workflow.GLOBAL_VAR_DEFNS_FP }}' From a563c75466d46c215225add3c48b3777b81ca7ca Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Sat, 8 Apr 2023 14:57:00 +0000 Subject: [PATCH 09/21] add comin_dir change for community to setup.py --- parm/wflow/default_workflow.yaml | 2 +- ush/setup.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index b7148ebfe7..f774d1a4ad 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -5,7 +5,7 @@ rocoto: entities: ACCOUNT: '{{ user.ACCOUNT }}' CCPA_OBS_DIR: '{{ platform.CCPA_OBS_DIR }}' - COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H{% else %}{{ workflow.EXPTDIR }}/@Y@m@d@H{% endif %}' + COMIN_DIR: '{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H' COMINgfs: '{{ platform.get("COMINgfs") }}' FCST_DIR: '{{ nco.DATAROOT }}/run_fcst.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' GLOBAL_VAR_DEFNS_FP: '{{ workflow.GLOBAL_VAR_DEFNS_FP }}' diff --git a/ush/setup.py b/ush/setup.py index 5b8c59847c..f3bf7302a6 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -1129,8 +1129,9 @@ def get_location(xcs, fmt, expt_cfg): for nco_var in nco_vars: nco_config[nco_var.upper()] = exptdir - # Set the rocoto string for the fcst output location + # Set the rocoto string for the fcst output location and comin directory rocoto_config["entities"]["FCST_DIR"] = "{{ nco.COMOUT_BASEDIR }}/@Y@m@d@H" + rocoto_config["entities"]["COMIN_DIR"] = "{{ nco.COMIN_BASEDIR }}/@Y@m@d@H" # Use env variables for NCO variables and create NCO directories if run_envir == "nco": From 34bffb95fba568aee951556dee8cdc8e36457bc7 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 10 Apr 2023 11:09:24 +0000 Subject: [PATCH 10/21] fix tmp dir name issue of run_post in nco mode --- scripts/exregional_run_post.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/exregional_run_post.sh b/scripts/exregional_run_post.sh index de2f3edef4..677b40e493 100755 --- a/scripts/exregional_run_post.sh +++ b/scripts/exregional_run_post.sh @@ -62,6 +62,7 @@ export OMP_STACKSIZE=${OMP_STACKSIZE_RUN_POST} # #----------------------------------------------------------------------- # +set -x eval ${PRE_TASK_CMDS} if [ -z "${RUN_CMD_POST:-}" ] ; then @@ -166,7 +167,7 @@ fi # Set the names of the forecast model's write-component output files. # if [ "${RUN_ENVIR}" = "nco" ]; then - DATAFCST=$DATAROOT/run_fcst${dot_ensmem/./_}.${share_pid} + DATAFCST=$DATAROOT/run_fcst_mem${ENSMEM_INDX}.${share_pid} else DATAFCST=$DATA fi From 715883a6d1ddf93f40c60cdc01f0ce5569937f83 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 10 Apr 2023 11:33:54 +0000 Subject: [PATCH 11/21] mv complete flag to end of pre_post_stat --- jobs/JREGIONAL_PRE_POST_STAT | 11 +++++++++++ scripts/exregional_aqm_lbcs.sh | 1 - scripts/exregional_pre_post_stat.sh | 5 ----- scripts/exregional_run_post.sh | 1 - 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/jobs/JREGIONAL_PRE_POST_STAT b/jobs/JREGIONAL_PRE_POST_STAT index 7d80d3e5eb..7611c6bd60 100755 --- a/jobs/JREGIONAL_PRE_POST_STAT +++ b/jobs/JREGIONAL_PRE_POST_STAT @@ -83,6 +83,17 @@ job_postamble # #----------------------------------------------------------------------- # +# Remove post_complete flag file. +# +#----------------------------------------------------------------------- +# +post_complete_file="${COMIN}/post_${PDY}${cyc}_task_complete.txt" +if [ -f ${post_complete_file} ] ; then + rm_vrfy -f ${post_complete_file} +fi +# +#----------------------------------------------------------------------- +# # Restore the shell options saved at the beginning of this script/func- # tion. # diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index fcc2382a7a..05b8650c8d 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -70,7 +70,6 @@ else print_info_msg "$VERBOSE" " All executables will be submitted with command \'${RUN_CMD_AQMLBC}\'." fi -set -x # #----------------------------------------------------------------------- # diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index ae07bdf423..e4914a4a6c 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -68,11 +68,6 @@ if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} - - post_complete_file="${COMIN}/post_${PDY}${cyc}_task_complete.txt" - if [ -f ${post_complete_file} ] ; then - rm_vrfy -f ${post_complete_file} - fi fi ist=1 diff --git a/scripts/exregional_run_post.sh b/scripts/exregional_run_post.sh index 677b40e493..3e1494822f 100755 --- a/scripts/exregional_run_post.sh +++ b/scripts/exregional_run_post.sh @@ -62,7 +62,6 @@ export OMP_STACKSIZE=${OMP_STACKSIZE_RUN_POST} # #----------------------------------------------------------------------- # -set -x eval ${PRE_TASK_CMDS} if [ -z "${RUN_CMD_POST:-}" ] ; then From 4b4ec26bed224efcf6337a27f15f486613fcb156 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 10 Apr 2023 13:32:34 +0000 Subject: [PATCH 12/21] fix wrong FCST_DIR in nco mode --- parm/wflow/default_workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index f774d1a4ad..0b3ba8868a 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -7,7 +7,7 @@ rocoto: CCPA_OBS_DIR: '{{ platform.CCPA_OBS_DIR }}' COMIN_DIR: '{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H' COMINgfs: '{{ platform.get("COMINgfs") }}' - FCST_DIR: '{{ nco.DATAROOT }}/run_fcst.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' + FCST_DIR: '{{ nco.DATAROOT }}/run_fcst_mem#mem#.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' GLOBAL_VAR_DEFNS_FP: '{{ workflow.GLOBAL_VAR_DEFNS_FP }}' JOBSdir: '{{ user.JOBSdir }}' LOAD_MODULES_RUN_TASK_FP: '{{ workflow.LOAD_MODULES_RUN_TASK_FP }}' From 58e61e4336f7c0d89dda948bc46d9c5366e72df7 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 10 Apr 2023 16:02:42 +0000 Subject: [PATCH 13/21] add tpp to machine file for bias-correction on wcoss2 --- ush/machine/wcoss2.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ush/machine/wcoss2.yaml b/ush/machine/wcoss2.yaml index 595b387451..b75c95c658 100644 --- a/ush/machine/wcoss2.yaml +++ b/ush/machine/wcoss2.yaml @@ -73,3 +73,7 @@ rocoto: nodes: '{{ nnodes }}:ppn={{ ppn }}:tpp={{ task_nexus_emission.OMP_NUM_THREADS_NEXUS_EMISSION }}' task_fire_emission: native: + task_bias_correction_o3: + nodes: '{{ nnodes }}:ppn={{ ppn }}:tpp={{ task_bias_correction_o3.OMP_NUM_THREADS_BIAS_CORRECTION_O3 }}' + task_bias_correction_pm25: + nodes: '{{ nnodes }}:ppn={{ ppn }}:tpp={{ task_bias_correction_pm25.OMP_NUM_THREADS_BIAS_CORRECTION_PM25 }}' From 4a18dbc50d818602d9b3e7a3b76e5bac3ff123ab Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 10 Apr 2023 20:22:46 +0000 Subject: [PATCH 14/21] modify run_post dependency --- jobs/JREGIONAL_RUN_POST | 9 +++++---- parm/wflow/aqm_all.yaml | 12 ++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/jobs/JREGIONAL_RUN_POST b/jobs/JREGIONAL_RUN_POST index cb6f00ac1d..ae0e6ca97b 100755 --- a/jobs/JREGIONAL_RUN_POST +++ b/jobs/JREGIONAL_RUN_POST @@ -142,10 +142,11 @@ if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} -fi -fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" ) -if [ "${fhr}" = "${fcst_len_hrs}" ]; then - touch "${COMIN}/post_${PDY}${cyc}_task_complete.txt" + + fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" ) + if [ "${fhr}" = "${fcst_len_hrs}" ]; then + touch "${COMIN}/post_${PDY}${cyc}_task_complete.txt" + fi fi # #----------------------------------------------------------------------- diff --git a/parm/wflow/aqm_all.yaml b/parm/wflow/aqm_all.yaml index e14399c426..39dd7c9dfe 100644 --- a/parm/wflow/aqm_all.yaml +++ b/parm/wflow/aqm_all.yaml @@ -154,10 +154,14 @@ task_pre_post_stat: command: '&LOAD_MODULES_RUN_TASK_FP; "pre_post_stat" "&JOBSdir;/JREGIONAL_PRE_POST_STAT"' join: !cycstr '&LOGDIR;/{{ jobname }}_@Y@m@d@H&LOGEXT;' dependency: - datadep: - attrs: - age: 00:00:00:05 - text: !cycstr '&COMIN_DIR;/post_@Y@m@d@H_task_complete.txt' + or: + datadep: + attrs: + age: 00:00:00:05 + text: !cycstr '&COMIN_DIR;/post_@Y@m@d@H_task_complete.txt' + metataskdep: + attrs: + metatask: run_ens_post task_post_stat_o3: <<: *default_aqm From 02be7bb7a1425762279a22e921005646bfe673f5 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Sun, 16 Apr 2023 18:43:16 +0000 Subject: [PATCH 15/21] remove num_fcst_len_cycl --- etc/lmod-setup.csh | 7 ++++++- etc/lmod-setup.sh | 19 ++++++++++++------- jobs/JREGIONAL_RUN_POST | 4 ++-- scripts/exregional_aqm_lbcs.sh | 3 ++- scripts/exregional_bias_correction_o3.sh | 3 ++- scripts/exregional_bias_correction_pm25.sh | 4 ++-- scripts/exregional_get_extrn_mdl_files.sh | 4 +++- scripts/exregional_make_lbcs.sh | 3 ++- scripts/exregional_nexus_emission.sh | 3 ++- scripts/exregional_nexus_gfs_sfc.sh | 3 ++- scripts/exregional_nexus_post_split.sh | 3 ++- scripts/exregional_point_source.sh | 3 ++- scripts/exregional_post_stat_o3.sh | 3 ++- scripts/exregional_pre_post_stat.sh | 3 ++- scripts/exregional_run_fcst.sh | 3 ++- ush/config_defaults.yaml | 1 - ush/setup.py | 3 --- 17 files changed, 45 insertions(+), 27 deletions(-) diff --git a/etc/lmod-setup.csh b/etc/lmod-setup.csh index 69cffe5e12..0cdac9b440 100644 --- a/etc/lmod-setup.csh +++ b/etc/lmod-setup.csh @@ -13,7 +13,9 @@ else set L_MACHINE=$1 endif -source /etc/csh.login +if ( "$L_MACHINE" != wcoss2 ) then + source /etc/csh.login +endif if ( "$L_MACHINE" == macos ) then arch=$(uname -m) @@ -53,6 +55,9 @@ else if ( "$L_MACHINE" == odin ) then module --initial_load --no_redirect restore setenv MODULEPATH "/oldscratch/ywang/external/hpc-stack/modulefiles/mpi/intel/2020/cray-mpich/7.7.16:/oldscratch/ywang/external/hpc-stack/modulefiles/compiler/intel/2020:/oldscratch/ywang/external/hpc-stack/modulefiles/core:/oldscratch/ywang/external/hpc-stack/modulefiles/stack:/opt/cray/pe/perftools/21.02.0/modulefiles:/opt/cray/ari/modulefiles:/opt/cray/pe/craype-targets/default/modulefiles:/opt/cray/pe/modulefiles:/opt/cray/modulefiles:/opt/modulefiles" +elif ( "$L_MACHINE" = wcoss2 ) then + module reset + else module purge endif diff --git a/etc/lmod-setup.sh b/etc/lmod-setup.sh index 50979f7dbd..9c330d910c 100644 --- a/etc/lmod-setup.sh +++ b/etc/lmod-setup.sh @@ -14,13 +14,15 @@ else L_MACHINE=$1 fi -[[ ${SHELLOPTS} =~ nounset ]] && has_mu=true || has_mu=false -[[ ${SHELLOPTS} =~ errexit ]] && has_me=true || has_me=false -$has_mu && set +u -$has_me && set +e -source /etc/profile -$has_mu && set -u -$has_me && set -e +if [ "$L_MACHINE" != wcoss2 ]; then + [[ ${SHELLOPTS} =~ nounset ]] && has_mu=true || has_mu=false + [[ ${SHELLOPTS} =~ errexit ]] && has_me=true || has_me=false + $has_mu && set +u + $has_me && set +e + source /etc/profile + $has_mu && set -u + $has_me && set -e +fi if [ "$L_MACHINE" = macos ]; then arch=$(uname -m) @@ -56,6 +58,9 @@ elif [ "$L_MACHINE" = odin ]; then module --initial_load --no_redirect restore export MODULEPATH="/oldscratch/ywang/external/hpc-stack/modulefiles/mpi/intel/2020/cray-mpich/7.7.16:/oldscratch/ywang/external/hpc-stack/modulefiles/compiler/intel/2020:/oldscratch/ywang/external/hpc-stack/modulefiles/core:/oldscratch/ywang/external/hpc-stack/modulefiles/stack:/opt/cray/pe/perftools/21.02.0/modulefiles:/opt/cray/ari/modulefiles:/opt/cray/pe/craype-targets/default/modulefiles:/opt/cray/pe/modulefiles:/opt/cray/modulefiles:/opt/modulefiles" +elif [ "$L_MACHINE" = wcoss2 ]; then + module reset + else module purge fi diff --git a/jobs/JREGIONAL_RUN_POST b/jobs/JREGIONAL_RUN_POST index ae0e6ca97b..25c2f88c64 100755 --- a/jobs/JREGIONAL_RUN_POST +++ b/jobs/JREGIONAL_RUN_POST @@ -8,7 +8,7 @@ # #----------------------------------------------------------------------- # - +set -x # #----------------------------------------------------------------------- # @@ -138,7 +138,7 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed." # #----------------------------------------------------------------------- # -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index 05b8650c8d..6e705e614b 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -92,7 +93,7 @@ yyyymmdd=${CDATE_MOD:0:8} mm="${CDATE_MOD:4:2}" hh="${CDATE_MOD:8:2}" -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_bias_correction_o3.sh b/scripts/exregional_bias_correction_o3.sh index 083d031f02..b5ec0bf1fa 100755 --- a/scripts/exregional_bias_correction_o3.sh +++ b/scripts/exregional_bias_correction_o3.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -105,7 +106,7 @@ if [ "${PREDEF_GRID_NAME}" = "AQM_NA_13km" ]; then id_domain=793 fi -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_bias_correction_pm25.sh b/scripts/exregional_bias_correction_pm25.sh index 8723235fd1..2e49e9554b 100755 --- a/scripts/exregional_bias_correction_pm25.sh +++ b/scripts/exregional_bias_correction_pm25.sh @@ -104,13 +104,13 @@ yyyymm_m3=${PDYm3:0:6} if [ "${PREDEF_GRID_NAME}" = "AQM_NA_13km" ]; then id_domain=793 fi -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} fi - #----------------------------------------------------------------------------- # STEP 1: Retrieve AIRNOW observation data #----------------------------------------------------------------------------- diff --git a/scripts/exregional_get_extrn_mdl_files.sh b/scripts/exregional_get_extrn_mdl_files.sh index 5aa32127d9..a10607701a 100755 --- a/scripts/exregional_get_extrn_mdl_files.sh +++ b/scripts/exregional_get_extrn_mdl_files.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -70,7 +71,8 @@ if [ "${ICS_OR_LBCS}" = "ICS" ]; then elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then file_set="fcst" first_time=$((TIME_OFFSET_HRS + LBC_SPEC_INTVL_HRS)) - if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then + + if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index 92d6ec3dc9..fc70aa7a72 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -100,7 +101,7 @@ DATA="${DATA}/tmp_LBCS" mkdir_vrfy -p "$DATA" cd_vrfy $DATA -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_nexus_emission.sh b/scripts/exregional_nexus_emission.sh index 17c0abb048..26b09ccf61 100755 --- a/scripts/exregional_nexus_emission.sh +++ b/scripts/exregional_nexus_emission.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -132,7 +133,7 @@ yyyymmdd="${PDY}" NUM_SPLIT_NEXUS=$( printf "%02d" ${NUM_SPLIT_NEXUS} ) -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index 9658d2a448..96efd527f5 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -63,7 +64,7 @@ yyyymm=${GFS_SFC_CDATE:0:6} yyyy=${GFS_SFC_CDATE:0:4} hh=${GFS_SFC_CDATE:8:2} -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_nexus_post_split.sh b/scripts/exregional_nexus_post_split.sh index 252813ed6e..0cea87b5b5 100755 --- a/scripts/exregional_nexus_post_split.sh +++ b/scripts/exregional_nexus_post_split.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -71,7 +72,7 @@ yyyymmdd="${PDY}" NUM_SPLIT_NEXUS=$( printf "%02d" ${NUM_SPLIT_NEXUS} ) -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_point_source.sh b/scripts/exregional_point_source.sh index f3e5eeee63..0c6b295855 100755 --- a/scripts/exregional_point_source.sh +++ b/scripts/exregional_point_source.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -53,7 +54,7 @@ This is the ex-script for the task that runs PT_SOURCE. # eval ${PRE_TASK_CMDS} -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_post_stat_o3.sh b/scripts/exregional_post_stat_o3.sh index 8228a3c991..bf55e59eaa 100755 --- a/scripts/exregional_post_stat_o3.sh +++ b/scripts/exregional_post_stat_o3.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -102,7 +103,7 @@ eval ${RUN_CMD_SERIAL} ${EXECdir}/aqm_post_grib2 ${PDY} ${cyc} ${REDIRECT_OUT_ER Call to executable to run AQM_POST_GRIB2 returned with nonzero exit code." POST_STEP -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index e4914a4a6c..e3bed8f27e 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -64,7 +65,7 @@ rm_vrfy -r $DATA mkdir_vrfy -p "$DATA" cd_vrfy $DATA -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 98cfa1f577..756011608d 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -1,5 +1,6 @@ #!/bin/bash +set -x # #----------------------------------------------------------------------- # @@ -79,7 +80,7 @@ else All executables will be submitted with command \'${RUN_CMD_FCST}\'." fi -if [ "${NUM_FCST_LEN_CYCL}" -gt "1" ]; then +if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then cyc_mod=$(( ${cyc} - ${DATE_FIRST_CYCL:8:2} )) CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} )) FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]} diff --git a/ush/config_defaults.yaml b/ush/config_defaults.yaml index 95aeb31b55..4532bc66cc 100644 --- a/ush/config_defaults.yaml +++ b/ush/config_defaults.yaml @@ -857,7 +857,6 @@ workflow: FCST_LEN_HRS: 24 FCST_LEN_CYCL: - '{{ FCST_LEN_HRS }}' - NUM_FCST_LEN_CYCL: 1 LONG_FCST_LEN: '{% if FCST_LEN_HRS < 0 %}{{ FCST_LEN_CYCL|max }}{% else %}{{ FCST_LEN_HRS }}{% endif %}' # diff --git a/ush/setup.py b/ush/setup.py index f3bf7302a6..1bbe64b850 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -711,9 +711,6 @@ def get_location(xcs, fmt, expt_cfg): # Reset the hours to the short forecast length workflow_config["FCST_LEN_HRS"] = min(fcst_len_cycl) - # Reset the number of the forecast length cycles - workflow_config["NUM_FCST_LEN_CYCL"] = len(fcst_len_cycl) - # Find the entries that match the long forecast, and map them to # their time of day. long_fcst_len = max(fcst_len_cycl) From 777609435e58a79aeaa95b025773a5b02ff36c36 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Sun, 16 Apr 2023 18:46:03 +0000 Subject: [PATCH 16/21] fix typo --- etc/lmod-setup.csh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/lmod-setup.csh b/etc/lmod-setup.csh index 0cdac9b440..ee7ed10603 100644 --- a/etc/lmod-setup.csh +++ b/etc/lmod-setup.csh @@ -55,7 +55,7 @@ else if ( "$L_MACHINE" == odin ) then module --initial_load --no_redirect restore setenv MODULEPATH "/oldscratch/ywang/external/hpc-stack/modulefiles/mpi/intel/2020/cray-mpich/7.7.16:/oldscratch/ywang/external/hpc-stack/modulefiles/compiler/intel/2020:/oldscratch/ywang/external/hpc-stack/modulefiles/core:/oldscratch/ywang/external/hpc-stack/modulefiles/stack:/opt/cray/pe/perftools/21.02.0/modulefiles:/opt/cray/ari/modulefiles:/opt/cray/pe/craype-targets/default/modulefiles:/opt/cray/pe/modulefiles:/opt/cray/modulefiles:/opt/modulefiles" -elif ( "$L_MACHINE" = wcoss2 ) then +else if ( "$L_MACHINE" = wcoss2 ) then module reset else From 5314fb7cff1206730120f95dceb61b1ea6fc77c2 Mon Sep 17 00:00:00 2001 From: "Chan-hoo.Jeon" Date: Sun, 16 Apr 2023 18:59:57 +0000 Subject: [PATCH 17/21] move set -x in scripts --- scripts/exregional_aqm_lbcs.sh | 2 +- scripts/exregional_bias_correction_o3.sh | 2 +- scripts/exregional_get_extrn_mdl_files.sh | 2 +- scripts/exregional_make_lbcs.sh | 2 +- scripts/exregional_nexus_emission.sh | 2 +- scripts/exregional_nexus_gfs_sfc.sh | 2 +- scripts/exregional_nexus_post_split.sh | 2 +- scripts/exregional_point_source.sh | 2 +- scripts/exregional_post_stat_o3.sh | 2 +- scripts/exregional_pre_post_stat.sh | 2 +- scripts/exregional_run_fcst.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index 6e705e614b..9454bcb042 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -51,6 +50,7 @@ lateral boundary conditions. # #----------------------------------------------------------------------- # +set -x export KMP_AFFINITY=${KMP_AFFINITY_MAKE_LBCS} export OMP_NUM_THREADS=${OMP_NUM_THREADS_MAKE_LBCS} export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} diff --git a/scripts/exregional_bias_correction_o3.sh b/scripts/exregional_bias_correction_o3.sh index b5ec0bf1fa..2b226520d3 100755 --- a/scripts/exregional_bias_correction_o3.sh +++ b/scripts/exregional_bias_correction_o3.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -51,6 +50,7 @@ This is the ex-script for the task that runs BIAS-CORRECTION-O3. # #----------------------------------------------------------------------- # +set -x export KMP_AFFINITY=${KMP_AFFINITY_BIAS_CORRECTION_O3} export OMP_NUM_THREADS=${OMP_NUM_THREADS_BIAS_CORRECTION_O3} export OMP_STACKSIZE=${OMP_STACKSIZE_BIAS_CORRECTION_O3} diff --git a/scripts/exregional_get_extrn_mdl_files.sh b/scripts/exregional_get_extrn_mdl_files.sh index a10607701a..646b8d4e89 100755 --- a/scripts/exregional_get_extrn_mdl_files.sh +++ b/scripts/exregional_get_extrn_mdl_files.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -55,6 +54,7 @@ or lateral boundary conditions for the FV3. # #----------------------------------------------------------------------- # +set -x if [ "${ICS_OR_LBCS}" = "ICS" ]; then if [ ${TIME_OFFSET_HRS} -eq 0 ] ; then file_set="anl" diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index fc70aa7a72..0fb218a213 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -54,6 +53,7 @@ hour zero). # #----------------------------------------------------------------------- # +set -x export KMP_AFFINITY=${KMP_AFFINITY_MAKE_LBCS} export OMP_NUM_THREADS=${OMP_NUM_THREADS_MAKE_LBCS} export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} diff --git a/scripts/exregional_nexus_emission.sh b/scripts/exregional_nexus_emission.sh index 26b09ccf61..a1aeddeefb 100755 --- a/scripts/exregional_nexus_emission.sh +++ b/scripts/exregional_nexus_emission.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -52,6 +51,7 @@ This is the ex-script for the task that runs NEXUS. # #----------------------------------------------------------------------- # +set -x export KMP_AFFINITY=${KMP_AFFINITY_NEXUS_EMISSION} export OMP_NUM_THREADS=${OMP_NUM_THREADS_NEXUS_EMISSION} export OMP_STACKSIZE=${OMP_STACKSIZE_NEXUS_EMISSION} diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index 96efd527f5..5e71e69f3b 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -49,6 +48,7 @@ data files from disk or HPSS. # #----------------------------------------------------------------------- # +set -x DATA="${DATA}/tmp_GFS_SFC" mkdir_vrfy -p "$DATA" cd_vrfy $DATA diff --git a/scripts/exregional_nexus_post_split.sh b/scripts/exregional_nexus_post_split.sh index 0cea87b5b5..4a17069363 100755 --- a/scripts/exregional_nexus_post_split.sh +++ b/scripts/exregional_nexus_post_split.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -52,6 +51,7 @@ This is the ex-script for the task that runs NEXUS. # #----------------------------------------------------------------------- # +set -x eval ${PRE_TASK_CMDS} # #----------------------------------------------------------------------- diff --git a/scripts/exregional_point_source.sh b/scripts/exregional_point_source.sh index 0c6b295855..b7f2ce8b99 100755 --- a/scripts/exregional_point_source.sh +++ b/scripts/exregional_point_source.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -52,6 +51,7 @@ This is the ex-script for the task that runs PT_SOURCE. # #----------------------------------------------------------------------- # +set -x eval ${PRE_TASK_CMDS} if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then diff --git a/scripts/exregional_post_stat_o3.sh b/scripts/exregional_post_stat_o3.sh index bf55e59eaa..da47ff630c 100755 --- a/scripts/exregional_post_stat_o3.sh +++ b/scripts/exregional_post_stat_o3.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -52,6 +51,7 @@ This is the ex-script for the task that runs POST-STAT-O3. # #----------------------------------------------------------------------- # +set -x eval ${PRE_TASK_CMDS} if [ -z "${RUN_CMD_SERIAL:-}" ] ; then diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index e3bed8f27e..91b3756578 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -52,6 +51,7 @@ This is the ex-script for the task that runs POST-UPP-STAT. # #----------------------------------------------------------------------- # +set -x eval ${PRE_TASK_CMDS} # #----------------------------------------------------------------------- diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 756011608d..71fcfb9a8b 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -x # #----------------------------------------------------------------------- # @@ -53,6 +52,7 @@ specified cycle. # #----------------------------------------------------------------------- # +set -x export KMP_AFFINITY=${KMP_AFFINITY_RUN_FCST} export OMP_NUM_THREADS=${OMP_NUM_THREADS_RUN_FCST} export OMP_STACKSIZE=${OMP_STACKSIZE_RUN_FCST} From 5301a5a9f4ff5fbd10eb13ff76b89190a137cf56 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Tue, 18 Apr 2023 16:34:03 +0000 Subject: [PATCH 18/21] remove set -x from scripts --- scripts/exregional_aqm_lbcs.sh | 1 - scripts/exregional_bias_correction_o3.sh | 1 - scripts/exregional_get_extrn_mdl_files.sh | 1 - scripts/exregional_make_lbcs.sh | 1 - scripts/exregional_nexus_emission.sh | 1 - scripts/exregional_nexus_gfs_sfc.sh | 1 - scripts/exregional_nexus_post_split.sh | 1 - scripts/exregional_point_source.sh | 1 - scripts/exregional_post_stat_o3.sh | 1 - scripts/exregional_pre_post_stat.sh | 1 - scripts/exregional_run_fcst.sh | 1 - scripts/exregional_run_met_ensemblestat_vx_grid.sh | 1 - scripts/exregional_run_met_gridstat_vx.sh | 1 - scripts/exregional_run_met_pointstat_vx.sh | 1 - 14 files changed, 14 deletions(-) diff --git a/scripts/exregional_aqm_lbcs.sh b/scripts/exregional_aqm_lbcs.sh index 9454bcb042..ccf09f52e2 100755 --- a/scripts/exregional_aqm_lbcs.sh +++ b/scripts/exregional_aqm_lbcs.sh @@ -50,7 +50,6 @@ lateral boundary conditions. # #----------------------------------------------------------------------- # -set -x export KMP_AFFINITY=${KMP_AFFINITY_MAKE_LBCS} export OMP_NUM_THREADS=${OMP_NUM_THREADS_MAKE_LBCS} export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} diff --git a/scripts/exregional_bias_correction_o3.sh b/scripts/exregional_bias_correction_o3.sh index 2b226520d3..82a099066f 100755 --- a/scripts/exregional_bias_correction_o3.sh +++ b/scripts/exregional_bias_correction_o3.sh @@ -50,7 +50,6 @@ This is the ex-script for the task that runs BIAS-CORRECTION-O3. # #----------------------------------------------------------------------- # -set -x export KMP_AFFINITY=${KMP_AFFINITY_BIAS_CORRECTION_O3} export OMP_NUM_THREADS=${OMP_NUM_THREADS_BIAS_CORRECTION_O3} export OMP_STACKSIZE=${OMP_STACKSIZE_BIAS_CORRECTION_O3} diff --git a/scripts/exregional_get_extrn_mdl_files.sh b/scripts/exregional_get_extrn_mdl_files.sh index 646b8d4e89..4be9381eaa 100755 --- a/scripts/exregional_get_extrn_mdl_files.sh +++ b/scripts/exregional_get_extrn_mdl_files.sh @@ -54,7 +54,6 @@ or lateral boundary conditions for the FV3. # #----------------------------------------------------------------------- # -set -x if [ "${ICS_OR_LBCS}" = "ICS" ]; then if [ ${TIME_OFFSET_HRS} -eq 0 ] ; then file_set="anl" diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index 0fb218a213..1183fb582e 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -53,7 +53,6 @@ hour zero). # #----------------------------------------------------------------------- # -set -x export KMP_AFFINITY=${KMP_AFFINITY_MAKE_LBCS} export OMP_NUM_THREADS=${OMP_NUM_THREADS_MAKE_LBCS} export OMP_STACKSIZE=${OMP_STACKSIZE_MAKE_LBCS} diff --git a/scripts/exregional_nexus_emission.sh b/scripts/exregional_nexus_emission.sh index a1aeddeefb..2c9915f304 100755 --- a/scripts/exregional_nexus_emission.sh +++ b/scripts/exregional_nexus_emission.sh @@ -51,7 +51,6 @@ This is the ex-script for the task that runs NEXUS. # #----------------------------------------------------------------------- # -set -x export KMP_AFFINITY=${KMP_AFFINITY_NEXUS_EMISSION} export OMP_NUM_THREADS=${OMP_NUM_THREADS_NEXUS_EMISSION} export OMP_STACKSIZE=${OMP_STACKSIZE_NEXUS_EMISSION} diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index 5e71e69f3b..cb6f35e76f 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -48,7 +48,6 @@ data files from disk or HPSS. # #----------------------------------------------------------------------- # -set -x DATA="${DATA}/tmp_GFS_SFC" mkdir_vrfy -p "$DATA" cd_vrfy $DATA diff --git a/scripts/exregional_nexus_post_split.sh b/scripts/exregional_nexus_post_split.sh index 4a17069363..054b825d0c 100755 --- a/scripts/exregional_nexus_post_split.sh +++ b/scripts/exregional_nexus_post_split.sh @@ -51,7 +51,6 @@ This is the ex-script for the task that runs NEXUS. # #----------------------------------------------------------------------- # -set -x eval ${PRE_TASK_CMDS} # #----------------------------------------------------------------------- diff --git a/scripts/exregional_point_source.sh b/scripts/exregional_point_source.sh index b7f2ce8b99..a3be0256c4 100755 --- a/scripts/exregional_point_source.sh +++ b/scripts/exregional_point_source.sh @@ -51,7 +51,6 @@ This is the ex-script for the task that runs PT_SOURCE. # #----------------------------------------------------------------------- # -set -x eval ${PRE_TASK_CMDS} if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then diff --git a/scripts/exregional_post_stat_o3.sh b/scripts/exregional_post_stat_o3.sh index da47ff630c..555d43b82a 100755 --- a/scripts/exregional_post_stat_o3.sh +++ b/scripts/exregional_post_stat_o3.sh @@ -51,7 +51,6 @@ This is the ex-script for the task that runs POST-STAT-O3. # #----------------------------------------------------------------------- # -set -x eval ${PRE_TASK_CMDS} if [ -z "${RUN_CMD_SERIAL:-}" ] ; then diff --git a/scripts/exregional_pre_post_stat.sh b/scripts/exregional_pre_post_stat.sh index 91b3756578..a78ce9e2f5 100755 --- a/scripts/exregional_pre_post_stat.sh +++ b/scripts/exregional_pre_post_stat.sh @@ -51,7 +51,6 @@ This is the ex-script for the task that runs POST-UPP-STAT. # #----------------------------------------------------------------------- # -set -x eval ${PRE_TASK_CMDS} # #----------------------------------------------------------------------- diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 71fcfb9a8b..7049b8588e 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -52,7 +52,6 @@ specified cycle. # #----------------------------------------------------------------------- # -set -x export KMP_AFFINITY=${KMP_AFFINITY_RUN_FCST} export OMP_NUM_THREADS=${OMP_NUM_THREADS_RUN_FCST} export OMP_STACKSIZE=${OMP_STACKSIZE_RUN_FCST} diff --git a/scripts/exregional_run_met_ensemblestat_vx_grid.sh b/scripts/exregional_run_met_ensemblestat_vx_grid.sh index 9191bb7a0b..dc6e489798 100755 --- a/scripts/exregional_run_met_ensemblestat_vx_grid.sh +++ b/scripts/exregional_run_met_ensemblestat_vx_grid.sh @@ -54,7 +54,6 @@ gridded data. #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" "Starting ensemble-stat verification" -set -x # #----------------------------------------------------------------------- # diff --git a/scripts/exregional_run_met_gridstat_vx.sh b/scripts/exregional_run_met_gridstat_vx.sh index 5ff8c3031f..af46454b92 100755 --- a/scripts/exregional_run_met_gridstat_vx.sh +++ b/scripts/exregional_run_met_gridstat_vx.sh @@ -55,7 +55,6 @@ the UPP output files by initialization time for all forecast hours. # #----------------------------------------------------------------------- # -set -x yyyymmdd=${PDY} hh=${cyc} export CDATE diff --git a/scripts/exregional_run_met_pointstat_vx.sh b/scripts/exregional_run_met_pointstat_vx.sh index c852248553..5db4511da0 100755 --- a/scripts/exregional_run_met_pointstat_vx.sh +++ b/scripts/exregional_run_met_pointstat_vx.sh @@ -64,7 +64,6 @@ the UPP output files by initialization time for all forecast hours. # #----------------------------------------------------------------------- # -set -x yyyymmdd=${PDY} hh=${cyc} export CDATE From 296fedb92ccdc20312391fe1dac0646741ab8bf7 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Tue, 18 Apr 2023 16:36:09 +0000 Subject: [PATCH 19/21] remove set -x from j-job --- jobs/JREGIONAL_RUN_POST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/JREGIONAL_RUN_POST b/jobs/JREGIONAL_RUN_POST index 25c2f88c64..ef783f34da 100755 --- a/jobs/JREGIONAL_RUN_POST +++ b/jobs/JREGIONAL_RUN_POST @@ -8,7 +8,7 @@ # #----------------------------------------------------------------------- # -set -x + # #----------------------------------------------------------------------- # From bca23d9489568df40dc48c1051e696e268ea090b Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Thu, 20 Apr 2023 18:55:00 +0000 Subject: [PATCH 20/21] move defs to yaml --- parm/wflow/default_workflow.yaml | 6 ++++-- scripts/exregional_nexus_gfs_sfc.sh | 4 ++-- ush/setup.py | 24 ------------------------ 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index 0b3ba8868a..72aa97831d 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -5,9 +5,9 @@ rocoto: entities: ACCOUNT: '{{ user.ACCOUNT }}' CCPA_OBS_DIR: '{{ platform.CCPA_OBS_DIR }}' - COMIN_DIR: '{{ nco.COMIN_BASEDIR }}/{{ nco.RUN }}.@Y@m@d/@H' + COMIN_DIR: '{% if user.RUN_ENVIR == "nco" %}{{"{}/{}.@Y@m@d/@H".format(nco.COMIN_BASEDIR,nco.RUN)}}{% else %}{{"{}/@Y@m@d@H".format(workflow.EXPTDIR)}}{% endif %}' COMINgfs: '{{ platform.get("COMINgfs") }}' - FCST_DIR: '{{ nco.DATAROOT }}/run_fcst_mem#mem#.{{ workflow.WORKFLOW_ID }}_@Y@m@d@H' + FCST_DIR: '{% if user.RUN_ENVIR == "nco" %}{{"{}/run_fcst_mem#mem#.{}_@Y@m@d@H".format(nco.DATAROOT,workflow.WORKFLOW_ID)}}{% else %}{{"{}/@Y@m@d@H".format(workflow.EXPTDIR)}}{% endif %}' GLOBAL_VAR_DEFNS_FP: '{{ workflow.GLOBAL_VAR_DEFNS_FP }}' JOBSdir: '{{ user.JOBSdir }}' LOAD_MODULES_RUN_TASK_FP: '{{ workflow.LOAD_MODULES_RUN_TASK_FP }}' @@ -40,6 +40,8 @@ rocoto: - !startstopfreq ['{{workflow.DATE_FIRST_CYCL}}', '{{workflow.DATE_FIRST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] forecast: - !startstopfreq ['{{workflow.DATE_FIRST_CYCL}}', '{{workflow.DATE_LAST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] + cycled_from_second: + - !startstopfreq ['{%- if workflow.DATE_FIRST_CYCL != workflow.DATE_LAST_CYCL %}{{ [workflow.DATE_FIRST_CYCL[0:8], workflow.INCR_CYCL_FREQ]|join }}{%- else %}{{workflow.DATE_FIRST_CYCL}}{%- endif %}', '{{workflow.DATE_LAST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] log: !cycstr '&LOGDIR;/FV3LAM_wflow.{% if user.RUN_ENVIR == "nco" %}{{ workflow.WORKFLOW_ID + "." }}{% endif %}log' tasks: taskgroups: '{{ ["parm/wflow/prep.yaml", "parm/wflow/coldstart.yaml", "parm/wflow/post.yaml"]|include }}' diff --git a/scripts/exregional_nexus_gfs_sfc.sh b/scripts/exregional_nexus_gfs_sfc.sh index cb6f35e76f..46ed3b15ef 100755 --- a/scripts/exregional_nexus_gfs_sfc.sh +++ b/scripts/exregional_nexus_gfs_sfc.sh @@ -154,8 +154,8 @@ else print_err_msg_exit "htar file reading operation (\"htar -xvf ...\") failed." POST_STEP fi - # Move retrieved files to staging directory - mv_vrfy ${DATA}/${GFS_SFC_TAR_SUB_DIR}/gfs.*.nc ${GFS_SFC_STAGING_DIR} + # Link retrieved files to staging directory + ln_vrfy -sf ${GFS_SFC_TAR_SUB_DIR}/gfs.*.nc . fi # diff --git a/ush/setup.py b/ush/setup.py index 1bbe64b850..37cd444e5c 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -8,7 +8,6 @@ import traceback import logging from textwrap import dedent -from datetime import timedelta import yaml @@ -34,7 +33,6 @@ get_ini_value, str_to_list, extend_yaml, - date_to_str, ) from set_cycle_dates import set_cycle_dates @@ -727,24 +725,6 @@ def get_location(xcs, fmt, expt_cfg): rocoto_config['cycledefs']['long_forecast'] = fcst_cdef - # add cycledefs excluding the first cycle for AQM - cpl_aqm = expt_config['cpl_aqm_parm']['CPL_AQM'] - if cpl_aqm: - incr_cycl_freq = int(workflow_config.get("INCR_CYCL_FREQ")) - if date_first_cycl == date_last_cycl: - cycl_next = date_to_str(date_first_cycl, format="%Y%m%d%H") - else: - cycl_next = date_to_str(date_first_cycl + timedelta(hours=incr_cycl_freq), format="%Y%m%d%H") - - first = date_first_cycl.strftime("%Y%m%d%H") - last = date_last_cycl.strftime("%Y%m%d%H") - - cycled_from_second = [] - if cycl_next != first: - cycled_from_second.append(f'{cycl_next}00 {last}00 {incr_cycl_freq}:00:00') - - rocoto_config['cycledefs']['cycled_from_second'] = cycled_from_second - # check the availability of restart intervals for restart capability of forecast do_fcst_restart = fcst_config.get("DO_FCST_RESTART") if do_fcst_restart: @@ -1126,10 +1106,6 @@ def get_location(xcs, fmt, expt_cfg): for nco_var in nco_vars: nco_config[nco_var.upper()] = exptdir - # Set the rocoto string for the fcst output location and comin directory - rocoto_config["entities"]["FCST_DIR"] = "{{ nco.COMOUT_BASEDIR }}/@Y@m@d@H" - rocoto_config["entities"]["COMIN_DIR"] = "{{ nco.COMIN_BASEDIR }}/@Y@m@d@H" - # Use env variables for NCO variables and create NCO directories if run_envir == "nco": From c53cb9e5f5c0858902b54f972eb8f8f06e5fe374 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Thu, 20 Apr 2023 20:27:26 +0000 Subject: [PATCH 21/21] set incr_cycl_freq to 2 digits --- parm/wflow/default_workflow.yaml | 2 +- ush/setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/parm/wflow/default_workflow.yaml b/parm/wflow/default_workflow.yaml index 72aa97831d..c89b221ba8 100644 --- a/parm/wflow/default_workflow.yaml +++ b/parm/wflow/default_workflow.yaml @@ -41,7 +41,7 @@ rocoto: forecast: - !startstopfreq ['{{workflow.DATE_FIRST_CYCL}}', '{{workflow.DATE_LAST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] cycled_from_second: - - !startstopfreq ['{%- if workflow.DATE_FIRST_CYCL != workflow.DATE_LAST_CYCL %}{{ [workflow.DATE_FIRST_CYCL[0:8], workflow.INCR_CYCL_FREQ]|join }}{%- else %}{{workflow.DATE_FIRST_CYCL}}{%- endif %}', '{{workflow.DATE_LAST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] + - !startstopfreq ['{%- if workflow.DATE_FIRST_CYCL != workflow.DATE_LAST_CYCL %}{{ [workflow.DATE_FIRST_CYCL[0:8], "{:02d}".format(workflow.INCR_CYCL_FREQ)]|join }}{%- else %}{{workflow.DATE_FIRST_CYCL}}{%- endif %}', '{{workflow.DATE_LAST_CYCL}}', '{{workflow.INCR_CYCL_FREQ}}'] log: !cycstr '&LOGDIR;/FV3LAM_wflow.{% if user.RUN_ENVIR == "nco" %}{{ workflow.WORKFLOW_ID + "." }}{% endif %}log' tasks: taskgroups: '{{ ["parm/wflow/prep.yaml", "parm/wflow/coldstart.yaml", "parm/wflow/post.yaml"]|include }}' diff --git a/ush/setup.py b/ush/setup.py index 37cd444e5c..b158524ae4 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -672,7 +672,6 @@ def get_location(xcs, fmt, expt_cfg): run_envir = expt_config["user"].get("RUN_ENVIR", "") - fcst_len_hrs = workflow_config.get("FCST_LEN_HRS") date_first_cycl = workflow_config.get("DATE_FIRST_CYCL") date_last_cycl = workflow_config.get("DATE_LAST_CYCL")