Skip to content

Commit

Permalink
[develop] Bring change of production/AQM.v7 back to develop (ufs-comm…
Browse files Browse the repository at this point in the history
…unity#828)

Multiple scripts relevant to AQM are updated to meet the NCO standards and EE2 reviewer's comments based on the production/AQM.v7 branch:
* The NCO variables such as NET, RUN, envir are renamed with the suffix _default meaning the default value. This is because they should be defined in job cards as can be seen in the NCO standards (pp.4, Table 1). In the current rocoto-based workflow, the job cards do not exist (instead, it uses the XML file). Therefore, they can be set in the configuration file and ush/machine/ file. However, for ecFlow, these variables should be replaced with those in the job cards. (The ecFlow option will be added in a separate PR later). This is done in the ush/job_preamble.sh script which is sourced in the J-job scripts.
* NCO wants to define COMIN/COMOUT, COMINmodel, DATAROOT using the compath call available in prod_util.
* NCO does not want to add a new directory (COMINext) to COM. The use of COMINext is removed.
* NCO wants to use the error handling calls such as 'err_chk' and 'err_exit' in 'prod_util' which is available only on WCOSS2.
* NCO uses the YES/NO flags while SRW App uses TRUE/FALSE. To resolve this mismatch, the boolify calls for the NCO variables are added to job_preamble.sh.
* The 'pgmerr' function is added to POST_STEP.
* The forecast hour in some output file names is changed to 3 digit.
* The working directory DATA is defined and created in job_preamble.sh for the NCO mode. Therefore, if-statement for the 'community' mode is added to the J-job scripts.
* The KEEPDATA capability does not work correctly for the shared tasks
* The input data directories are renamed to DCOMINdata.
  • Loading branch information
chan-hoo authored Jun 29, 2023
1 parent b3e5e0f commit 9b9942f
Show file tree
Hide file tree
Showing 52 changed files with 1,193 additions and 708 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ fix/
include/
lib/
share/
modulefiles/extrn_comp_build/
sorc/*/
tests/WE2E/WE2E_tests_*.yaml
tests/WE2E/*.txt
Expand Down
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protocol = git
repo_url = https://github.com/noaa-oar-arl/NEXUS
# Specify either a branch name or a hash but not both.
#branch = develop
hash = 3842818
hash = 6a7a994
local_path = sorc/arl_nexus
required = True

Expand All @@ -58,7 +58,7 @@ protocol = git
repo_url = https://github.com/NOAA-EMC/AQM-utils
# Specify either a branch name or a hash but not both.
#branch = develop
hash = 0a86f73
hash = 694a139
local_path = sorc/AQM-utils
required = True

Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_AQM_ICS
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_AQM_ICS}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
9 changes: 7 additions & 2 deletions jobs/JREGIONAL_AQM_LBCS
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_AQM_LBCS}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi

#
#-----------------------------------------------------------------------
#
Expand Down
9 changes: 8 additions & 1 deletion jobs/JREGIONAL_BIAS_CORRECTION_O3
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ This is the J-job script for the task that runs BIAS-CORRECTION-O3.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_BIAS_CORRECTION_O3}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi

mkdir_vrfy -p ${COMOUTwmo}

export PARMaqm_utils="${PARMaqm_utils:-${HOMEdir}/sorc/AQM-utils/parm}"

Expand Down
9 changes: 8 additions & 1 deletion jobs/JREGIONAL_BIAS_CORRECTION_PM25
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ This is the J-job script for the task that runs BIAS-CORRECTION-PM25.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_BIAS_CORRECTION_PM25}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi

mkdir_vrfy -p ${COMOUTwmo}

export PARMaqm_utils="${PARMaqm_utils:-${HOMEdir}/sorc/AQM-utils/parm}"

Expand Down
10 changes: 7 additions & 3 deletions jobs/JREGIONAL_FIRE_EMISSION
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,20 @@ fi
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_FIRE_EMISSION}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
# Create the directory where the RAVE fire emission files should be stored
#
#-----------------------------------------------------------------------
#
export FIRE_EMISSION_STAGING_DIR="${COMINext}/FIRE_EMISSION"
export FIRE_EMISSION_STAGING_DIR="${FIRE_EMISSION_STAGING_DIR:-${COMIN}/FIRE_EMISSION}"
mkdir_vrfy -p "${FIRE_EMISSION_STAGING_DIR}"
#
#-----------------------------------------------------------------------
Expand Down
7 changes: 3 additions & 4 deletions jobs/JREGIONAL_GET_EXTRN_MDL_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#
. $USHdir/source_util_funcs.sh
source_config_for_task "task_get_extrn_ics|task_get_extrn_lbcs" ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/job_preamble.sh
. $USHdir/job_preamble.sh "TRUE"
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -221,8 +221,7 @@ esac
#-----------------------------------------------------------------------
#
if [ $RUN_ENVIR = "nco" ]; then
export EXTRN_MDL_STAGING_DIR="${COMINext}"
mkdir_vrfy -p "${EXTRN_MDL_STAGING_DIR}"
export EXTRN_MDL_STAGING_DIR="${EXTRN_MDL_STAGING_DIR:-${DATA}}"
else
export EXTRN_MDL_STAGING_DIR="${COMIN}/${EXTRN_MDL_NAME}/for_${ICS_OR_LBCS}"
mkdir_vrfy -p "${EXTRN_MDL_STAGING_DIR}"
Expand All @@ -245,7 +244,7 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
job_postamble
job_postamble "FALSE"
#
#-----------------------------------------------------------------------
#
Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_MAKE_ICS
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ mkdir_vrfy -p "${INPUT_DATA_NWGES}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ $RUN_ENVIR = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_MAKE_ICS}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_MAKE_LBCS
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ mkdir_vrfy -p "${INPUT_DATA_NWGES}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_MAKE_LBCS}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_NEXUS_EMISSION
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_NEXUS_EMISSION_${nspt}}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
21 changes: 8 additions & 13 deletions jobs/JREGIONAL_NEXUS_GFS_SFC
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
. $USHdir/source_util_funcs.sh
source_config_for_task "cpl_aqm_parm|task_nexus_gfs_sfc" ${GLOBAL_VAR_DEFNS_FP}
. $USHdir/job_preamble.sh
. $USHdir/job_preamble.sh "TRUE"
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -91,21 +91,16 @@ fi
#
#-----------------------------------------------------------------------
#
# Create the directory where the RAVE fire emission files should be stored
#
#-----------------------------------------------------------------------
#
export GFS_SFC_STAGING_DIR="${COMINext}/GFS_SFC"
mkdir_vrfy -p "${GFS_SFC_STAGING_DIR}"
#
#-----------------------------------------------------------------------
#
# Set the run directory
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_NEXUS_GFS_SFC}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand All @@ -123,7 +118,7 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
job_postamble
job_postamble "FALSE"
#
#-----------------------------------------------------------------------
#
Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_NEXUS_POST_SPLIT
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_NEXUS_POST_SPLIT}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
8 changes: 6 additions & 2 deletions jobs/JREGIONAL_POINT_SOURCE
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ mkdir_vrfy -p "${INPUT_DATA}"
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p "${DATA}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_POINT_SOURCE}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#
#-----------------------------------------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion jobs/JREGIONAL_POST_STAT_O3
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ This is the J-job script for the task that runs POST-STAT-O3.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_POST_STAT_O3}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi

mkdir_vrfy -p ${COMOUTwmo}

export PARMaqm_utils="${PARMaqm_utils:-${HOMEdir}/sorc/AQM-utils/parm}"
#
Expand Down
9 changes: 8 additions & 1 deletion jobs/JREGIONAL_POST_STAT_PM25
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ This is the J-job script for the task that runs POST-UPP-STAT.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_POST_STAT_PM25}"
if [ "${RUN_ENVIR}" = "community" ]; then
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi

mkdir_vrfy -p ${COMOUTwmo}

export PARMaqm_utils="${PARMaqm_utils:-${HOMEdir}/sorc/AQM-utils/parm}"
#
Expand Down
7 changes: 6 additions & 1 deletion jobs/JREGIONAL_PRE_POST_STAT
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ This is the J-job script for the task that runs POST-UPP-STAT.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}/tmp_PRE_POST_STAT}"
check_for_preexist_dir_file "$DATA" "delete"
mkdir_vrfy -p $DATA
cd_vrfy $DATA
fi
#
#-----------------------------------------------------------------------
#
Expand Down
4 changes: 2 additions & 2 deletions jobs/JREGIONAL_RUN_FCST
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ the specified cycle.
if [ $RUN_ENVIR = "nco" ]; then
export INPUT_DATA="${COMIN}"
else
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
export INPUT_DATA="${COMIN}${SLASH_ENSMEM_SUBDIR}/INPUT"
fi
#
Expand All @@ -75,7 +76,6 @@ fi
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
mkdir_vrfy -p ${DATA}/INPUT
mkdir_vrfy -p ${DATA}/RESTART
#
Expand All @@ -96,7 +96,7 @@ Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
#-----------------------------------------------------------------------
#
job_postamble
job_postamble "FALSE"
#
#-----------------------------------------------------------------------
#
Expand Down
28 changes: 14 additions & 14 deletions jobs/JREGIONAL_RUN_POST
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ This is the J-job script for the task that runs the post-processor (UPP)
on the output files corresponding to a specified forecast hour.
========================================================================"
#
#-----------------------------------------------------------------------
#
# Set the run directory.
#
#-----------------------------------------------------------------------
#
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
#
# If SUB_HOURLY_POST is not set to "TRUE", ensure that the forecast
# minutes (fmn) are set to "00". This is necessary in order to pass
# "fmn" into the post ex-script for the calculation of post_time.
Expand All @@ -90,10 +82,11 @@ fi
#
#-----------------------------------------------------------------------
#
if [ "${RUN_ENVIR}" != "nco" ]; then
if [ "${RUN_ENVIR}" = "community" ]; then
DATA="${DATA:-${COMIN}${SLASH_ENSMEM_SUBDIR}}"
export COMOUT="${DATA}/postprd"
mkdir_vrfy -p "${COMOUT}"
fi
mkdir_vrfy -p "${COMOUT}"

if [ "${SUB_HOURLY_POST}" = "TRUE" ]; then
export DATA_FHR="${DATA:-$COMOUT}/$fhr$fmn"
Expand Down Expand Up @@ -143,9 +136,11 @@ if [ ${#FCST_LEN_CYCL[@]} -gt 1 ]; then
CYCLE_IDX=$(( ${cyc_mod} / ${INCR_CYCL_FREQ} ))
FCST_LEN_HRS=${FCST_LEN_CYCL[$CYCLE_IDX]}

fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" )
if [ "${fhr}" = "${fcst_len_hrs}" ]; then
touch "${COMIN}/post_${PDY}${cyc}_task_complete.txt"
if [ "${WORKFLOW_MANAGER}" = "rocoto" ]; then
fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" )
if [ "${fhr}" = "${fcst_len_hrs}" ]; then
touch "${COMIN}/post_${PDY}${cyc}_task_complete.txt"
fi
fi
fi
#
Expand All @@ -155,7 +150,12 @@ fi
#
#-----------------------------------------------------------------------
#
job_postamble
fcst_len_hrs=$( printf "%03d" "${FCST_LEN_HRS}" )
if [ "${fhr}" = "${fcst_len_hrs}" ]; then
job_postamble "TRUE"
else
job_postamble
fi
#
#-----------------------------------------------------------------------
#
Expand Down
2 changes: 2 additions & 0 deletions modulefiles/tasks/wcoss2/python_srw.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load(pathJoin("PrgEnv-intel", os.getenv("PrgEnv_intel_ver")))
load(pathJoin("craype", os.getenv("craype_ver")))
load(pathJoin("intel", os.getenv("intel_ver")))
load(pathJoin("python", os.getenv("python_ver")))
load(pathJoin("prod_util", os.getenv("prod_util_ver")))
Loading

0 comments on commit 9b9942f

Please sign in to comment.