From bcdcf3cd7fe2710e825bd08d07d2b62f0e039faa Mon Sep 17 00:00:00 2001 From: Ming Hu Date: Tue, 8 Oct 2024 05:00:23 -0600 Subject: [PATCH] Updates for main branch to run RRFS_A real-time deterministic and EnkF DA cycles (#513) * Bug fixes found in real-time testing on WCOSS2. --------- --- jobs/JRRFS_ANALYSIS_GSI | 4 +- jobs/JRRFS_ANALYSIS_GSIDIAG | 5 +- jobs/JRRFS_ANALYSIS_NONVARCLD | 2 +- jobs/JRRFS_CALC_ENSMEAN | 4 +- jobs/JRRFS_MAKE_ICS | 2 +- jobs/JRRFS_PREP_CYC | 20 +++-- jobs/JRRFS_RECENTER | 6 +- jobs/JRRFS_SAVE_RESTART | 13 +-- jobs/JRRFS_UPDATE_LBC_SOIL | 1 - .../tasks/wcoss2/analysis_gsi.local.lua | 1 + modulefiles/tasks/wcoss2/bufrsnd.local.lua | 2 + modulefiles/tasks/wcoss2/post.local.lua | 2 + modulefiles/tasks/wcoss2/prdgen.local.lua | 2 + modulefiles/tasks/wcoss2/prep_cyc.local.lua | 2 + modulefiles/tasks/wcoss2/recenter.local.lua | 2 + parm/FV3LAM_wflow.xml | 79 +++++++++++-------- scripts/exrrfs_analysis_enkf.sh | 21 +++-- scripts/exrrfs_analysis_gsi.sh | 21 ++--- scripts/exrrfs_calc_ensmean.sh | 10 +-- scripts/exrrfs_make_lbcs.sh | 2 +- scripts/exrrfs_prep_cyc.sh | 12 +-- scripts/exrrfs_process_radar.sh | 1 + scripts/exrrfs_recenter.sh | 26 +++--- ush/link_fix.sh | 2 +- ush/setup.sh | 3 +- ush/valid_param_vals.sh | 2 +- versions/run.ver | 1 + 27 files changed, 148 insertions(+), 100 deletions(-) diff --git a/jobs/JRRFS_ANALYSIS_GSI b/jobs/JRRFS_ANALYSIS_GSI index 52bb473cc..c70b088e6 100755 --- a/jobs/JRRFS_ANALYSIS_GSI +++ b/jobs/JRRFS_ANALYSIS_GSI @@ -80,7 +80,7 @@ fi if [ "${GSI_TYPE}" = "OBSERVER" ]; then if [ "${MEM_TYPE}" = "MEAN" ]; then export jobid=${RUN}_observer_${workname}_ensmean_${envir}_${cyc} - observer_nwges_dir="${GESROOT}/ensmean/observer_${workname}" + observer_nwges_dir="${GESROOT}/${RUN}.${PDY}/${cyc}/ensmean/observer_${workname}" else # GSI_TYPE = OBSERVER is only for EnKF (ensemble forecasts do not have ANALYSIS tasks) export jobid=${RUN}_observer_${workname}_${mem_num}_${envir}_${cyc} @@ -113,7 +113,7 @@ fi export gridspec_dir=${GESROOT}/grid_spec -export ${OB_TYPE} +export OB_TYPE=${OB_TYPE} #----------------------------------------------------------------------- # Define COM directories diff --git a/jobs/JRRFS_ANALYSIS_GSIDIAG b/jobs/JRRFS_ANALYSIS_GSIDIAG index d14d440b4..5f3890328 100755 --- a/jobs/JRRFS_ANALYSIS_GSIDIAG +++ b/jobs/JRRFS_ANALYSIS_GSIDIAG @@ -72,8 +72,9 @@ fi export jobid=${RUN}_analysis_conv_dbz_${workname}_${envir}_${cyc} export DATA="${DATAROOT}/${jobid}" -rm -rf ${DATA} -mkdir -p ${DATA} +if [ ! -d "${DATA}" ]; then + echo "WARNING: ${DATA} does not exist" +fi if [ ! -d "${SATBIAS_DIR}" ]; then echo "making satbias_dir directory for cycling bias correction files" diff --git a/jobs/JRRFS_ANALYSIS_NONVARCLD b/jobs/JRRFS_ANALYSIS_NONVARCLD index 7ff335f50..516f8b960 100755 --- a/jobs/JRRFS_ANALYSIS_NONVARCLD +++ b/jobs/JRRFS_ANALYSIS_NONVARCLD @@ -95,7 +95,7 @@ if [ ${CYCLE_TYPE} = "spinup" ]; then if [ "${MEM_TYPE}" = "MEAN" ]; then export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc}_spinup/ensmean)} else - export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc}_spinup/${mem_num})} + export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc}_spinup)} fi export COMIN=${COMIN:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc}_spinup)} else diff --git a/jobs/JRRFS_CALC_ENSMEAN b/jobs/JRRFS_CALC_ENSMEAN index 0f189df8a..37a1c30e0 100755 --- a/jobs/JRRFS_CALC_ENSMEAN +++ b/jobs/JRRFS_CALC_ENSMEAN @@ -60,7 +60,7 @@ RRFS for the specified cycle. export pid=${pid:-$$} export RUN=${RUN:-rrfs} -export mem_num=m$(echo "${ENSMEM_INDX}") +#export mem_num=m$(echo "${ENSMEM_INDX}") export CYCLE_TYPE=${CYCLE_TYPE:-prod} if [ "${CYCLE_TYPE}" = "spinup" ]; then @@ -89,7 +89,7 @@ mkdir -p "${COMOUT}" # Execute the script. #----------------------------------------------------------------------- -export pgmout="${ensmeandir}/OUTPUT.$$" +export pgmout="${DATA}/OUTPUT.$$" env $HOMErrfs/scripts/exrrfs_calc_ensmean.sh diff --git a/jobs/JRRFS_MAKE_ICS b/jobs/JRRFS_MAKE_ICS index 9f6f45c90..dd5fada77 100755 --- a/jobs/JRRFS_MAKE_ICS +++ b/jobs/JRRFS_MAKE_ICS @@ -15,7 +15,7 @@ export USHrrfs=${USHrrfs:-${HOMErrfs}/ush} export FIXam=${FIXam:-${FIXrrfs}/am} export FIXLAM=${FIXLAM:-${FIXrrfs}/lam/${PREDEF_GRID_NAME}} -export FIXGSI=${FIXrrfs}/gsi +export FIX_GSI=${FIXrrfs}/gsi #----------------------------------------------------------------------- # Source the variable definitions file and the bash utility functions. diff --git a/jobs/JRRFS_PREP_CYC b/jobs/JRRFS_PREP_CYC index 3118f9de4..5bad60a69 100755 --- a/jobs/JRRFS_PREP_CYC +++ b/jobs/JRRFS_PREP_CYC @@ -67,14 +67,19 @@ export mem_num=m$(echo "${ENSMEM_INDX}") export CYCLE_TYPE=${CYCLE_TYPE:-prod} export CYCLE_SUBTYPE=${CYCLE_SUBTYPE:-empty} -export ctrlpath="" +#export ctrlpath="" if [ "${CYCLE_TYPE}" = "spinup" ]; then - export INPUT_DATA=${DATAROOT}/${RUN}_forecast_spinup_${envir}_${cyc}/INPUT - if [ "${DO_ENSINIT}" = "TRUE" ] && [ "${CYCLE_SUBTYPE}" = "ensinit" ]; then - export INPUT_DATA=${DATAROOT}/${RUN}_forecast_ensinit_${envir}_${cyc}/INPUT - fi - if [ "${DO_ENSINIT}" = "TRUE" ] && [ "${CYCLE_SUBTYPE}" = "spinup" ]; then - ctrlpath=${ENSCTRL_DATAROOT} + if [ "${DO_ENSEMBLE}" = "TRUE" ]; then # EnKF has spinup forecasts + export INPUT_DATA=${DATAROOT}/${RUN}_forecast_spinup_${mem_num}_${envir}_${cyc}/INPUT + if [ "${DO_ENSINIT}" = "TRUE" ] && [ "${CYCLE_SUBTYPE}" = "ensinit" ]; then + export INPUT_DATA=${DATAROOT}/${RUN}_forecast_ensinit_${mem_num}_${envir}_${cyc}/INPUT + fi +# if [ "${DO_ENSINIT}" = "TRUE" ] && [ "${CYCLE_SUBTYPE}" = "spinup" ]; then +# ctrlpath=${ENSCTRL_DATAROOT} +# fi + else + export INPUT_DATA=${DATAROOT}/${RUN}_forecast_spinup_${envir}_${cyc}/INPUT +# ctrlpath=${ENSCTRL_DATAROOT} fi else if [ "${DO_ENSEMBLE}" = "TRUE" ]; then @@ -84,7 +89,6 @@ else fi fi -rm -fr ${INPUT_DATA} mkdir -p ${INPUT_DATA} cd ${INPUT_DATA} diff --git a/jobs/JRRFS_RECENTER b/jobs/JRRFS_RECENTER index a40f62824..94bf9f1f7 100755 --- a/jobs/JRRFS_RECENTER +++ b/jobs/JRRFS_RECENTER @@ -60,13 +60,13 @@ with RRFS for the specified cycle. export pid=${pid:-$$} export RUN=${RUN:-rrfs} -export mem_num=m$(echo "${ENSMEM_INDX}") +#export mem_num=m$(echo "${ENSMEM_INDX}") export CYCLE_TYPE=${CYCLE_TYPE:-prod} if [ "${CYCLE_TYPE}" = "spinup" ]; then - export jobid=${RUN}_recenter_spinup_${mem_num}_${envir}_${cyc} + export jobid=${RUN}_recenter_spinup_${envir}_${cyc} else - export jobid=${RUN}_recenter_${mem_num}_${envir}_${cyc} + export jobid=${RUN}_recenter_${envir}_${cyc} fi export DATA=${DATAROOT}/${jobid} diff --git a/jobs/JRRFS_SAVE_RESTART b/jobs/JRRFS_SAVE_RESTART index 7d6f95030..c6f1cef5a 100755 --- a/jobs/JRRFS_SAVE_RESTART +++ b/jobs/JRRFS_SAVE_RESTART @@ -90,13 +90,14 @@ mkdir -p "${NWGES_DIR}/RESTART" mkdir -p "${NWGES_DIR}/INPUT" if [ "${SURFACE_DIR}" != "empty" ]; then mkdir -p "${SURFACE_DIR}" + cd ${SURFACE_DIR} fi -len_ensmem=${#ENSMEM_INDX} -if [ ${len_ensmem} -le 3 ]; then - CYCLE_SUBTYPE="control" -fi -cd ${SURFACE_DIR} +# check this, why we need this???? +#len_ensmem=${#ENSMEM_INDX} +#if [ ${len_ensmem} -le 3 ]; then +# CYCLE_SUBTYPE="control" +#fi #----------------------------------------------------------------------- # Make sure that fhr is a non-empty string consisting of only digits. @@ -114,7 +115,7 @@ fi # Execute the script. #----------------------------------------------------------------------- -export pgmout="${SURFACE_DIR}/OUTPUT.$$" +export pgmout="${DATA}/OUTPUT.$$" env ${HOMErrfs}/scripts/exrrfs_save_restart.sh diff --git a/jobs/JRRFS_UPDATE_LBC_SOIL b/jobs/JRRFS_UPDATE_LBC_SOIL index f3bd44011..ea34e6f77 100755 --- a/jobs/JRRFS_UPDATE_LBC_SOIL +++ b/jobs/JRRFS_UPDATE_LBC_SOIL @@ -114,7 +114,6 @@ else if [ "${DO_ENSEMBLE}" = "TRUE" ]; then export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc}/${mem_num})} else - export COMOUT="${COMOUT_BASEDIR}/$RUN.$PDY/${cyc}" export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${rrfs_ver}/${RUN}.${PDY}/${cyc})} fi fi diff --git a/modulefiles/tasks/wcoss2/analysis_gsi.local.lua b/modulefiles/tasks/wcoss2/analysis_gsi.local.lua index 13d9f37f3..5a06356cb 100644 --- a/modulefiles/tasks/wcoss2/analysis_gsi.local.lua +++ b/modulefiles/tasks/wcoss2/analysis_gsi.local.lua @@ -23,3 +23,4 @@ load(pathJoin("udunits", os.getenv("udunits_ver"))) load(pathJoin("gsl", os.getenv("gsl_ver"))) load(pathJoin("nco", os.getenv("nco_ver"))) +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/modulefiles/tasks/wcoss2/bufrsnd.local.lua b/modulefiles/tasks/wcoss2/bufrsnd.local.lua index 22404c80c..f2cc391b5 100644 --- a/modulefiles/tasks/wcoss2/bufrsnd.local.lua +++ b/modulefiles/tasks/wcoss2/bufrsnd.local.lua @@ -15,3 +15,5 @@ prepend_path("MODULEPATH", os.getenv("modulepath_mpi")) load(pathJoin("hdf5", os.getenv("hdf5_ver"))) load(pathJoin("netcdf", os.getenv("netcdf_ver"))) load(pathJoin("gempak", os.getenv("gempak_ver"))) + +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/modulefiles/tasks/wcoss2/post.local.lua b/modulefiles/tasks/wcoss2/post.local.lua index 43273d6c8..38ce4a972 100644 --- a/modulefiles/tasks/wcoss2/post.local.lua +++ b/modulefiles/tasks/wcoss2/post.local.lua @@ -17,3 +17,5 @@ load(pathJoin("hdf5", os.getenv("hdf5_ver"))) load(pathJoin("netcdf", os.getenv("netcdf_ver"))) load(pathJoin("libjpeg", os.getenv("libjpeg_ver"))) load(pathJoin("wgrib2", os.getenv("wgrib2_ver"))) + +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/modulefiles/tasks/wcoss2/prdgen.local.lua b/modulefiles/tasks/wcoss2/prdgen.local.lua index d4075e307..eb778b98b 100644 --- a/modulefiles/tasks/wcoss2/prdgen.local.lua +++ b/modulefiles/tasks/wcoss2/prdgen.local.lua @@ -18,3 +18,5 @@ load(pathJoin("wgrib2", os.getenv("wgrib2_ver"))) load(pathJoin("udunits", os.getenv("udunits_ver"))) load(pathJoin("gsl", os.getenv("gsl_ver"))) load(pathJoin("nco", os.getenv("nco_ver"))) + +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/modulefiles/tasks/wcoss2/prep_cyc.local.lua b/modulefiles/tasks/wcoss2/prep_cyc.local.lua index 9fad8ba69..9a485bf74 100644 --- a/modulefiles/tasks/wcoss2/prep_cyc.local.lua +++ b/modulefiles/tasks/wcoss2/prep_cyc.local.lua @@ -22,3 +22,5 @@ load(pathJoin("libjpeg", os.getenv("libjpeg_ver"))) load(pathJoin("udunits", os.getenv("udunits_ver"))) load(pathJoin("gsl", os.getenv("gsl_ver"))) load(pathJoin("nco", os.getenv("nco_ver"))) + +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/modulefiles/tasks/wcoss2/recenter.local.lua b/modulefiles/tasks/wcoss2/recenter.local.lua index 15121d298..cea287754 100644 --- a/modulefiles/tasks/wcoss2/recenter.local.lua +++ b/modulefiles/tasks/wcoss2/recenter.local.lua @@ -15,3 +15,5 @@ prepend_path("MODULEPATH", os.getenv("modulepath_mpi")) load(pathJoin("hdf5", os.getenv("hdf5_ver"))) load(pathJoin("netcdf", os.getenv("netcdf_ver"))) load(pathJoin("libjpeg", os.getenv("libjpeg_ver"))) + +load(pathJoin("prod_envir", os.getenv("prod_envir_ver"))) diff --git a/parm/FV3LAM_wflow.xml b/parm/FV3LAM_wflow.xml index a032b72eb..b465a473b 100644 --- a/parm/FV3LAM_wflow.xml +++ b/parm/FV3LAM_wflow.xml @@ -66,6 +66,7 @@ Workflow task names. +