From 17c9d5789566a030b0628617e56fb14993ed2cc8 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 17 Aug 2023 15:25:32 -0400 Subject: [PATCH] Remove RUN_ENVIR from as many places as possible (#1802) This PR: - eliminates superfluous `RUN_ENVIR` definitions from jobs and scripts as `config.base` contains that definition and all jobs must source `config.base`. - retains `RUN_ENVIR` conditionals in `configs` where it is necessary to distinguish between datasets as well as in genesis and tracker jobs where external directories to GFS are created to place products. Fixes #1220 --- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 3 --- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 3 --- jobs/JGFS_ATMOS_FSU_GENESIS | 2 -- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 2 -- jobs/JGLOBAL_ATMOS_SFCANL | 3 --- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 3 --- jobs/rocoto/awips.sh | 7 +++---- jobs/rocoto/metp.sh | 1 - jobs/rocoto/ocnpost.sh | 7 ++----- jobs/rocoto/prep.sh | 14 ++++++------- parm/config/gfs/config.prep | 2 -- scripts/exgdas_atmos_verfozn.sh | 11 +++++----- scripts/exgdas_atmos_verfrad.sh | 33 +++++++++++++++--------------- scripts/exgdas_atmos_vminmon.sh | 7 +++---- scripts/exgfs_atmos_vminmon.sh | 9 ++++---- 15 files changed, 39 insertions(+), 68 deletions(-) diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index 85e4bf7651..3410939da3 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -4,9 +4,6 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "vrfy" -c "base vrfy" -# TODO (#1220) Determine if this is still needed -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - ############################################## # Set variables used in the exglobal script ############################################## diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 3aa3c6f5f4..e804e66166 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -4,9 +4,6 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "vrfy" -c "base vrfy" -# TODO (#1220) Determine if this is still needed -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - export COMPONENT="atmos" diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index e5fd5ff3c3..40370ba529 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -3,8 +3,6 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "vrfy" -c "base vrfy" -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - export COMPONENT="atmos" diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index fdaca08240..3312ef27f5 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -3,8 +3,6 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "sfc_prep" -c "base" -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - export SENDDBN=${SENDDBN:-NO} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL index dcedb7b65b..0d709e56dd 100755 --- a/jobs/JGLOBAL_ATMOS_SFCANL +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -8,9 +8,6 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "sfcanl" -c "base sfcanl" # Set variables used in the script ############################################## export CDUMP="${RUN/enkf}" -if [[ ${RUN_ENVIR} = "nco" ]]; then - export ROTDIR=${COMROOT:?}/${NET}/${envir} -fi ############################################## diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index d5e4834851..82c3a5c755 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -3,9 +3,6 @@ source "${HOMEgfs}/ush/preamble.sh" source "${HOMEgfs}/ush/jjob_header.sh" -e "prep" -c "base prep" -# TODO (#1220) Evaluate if this is still needed -export RUN_ENVIR=${RUN_ENVIR:-"nco"} - ############################################## # Set variables used in the exglobal script diff --git a/jobs/rocoto/awips.sh b/jobs/rocoto/awips.sh index f9289255f9..ffa59ec539 100755 --- a/jobs/rocoto/awips.sh +++ b/jobs/rocoto/awips.sh @@ -5,7 +5,6 @@ source "${HOMEgfs}/ush/preamble.sh" ############################################################### ## Abstract: ## Inline awips driver script -## RUN_ENVIR : runtime environment (emc | nco) ## HOMEgfs : /full/path/to/workflow ## EXPDIR : /full/path/to/config/files ## CDATE : current analysis date (YYYYMMDDHH) @@ -49,7 +48,7 @@ for fhr in ${fhrlst}; do export fcsthrs=${fhr3} ${AWIPS20SH} fi - + if ((fhr % 6 == 0)); then ${AWIPSG2SH} fi @@ -57,9 +56,9 @@ for fhr in ${fhrlst}; do fhmin=90 fhmax=240 - if (( fhr >= fhmin && fhr <= fhmax )); then + if (( fhr >= fhmin && fhr <= fhmax )); then if ((fhr % 6 == 0)); then - fhr3=$(printf %03i $((10#${fhr}))) + fhr3=$(printf %03i $((10#${fhr}))) export fcsthrs=${fhr3} ${AWIPS20SH} ${AWIPSG2SH} diff --git a/jobs/rocoto/metp.sh b/jobs/rocoto/metp.sh index 82254a0435..95ff2d0f4d 100755 --- a/jobs/rocoto/metp.sh +++ b/jobs/rocoto/metp.sh @@ -5,7 +5,6 @@ source "${HOMEgfs}/ush/preamble.sh" ############################################################### ## Abstract: ## Inline METplus verification and diagnostics driver script -## RUN_ENVIR : runtime environment (emc | nco) ## HOMEgfs : /full/path/to/workflow ## EXPDIR : /full/path/to/config/files ## CDATE : current analysis date (YYYYMMDDHH) diff --git a/jobs/rocoto/ocnpost.sh b/jobs/rocoto/ocnpost.sh index 0ad27afb04..0766ac3b37 100755 --- a/jobs/rocoto/ocnpost.sh +++ b/jobs/rocoto/ocnpost.sh @@ -21,9 +21,6 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnpost" -c "base ocnpost" # Set variables used in the exglobal script ############################################## export CDUMP=${RUN/enkf} -if [[ ${RUN_ENVIR} = "nco" ]]; then - export ROTDIR=${COMROOT:?}/${NET}/${envir} -fi ############################################## # Begin JOB SPECIFIC work @@ -49,7 +46,7 @@ export ENSMEM=${ENSMEM:-000} export IDATE=${PDY}${cyc} for fhr in ${fhrlst}; do - export fhr=${fhr} + export fhr=${fhr} # Ignore possible spelling error (nothing is misspelled) # shellcheck disable=SC2153 VDATE=$(${NDATE} "${fhr}" "${IDATE}") @@ -110,7 +107,7 @@ for fhr in ${fhrlst}; do status=$? [[ ${status} -ne 0 ]] && exit "${status}" fi - fi + fi done # clean up working folder diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index 826dec5ae7..f90be861d9 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -65,14 +65,12 @@ fi if [[ ${PROCESS_TROPCY} = "YES" ]]; then export COMINsyn=${COMINsyn:-$(compath.py gfs/prod/syndat)} - if [[ ${RUN_ENVIR} != "nco" ]]; then - export ARCHSYND=${ROTDIR}/syndat - if [[ ! -d ${ARCHSYND} ]]; then mkdir -p ${ARCHSYND}; fi - if [[ ! -s ${ARCHSYND}/syndat_akavit ]]; then - for file in syndat_akavit syndat_dateck syndat_stmcat.scr syndat_stmcat syndat_sthisto syndat_sthista ; do - cp ${COMINsyn}/${file} ${ARCHSYND}/. - done - fi + export ARCHSYND=${ROTDIR}/syndat + if [[ ! -d ${ARCHSYND} ]]; then mkdir -p ${ARCHSYND}; fi + if [[ ! -s ${ARCHSYND}/syndat_akavit ]]; then + for file in syndat_akavit syndat_dateck syndat_stmcat.scr syndat_stmcat syndat_sthisto syndat_sthista ; do + cp ${COMINsyn}/${file} ${ARCHSYND}/. + done fi if [[ ${ROTDIR_DUMP} = "YES" ]]; then rm "${COM_OBS}/${CDUMP}.t${cyc}z.syndata.tcvitals.tm00"; fi diff --git a/parm/config/gfs/config.prep b/parm/config/gfs/config.prep index b05b82a43e..332ed87568 100644 --- a/parm/config/gfs/config.prep +++ b/parm/config/gfs/config.prep @@ -13,8 +13,6 @@ export cdate10=${PDY}${cyc} # Relocation and syndata QC export PROCESS_TROPCY=${PROCESS_TROPCY:-NO} -[[ $RUN_ENVIR == "nco" && $envir == "prod" ]] && export PROCESS_TROPCY="YES" -export DO_RELOCATE="NO" export TROPCYQCRELOSH="$HOMEgfs/scripts/exglobal_atmos_tropcy_qc_reloc.sh" export SENDCOM=YES diff --git a/scripts/exgdas_atmos_verfozn.sh b/scripts/exgdas_atmos_verfozn.sh index aa686284be..ae4954891a 100755 --- a/scripts/exgdas_atmos_verfozn.sh +++ b/scripts/exgdas_atmos_verfozn.sh @@ -6,7 +6,7 @@ source "$HOMEgfs/ush/preamble.sh" # exgdas_vrfyozn.sh # # This script runs the data extract/validation portion of the Ozone Monitor -# (OznMon) DA package. +# (OznMon) DA package. # ################################################################################ err=0 @@ -14,7 +14,6 @@ err=0 #------------------------------------------------------------------------------- # Set environment # -export RUN_ENVIR=${RUN_ENVIR:-nco} export NET=${NET:-gfs} export RUN=${RUN:-gdas} export envir=${envir:-prod} @@ -49,11 +48,11 @@ fi data_available=0 if [[ -s ${oznstat} ]]; then - data_available=1 + data_available=1 #------------------------------------------------------------------ - # Copy data files file to local data directory. - # Untar oznstat file. + # Copy data files file to local data directory. + # Untar oznstat file. #------------------------------------------------------------------ $NCP $oznstat ./oznstat.$PDATE @@ -70,7 +69,7 @@ if [[ -s ${oznstat} ]]; then mv $filenc4 $file done fi - + export OZNMON_NETCDF=${netcdf} ${HOMEoznmon}/ush/ozn_xtrct.sh diff --git a/scripts/exgdas_atmos_verfrad.sh b/scripts/exgdas_atmos_verfrad.sh index 5306fbbdba..f6f244b708 100755 --- a/scripts/exgdas_atmos_verfrad.sh +++ b/scripts/exgdas_atmos_verfrad.sh @@ -10,8 +10,8 @@ source "$HOMEgfs/ush/preamble.sh" # # Author: Ed Safford Org: NP23 Date: 2012-01-18 # -# Abstract: This script runs the data extract/validation portion of the -# RadMon package. +# Abstract: This script runs the data extract/validation portion of the +# RadMon package. # # Condition codes # 0 - no problem encountered @@ -21,7 +21,6 @@ source "$HOMEgfs/ush/preamble.sh" export VERBOSE=${VERBOSE:-YES} -export RUN_ENVIR=${RUN_ENVIR:-nco} export NET=${NET:-gfs} export RUN=${RUN:-gdas} export envir=${envir:-prod} @@ -60,11 +59,11 @@ fi data_available=0 if [[ -s ${radstat} && -s ${biascr} ]]; then - data_available=1 + data_available=1 #------------------------------------------------------------------ - # Copy data files file to local data directory. - # Untar radstat file. + # Copy data files file to local data directory. + # Untar radstat file. #------------------------------------------------------------------ $NCP $biascr ./biascr.$PDATE @@ -75,8 +74,8 @@ if [[ -s ${radstat} && -s ${biascr} ]]; then #------------------------------------------------------------------ # SATYPE is the list of expected satellite/instrument sources - # in the radstat file. It should be stored in the $TANKverf - # directory. If it isn't there then use the $FIXgdas copy. In all + # in the radstat file. It should be stored in the $TANKverf + # directory. If it isn't there then use the $FIXgdas copy. In all # cases write it back out to the radmon.$PDY directory. Add any # new sources to the list before writing back out. #------------------------------------------------------------------ @@ -87,10 +86,10 @@ if [[ -s ${radstat} && -s ${biascr} ]]; then fi echo satype_file = $satype_file - + #------------------------------------------------------------------ - # Get previous cycle's date, and look for the satype_file. Using - # the previous cycle will get us the previous day's directory if + # Get previous cycle's date, and look for the satype_file. Using + # the previous cycle will get us the previous day's directory if # the cycle being processed is 00z. #------------------------------------------------------------------ if [[ $cyc = "00" ]]; then @@ -101,11 +100,11 @@ if [[ -s ${radstat} && -s ${biascr} ]]; then echo satype_file = $satype_file export SATYPE=$(cat ${satype_file}) - + #------------------------------------------------------------- - # Update the SATYPE if any new sat/instrument was - # found in $radstat_satype. Write the SATYPE contents back + # Update the SATYPE if any new sat/instrument was + # found in $radstat_satype. Write the SATYPE contents back # to $TANKverf/radmon.$PDY. #------------------------------------------------------------- satype_changes=0 @@ -122,7 +121,7 @@ if [[ -s ${radstat} && -s ${biascr} ]]; then fi done - + #------------------------------------------------------------------ # Rename the diag files and uncompress #------------------------------------------------------------------ @@ -133,14 +132,14 @@ if [[ -s ${radstat} && -s ${biascr} ]]; then if [[ netcdf -eq 0 && -e diag_${type}_ges.${PDATE}.nc4.${Z} ]]; then netcdf=1 fi - + if [[ $(find . -maxdepth 1 -type f -name "diag_${type}_ges.${PDATE}*.${Z}" | wc -l) -gt 0 ]]; then mv diag_${type}_ges.${PDATE}*.${Z} ${type}.${Z} ${UNCOMPRESS} ./${type}.${Z} else echo "WARNING: diag_${type}_ges.${PDATE}*.${Z} not available, skipping" fi - + if [[ $USE_ANL -eq 1 ]]; then if [[ $(find . -maxdepth 1 -type f -name "diag_${type}_anl.${PDATE}*.${Z}" | wc -l) -gt 0 ]]; then mv diag_${type}_anl.${PDATE}*.${Z} ${type}_anl.${Z} diff --git a/scripts/exgdas_atmos_vminmon.sh b/scripts/exgdas_atmos_vminmon.sh index 2a22fcb0b6..94790c67c5 100755 --- a/scripts/exgdas_atmos_vminmon.sh +++ b/scripts/exgdas_atmos_vminmon.sh @@ -10,8 +10,8 @@ source "$HOMEgfs/ush/preamble.sh" # # Author: Ed Safford Org: NP23 Date: 2015-04-10 # -# Abstract: This script runs the data extract/validation portion of the -# MinMon package. +# Abstract: This script runs the data extract/validation portion of the +# MinMon package. # # Condition codes # 0 - no problem encountered @@ -23,7 +23,6 @@ source "$HOMEgfs/ush/preamble.sh" ######################################## # Set environment ######################################## -export RUN_ENVIR=${RUN_ENVIR:-nco} export NET=${NET:-gfs} export RUN=${RUN:-gdas} export envir=${envir:-prod} @@ -60,7 +59,7 @@ data_available=0 if [[ -s ${gsistat} ]]; then - data_available=1 + data_available=1 #----------------------------------------------------------------------- # Copy the $MINMON_SUFFIX.gnorm_data.txt file to the working directory diff --git a/scripts/exgfs_atmos_vminmon.sh b/scripts/exgfs_atmos_vminmon.sh index a1346d5f9e..d0ab4e3674 100755 --- a/scripts/exgfs_atmos_vminmon.sh +++ b/scripts/exgfs_atmos_vminmon.sh @@ -10,8 +10,8 @@ source "$HOMEgfs/ush/preamble.sh" # # Author: Ed Safford Org: NP23 Date: 2015-04-10 # -# Abstract: This script runs the data extract/validation portion of the -# MinMon package. +# Abstract: This script runs the data extract/validation portion of the +# MinMon package. # # Condition codes # 0 - no problem encountered @@ -23,7 +23,6 @@ source "$HOMEgfs/ush/preamble.sh" ######################################## # Set environment ######################################## -export RUN_ENVIR=${RUN_ENVIR:-nco} export NET=${NET:-gfs} export RUN=${RUN:-gfs} export envir=${envir:-prod} @@ -31,7 +30,7 @@ export envir=${envir:-prod} ######################################## # Command line arguments ######################################## -export PDY=${1:-${PDY:?}} +export PDY=${1:-${PDY:?}} export cyc=${2:-${cyc:?}} ######################################## @@ -68,7 +67,7 @@ data_available=0 if [[ -s ${gsistat} ]]; then - data_available=1 + data_available=1 #------------------------------------------------------------------ # Copy the $MINMON_SUFFIX.gnorm_data.txt file to the working directory