From fd648d2fd1b89097888c0af5ccf49ca72792ddf6 Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Wed, 16 Nov 2022 10:32:05 -0600 Subject: [PATCH 1/7] Remove outdated and unneeded gfs.ver from env folder Refs #397 --- env/gfs.ver | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 env/gfs.ver diff --git a/env/gfs.ver b/env/gfs.ver deleted file mode 100644 index a8f32bd2893..00000000000 --- a/env/gfs.ver +++ /dev/null @@ -1,22 +0,0 @@ -export gfs_ver=v15.0.0 - -export crtm_ver=2.3.0 -export hwrf_ver=v11.0.0 -export g2tmpl_ver=1.4.0 - -export grib_util_ver=1.1.0 -export util_shared_ver=1.0.6 -export cfp_intel_sandybridge_ver=1.1.0 -export iobuf_ver=2.0.7 -export ESMF_intel_sandybridge_ver=3_1_0rp5 -export ESMF_intel_haswell_ver=3_1_0rp5 -export gempak_ver=7.3.3 -export old_gempak_ver=6.32.0 -export NCL_gnu_sandybridge_ver=6.3.0 -export ncarg_intel_sandybridge_ver=6.1.0 -export dumpjb_ver=5.1.0 - -## FOLLOWING are used by JGDAS_TROPC -export obsproc_dump_ver=v4.0.0 -export obsproc_shared_bufr_dumplist_ver=v1.5.0 - From 0033786157817c054363bbcc2acc1163841ec871 Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 07:58:41 -0600 Subject: [PATCH 2/7] Update env files for shellcheck SC2250 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SC2250 – Prefer putting braces around variable references even when not strictly required. - Add curly braces around variables where missing in env files. Refs #397 --- env/HERA.env | 244 +++++++++++++++++++++++----------------------- env/JET.env | 216 ++++++++++++++++++++-------------------- env/ORION.env | 242 ++++++++++++++++++++++----------------------- env/WCOSS2.env | 260 ++++++++++++++++++++++++------------------------- 4 files changed, 481 insertions(+), 481 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index 45dd1d5265d..0a20a1cf95c 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -33,260 +33,260 @@ export NTHSTACK=1024000000 ulimit -s unlimited ulimit -a -export job=${PBS_JOBNAME:-$step} +export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ $step = "prep" -o $step = "prepbufr" ]; then +if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then - nth_max=$(($npe_node_max / $npe_node_prep)) + nth_max=$((${npe_node_max} / ${npe_node_prep})) export POE="NO" export BACK="NO" export sys_tp="HERA" export launcher_PREP="srun" -elif [ $step = "waveinit" -o $step = "waveprep" -o $step = "wavepostsbs" -o $step = "wavepostbndpnt" -o $step = "wavepostbndpntbll" -o $step = "wavepostpnt" ]; then +elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then export CFP_MP="YES" - if [ $step = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ $step = "atmanalrun" ]; then +elif [ ${step} = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) - export NTHREADS_ATMANAL=${nth_atmanalrun:-$nth_max} - [[ $NTHREADS_ATMANAL -gt $nth_max ]] && export NTHREADS_ATMANAL=$nth_max - export APRUN_ATMANAL="$launcher -n $npe_atmanalrun" + export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} + [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} + export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ $step = "atmensanalrun" ]; then +elif [ ${step} = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmensanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) - export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-$nth_max} - [[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max - export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun" + export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} + [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} + export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ $step = "aeroanlrun" ]; then +elif [ ${step} = "aeroanlrun" ]; then - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_aeroanlrun)) + nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) - export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max} - [[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max - export APRUN_AEROANL="$launcher -n $npe_aeroanlrun" + export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} + [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} + export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ $step = "anal" -o $step = "analcalc" ]; then +elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_anal)) + nth_max=$((${npe_node_max} / ${npe_node_anal})) - export NTHREADS_GSI=${nth_anal:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_anal}" + export NTHREADS_GSI=${nth_anal:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_anal}}" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher \$ncmd" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${nth_cycle:-12} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_cycle=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_cycle" + export APRUN_CYCLE="${launcher} -n ${npe_cycle}" export NTHREADS_GAUSFCANL=1 npe_gausfcanl=${npe_gausfcanl:-1} - export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" + export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ $step = "sfcanl" ]; then - nth_max=$(($npe_node_max / $npe_node_sfcanl)) +elif [ ${step} = "sfcanl" ]; then + nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_sfcanl=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_sfcanl" + export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ $step = "gldas" ]; then +elif [ ${step} = "gldas" ]; then export USE_CFP="NO" export CFP_MP="YES" - nth_max=$(($npe_node_max / $npe_node_gldas)) + nth_max=$((${npe_node_max} / ${npe_node_gldas})) - export NTHREADS_GLDAS=${nth_gldas:-$nth_max} - [[ $NTHREADS_GLDAS -gt $nth_max ]] && export NTHREADS_GLDAS=$nth_max - export APRUN_GLDAS="$launcher -n $npe_gldas" + export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} + [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} + export APRUN_GLDAS="${launcher} -n ${npe_gldas}" export NTHREADS_GAUSSIAN=${nth_gaussian:-1} - [[ $NTHREADS_GAUSSIAN -gt $nth_max ]] && export NTHREADS_GAUSSIAN=$nth_max - export APRUN_GAUSSIAN="$launcher -n $npe_gaussian" + [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} + export APRUN_GAUSSIAN="${launcher} -n ${npe_gaussian}" # Must run data processing with exactly the number of tasks as time # periods being processed. - npe_gldas_data_proc=$(($gldas_spinup_hours + 12)) - export APRUN_GLDAS_DATA_PROC="$launcher -n $npe_gldas_data_proc ${mpmd_opt}" + npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ $step = "eobs" ]; then +elif [ ${step} = "eobs" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO - nth_max=$(($npe_node_max / $npe_node_eobs)) + nth_max=$((${npe_node_max} / ${npe_node_eobs})) - export NTHREADS_GSI=${nth_eobs:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_eobs}" + export NTHREADS_GSI=${nth_eobs:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}}" export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ $step = "eupd" ]; then +elif [ ${step} = "eupd" ]; then - nth_max=$(($npe_node_max / $npe_node_eupd)) + nth_max=$((${npe_node_max} / ${npe_node_eupd})) - export NTHREADS_ENKF=${nth_eupd:-$nth_max} - [[ $NTHREADS_ENKF -gt $nth_max ]] && export NTHREADS_ENKF=$nth_max - export APRUN_ENKF="$launcher -n ${npe_enkf:-$npe_eupd}" + export NTHREADS_ENKF=${nth_eupd:-${nth_max}} + [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}}" export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ $step = "fcst" ]; then +elif [ ${step} = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs - if [[ $CDUMP == "gfs" ]]; then - npe_fcst=$npe_fcst_gfs - npe_node_fcst=$npe_node_fcst_gfs - nth_fv3=$nth_fv3_gfs + if [[ ${CDUMP} == "gfs" ]]; then + npe_fcst=${npe_fcst_gfs} + npe_node_fcst=${npe_node_fcst_gfs} + nth_fv3=${nth_fv3_gfs} fi - nth_max=$(($npe_node_max / $npe_node_fcst)) + nth_max=$((${npe_node_max} / ${npe_node_fcst})) - export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n $npe_fcst" + export NTHREADS_FV3=${nth_fv3:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_fcst}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n ${LEVS}" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" export NTHREADS_REMAP=${nth_remap:-2} - [[ $NTHREADS_REMAP -gt $nth_max ]] && export NTHREADS_REMAP=$nth_max - export APRUN_REMAP="$launcher -n ${npe_remap:-$npe_fcst}" + [[ ${NTHREADS_REMAP} -gt ${nth_max} ]] && export NTHREADS_REMAP=${nth_max} + export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ $step = "efcs" ]; then +elif [ ${step} = "efcs" ]; then - nth_max=$(($npe_node_max / $npe_node_efcs)) + nth_max=$((${npe_node_max} / ${npe_node_efcs})) - export NTHREADS_FV3=${nth_efcs:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n $npe_efcs" + export NTHREADS_FV3=${nth_efcs:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_efcs}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n ${LEVS}" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ $step = "post" ]; then +elif [ ${step} = "post" ]; then - nth_max=$(($npe_node_max / $npe_node_post)) + nth_max=$((${npe_node_max} / ${npe_node_post})) export NTHREADS_NP=${nth_np:-1} - [[ $NTHREADS_NP -gt $nth_max ]] && export NTHREADS_NP=$nth_max - export APRUN_NP="$launcher -n ${npe_post}" + [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} + export APRUN_NP="${launcher} -n ${npe_post}" export NTHREADS_DWN=${nth_dwn:-1} - [[ $NTHREADS_DWN -gt $nth_max ]] && export NTHREADS_DWN=$nth_max - export APRUN_DWN="$launcher -n ${npe_dwn}" + [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} + export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ $step = "ecen" ]; then +elif [ ${step} = "ecen" ]; then - nth_max=$(($npe_node_max / $npe_node_ecen)) + nth_max=$((${npe_node_max} / ${npe_node_ecen})) - export NTHREADS_ECEN=${nth_ecen:-$nth_max} - [[ $NTHREADS_ECEN -gt $nth_max ]] && export NTHREADS_ECEN=$nth_max - export APRUN_ECEN="$launcher -n ${npe_ecen}" + export NTHREADS_ECEN=${nth_ecen:-${nth_max}} + [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} + export APRUN_ECEN="${launcher} -n ${npe_ecen}" export NTHREADS_CHGRES=${nth_chgres:-12} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + [[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max} export APRUN_CHGRES="time" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher -n ${npe_ecen}" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ $step = "esfc" ]; then +elif [ ${step} = "esfc" ]; then - nth_max=$(($npe_node_max / $npe_node_esfc)) + nth_max=$((${npe_node_max} / ${npe_node_esfc})) - export NTHREADS_ESFC=${nth_esfc:-$nth_max} - [[ $NTHREADS_ESFC -gt $nth_max ]] && export NTHREADS_ESFC=$nth_max - export APRUN_ESFC="$launcher -n $npe_esfc" + export NTHREADS_ESFC=${nth_esfc:-${nth_max}} + [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} + export APRUN_ESFC="${launcher} -n ${npe_esfc}" export NTHREADS_CYCLE=${nth_cycle:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max - export APRUN_CYCLE="$launcher -n $npe_esfc" + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ $step = "epos" ]; then +elif [ ${step} = "epos" ]; then - nth_max=$(($npe_node_max / $npe_node_epos)) + nth_max=$((${npe_node_max} / ${npe_node_epos})) - export NTHREADS_EPOS=${nth_epos:-$nth_max} - [[ $NTHREADS_EPOS -gt $nth_max ]] && export NTHREADS_EPOS=$nth_max - export APRUN_EPOS="$launcher -n $npe_epos" + export NTHREADS_EPOS=${nth_epos:-${nth_max}} + [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} + export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ $step = "init" ]; then +elif [ ${step} = "init" ]; then - export APRUN="$launcher -n ${npe_init}" + export APRUN="${launcher} -n ${npe_init}" -elif [ $step = "postsnd" ]; then +elif [ ${step} = "postsnd" ]; then - nth_max=$(($npe_node_max / $npe_node_postsnd)) + nth_max=$((${npe_node_max} / ${npe_node_postsnd})) export NTHREADS_POSTSND=${nth_postsnd:-1} - [[ $NTHREADS_POSTSND -gt $nth_max ]] && export NTHREADS_POSTSND=$nth_max - export APRUN_POSTSND="$launcher -n ${npe_postsnd}" + [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} + export APRUN_POSTSND="${launcher} -n ${npe_postsnd}" export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1} - [[ $NTHREADS_POSTSNDCFP -gt $nth_max ]] && export NTHREADS_POSTSNDCFP=$nth_max - export APRUN_POSTSNDCFP="$launcher -n ${npe_postsnd} ${mpmd_opt}" + [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} + export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ $step = "awips" ]; then +elif [ ${step} = "awips" ]; then - nth_max=$(($npe_node_max / $npe_node_awips)) + nth_max=$((${npe_node_max} / ${npe_node_awips})) export NTHREADS_AWIPS=${nth_awips:-2} - [[ $NTHREADS_AWIPS -gt $nth_max ]] && export NTHREADS_AWIPS=$nth_max - export APRUN_AWIPSCFP="$launcher -n $npe_awips ${mpmd_opt}" + [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} + export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ $step = "gempak" ]; then +elif [ ${step} = "gempak" ]; then - nth_max=$(($npe_node_max / $npe_node_gempak)) + nth_max=$((${npe_node_max} / ${npe_node_gempak})) export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ $NTHREADS_GEMPAK -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} + [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}" fi diff --git a/env/JET.env b/env/JET.env index a5d3c7d1d29..552dce23de2 100755 --- a/env/JET.env +++ b/env/JET.env @@ -14,9 +14,9 @@ fi step=$1 -if [[ "$PARTITION_BATCH" = "xjet" ]]; then +if [[ "${PARTITION_BATCH}" = "xjet" ]]; then export npe_node_max=24 -elif [[ "$PARTITION_BATCH" = "vjet" ]]; then +elif [[ "${PARTITION_BATCH}" = "vjet" ]]; then export npe_node_max=16 fi export launcher="srun -l --export=ALL" @@ -29,205 +29,205 @@ export NTHSTACK=1024000000 ulimit -s unlimited ulimit -a -export job=${PBS_JOBNAME:-$step} +export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ $step = "prep" -o $step = "prepbufr" ]; then +if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then - nth_max=$(($npe_node_max / $npe_node_prep)) + nth_max=$((${npe_node_max} / ${npe_node_prep})) export POE="NO" export BACK=${BACK:-"NO"} export sys_tp="JET" -elif [ $step = "waveinit" -o $step = "waveprep" -o $step = "wavepostsbs" -o $step = "wavepostbndpnt" -o $step = "wavepostbndpntbll" -o $step = "wavepostpnt" ]; then +elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then - if [ $step = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ $step = "atmanalrun" ]; then +elif [ ${step} = "atmanalrun" ]; then - nth_max=$(($npe_node_max / $npe_node_atmanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) - export NTHREADS_ATMANAL=${nth_atmanalrun:-$nth_max} - [[ $NTHREADS_ATMANAL -gt $nth_max ]] && export NTHREADS_ATMANAL=$nth_max - export APRUN_ATMANAL="$launcher $npe_atmanalrun" + export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} + [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} + export APRUN_ATMANAL="${launcher} ${npe_atmanalrun}" -elif [ $step = "atmensanalrun" ]; then +elif [ ${step} = "atmensanalrun" ]; then - nth_max=$(($npe_node_max / $npe_node_atmensanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) - export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-$nth_max} - [[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max - export APRUN_ATMENSANAL="$launcher $npe_atmensanalrun" + export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} + [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} + export APRUN_ATMENSANAL="${launcher} ${npe_atmensanalrun}" -elif [ $step = "anal" ]; then +elif [ ${step} = "anal" ]; then - nth_max=$(($npe_node_max / $npe_node_anal)) + nth_max=$((${npe_node_max} / ${npe_node_anal})) - export NTHREADS_GSI=${nth_gsi:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher ${npe_gsi:-${npe_anal:-$PBS_NP}}" + export NTHREADS_GSI=${nth_gsi:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} ${npe_gsi:-${npe_anal:-${PBS_NP}}}" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher \$ncmd" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${nth_cycle:-12} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_cycle=${ntiles:-6} - export APRUN_CYCLE="$launcher $npe_cycle" + export APRUN_CYCLE="${launcher} ${npe_cycle}" export NTHREADS_GAUSFCANL=1 npe_gausfcanl=${npe_gausfcanl:-1} - export APRUN_GAUSFCANL="$launcher $npe_gausfcanl" + export APRUN_GAUSFCANL="${launcher} ${npe_gausfcanl}" -elif [ $step = "sfcanl" ]; then - nth_max=$(($npe_node_max / $npe_node_sfcanl)) +elif [ ${step} = "sfcanl" ]; then + nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_sfcanl=${ntiles:-6} - export APRUN_CYCLE="$launcher $npe_sfcanl" + export APRUN_CYCLE="${launcher} ${npe_sfcanl}" -elif [ $step = "gldas" ]; then +elif [ ${step} = "gldas" ]; then - nth_max=$(($npe_node_max / $npe_node_gldas)) + nth_max=$((${npe_node_max} / ${npe_node_gldas})) - export NTHREADS_GLDAS=${nth_gldas:-$nth_max} - [[ $NTHREADS_GLDAS -gt $nth_max ]] && export NTHREADS_GLDAS=$nth_max - export APRUN_GLDAS="$launcher $npe_gldas" + export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} + [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} + export APRUN_GLDAS="${launcher} ${npe_gldas}" export NTHREADS_GAUSSIAN=${nth_gaussian:-1} - [[ $NTHREADS_GAUSSIAN -gt $nth_max ]] && export NTHREADS_GAUSSIAN=$nth_max - export APRUN_GAUSSIAN="$launcher $npe_gaussian" + [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} + export APRUN_GAUSSIAN="${launcher} ${npe_gaussian}" -elif [ $step = "eobs" ]; then +elif [ ${step} = "eobs" ]; then - nth_max=$(($npe_node_max / $npe_node_eobs)) + nth_max=$((${npe_node_max} / ${npe_node_eobs})) - export NTHREADS_GSI=${nth_gsi:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher ${npe_gsi:-${npe_eobs:-$PBS_NP}}" + export NTHREADS_GSI=${nth_gsi:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} ${npe_gsi:-${npe_eobs:-${PBS_NP}}}" -elif [ $step = "eupd" ]; then +elif [ ${step} = "eupd" ]; then - nth_max=$(($npe_node_max / $npe_node_eupd)) + nth_max=$((${npe_node_max} / ${npe_node_eupd})) - export NTHREADS_ENKF=${nth_enkf:-$nth_max} - [[ $NTHREADS_ENKF -gt $nth_max ]] && export NTHREADS_ENKF=$nth_max - export APRUN_ENKF="$launcher ${npe_enkf:-${npe_eupd:-$PBS_NP}}" + export NTHREADS_ENKF=${nth_enkf:-${nth_max}} + [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="${launcher} ${npe_enkf:-${npe_eupd:-${PBS_NP}}}" -elif [ $step = "fcst" ]; then +elif [ ${step} = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs - if [[ $CDUMP == "gfs" ]]; then - npe_fcst=$npe_fcst_gfs - npe_node_fcst=$npe_node_fcst_gfs - nth_fv3=$nth_fv3_gfs + if [[ ${CDUMP} == "gfs" ]]; then + npe_fcst=${npe_fcst_gfs} + npe_node_fcst=${npe_node_fcst_gfs} + nth_fv3=${nth_fv3_gfs} fi - nth_max=$(($npe_node_max / $npe_node_fcst)) + nth_max=$((${npe_node_max} / ${npe_node_fcst})) - export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher" + export NTHREADS_FV3=${nth_fv3:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher $LEVS" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} ${LEVS}" export NTHREADS_REMAP=${nth_remap:-2} - [[ $NTHREADS_REMAP -gt $nth_max ]] && export NTHREADS_REMAP=$nth_max - export APRUN_REMAP="$launcher ${npe_remap:-${npe_fcst:-$PBS_NP}}" + [[ ${NTHREADS_REMAP} -gt ${nth_max} ]] && export NTHREADS_REMAP=${nth_max} + export APRUN_REMAP="${launcher} ${npe_remap:-${npe_fcst:-${PBS_NP}}}" export I_MPI_DAPL_UD="enable" -elif [ $step = "efcs" ]; then +elif [ ${step} = "efcs" ]; then - nth_max=$(($npe_node_max / $npe_node_efcs)) + nth_max=$((${npe_node_max} / ${npe_node_efcs})) - export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher ${npe_fv3:-${npe_efcs:-$PBS_NP}}" + export NTHREADS_FV3=${nth_fv3:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} ${npe_fv3:-${npe_efcs:-${PBS_NP}}}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher $LEVS" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} ${LEVS}" -elif [ $step = "post" ]; then +elif [ ${step} = "post" ]; then - nth_max=$(($npe_node_max / $npe_node_post)) + nth_max=$((${npe_node_max} / ${npe_node_post})) export NTHREADS_NP=${nth_np:-1} - [[ $NTHREADS_NP -gt $nth_max ]] && export NTHREADS_NP=$nth_max - export APRUN_NP="$launcher" + [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} + export APRUN_NP="${launcher}" export NTHREADS_DWN=${nth_dwn:-1} - [[ $NTHREADS_DWN -gt $nth_max ]] && export NTHREADS_DWN=$nth_max - export APRUN_NP="$launcher" + [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} + export APRUN_NP="${launcher}" -elif [ $step = "ecen" ]; then +elif [ ${step} = "ecen" ]; then - nth_max=$(($npe_node_max / $npe_node_ecen)) + nth_max=$((${npe_node_max} / ${npe_node_ecen})) - export NTHREADS_ECEN=${nth_ecen:-$nth_max} - [[ $NTHREADS_ECEN -gt $nth_max ]] && export NTHREADS_ECEN=$nth_max - export APRUN_ECEN="$launcher ${npe_ecen:-$PBS_NP}" + export NTHREADS_ECEN=${nth_ecen:-${nth_max}} + [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} + export APRUN_ECEN="${launcher} ${npe_ecen:-${PBS_NP}}" export NTHREADS_CHGRES=${nth_chgres:-12} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + [[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max} export APRUN_CHGRES="time" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher ${npe_ecen:-$PBS_NP}" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} ${npe_ecen:-${PBS_NP}}" -elif [ $step = "esfc" ]; then +elif [ ${step} = "esfc" ]; then - nth_max=$(($npe_node_max / $npe_node_esfc)) + nth_max=$((${npe_node_max} / ${npe_node_esfc})) - export NTHREADS_ESFC=${nth_esfc:-$nth_max} - [[ $NTHREADS_ESFC -gt $nth_max ]] && export NTHREADS_ESFC=$nth_max - export APRUN_ESFC="$launcher ${npe_esfc:-$PBS_NP}" + export NTHREADS_ESFC=${nth_esfc:-${nth_max}} + [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} + export APRUN_ESFC="${launcher} ${npe_esfc:-${PBS_NP}}" export NTHREADS_CYCLE=${nth_cycle:-12} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max - export APRUN_CYCLE="$launcher $npe_esfc" + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} ${npe_esfc}" -elif [ $step = "epos" ]; then +elif [ ${step} = "epos" ]; then - nth_max=$(($npe_node_max / $npe_node_epos)) + nth_max=$((${npe_node_max} / ${npe_node_epos})) - export NTHREADS_EPOS=${nth_epos:-$nth_max} - [[ $NTHREADS_EPOS -gt $nth_max ]] && export NTHREADS_EPOS=$nth_max - export APRUN_EPOS="$launcher ${npe_epos:-$PBS_NP}" + export NTHREADS_EPOS=${nth_epos:-${nth_max}} + [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} + export APRUN_EPOS="${launcher} ${npe_epos:-${PBS_NP}}" -elif [ $step = "init" ]; then +elif [ ${step} = "init" ]; then - export APRUN="$launcher" + export APRUN="${launcher}" -elif [ $step = "postsnd" ]; then +elif [ ${step} = "postsnd" ]; then - nth_max=$(($npe_node_max / $npe_node_postsnd)) + nth_max=$((${npe_node_max} / ${npe_node_postsnd})) export NTHREADS_POSTSND=${nth_postsnd:-1} - [[ $NTHREADS_POSTSND -gt $nth_max ]] && export NTHREADS_POSTSND=$nth_max - export APRUN_POSTSND="$launcher $npe_postsnd" + [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} + export APRUN_POSTSND="${launcher} ${npe_postsnd}" export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1} - [[ $NTHREADS_POSTSNDCFP -gt $nth_max ]] && export NTHREADS_POSTSNDCFP=$nth_max - export APRUN_POSTSNDCFP="$launcher $npe_postsndcfp" + [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} + export APRUN_POSTSNDCFP="${launcher} ${npe_postsndcfp}" -elif [ $step = "awips" ]; then +elif [ ${step} = "awips" ]; then - echo "WARNING: $step is not enabled on $machine!" + echo "WARNING: ${step} is not enabled on ${machine}!" -elif [ $step = "gempak" ]; then +elif [ ${step} = "gempak" ]; then - echo "WARNING: $step is not enabled on $machine!" + echo "WARNING: ${step} is not enabled on ${machine}!" fi diff --git a/env/ORION.env b/env/ORION.env index d8bc5fc6648..346512a88c0 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -33,255 +33,255 @@ export NTHSTACK=1024000000 ulimit -s unlimited ulimit -a -export job=${PBS_JOBNAME:-$step} +export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ $step = "prep" -o $step = "prepbufr" ]; then +if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then - nth_max=$(($npe_node_max / $npe_node_prep)) + nth_max=$((${npe_node_max} / ${npe_node_prep})) export POE="NO" export BACK=${BACK:-"YES"} export sys_tp="ORION" export launcher_PREP="srun" -elif [ $step = "waveinit" -o $step = "waveprep" -o $step = "wavepostsbs" -o $step = "wavepostbndpnt" -o $step = "wavepostpnt" ]; then +elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostpnt" ]; then export CFP_MP="YES" - if [ $step = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ $step = "atmanalrun" ]; then +elif [ ${step} = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) - export NTHREADS_ATMANAL=${nth_atmanalrun:-$nth_max} - [[ $NTHREADS_ATMANAL -gt $nth_max ]] && export NTHREADS_ATMANAL=$nth_max - export APRUN_ATMANAL="$launcher -n $npe_atmanalrun" + export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} + [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} + export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ $step = "atmensanalrun" ]; then +elif [ ${step} = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmensanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) - export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-$nth_max} - [[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max - export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun" + export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} + [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} + export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ $step = "aeroanlrun" ]; then +elif [ ${step} = "aeroanlrun" ]; then - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_aeroanlrun)) + nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) - export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max} - [[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max - export APRUN_AEROANL="$launcher -n $npe_aeroanlrun" + export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} + [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} + export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ $step = "anal" -o $step = "analcalc" ]; then +elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_anal)) + nth_max=$((${npe_node_max} / ${npe_node_anal})) - export NTHREADS_GSI=${nth_anal:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_anal}" + export NTHREADS_GSI=${nth_anal:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_anal}}" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher \$ncmd" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${nth_cycle:-12} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_cycle=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_cycle" + export APRUN_CYCLE="${launcher} -n ${npe_cycle}" export NTHREADS_GAUSFCANL=1 npe_gausfcanl=${npe_gausfcanl:-1} - export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" + export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ $step = "sfcanl" ]; then - nth_max=$(($npe_node_max / $npe_node_sfcanl)) +elif [ ${step} = "sfcanl" ]; then + nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_sfcanl=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_sfcanl" + export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ $step = "gldas" ]; then +elif [ ${step} = "gldas" ]; then export USE_CFP="NO" - nth_max=$(($npe_node_max / $npe_node_gldas)) + nth_max=$((${npe_node_max} / ${npe_node_gldas})) - export NTHREADS_GLDAS=${nth_gldas:-$nth_max} - [[ $NTHREADS_GLDAS -gt $nth_max ]] && export NTHREADS_GLDAS=$nth_max - export APRUN_GLDAS="$launcher -n $npe_gldas" + export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} + [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} + export APRUN_GLDAS="${launcher} -n ${npe_gldas}" export NTHREADS_GAUSSIAN=${nth_gaussian:-1} - [[ $NTHREADS_GAUSSIAN -gt $nth_max ]] && export NTHREADS_GAUSSIAN=$nth_max - export APRUN_GAUSSIAN="$launcher -n $npe_gaussian" + [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} + export APRUN_GAUSSIAN="${launcher} -n ${npe_gaussian}" # Must run data processing with exactly the number of tasks as time # periods being processed. - npe_gldas_data_proc=$(($gldas_spinup_hours + 12)) - export APRUN_GLDAS_DATA_PROC="$launcher -n $npe_gldas_data_proc ${mpmd_opt}" + npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ $step = "eobs" ]; then +elif [ ${step} = "eobs" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_eobs)) + nth_max=$((${npe_node_max} / ${npe_node_eobs})) - export NTHREADS_GSI=${nth_eobs:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_eobs}" + export NTHREADS_GSI=${nth_eobs:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}}" -elif [ $step = "eupd" ]; then +elif [ ${step} = "eupd" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -n \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_eupd)) + nth_max=$((${npe_node_max} / ${npe_node_eupd})) - export NTHREADS_ENKF=${nth_eupd:-$nth_max} - [[ $NTHREADS_ENKF -gt $nth_max ]] && export NTHREADS_ENKF=$nth_max - export APRUN_ENKF="$launcher -n ${npe_enkf:-$npe_eupd}" + export NTHREADS_ENKF=${nth_eupd:-${nth_max}} + [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}}" -elif [ $step = "fcst" ]; then +elif [ ${step} = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs - if [[ $CDUMP == "gfs" ]]; then - npe_fcst=$npe_fcst_gfs - npe_node_fcst=$npe_node_fcst_gfs - nth_fv3=$nth_fv3_gfs + if [[ ${CDUMP} == "gfs" ]]; then + npe_fcst=${npe_fcst_gfs} + npe_node_fcst=${npe_node_fcst_gfs} + nth_fv3=${nth_fv3_gfs} fi - nth_max=$(($npe_node_max / $npe_node_fcst)) + nth_max=$((${npe_node_max} / ${npe_node_fcst})) - export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n $npe_fcst" + export NTHREADS_FV3=${nth_fv3:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_fcst}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n ${LEVS}" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" export NTHREADS_REMAP=${nth_remap:-2} - [[ $NTHREADS_REMAP -gt $nth_max ]] && export NTHREADS_REMAP=$nth_max - export APRUN_REMAP="$launcher -n ${npe_remap:-$npe_fcst}" + [[ ${NTHREADS_REMAP} -gt ${nth_max} ]] && export NTHREADS_REMAP=${nth_max} + export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ $step = "efcs" ]; then +elif [ ${step} = "efcs" ]; then - nth_max=$(($npe_node_max / $npe_node_efcs)) + nth_max=$((${npe_node_max} / ${npe_node_efcs})) - export NTHREADS_FV3=${nth_efcs:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n $npe_efcs" + export NTHREADS_FV3=${nth_efcs:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_efcs}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n ${LEVS}" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ $step = "post" ]; then +elif [ ${step} = "post" ]; then - nth_max=$(($npe_node_max / $npe_node_post)) + nth_max=$((${npe_node_max} / ${npe_node_post})) export NTHREADS_NP=${nth_np:-1} - [[ $NTHREADS_NP -gt $nth_max ]] && export NTHREADS_NP=$nth_max - export APRUN_NP="$launcher -n ${npe_post}" + [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} + export APRUN_NP="${launcher} -n ${npe_post}" export NTHREADS_DWN=${nth_dwn:-1} - [[ $NTHREADS_DWN -gt $nth_max ]] && export NTHREADS_DWN=$nth_max - export APRUN_DWN="$launcher -n ${npe_dwn}" + [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} + export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ $step = "ecen" ]; then +elif [ ${step} = "ecen" ]; then - nth_max=$(($npe_node_max / $npe_node_ecen)) + nth_max=$((${npe_node_max} / ${npe_node_ecen})) - export NTHREADS_ECEN=${nth_ecen:-$nth_max} - [[ $NTHREADS_ECEN -gt $nth_max ]] && export NTHREADS_ECEN=$nth_max - export APRUN_ECEN="$launcher -n $npe_ecen" + export NTHREADS_ECEN=${nth_ecen:-${nth_max}} + [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} + export APRUN_ECEN="${launcher} -n ${npe_ecen}" export NTHREADS_CHGRES=${nth_chgres:-12} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + [[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max} export APRUN_CHGRES="time" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher -n $npe_ecen" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ $step = "esfc" ]; then +elif [ ${step} = "esfc" ]; then - nth_max=$(($npe_node_max / $npe_node_esfc)) + nth_max=$((${npe_node_max} / ${npe_node_esfc})) - export NTHREADS_ESFC=${nth_esfc:-$nth_max} - [[ $NTHREADS_ESFC -gt $nth_max ]] && export NTHREADS_ESFC=$nth_max - export APRUN_ESFC="$launcher -n $npe_esfc" + export NTHREADS_ESFC=${nth_esfc:-${nth_max}} + [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} + export APRUN_ESFC="${launcher} -n ${npe_esfc}" export NTHREADS_CYCLE=${nth_cycle:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max - export APRUN_CYCLE="$launcher -n $npe_esfc" + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ $step = "epos" ]; then +elif [ ${step} = "epos" ]; then - nth_max=$(($npe_node_max / $npe_node_epos)) + nth_max=$((${npe_node_max} / ${npe_node_epos})) - export NTHREADS_EPOS=${nth_epos:-$nth_max} - [[ $NTHREADS_EPOS -gt $nth_max ]] && export NTHREADS_EPOS=$nth_max - export APRUN_EPOS="$launcher -n $npe_epos" + export NTHREADS_EPOS=${nth_epos:-${nth_max}} + [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} + export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ $step = "init" ]; then +elif [ ${step} = "init" ]; then - export APRUN="$launcher -n ${npe_init}" + export APRUN="${launcher} -n ${npe_init}" -elif [ $step = "postsnd" ]; then +elif [ ${step} = "postsnd" ]; then - nth_max=$(($npe_node_max / $npe_node_postsnd)) + nth_max=$((${npe_node_max} / ${npe_node_postsnd})) export NTHREADS_POSTSND=${nth_postsnd:-1} - [[ $NTHREADS_POSTSND -gt $nth_max ]] && export NTHREADS_POSTSND=$nth_max - export APRUN_POSTSND="$launcher -n ${npe_postsnd}" + [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} + export APRUN_POSTSND="${launcher} -n ${npe_postsnd}" export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1} - [[ $NTHREADS_POSTSNDCFP -gt $nth_max ]] && export NTHREADS_POSTSNDCFP=$nth_max - export APRUN_POSTSNDCFP="$launcher -n ${npe_postsnd} ${mpmd_opt}" + [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} + export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ $step = "awips" ]; then +elif [ ${step} = "awips" ]; then - nth_max=$(($npe_node_max / $npe_node_awips)) + nth_max=$((${npe_node_max} / ${npe_node_awips})) export NTHREADS_AWIPS=${nth_awips:-2} - [[ $NTHREADS_AWIPS -gt $nth_max ]] && export NTHREADS_AWIPS=$nth_max - export APRUN_AWIPSCFP="$launcher -n $npe_awips ${mpmd_opt}" + [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} + export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ $step = "gempak" ]; then +elif [ ${step} = "gempak" ]; then - nth_max=$(($npe_node_max / ${npe_node_gempak})) + nth_max=$((${npe_node_max} / ${npe_node_gempak})) export NTHREADS_GEMPAK=${nth_gempak:-1} [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} diff --git a/env/WCOSS2.env b/env/WCOSS2.env index eb9969c429a..f8c771d7e93 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -21,159 +21,159 @@ export mpmd_opt="--cpu-bind verbose,core cfp" export npe_node_max=128 -export job=${PBS_JOBNAME:-$step} +export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ $step = "prep" -o $step = "prepbufr" ]; then +if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then - nth_max=$(($npe_node_max / $npe_node_prep)) + nth_max=$((${npe_node_max} / ${npe_node_prep})) export POE=${POE:-"YES"} export BACK=${BACK:-"off"} export sys_tp="wcoss2" export launcher_PREP="mpiexec" -elif [ $step = "waveinit" -o $step = "waveprep" -o $step = "wavepostsbs" -o $step = "wavepostbndpnt" -o $step = "wavepostbndpntbll" -o $step = "wavepostpnt" ]; then +elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then - if [ $step = "waveprep" -a $CDUMP = "gfs" ]; then NTASKS=$NTASKS_gfs ; fi - export wavempexec="$launcher -np" + if [ ${step} = "waveprep" -a ${CDUMP} = "gfs" ]; then NTASKS=${NTASKS_gfs} ; fi + export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt} -elif [ $step = "atmanalrun" ]; then +elif [ ${step} = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) - export NTHREADS_ATMANAL=${nth_atmanalrun:-$nth_max} - [[ $NTHREADS_ATMANAL -gt $nth_max ]] && export NTHREADS_ATMANAL=$nth_max - export APRUN_ATMANAL="$launcher -n $npe_atmanalrun" + export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} + [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} + export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ $step = "atmensanalrun" ]; then +elif [ ${step} = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_atmensanalrun)) + nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) - export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-$nth_max} - [[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max - export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun" + export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} + [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} + export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ $step = "aeroanlrun" ]; then +elif [ ${step} = "aeroanlrun" ]; then - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$(($npe_node_max / $npe_node_aeroanlrun)) + nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) - export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max} - [[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max - export APRUN_AEROANL="$launcher -n $npe_aeroanlrun" + export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} + [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} + export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ $step = "anal" -o $step = "analcalc" ]; then +elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G export FI_OFI_RXM_SAR_LIMIT=3145728 - if [ $step = "analcalc" ]; then + if [ ${step} = "analcalc" ]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" fi - nth_max=$(($npe_node_max / $npe_node_anal)) + nth_max=$((${npe_node_max} / ${npe_node_anal})) - export NTHREADS_GSI=${nth_anal:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_anal} -ppn $npe_node_anal --cpu-bind depth --depth $NTHREADS_GSI" + export NTHREADS_GSI=${nth_anal:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_anal}} -ppn ${npe_node_anal} --cpu-bind depth --depth ${NTHREADS_GSI}" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher \$ncmd" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} \$ncmd" export NTHREADS_CYCLE=${nth_cycle:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_cycle=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_cycle -ppn $npe_node_cycle --cpu-bind depth --depth $NTHREADS_CYCLE" + export APRUN_CYCLE="${launcher} -n ${npe_cycle} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" export NTHREADS_GAUSFCANL=1 npe_gausfcanl=${npe_gausfcanl:-1} - export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" + export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" export NTHREADS_CHGRES=${nth_echgres:-14} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + [[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max} export APRUN_CHGRES="" export CFP_MP=${CFP_MP:-"NO"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ $step = "sfcanl" ]; then +elif [ ${step} = "sfcanl" ]; then - nth_max=$(($npe_node_max / $npe_node_sfcanl)) + nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} npe_sfcanl=${ntiles:-6} - export APRUN_CYCLE="$launcher -n $npe_sfcanl" + export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ $step = "gldas" ]; then +elif [ ${step} = "gldas" ]; then export USE_CFP="YES" export CFP_MP="NO" - nth_max=$(($npe_node_max / $npe_node_gldas)) + nth_max=$((${npe_node_max} / ${npe_node_gldas})) - export NTHREADS_GLDAS=${nth_gldas:-$nth_max} - [[ $NTHREADS_GLDAS -gt $nth_max ]] && export NTHREADS_GLDAS=$nth_max - export APRUN_GLDAS="$launcher -n $npe_gldas -ppn $npe_node_gldas --cpu-bind depth --depth $NTHREADS_GLDAS" + export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} + [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} + export APRUN_GLDAS="${launcher} -n ${npe_gldas} -ppn ${npe_node_gldas} --cpu-bind depth --depth ${NTHREADS_GLDAS}" export NTHREADS_GAUSSIAN=${nth_gaussian:-1} - [[ $NTHREADS_GAUSSIAN -gt $nth_max ]] && export NTHREADS_GAUSSIAN=$nth_max - export APRUN_GAUSSIAN="$launcher -n $npe_gaussian -ppn $npe_node_gaussian --cpu-bind depth --depth $NTHREADS_GAUSSIAN" + [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} + export APRUN_GAUSSIAN="${launcher} -n ${npe_gaussian} -ppn ${npe_node_gaussian} --cpu-bind depth --depth ${NTHREADS_GAUSSIAN}" # Must run data processing with exactly the number of tasks as time # periods being processed. export USE_CFP=${USE_CFP:-"YES"} - npe_gldas_data_proc=$(($gldas_spinup_hours + 12)) - export APRUN_GLDAS_DATA_PROC="$launcher -np $npe_gldas_data_proc ${mpmd_opt}" + npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + export APRUN_GLDAS_DATA_PROC="${launcher} -np ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ $step = "eobs" ]; then +elif [ ${step} = "eobs" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G export FI_OFI_RXM_SAR_LIMIT=3145728 - nth_max=$(($npe_node_max / $npe_node_eobs)) + nth_max=$((${npe_node_max} / ${npe_node_eobs})) - export NTHREADS_GSI=${nth_eobs:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max - export APRUN_GSI="$launcher -n ${npe_gsi:-$npe_eobs} -ppn $npe_node_eobs --cpu-bind depth --depth $NTHREADS_GSI" + export NTHREADS_GSI=${nth_eobs:-${nth_max}} + [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} + export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}} -ppn ${npe_node_eobs} --cpu-bind depth --depth ${NTHREADS_GSI}" export CFP_MP=${CFP_MP:-"NO"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ $step = "eupd" ]; then +elif [ ${step} = "eupd" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=2G export MPICH_COLL_OPT_OFF=1 export FI_OFI_RXM_SAR_LIMIT=3145728 - nth_max=$(($npe_node_max / $npe_node_eupd)) + nth_max=$((${npe_node_max} / ${npe_node_eupd})) - export NTHREADS_ENKF=${nth_eupd:-$nth_max} - [[ $NTHREADS_ENKF -gt $nth_max ]] && export NTHREADS_ENKF=$nth_max - export APRUN_ENKF="$launcher -n ${npe_enkf:-$npe_eupd} -ppn $npe_node_eupd --cpu-bind depth --depth $NTHREADS_ENKF" + export NTHREADS_ENKF=${nth_eupd:-${nth_max}} + [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}} -ppn ${npe_node_eupd} --cpu-bind depth --depth ${NTHREADS_ENKF}" export CFP_MP=${CFP_MP:-"NO"} export USE_CFP=${USE_CFP:-"YES"} - export APRUNCFP="$launcher -np \$ncmd ${mpmd_opt}" + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ $step = "fcst" ]; then +elif [ ${step} = "fcst" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=2048M @@ -181,138 +181,138 @@ elif [ $step = "fcst" ]; then export FI_OFI_RXM_TX_SIZE=40000 #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs - if [[ $CDUMP == "gfs" ]]; then - npe_fcst=$npe_fcst_gfs - npe_node_fcst=$npe_node_fcst_gfs - nth_fv3=$nth_fv3_gfs + if [[ ${CDUMP} == "gfs" ]]; then + npe_fcst=${npe_fcst_gfs} + npe_node_fcst=${npe_node_fcst_gfs} + nth_fv3=${nth_fv3_gfs} fi - nth_max=$(($npe_node_max / $npe_node_fcst)) + nth_max=$((${npe_node_max} / ${npe_node_fcst})) - export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n $npe_fcst -ppn $npe_node_fcst --cpu-bind depth --depth $NTHREADS_FV3" + export NTHREADS_FV3=${nth_fv3:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_fcst} -ppn ${npe_node_fcst} --cpu-bind depth --depth ${NTHREADS_FV3}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n $LEVS" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" export NTHREADS_REMAP=${nth_remap:-2} - [[ $NTHREADS_REMAP -gt $nth_max ]] && export NTHREADS_REMAP=$nth_max - export APRUN_REMAP="$launcher -n ${npe_remap:-$npe_fcst}" + [[ ${NTHREADS_REMAP} -gt ${nth_max} ]] && export NTHREADS_REMAP=${nth_max} + export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ $step = "efcs" ]; then +elif [ ${step} = "efcs" ]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" export FI_OFI_RXM_SAR_LIMIT=3145728 export FI_OFI_RXM_RX_SIZE=40000 export FI_OFI_RXM_TX_SIZE=40000 - nth_max=$(($npe_node_max / $npe_node_efcs)) + nth_max=$((${npe_node_max} / ${npe_node_efcs})) - export NTHREADS_FV3=${nth_efcs:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max - export cores_per_node=$npe_node_max - export APRUN_FV3="$launcher -n ${npe_fv3:-$npe_efcs} -ppn $npe_node_efcs --cpu-bind depth --depth $NTHREADS_FV3" + export NTHREADS_FV3=${nth_efcs:-${nth_max}} + [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=${npe_node_max} + export APRUN_FV3="${launcher} -n ${npe_fv3:-${npe_efcs}} -ppn ${npe_node_efcs} --cpu-bind depth --depth ${NTHREADS_FV3}" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max - export APRUN_REGRID_NEMSIO="$launcher -n $LEVS" + [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ $step = "post" ]; then +elif [ ${step} = "post" ]; then - nth_max=$(($npe_node_max / $npe_node_post)) + nth_max=$((${npe_node_max} / ${npe_node_post})) export NTHREADS_NP=${nth_np:-1} - [[ $NTHREADS_NP -gt $nth_max ]] && export NTHREADS_NP=$nth_max - export APRUN_NP="$launcher -n ${npe_np:-$npe_post} -ppn $npe_node_post --cpu-bind depth --depth $NTHREADS_NP" + [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} + export APRUN_NP="${launcher} -n ${npe_np:-${npe_post}} -ppn ${npe_node_post} --cpu-bind depth --depth ${NTHREADS_NP}" export NTHREADS_DWN=${nth_dwn:-1} - [[ $NTHREADS_DWN -gt $nth_max ]] && export NTHREADS_DWN=$nth_max - export APRUN_DWN="$launcher -np $npe_dwn ${mpmd_opt}" + [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} + export APRUN_DWN="${launcher} -np ${npe_dwn} ${mpmd_opt}" -elif [ $step = "ecen" ]; then +elif [ ${step} = "ecen" ]; then - nth_max=$(($npe_node_max / $npe_node_ecen)) + nth_max=$((${npe_node_max} / ${npe_node_ecen})) - export NTHREADS_ECEN=${nth_ecen:-$nth_max} - [[ $NTHREADS_ECEN -gt $nth_max ]] && export NTHREADS_ECEN=$nth_max - export APRUN_ECEN="$launcher -n $npe_ecen -ppn $npe_node_ecen --cpu-bind depth --depth $NTHREADS_ECEN" + export NTHREADS_ECEN=${nth_ecen:-${nth_max}} + [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} + export APRUN_ECEN="${launcher} -n ${npe_ecen} -ppn ${npe_node_ecen} --cpu-bind depth --depth ${NTHREADS_ECEN}" export NTHREADS_CHGRES=${nth_chgres:-14} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + [[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max} export APRUN_CHGRES="time" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max - export APRUN_CALCINC="$launcher -n $npe_ecen" + [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="${launcher} -n ${npe_ecen}" export NTHREADS_CYCLE=${nth_cycle:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max - export APRUN_CYCLE="$launcher -n $npe_ecen -ppn $npe_node_cycle --cpu-bind depth --depth $NTHREADS_CYCLE" + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} -n ${npe_ecen} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ $step = "esfc" ]; then +elif [ ${step} = "esfc" ]; then - nth_max=$(($npe_node_max / $npe_node_esfc)) + nth_max=$((${npe_node_max} / ${npe_node_esfc})) - export NTHREADS_ESFC=${nth_esfc:-$nth_max} - [[ $NTHREADS_ESFC -gt $nth_max ]] && export NTHREADS_ESFC=$nth_max - export APRUN_ESFC="$launcher -n $npe_esfc -ppn $npe_node_esfc --cpu-bind depth --depth $NTHREADS_ESFC" + export NTHREADS_ESFC=${nth_esfc:-${nth_max}} + [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} + export APRUN_ESFC="${launcher} -n ${npe_esfc} -ppn ${npe_node_esfc} --cpu-bind depth --depth ${NTHREADS_ESFC}" export NTHREADS_CYCLE=${nth_cycle:-14} - [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max - export APRUN_CYCLE="$launcher -n $npe_esfc -ppn $npe_node_cycle --cpu-bind depth --depth $NTHREADS_CYCLE" + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} -n ${npe_esfc} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ $step = "epos" ]; then +elif [ ${step} = "epos" ]; then - nth_max=$(($npe_node_max / $npe_node_epos)) + nth_max=$((${npe_node_max} / ${npe_node_epos})) - export NTHREADS_EPOS=${nth_epos:-$nth_max} - [[ $NTHREADS_EPOS -gt $nth_max ]] && export NTHREADS_EPOS=$nth_max - export APRUN_EPOS="$launcher -n $npe_epos -ppn $npe_node_epos --cpu-bind depth --depth $NTHREADS_EPOS" + export NTHREADS_EPOS=${nth_epos:-${nth_max}} + [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} + export APRUN_EPOS="${launcher} -n ${npe_epos} -ppn ${npe_node_epos} --cpu-bind depth --depth ${NTHREADS_EPOS}" -elif [ $step = "init" ]; then +elif [ ${step} = "init" ]; then - export APRUN="$launcher" + export APRUN="${launcher}" -elif [ $step = "postsnd" ]; then +elif [ ${step} = "postsnd" ]; then export MPICH_MPIIO_HINTS_DISPLAY=1 export OMP_NUM_THREADS=1 - nth_max=$(($npe_node_max / $npe_node_postsnd)) + nth_max=$((${npe_node_max} / ${npe_node_postsnd})) export NTHREADS_POSTSND=${nth_postsnd:-1} - [[ $NTHREADS_POSTSND -gt $nth_max ]] && export NTHREADS_POSTSND=$nth_max - export APRUN_POSTSND="$launcher -n $npe_postsnd --depth=$NTHREADS_POSTSND --cpu-bind depth" + [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} + export APRUN_POSTSND="${launcher} -n ${npe_postsnd} --depth=${NTHREADS_POSTSND} --cpu-bind depth" export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1} - [[ $NTHREADS_POSTSNDCFP -gt $nth_max ]] && export NTHREADS_POSTSNDCFP=$nth_max - export APRUN_POSTSNDCFP="$launcher -np $npe_postsndcfp ${mpmd_opt}" + [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} + export APRUN_POSTSNDCFP="${launcher} -np ${npe_postsndcfp} ${mpmd_opt}" -elif [ $step = "awips" ]; then +elif [ ${step} = "awips" ]; then - nth_max=$(($npe_node_max / $npe_node_awips)) + nth_max=$((${npe_node_max} / ${npe_node_awips})) export NTHREADS_AWIPS=${nth_awips:-2} - [[ $NTHREADS_AWIPS -gt $nth_max ]] && export NTHREADS_AWIPS=$nth_max - export APRUN_AWIPSCFP="$launcher -np $npe_awips ${mpmd_opt}" + [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} + export APRUN_AWIPSCFP="${launcher} -np ${npe_awips} ${mpmd_opt}" -elif [ $step = "gempak" ]; then +elif [ ${step} = "gempak" ]; then - nth_max=$(($npe_node_max / $npe_node_gempak)) + nth_max=$((${npe_node_max} / ${npe_node_gempak})) export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ $NTHREADS_GEMPAK -gt $nth_max ]] && export NTHREADS_GEMPAK=$nth_max - export APRUN_GEMPAKCFP="$launcher -np $npe_gempak ${mpmd_opt}" + [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} + export APRUN_GEMPAKCFP="${launcher} -np ${npe_gempak} ${mpmd_opt}" -elif [ $step = "waveawipsbulls" ]; then +elif [ ${step} = "waveawipsbulls" ]; then unset PERL5LIB -elif [ $step = "wafsgrib2" -o $step = "wafsgrib20p25" ]; then +elif [ ${step} = "wafsgrib2" -o ${step} = "wafsgrib20p25" ]; then export USE_CFP=${USE_CFP:-"YES"} From 5dc099dd8f80b8c0fde3a88910a430e9dff3d87c Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 08:06:07 -0600 Subject: [PATCH 3/7] Update env files for shellcheck SC2086 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SC2086 – Double quote to prevent globbing and word splitting. - Add double quotes around variables where missing in env files. Refs #397 --- env/HERA.env | 42 +++++++++++++++++++++--------------------- env/JET.env | 40 ++++++++++++++++++++-------------------- env/ORION.env | 42 +++++++++++++++++++++--------------------- env/WCOSS2.env | 48 ++++++++++++++++++++++++------------------------ 4 files changed, 86 insertions(+), 86 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index 0a20a1cf95c..c02bc07acb2 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -37,7 +37,7 @@ export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then +if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -46,14 +46,14 @@ if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then export sys_tp="HERA" export launcher_PREP="srun" -elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then +elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then export CFP_MP="YES" - if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ ${step} = "atmanalrun" ]; then +elif [ "${step}" = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -65,7 +65,7 @@ elif [ ${step} = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ ${step} = "atmensanalrun" ]; then +elif [ "${step}" = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -77,7 +77,7 @@ elif [ ${step} = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ ${step} = "aeroanlrun" ]; then +elif [ "${step}" = "aeroanlrun" ]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" @@ -87,7 +87,7 @@ elif [ ${step} = "aeroanlrun" ]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then +elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -116,7 +116,7 @@ elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ ${step} = "sfcanl" ]; then +elif [ "${step}" = "sfcanl" ]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -124,7 +124,7 @@ elif [ ${step} = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ ${step} = "gldas" ]; then +elif [ "${step}" = "gldas" ]; then export USE_CFP="NO" export CFP_MP="YES" @@ -145,7 +145,7 @@ elif [ ${step} = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ ${step} = "eobs" ]; then +elif [ "${step}" = "eobs" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -160,7 +160,7 @@ elif [ ${step} = "eobs" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ ${step} = "eupd" ]; then +elif [ "${step}" = "eupd" ]; then nth_max=$((${npe_node_max} / ${npe_node_eupd})) @@ -172,7 +172,7 @@ elif [ ${step} = "eupd" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ ${step} = "fcst" ]; then +elif [ "${step}" = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -197,7 +197,7 @@ elif [ ${step} = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ ${step} = "efcs" ]; then +elif [ "${step}" = "efcs" ]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -210,7 +210,7 @@ elif [ ${step} = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ ${step} = "post" ]; then +elif [ "${step}" = "post" ]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -222,7 +222,7 @@ elif [ ${step} = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ ${step} = "ecen" ]; then +elif [ "${step}" = "ecen" ]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -238,7 +238,7 @@ elif [ ${step} = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ ${step} = "esfc" ]; then +elif [ "${step}" = "esfc" ]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -250,7 +250,7 @@ elif [ ${step} = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ ${step} = "epos" ]; then +elif [ "${step}" = "epos" ]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -258,11 +258,11 @@ elif [ ${step} = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ ${step} = "init" ]; then +elif [ "${step}" = "init" ]; then export APRUN="${launcher} -n ${npe_init}" -elif [ ${step} = "postsnd" ]; then +elif [ "${step}" = "postsnd" ]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -274,7 +274,7 @@ elif [ ${step} = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ ${step} = "awips" ]; then +elif [ "${step}" = "awips" ]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -282,7 +282,7 @@ elif [ ${step} = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ ${step} = "gempak" ]; then +elif [ "${step}" = "gempak" ]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) diff --git a/env/JET.env b/env/JET.env index 552dce23de2..9774e3e8c07 100755 --- a/env/JET.env +++ b/env/JET.env @@ -32,7 +32,7 @@ ulimit -a export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then +if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -40,13 +40,13 @@ if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then export BACK=${BACK:-"NO"} export sys_tp="JET" -elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then +elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then - if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ ${step} = "atmanalrun" ]; then +elif [ "${step}" = "atmanalrun" ]; then nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) @@ -54,7 +54,7 @@ elif [ ${step} = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} ${npe_atmanalrun}" -elif [ ${step} = "atmensanalrun" ]; then +elif [ "${step}" = "atmensanalrun" ]; then nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) @@ -62,7 +62,7 @@ elif [ ${step} = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} ${npe_atmensanalrun}" -elif [ ${step} = "anal" ]; then +elif [ "${step}" = "anal" ]; then nth_max=$((${npe_node_max} / ${npe_node_anal})) @@ -83,7 +83,7 @@ elif [ ${step} = "anal" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} ${npe_gausfcanl}" -elif [ ${step} = "sfcanl" ]; then +elif [ "${step}" = "sfcanl" ]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -91,7 +91,7 @@ elif [ ${step} = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} ${npe_sfcanl}" -elif [ ${step} = "gldas" ]; then +elif [ "${step}" = "gldas" ]; then nth_max=$((${npe_node_max} / ${npe_node_gldas})) @@ -103,7 +103,7 @@ elif [ ${step} = "gldas" ]; then [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} export APRUN_GAUSSIAN="${launcher} ${npe_gaussian}" -elif [ ${step} = "eobs" ]; then +elif [ "${step}" = "eobs" ]; then nth_max=$((${npe_node_max} / ${npe_node_eobs})) @@ -111,7 +111,7 @@ elif [ ${step} = "eobs" ]; then [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="${launcher} ${npe_gsi:-${npe_eobs:-${PBS_NP}}}" -elif [ ${step} = "eupd" ]; then +elif [ "${step}" = "eupd" ]; then nth_max=$((${npe_node_max} / ${npe_node_eupd})) @@ -119,7 +119,7 @@ elif [ ${step} = "eupd" ]; then [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} export APRUN_ENKF="${launcher} ${npe_enkf:-${npe_eupd:-${PBS_NP}}}" -elif [ ${step} = "fcst" ]; then +elif [ "${step}" = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -144,7 +144,7 @@ elif [ ${step} = "fcst" ]; then export APRUN_REMAP="${launcher} ${npe_remap:-${npe_fcst:-${PBS_NP}}}" export I_MPI_DAPL_UD="enable" -elif [ ${step} = "efcs" ]; then +elif [ "${step}" = "efcs" ]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -157,7 +157,7 @@ elif [ ${step} = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} ${LEVS}" -elif [ ${step} = "post" ]; then +elif [ "${step}" = "post" ]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -169,7 +169,7 @@ elif [ ${step} = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_NP="${launcher}" -elif [ ${step} = "ecen" ]; then +elif [ "${step}" = "ecen" ]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -185,7 +185,7 @@ elif [ ${step} = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} ${npe_ecen:-${PBS_NP}}" -elif [ ${step} = "esfc" ]; then +elif [ "${step}" = "esfc" ]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -198,7 +198,7 @@ elif [ ${step} = "esfc" ]; then export APRUN_CYCLE="${launcher} ${npe_esfc}" -elif [ ${step} = "epos" ]; then +elif [ "${step}" = "epos" ]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -206,11 +206,11 @@ elif [ ${step} = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} ${npe_epos:-${PBS_NP}}" -elif [ ${step} = "init" ]; then +elif [ "${step}" = "init" ]; then export APRUN="${launcher}" -elif [ ${step} = "postsnd" ]; then +elif [ "${step}" = "postsnd" ]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -222,11 +222,11 @@ elif [ ${step} = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} ${npe_postsndcfp}" -elif [ ${step} = "awips" ]; then +elif [ "${step}" = "awips" ]; then echo "WARNING: ${step} is not enabled on ${machine}!" -elif [ ${step} = "gempak" ]; then +elif [ "${step}" = "gempak" ]; then echo "WARNING: ${step} is not enabled on ${machine}!" diff --git a/env/ORION.env b/env/ORION.env index 346512a88c0..52759220721 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -36,7 +36,7 @@ ulimit -a export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then +if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -45,14 +45,14 @@ if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then export sys_tp="ORION" export launcher_PREP="srun" -elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostpnt" ]; then +elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostpnt" ]; then export CFP_MP="YES" - if [ ${step} = "waveprep" ]; then export MP_PULSE=0 ; fi + if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ ${step} = "atmanalrun" ]; then +elif [ "${step}" = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -64,7 +64,7 @@ elif [ ${step} = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ ${step} = "atmensanalrun" ]; then +elif [ "${step}" = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -76,7 +76,7 @@ elif [ ${step} = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ ${step} = "aeroanlrun" ]; then +elif [ "${step}" = "aeroanlrun" ]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" @@ -86,7 +86,7 @@ elif [ ${step} = "aeroanlrun" ]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then +elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -114,7 +114,7 @@ elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ ${step} = "sfcanl" ]; then +elif [ "${step}" = "sfcanl" ]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -122,7 +122,7 @@ elif [ ${step} = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ ${step} = "gldas" ]; then +elif [ "${step}" = "gldas" ]; then export USE_CFP="NO" @@ -142,7 +142,7 @@ elif [ ${step} = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ ${step} = "eobs" ]; then +elif [ "${step}" = "eobs" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -157,7 +157,7 @@ elif [ ${step} = "eobs" ]; then [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}}" -elif [ ${step} = "eupd" ]; then +elif [ "${step}" = "eupd" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -169,7 +169,7 @@ elif [ ${step} = "eupd" ]; then [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}}" -elif [ ${step} = "fcst" ]; then +elif [ "${step}" = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -194,7 +194,7 @@ elif [ ${step} = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ ${step} = "efcs" ]; then +elif [ "${step}" = "efcs" ]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -207,7 +207,7 @@ elif [ ${step} = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ ${step} = "post" ]; then +elif [ "${step}" = "post" ]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -219,7 +219,7 @@ elif [ ${step} = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ ${step} = "ecen" ]; then +elif [ "${step}" = "ecen" ]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -235,7 +235,7 @@ elif [ ${step} = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ ${step} = "esfc" ]; then +elif [ "${step}" = "esfc" ]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -247,7 +247,7 @@ elif [ ${step} = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ ${step} = "epos" ]; then +elif [ "${step}" = "epos" ]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -255,11 +255,11 @@ elif [ ${step} = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ ${step} = "init" ]; then +elif [ "${step}" = "init" ]; then export APRUN="${launcher} -n ${npe_init}" -elif [ ${step} = "postsnd" ]; then +elif [ "${step}" = "postsnd" ]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -271,7 +271,7 @@ elif [ ${step} = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ ${step} = "awips" ]; then +elif [ "${step}" = "awips" ]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -279,7 +279,7 @@ elif [ ${step} = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ ${step} = "gempak" ]; then +elif [ "${step}" = "gempak" ]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) diff --git a/env/WCOSS2.env b/env/WCOSS2.env index f8c771d7e93..948c7f2a4fd 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -24,7 +24,7 @@ export npe_node_max=128 export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then +if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -33,13 +33,13 @@ if [ ${step} = "prep" -o ${step} = "prepbufr" ]; then export sys_tp="wcoss2" export launcher_PREP="mpiexec" -elif [ ${step} = "waveinit" -o ${step} = "waveprep" -o ${step} = "wavepostsbs" -o ${step} = "wavepostbndpnt" -o ${step} = "wavepostbndpntbll" -o ${step} = "wavepostpnt" ]; then +elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then - if [ ${step} = "waveprep" -a ${CDUMP} = "gfs" ]; then NTASKS=${NTASKS_gfs} ; fi + if [ "${step}" = "waveprep" -a "${CDUMP}" = "gfs" ]; then NTASKS=${NTASKS_gfs} ; fi export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt} -elif [ ${step} = "atmanalrun" ]; then +elif [ "${step}" = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -51,7 +51,7 @@ elif [ ${step} = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ ${step} = "atmensanalrun" ]; then +elif [ "${step}" = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -63,7 +63,7 @@ elif [ ${step} = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ ${step} = "aeroanlrun" ]; then +elif [ "${step}" = "aeroanlrun" ]; then export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" @@ -73,13 +73,13 @@ elif [ ${step} = "aeroanlrun" ]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then +elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G export FI_OFI_RXM_SAR_LIMIT=3145728 - if [ ${step} = "analcalc" ]; then + if [ "${step}" = "analcalc" ]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" fi @@ -110,7 +110,7 @@ elif [ ${step} = "anal" -o ${step} = "analcalc" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ ${step} = "sfcanl" ]; then +elif [ "${step}" = "sfcanl" ]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) @@ -119,7 +119,7 @@ elif [ ${step} = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ ${step} = "gldas" ]; then +elif [ "${step}" = "gldas" ]; then export USE_CFP="YES" export CFP_MP="NO" @@ -140,7 +140,7 @@ elif [ ${step} = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -np ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ ${step} = "eobs" ]; then +elif [ "${step}" = "eobs" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G @@ -156,7 +156,7 @@ elif [ ${step} = "eobs" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ ${step} = "eupd" ]; then +elif [ "${step}" = "eupd" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=2G @@ -173,7 +173,7 @@ elif [ ${step} = "eupd" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ ${step} = "fcst" ]; then +elif [ "${step}" = "fcst" ]; then export OMP_PLACES=cores export OMP_STACKSIZE=2048M @@ -203,7 +203,7 @@ elif [ ${step} = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ ${step} = "efcs" ]; then +elif [ "${step}" = "efcs" ]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" export FI_OFI_RXM_SAR_LIMIT=3145728 @@ -221,7 +221,7 @@ elif [ ${step} = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ ${step} = "post" ]; then +elif [ "${step}" = "post" ]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -233,7 +233,7 @@ elif [ ${step} = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -np ${npe_dwn} ${mpmd_opt}" -elif [ ${step} = "ecen" ]; then +elif [ "${step}" = "ecen" ]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -253,7 +253,7 @@ elif [ ${step} = "ecen" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_ecen} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ ${step} = "esfc" ]; then +elif [ "${step}" = "esfc" ]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -265,7 +265,7 @@ elif [ ${step} = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ ${step} = "epos" ]; then +elif [ "${step}" = "epos" ]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -273,11 +273,11 @@ elif [ ${step} = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos} -ppn ${npe_node_epos} --cpu-bind depth --depth ${NTHREADS_EPOS}" -elif [ ${step} = "init" ]; then +elif [ "${step}" = "init" ]; then export APRUN="${launcher}" -elif [ ${step} = "postsnd" ]; then +elif [ "${step}" = "postsnd" ]; then export MPICH_MPIIO_HINTS_DISPLAY=1 export OMP_NUM_THREADS=1 @@ -292,7 +292,7 @@ elif [ ${step} = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -np ${npe_postsndcfp} ${mpmd_opt}" -elif [ ${step} = "awips" ]; then +elif [ "${step}" = "awips" ]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -300,7 +300,7 @@ elif [ ${step} = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -np ${npe_awips} ${mpmd_opt}" -elif [ ${step} = "gempak" ]; then +elif [ "${step}" = "gempak" ]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) @@ -308,11 +308,11 @@ elif [ ${step} = "gempak" ]; then [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} export APRUN_GEMPAKCFP="${launcher} -np ${npe_gempak} ${mpmd_opt}" -elif [ ${step} = "waveawipsbulls" ]; then +elif [ "${step}" = "waveawipsbulls" ]; then unset PERL5LIB -elif [ ${step} = "wafsgrib2" -o ${step} = "wafsgrib20p25" ]; then +elif [ "${step}" = "wafsgrib2" -o "${step}" = "wafsgrib20p25" ]; then export USE_CFP=${USE_CFP:-"YES"} From 9dd25ded1ed608376ba39535e422219a54f3348a Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 08:15:43 -0600 Subject: [PATCH 4/7] Update env files for shellcheck SC2292 - SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. - Change [ ] to [[ ]] where needed in env files. Refs #397 --- env/HERA.env | 38 +++++++++++++++++++------------------- env/JET.env | 38 +++++++++++++++++++------------------- env/ORION.env | 38 +++++++++++++++++++------------------- env/S4.env | 2 +- env/WCOSS2.env | 40 ++++++++++++++++++++-------------------- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index c02bc07acb2..7103a3cc911 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -1,6 +1,6 @@ #! /usr/bin/env bash -if [ $# -ne 1 ]; then +if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" @@ -49,11 +49,11 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then export CFP_MP="YES" - if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi + if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ "${step}" = "atmanalrun" ]; then +elif [[ "${step}" = "atmanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -65,7 +65,7 @@ elif [ "${step}" = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ "${step}" = "atmensanalrun" ]; then +elif [[ "${step}" = "atmensanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -77,7 +77,7 @@ elif [ "${step}" = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ "${step}" = "aeroanlrun" ]; then +elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" @@ -116,7 +116,7 @@ elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ "${step}" = "sfcanl" ]; then +elif [[ "${step}" = "sfcanl" ]]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -124,7 +124,7 @@ elif [ "${step}" = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ "${step}" = "gldas" ]; then +elif [[ "${step}" = "gldas" ]]; then export USE_CFP="NO" export CFP_MP="YES" @@ -145,7 +145,7 @@ elif [ "${step}" = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ "${step}" = "eobs" ]; then +elif [[ "${step}" = "eobs" ]]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -160,7 +160,7 @@ elif [ "${step}" = "eobs" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ "${step}" = "eupd" ]; then +elif [[ "${step}" = "eupd" ]]; then nth_max=$((${npe_node_max} / ${npe_node_eupd})) @@ -172,7 +172,7 @@ elif [ "${step}" = "eupd" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" -elif [ "${step}" = "fcst" ]; then +elif [[ "${step}" = "fcst" ]]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -197,7 +197,7 @@ elif [ "${step}" = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ "${step}" = "efcs" ]; then +elif [[ "${step}" = "efcs" ]]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -210,7 +210,7 @@ elif [ "${step}" = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ "${step}" = "post" ]; then +elif [[ "${step}" = "post" ]]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -222,7 +222,7 @@ elif [ "${step}" = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ "${step}" = "ecen" ]; then +elif [[ "${step}" = "ecen" ]]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -238,7 +238,7 @@ elif [ "${step}" = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ "${step}" = "esfc" ]; then +elif [[ "${step}" = "esfc" ]]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -250,7 +250,7 @@ elif [ "${step}" = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ "${step}" = "epos" ]; then +elif [[ "${step}" = "epos" ]]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -258,11 +258,11 @@ elif [ "${step}" = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ "${step}" = "init" ]; then +elif [[ "${step}" = "init" ]]; then export APRUN="${launcher} -n ${npe_init}" -elif [ "${step}" = "postsnd" ]; then +elif [[ "${step}" = "postsnd" ]]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -274,7 +274,7 @@ elif [ "${step}" = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ "${step}" = "awips" ]; then +elif [[ "${step}" = "awips" ]]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -282,7 +282,7 @@ elif [ "${step}" = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ "${step}" = "gempak" ]; then +elif [[ "${step}" = "gempak" ]]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) diff --git a/env/JET.env b/env/JET.env index 9774e3e8c07..77422634882 100755 --- a/env/JET.env +++ b/env/JET.env @@ -1,6 +1,6 @@ #!/bin/ksh -x -if [ $# -ne 1 ]; then +if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" @@ -42,11 +42,11 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then - if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi + if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ "${step}" = "atmanalrun" ]; then +elif [[ "${step}" = "atmanalrun" ]]; then nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) @@ -54,7 +54,7 @@ elif [ "${step}" = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} ${npe_atmanalrun}" -elif [ "${step}" = "atmensanalrun" ]; then +elif [[ "${step}" = "atmensanalrun" ]]; then nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) @@ -62,7 +62,7 @@ elif [ "${step}" = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} ${npe_atmensanalrun}" -elif [ "${step}" = "anal" ]; then +elif [[ "${step}" = "anal" ]]; then nth_max=$((${npe_node_max} / ${npe_node_anal})) @@ -83,7 +83,7 @@ elif [ "${step}" = "anal" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} ${npe_gausfcanl}" -elif [ "${step}" = "sfcanl" ]; then +elif [[ "${step}" = "sfcanl" ]]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -91,7 +91,7 @@ elif [ "${step}" = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} ${npe_sfcanl}" -elif [ "${step}" = "gldas" ]; then +elif [[ "${step}" = "gldas" ]]; then nth_max=$((${npe_node_max} / ${npe_node_gldas})) @@ -103,7 +103,7 @@ elif [ "${step}" = "gldas" ]; then [[ ${NTHREADS_GAUSSIAN} -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} export APRUN_GAUSSIAN="${launcher} ${npe_gaussian}" -elif [ "${step}" = "eobs" ]; then +elif [[ "${step}" = "eobs" ]]; then nth_max=$((${npe_node_max} / ${npe_node_eobs})) @@ -111,7 +111,7 @@ elif [ "${step}" = "eobs" ]; then [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="${launcher} ${npe_gsi:-${npe_eobs:-${PBS_NP}}}" -elif [ "${step}" = "eupd" ]; then +elif [[ "${step}" = "eupd" ]]; then nth_max=$((${npe_node_max} / ${npe_node_eupd})) @@ -119,7 +119,7 @@ elif [ "${step}" = "eupd" ]; then [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} export APRUN_ENKF="${launcher} ${npe_enkf:-${npe_eupd:-${PBS_NP}}}" -elif [ "${step}" = "fcst" ]; then +elif [[ "${step}" = "fcst" ]]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -144,7 +144,7 @@ elif [ "${step}" = "fcst" ]; then export APRUN_REMAP="${launcher} ${npe_remap:-${npe_fcst:-${PBS_NP}}}" export I_MPI_DAPL_UD="enable" -elif [ "${step}" = "efcs" ]; then +elif [[ "${step}" = "efcs" ]]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -157,7 +157,7 @@ elif [ "${step}" = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} ${LEVS}" -elif [ "${step}" = "post" ]; then +elif [[ "${step}" = "post" ]]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -169,7 +169,7 @@ elif [ "${step}" = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_NP="${launcher}" -elif [ "${step}" = "ecen" ]; then +elif [[ "${step}" = "ecen" ]]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -185,7 +185,7 @@ elif [ "${step}" = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} ${npe_ecen:-${PBS_NP}}" -elif [ "${step}" = "esfc" ]; then +elif [[ "${step}" = "esfc" ]]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -198,7 +198,7 @@ elif [ "${step}" = "esfc" ]; then export APRUN_CYCLE="${launcher} ${npe_esfc}" -elif [ "${step}" = "epos" ]; then +elif [[ "${step}" = "epos" ]]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -206,11 +206,11 @@ elif [ "${step}" = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} ${npe_epos:-${PBS_NP}}" -elif [ "${step}" = "init" ]; then +elif [[ "${step}" = "init" ]]; then export APRUN="${launcher}" -elif [ "${step}" = "postsnd" ]; then +elif [[ "${step}" = "postsnd" ]]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -222,11 +222,11 @@ elif [ "${step}" = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} ${npe_postsndcfp}" -elif [ "${step}" = "awips" ]; then +elif [[ "${step}" = "awips" ]]; then echo "WARNING: ${step} is not enabled on ${machine}!" -elif [ "${step}" = "gempak" ]; then +elif [[ "${step}" = "gempak" ]]; then echo "WARNING: ${step} is not enabled on ${machine}!" diff --git a/env/ORION.env b/env/ORION.env index 52759220721..0689b936a73 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -1,6 +1,6 @@ #! /usr/bin/env bash -if [ $# -ne 1 ]; then +if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" @@ -48,11 +48,11 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostpnt" ]; then export CFP_MP="YES" - if [ "${step}" = "waveprep" ]; then export MP_PULSE=0 ; fi + if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} export wave_mpmd=${mpmd_opt} -elif [ "${step}" = "atmanalrun" ]; then +elif [[ "${step}" = "atmanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -64,7 +64,7 @@ elif [ "${step}" = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ "${step}" = "atmensanalrun" ]; then +elif [[ "${step}" = "atmensanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -76,7 +76,7 @@ elif [ "${step}" = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ "${step}" = "aeroanlrun" ]; then +elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" @@ -114,7 +114,7 @@ elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" -elif [ "${step}" = "sfcanl" ]; then +elif [[ "${step}" = "sfcanl" ]]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -122,7 +122,7 @@ elif [ "${step}" = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ "${step}" = "gldas" ]; then +elif [[ "${step}" = "gldas" ]]; then export USE_CFP="NO" @@ -142,7 +142,7 @@ elif [ "${step}" = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ "${step}" = "eobs" ]; then +elif [[ "${step}" = "eobs" ]]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -157,7 +157,7 @@ elif [ "${step}" = "eobs" ]; then [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}}" -elif [ "${step}" = "eupd" ]; then +elif [[ "${step}" = "eupd" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -169,7 +169,7 @@ elif [ "${step}" = "eupd" ]; then [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}}" -elif [ "${step}" = "fcst" ]; then +elif [[ "${step}" = "fcst" ]]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ ${CDUMP} == "gfs" ]]; then @@ -194,7 +194,7 @@ elif [ "${step}" = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ "${step}" = "efcs" ]; then +elif [[ "${step}" = "efcs" ]]; then nth_max=$((${npe_node_max} / ${npe_node_efcs})) @@ -207,7 +207,7 @@ elif [ "${step}" = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ "${step}" = "post" ]; then +elif [[ "${step}" = "post" ]]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -219,7 +219,7 @@ elif [ "${step}" = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -n ${npe_dwn}" -elif [ "${step}" = "ecen" ]; then +elif [[ "${step}" = "ecen" ]]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -235,7 +235,7 @@ elif [ "${step}" = "ecen" ]; then [[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="${launcher} -n ${npe_ecen}" -elif [ "${step}" = "esfc" ]; then +elif [[ "${step}" = "esfc" ]]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -247,7 +247,7 @@ elif [ "${step}" = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc}" -elif [ "${step}" = "epos" ]; then +elif [[ "${step}" = "epos" ]]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -255,11 +255,11 @@ elif [ "${step}" = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos}" -elif [ "${step}" = "init" ]; then +elif [[ "${step}" = "init" ]]; then export APRUN="${launcher} -n ${npe_init}" -elif [ "${step}" = "postsnd" ]; then +elif [[ "${step}" = "postsnd" ]]; then nth_max=$((${npe_node_max} / ${npe_node_postsnd})) @@ -271,7 +271,7 @@ elif [ "${step}" = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsnd} ${mpmd_opt}" -elif [ "${step}" = "awips" ]; then +elif [[ "${step}" = "awips" ]]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -279,7 +279,7 @@ elif [ "${step}" = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -n ${npe_awips} ${mpmd_opt}" -elif [ "${step}" = "gempak" ]; then +elif [[ "${step}" = "gempak" ]]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) diff --git a/env/S4.env b/env/S4.env index 16b7df08251..125e98b0daf 100755 --- a/env/S4.env +++ b/env/S4.env @@ -1,6 +1,6 @@ #!/bin/bash -x -if [ $# -ne 1 ]; then +if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" diff --git a/env/WCOSS2.env b/env/WCOSS2.env index 948c7f2a4fd..79bd9a271b3 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -1,6 +1,6 @@ #! /usr/bin/env bash -if [ $# -ne 1 ]; then +if [[ $# -ne 1 ]]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" @@ -39,7 +39,7 @@ elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepost export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt} -elif [ "${step}" = "atmanalrun" ]; then +elif [[ "${step}" = "atmanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -51,7 +51,7 @@ elif [ "${step}" = "atmanalrun" ]; then [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="${launcher} -n ${npe_atmanalrun}" -elif [ "${step}" = "atmensanalrun" ]; then +elif [[ "${step}" = "atmensanalrun" ]]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -63,7 +63,7 @@ elif [ "${step}" = "atmensanalrun" ]; then [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="${launcher} -n ${npe_atmensanalrun}" -elif [ "${step}" = "aeroanlrun" ]; then +elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" @@ -79,7 +79,7 @@ elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then export OMP_STACKSIZE=1G export FI_OFI_RXM_SAR_LIMIT=3145728 - if [ "${step}" = "analcalc" ]; then + if [[ "${step}" = "analcalc" ]]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" fi @@ -110,7 +110,7 @@ elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ "${step}" = "sfcanl" ]; then +elif [[ "${step}" = "sfcanl" ]]; then nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) @@ -119,7 +119,7 @@ elif [ "${step}" = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}" -elif [ "${step}" = "gldas" ]; then +elif [[ "${step}" = "gldas" ]]; then export USE_CFP="YES" export CFP_MP="NO" @@ -140,7 +140,7 @@ elif [ "${step}" = "gldas" ]; then npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -np ${npe_gldas_data_proc} ${mpmd_opt}" -elif [ "${step}" = "eobs" ]; then +elif [[ "${step}" = "eobs" ]]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G @@ -156,7 +156,7 @@ elif [ "${step}" = "eobs" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ "${step}" = "eupd" ]; then +elif [[ "${step}" = "eupd" ]]; then export OMP_PLACES=cores export OMP_STACKSIZE=2G @@ -173,7 +173,7 @@ elif [ "${step}" = "eupd" ]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" -elif [ "${step}" = "fcst" ]; then +elif [[ "${step}" = "fcst" ]]; then export OMP_PLACES=cores export OMP_STACKSIZE=2048M @@ -203,7 +203,7 @@ elif [ "${step}" = "fcst" ]; then export APRUN_REMAP="${launcher} -n ${npe_remap:-${npe_fcst}}" export I_MPI_DAPL_UD="enable" -elif [ "${step}" = "efcs" ]; then +elif [[ "${step}" = "efcs" ]]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" export FI_OFI_RXM_SAR_LIMIT=3145728 @@ -221,7 +221,7 @@ elif [ "${step}" = "efcs" ]; then [[ ${NTHREADS_REGRID_NEMSIO} -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="${launcher} -n ${LEVS}" -elif [ "${step}" = "post" ]; then +elif [[ "${step}" = "post" ]]; then nth_max=$((${npe_node_max} / ${npe_node_post})) @@ -233,7 +233,7 @@ elif [ "${step}" = "post" ]; then [[ ${NTHREADS_DWN} -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="${launcher} -np ${npe_dwn} ${mpmd_opt}" -elif [ "${step}" = "ecen" ]; then +elif [[ "${step}" = "ecen" ]]; then nth_max=$((${npe_node_max} / ${npe_node_ecen})) @@ -253,7 +253,7 @@ elif [ "${step}" = "ecen" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_ecen} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ "${step}" = "esfc" ]; then +elif [[ "${step}" = "esfc" ]]; then nth_max=$((${npe_node_max} / ${npe_node_esfc})) @@ -265,7 +265,7 @@ elif [ "${step}" = "esfc" ]; then [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} export APRUN_CYCLE="${launcher} -n ${npe_esfc} -ppn ${npe_node_cycle} --cpu-bind depth --depth ${NTHREADS_CYCLE}" -elif [ "${step}" = "epos" ]; then +elif [[ "${step}" = "epos" ]]; then nth_max=$((${npe_node_max} / ${npe_node_epos})) @@ -273,11 +273,11 @@ elif [ "${step}" = "epos" ]; then [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="${launcher} -n ${npe_epos} -ppn ${npe_node_epos} --cpu-bind depth --depth ${NTHREADS_EPOS}" -elif [ "${step}" = "init" ]; then +elif [[ "${step}" = "init" ]]; then export APRUN="${launcher}" -elif [ "${step}" = "postsnd" ]; then +elif [[ "${step}" = "postsnd" ]]; then export MPICH_MPIIO_HINTS_DISPLAY=1 export OMP_NUM_THREADS=1 @@ -292,7 +292,7 @@ elif [ "${step}" = "postsnd" ]; then [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="${launcher} -np ${npe_postsndcfp} ${mpmd_opt}" -elif [ "${step}" = "awips" ]; then +elif [[ "${step}" = "awips" ]]; then nth_max=$((${npe_node_max} / ${npe_node_awips})) @@ -300,7 +300,7 @@ elif [ "${step}" = "awips" ]; then [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="${launcher} -np ${npe_awips} ${mpmd_opt}" -elif [ "${step}" = "gempak" ]; then +elif [[ "${step}" = "gempak" ]]; then nth_max=$((${npe_node_max} / ${npe_node_gempak})) @@ -308,7 +308,7 @@ elif [ "${step}" = "gempak" ]; then [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} export APRUN_GEMPAKCFP="${launcher} -np ${npe_gempak} ${mpmd_opt}" -elif [ "${step}" = "waveawipsbulls" ]; then +elif [[ "${step}" = "waveawipsbulls" ]]; then unset PERL5LIB From 2ae6b6b5dfb8f34bfff6e34dec54e92c0dabb4fb Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 08:40:18 -0600 Subject: [PATCH 5/7] Update env files for shellcheck SC2166 and more SC2292 - SC2166 (warning): Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. - SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. - Change "-o" to "||" and "-a" to "&&". - Also apply more SC2292 double brace updates to lines that had SC2166 updates. Refs #397 --- env/HERA.env | 6 +++--- env/JET.env | 4 ++-- env/ORION.env | 6 +++--- env/WCOSS2.env | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index 7103a3cc911..894eeb38f3b 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -37,7 +37,7 @@ export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then +if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -46,7 +46,7 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then export sys_tp="HERA" export launcher_PREP="srun" -elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then +elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then export CFP_MP="YES" if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi @@ -87,7 +87,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then +elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO diff --git a/env/JET.env b/env/JET.env index 77422634882..025ead574c0 100755 --- a/env/JET.env +++ b/env/JET.env @@ -32,7 +32,7 @@ ulimit -a export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then +if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -40,7 +40,7 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then export BACK=${BACK:-"NO"} export sys_tp="JET" -elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then +elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi export wavempexec=${launcher} diff --git a/env/ORION.env b/env/ORION.env index 0689b936a73..4e8a6413a7b 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -36,7 +36,7 @@ ulimit -a export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then +if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -45,7 +45,7 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then export sys_tp="ORION" export launcher_PREP="srun" -elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostpnt" ]; then +elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostpnt" ]]; then export CFP_MP="YES" if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi @@ -86,7 +86,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then +elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO diff --git a/env/WCOSS2.env b/env/WCOSS2.env index 79bd9a271b3..d164fffe306 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -24,7 +24,7 @@ export npe_node_max=128 export job=${PBS_JOBNAME:-${step}} export jobid=${job}.${PBS_JOBID:-$$} -if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then +if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then nth_max=$((${npe_node_max} / ${npe_node_prep})) @@ -33,9 +33,9 @@ if [ "${step}" = "prep" -o "${step}" = "prepbufr" ]; then export sys_tp="wcoss2" export launcher_PREP="mpiexec" -elif [ "${step}" = "waveinit" -o "${step}" = "waveprep" -o "${step}" = "wavepostsbs" -o "${step}" = "wavepostbndpnt" -o "${step}" = "wavepostbndpntbll" -o "${step}" = "wavepostpnt" ]; then +elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then - if [ "${step}" = "waveprep" -a "${CDUMP}" = "gfs" ]; then NTASKS=${NTASKS_gfs} ; fi + if [[ "${step}" = "waveprep" ]] && [[ "${CDUMP}" = "gfs" ]]; then NTASKS=${NTASKS_gfs} ; fi export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt} @@ -73,7 +73,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}" -elif [ "${step}" = "anal" -o "${step}" = "analcalc" ]; then +elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export OMP_PLACES=cores export OMP_STACKSIZE=1G @@ -312,7 +312,7 @@ elif [[ "${step}" = "waveawipsbulls" ]]; then unset PERL5LIB -elif [ "${step}" = "wafsgrib2" -o "${step}" = "wafsgrib20p25" ]; then +elif [[ "${step}" = "wafsgrib2" ]] || [[ "${step}" = "wafsgrib20p25" ]]; then export USE_CFP=${USE_CFP:-"YES"} From 6cd424da2a348aca789e2cc983ef212917b994c3 Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 12:25:22 -0600 Subject: [PATCH 6/7] Update env files for shellcheck SC2004 - SC2004 (style): $/${} is unnecessary on arithmetic variables. - Update arithmetic expressions accordingly in env files. Refs #397 --- env/HERA.env | 38 +++++++++++++++++++------------------- env/JET.env | 30 +++++++++++++++--------------- env/ORION.env | 38 +++++++++++++++++++------------------- env/WCOSS2.env | 38 +++++++++++++++++++------------------- 4 files changed, 72 insertions(+), 72 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index 894eeb38f3b..b3049c40326 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -39,7 +39,7 @@ export jobid=${job}.${PBS_JOBID:-$$} if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_prep})) + nth_max=$((npe_node_max / npe_node_prep)) export POE="NO" export BACK="NO" @@ -59,7 +59,7 @@ elif [[ "${step}" = "atmanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) + nth_max=$((npe_node_max / npe_node_atmanalrun)) export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} @@ -71,7 +71,7 @@ elif [[ "${step}" = "atmensanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) + nth_max=$((npe_node_max / npe_node_atmensanalrun)) export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} @@ -81,7 +81,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) + nth_max=$((npe_node_max / npe_node_aeroanlrun)) export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} @@ -96,7 +96,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_anal})) + nth_max=$((npe_node_max / npe_node_anal)) export NTHREADS_GSI=${nth_anal:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -117,7 +117,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" elif [[ "${step}" = "sfcanl" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) + nth_max=$((npe_node_max / npe_node_sfcanl)) export NTHREADS_CYCLE=${nth_sfcanl:-14} [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} @@ -129,7 +129,7 @@ elif [[ "${step}" = "gldas" ]]; then export USE_CFP="NO" export CFP_MP="YES" - nth_max=$((${npe_node_max} / ${npe_node_gldas})) + nth_max=$((npe_node_max / npe_node_gldas)) export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} @@ -142,7 +142,7 @@ elif [[ "${step}" = "gldas" ]]; then # Must run data processing with exactly the number of tasks as time # periods being processed. - npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + npe_gldas_data_proc=$((gldas_spinup_hours + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" elif [[ "${step}" = "eobs" ]]; then @@ -150,7 +150,7 @@ elif [[ "${step}" = "eobs" ]]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO - nth_max=$((${npe_node_max} / ${npe_node_eobs})) + nth_max=$((npe_node_max / npe_node_eobs)) export NTHREADS_GSI=${nth_eobs:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -162,7 +162,7 @@ elif [[ "${step}" = "eobs" ]]; then elif [[ "${step}" = "eupd" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_eupd})) + nth_max=$((npe_node_max / npe_node_eupd)) export NTHREADS_ENKF=${nth_eupd:-${nth_max}} [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} @@ -181,7 +181,7 @@ elif [[ "${step}" = "fcst" ]]; then nth_fv3=${nth_fv3_gfs} fi - nth_max=$((${npe_node_max} / ${npe_node_fcst})) + nth_max=$((npe_node_max / npe_node_fcst)) export NTHREADS_FV3=${nth_fv3:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -199,7 +199,7 @@ elif [[ "${step}" = "fcst" ]]; then elif [[ "${step}" = "efcs" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_efcs})) + nth_max=$((npe_node_max / npe_node_efcs)) export NTHREADS_FV3=${nth_efcs:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -212,7 +212,7 @@ elif [[ "${step}" = "efcs" ]]; then elif [[ "${step}" = "post" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_post})) + nth_max=$((npe_node_max / npe_node_post)) export NTHREADS_NP=${nth_np:-1} [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} @@ -224,7 +224,7 @@ elif [[ "${step}" = "post" ]]; then elif [[ "${step}" = "ecen" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_ecen})) + nth_max=$((npe_node_max / npe_node_ecen)) export NTHREADS_ECEN=${nth_ecen:-${nth_max}} [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} @@ -240,7 +240,7 @@ elif [[ "${step}" = "ecen" ]]; then elif [[ "${step}" = "esfc" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_esfc})) + nth_max=$((npe_node_max / npe_node_esfc)) export NTHREADS_ESFC=${nth_esfc:-${nth_max}} [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} @@ -252,7 +252,7 @@ elif [[ "${step}" = "esfc" ]]; then elif [[ "${step}" = "epos" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_epos})) + nth_max=$((npe_node_max / npe_node_epos)) export NTHREADS_EPOS=${nth_epos:-${nth_max}} [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} @@ -264,7 +264,7 @@ elif [[ "${step}" = "init" ]]; then elif [[ "${step}" = "postsnd" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_postsnd})) + nth_max=$((npe_node_max / npe_node_postsnd)) export NTHREADS_POSTSND=${nth_postsnd:-1} [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} @@ -276,7 +276,7 @@ elif [[ "${step}" = "postsnd" ]]; then elif [[ "${step}" = "awips" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_awips})) + nth_max=$((npe_node_max / npe_node_awips)) export NTHREADS_AWIPS=${nth_awips:-2} [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} @@ -284,7 +284,7 @@ elif [[ "${step}" = "awips" ]]; then elif [[ "${step}" = "gempak" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_gempak})) + nth_max=$((npe_node_max / npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} diff --git a/env/JET.env b/env/JET.env index 025ead574c0..19ab4b341a4 100755 --- a/env/JET.env +++ b/env/JET.env @@ -34,7 +34,7 @@ export jobid=${job}.${PBS_JOBID:-$$} if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_prep})) + nth_max=$((npe_node_max / npe_node_prep)) export POE="NO" export BACK=${BACK:-"NO"} @@ -48,7 +48,7 @@ elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step} elif [[ "${step}" = "atmanalrun" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) + nth_max=$((npe_node_max / npe_node_atmanalrun)) export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} @@ -56,7 +56,7 @@ elif [[ "${step}" = "atmanalrun" ]]; then elif [[ "${step}" = "atmensanalrun" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) + nth_max=$((npe_node_max / npe_node_atmensanalrun)) export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} @@ -64,7 +64,7 @@ elif [[ "${step}" = "atmensanalrun" ]]; then elif [[ "${step}" = "anal" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_anal})) + nth_max=$((npe_node_max / npe_node_anal)) export NTHREADS_GSI=${nth_gsi:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -84,7 +84,7 @@ elif [[ "${step}" = "anal" ]]; then export APRUN_GAUSFCANL="${launcher} ${npe_gausfcanl}" elif [[ "${step}" = "sfcanl" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) + nth_max=$((npe_node_max / npe_node_sfcanl)) export NTHREADS_CYCLE=${nth_sfcanl:-14} [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} @@ -93,7 +93,7 @@ elif [[ "${step}" = "sfcanl" ]]; then elif [[ "${step}" = "gldas" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_gldas})) + nth_max=$((npe_node_max / npe_node_gldas)) export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} @@ -105,7 +105,7 @@ elif [[ "${step}" = "gldas" ]]; then elif [[ "${step}" = "eobs" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_eobs})) + nth_max=$((npe_node_max / npe_node_eobs)) export NTHREADS_GSI=${nth_gsi:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -113,7 +113,7 @@ elif [[ "${step}" = "eobs" ]]; then elif [[ "${step}" = "eupd" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_eupd})) + nth_max=$((npe_node_max / npe_node_eupd)) export NTHREADS_ENKF=${nth_enkf:-${nth_max}} [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} @@ -128,7 +128,7 @@ elif [[ "${step}" = "fcst" ]]; then nth_fv3=${nth_fv3_gfs} fi - nth_max=$((${npe_node_max} / ${npe_node_fcst})) + nth_max=$((npe_node_max / npe_node_fcst)) export NTHREADS_FV3=${nth_fv3:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -146,7 +146,7 @@ elif [[ "${step}" = "fcst" ]]; then elif [[ "${step}" = "efcs" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_efcs})) + nth_max=$((npe_node_max / npe_node_efcs)) export NTHREADS_FV3=${nth_fv3:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -159,7 +159,7 @@ elif [[ "${step}" = "efcs" ]]; then elif [[ "${step}" = "post" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_post})) + nth_max=$((npe_node_max / npe_node_post)) export NTHREADS_NP=${nth_np:-1} [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} @@ -171,7 +171,7 @@ elif [[ "${step}" = "post" ]]; then elif [[ "${step}" = "ecen" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_ecen})) + nth_max=$((npe_node_max / npe_node_ecen)) export NTHREADS_ECEN=${nth_ecen:-${nth_max}} [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} @@ -187,7 +187,7 @@ elif [[ "${step}" = "ecen" ]]; then elif [[ "${step}" = "esfc" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_esfc})) + nth_max=$((npe_node_max / npe_node_esfc)) export NTHREADS_ESFC=${nth_esfc:-${nth_max}} [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} @@ -200,7 +200,7 @@ elif [[ "${step}" = "esfc" ]]; then elif [[ "${step}" = "epos" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_epos})) + nth_max=$((npe_node_max / npe_node_epos)) export NTHREADS_EPOS=${nth_epos:-${nth_max}} [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} @@ -212,7 +212,7 @@ elif [[ "${step}" = "init" ]]; then elif [[ "${step}" = "postsnd" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_postsnd})) + nth_max=$((npe_node_max / npe_node_postsnd)) export NTHREADS_POSTSND=${nth_postsnd:-1} [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} diff --git a/env/ORION.env b/env/ORION.env index 4e8a6413a7b..2ccbe271da8 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -38,7 +38,7 @@ export jobid=${job}.${PBS_JOBID:-$$} if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_prep})) + nth_max=$((npe_node_max / npe_node_prep)) export POE="NO" export BACK=${BACK:-"YES"} @@ -58,7 +58,7 @@ elif [[ "${step}" = "atmanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) + nth_max=$((npe_node_max / npe_node_atmanalrun)) export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} @@ -70,7 +70,7 @@ elif [[ "${step}" = "atmensanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) + nth_max=$((npe_node_max / npe_node_atmensanalrun)) export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} @@ -80,7 +80,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) + nth_max=$((npe_node_max / npe_node_aeroanlrun)) export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} @@ -95,7 +95,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_anal})) + nth_max=$((npe_node_max / npe_node_anal)) export NTHREADS_GSI=${nth_anal:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -115,7 +115,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}" elif [[ "${step}" = "sfcanl" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) + nth_max=$((npe_node_max / npe_node_sfcanl)) export NTHREADS_CYCLE=${nth_sfcanl:-14} [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} @@ -126,7 +126,7 @@ elif [[ "${step}" = "gldas" ]]; then export USE_CFP="NO" - nth_max=$((${npe_node_max} / ${npe_node_gldas})) + nth_max=$((npe_node_max / npe_node_gldas)) export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} @@ -139,7 +139,7 @@ elif [[ "${step}" = "gldas" ]]; then # Must run data processing with exactly the number of tasks as time # periods being processed. - npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + npe_gldas_data_proc=$((gldas_spinup_hours + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -n ${npe_gldas_data_proc} ${mpmd_opt}" elif [[ "${step}" = "eobs" ]]; then @@ -151,7 +151,7 @@ elif [[ "${step}" = "eobs" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_eobs})) + nth_max=$((npe_node_max / npe_node_eobs)) export NTHREADS_GSI=${nth_eobs:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -163,7 +163,7 @@ elif [[ "${step}" = "eupd" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_eupd})) + nth_max=$((npe_node_max / npe_node_eupd)) export NTHREADS_ENKF=${nth_eupd:-${nth_max}} [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} @@ -178,7 +178,7 @@ elif [[ "${step}" = "fcst" ]]; then nth_fv3=${nth_fv3_gfs} fi - nth_max=$((${npe_node_max} / ${npe_node_fcst})) + nth_max=$((npe_node_max / npe_node_fcst)) export NTHREADS_FV3=${nth_fv3:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -196,7 +196,7 @@ elif [[ "${step}" = "fcst" ]]; then elif [[ "${step}" = "efcs" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_efcs})) + nth_max=$((npe_node_max / npe_node_efcs)) export NTHREADS_FV3=${nth_efcs:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -209,7 +209,7 @@ elif [[ "${step}" = "efcs" ]]; then elif [[ "${step}" = "post" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_post})) + nth_max=$((npe_node_max / npe_node_post)) export NTHREADS_NP=${nth_np:-1} [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} @@ -221,7 +221,7 @@ elif [[ "${step}" = "post" ]]; then elif [[ "${step}" = "ecen" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_ecen})) + nth_max=$((npe_node_max / npe_node_ecen)) export NTHREADS_ECEN=${nth_ecen:-${nth_max}} [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} @@ -237,7 +237,7 @@ elif [[ "${step}" = "ecen" ]]; then elif [[ "${step}" = "esfc" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_esfc})) + nth_max=$((npe_node_max / npe_node_esfc)) export NTHREADS_ESFC=${nth_esfc:-${nth_max}} [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} @@ -249,7 +249,7 @@ elif [[ "${step}" = "esfc" ]]; then elif [[ "${step}" = "epos" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_epos})) + nth_max=$((npe_node_max / npe_node_epos)) export NTHREADS_EPOS=${nth_epos:-${nth_max}} [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} @@ -261,7 +261,7 @@ elif [[ "${step}" = "init" ]]; then elif [[ "${step}" = "postsnd" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_postsnd})) + nth_max=$((npe_node_max / npe_node_postsnd)) export NTHREADS_POSTSND=${nth_postsnd:-1} [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} @@ -273,7 +273,7 @@ elif [[ "${step}" = "postsnd" ]]; then elif [[ "${step}" = "awips" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_awips})) + nth_max=$((npe_node_max / npe_node_awips)) export NTHREADS_AWIPS=${nth_awips:-2} [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} @@ -281,7 +281,7 @@ elif [[ "${step}" = "awips" ]]; then elif [[ "${step}" = "gempak" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_gempak})) + nth_max=$((npe_node_max / npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} diff --git a/env/WCOSS2.env b/env/WCOSS2.env index d164fffe306..626315a1898 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -26,7 +26,7 @@ export jobid=${job}.${PBS_JOBID:-$$} if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_prep})) + nth_max=$((npe_node_max / npe_node_prep)) export POE=${POE:-"YES"} export BACK=${BACK:-"off"} @@ -45,7 +45,7 @@ elif [[ "${step}" = "atmanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmanalrun})) + nth_max=$((npe_node_max / npe_node_atmanalrun)) export NTHREADS_ATMANAL=${nth_atmanalrun:-${nth_max}} [[ ${NTHREADS_ATMANAL} -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} @@ -57,7 +57,7 @@ elif [[ "${step}" = "atmensanalrun" ]]; then export USE_CFP=${USE_CFP:-"YES"} export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_atmensanalrun})) + nth_max=$((npe_node_max / npe_node_atmensanalrun)) export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-${nth_max}} [[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} @@ -67,7 +67,7 @@ elif [[ "${step}" = "aeroanlrun" ]]; then export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" - nth_max=$((${npe_node_max} / ${npe_node_aeroanlrun})) + nth_max=$((npe_node_max / npe_node_aeroanlrun)) export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}} [[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} @@ -83,7 +83,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export MPICH_MPIIO_HINTS="*:romio_cb_write=disable" fi - nth_max=$((${npe_node_max} / ${npe_node_anal})) + nth_max=$((npe_node_max / npe_node_anal)) export NTHREADS_GSI=${nth_anal:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -112,7 +112,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then elif [[ "${step}" = "sfcanl" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_sfcanl})) + nth_max=$((npe_node_max / npe_node_sfcanl)) export NTHREADS_CYCLE=${nth_sfcanl:-14} [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} @@ -124,7 +124,7 @@ elif [[ "${step}" = "gldas" ]]; then export USE_CFP="YES" export CFP_MP="NO" - nth_max=$((${npe_node_max} / ${npe_node_gldas})) + nth_max=$((npe_node_max / npe_node_gldas)) export NTHREADS_GLDAS=${nth_gldas:-${nth_max}} [[ ${NTHREADS_GLDAS} -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} @@ -137,7 +137,7 @@ elif [[ "${step}" = "gldas" ]]; then # Must run data processing with exactly the number of tasks as time # periods being processed. export USE_CFP=${USE_CFP:-"YES"} - npe_gldas_data_proc=$((${gldas_spinup_hours} + 12)) + npe_gldas_data_proc=$((gldas_spinup_hours + 12)) export APRUN_GLDAS_DATA_PROC="${launcher} -np ${npe_gldas_data_proc} ${mpmd_opt}" elif [[ "${step}" = "eobs" ]]; then @@ -146,7 +146,7 @@ elif [[ "${step}" = "eobs" ]]; then export OMP_STACKSIZE=1G export FI_OFI_RXM_SAR_LIMIT=3145728 - nth_max=$((${npe_node_max} / ${npe_node_eobs})) + nth_max=$((npe_node_max / npe_node_eobs)) export NTHREADS_GSI=${nth_eobs:-${nth_max}} [[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} @@ -163,7 +163,7 @@ elif [[ "${step}" = "eupd" ]]; then export MPICH_COLL_OPT_OFF=1 export FI_OFI_RXM_SAR_LIMIT=3145728 - nth_max=$((${npe_node_max} / ${npe_node_eupd})) + nth_max=$((npe_node_max / npe_node_eupd)) export NTHREADS_ENKF=${nth_eupd:-${nth_max}} [[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} @@ -187,7 +187,7 @@ elif [[ "${step}" = "fcst" ]]; then nth_fv3=${nth_fv3_gfs} fi - nth_max=$((${npe_node_max} / ${npe_node_fcst})) + nth_max=$((npe_node_max / npe_node_fcst)) export NTHREADS_FV3=${nth_fv3:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -210,7 +210,7 @@ elif [[ "${step}" = "efcs" ]]; then export FI_OFI_RXM_RX_SIZE=40000 export FI_OFI_RXM_TX_SIZE=40000 - nth_max=$((${npe_node_max} / ${npe_node_efcs})) + nth_max=$((npe_node_max / npe_node_efcs)) export NTHREADS_FV3=${nth_efcs:-${nth_max}} [[ ${NTHREADS_FV3} -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} @@ -223,7 +223,7 @@ elif [[ "${step}" = "efcs" ]]; then elif [[ "${step}" = "post" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_post})) + nth_max=$((npe_node_max / npe_node_post)) export NTHREADS_NP=${nth_np:-1} [[ ${NTHREADS_NP} -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} @@ -235,7 +235,7 @@ elif [[ "${step}" = "post" ]]; then elif [[ "${step}" = "ecen" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_ecen})) + nth_max=$((npe_node_max / npe_node_ecen)) export NTHREADS_ECEN=${nth_ecen:-${nth_max}} [[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} @@ -255,7 +255,7 @@ elif [[ "${step}" = "ecen" ]]; then elif [[ "${step}" = "esfc" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_esfc})) + nth_max=$((npe_node_max / npe_node_esfc)) export NTHREADS_ESFC=${nth_esfc:-${nth_max}} [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} @@ -267,7 +267,7 @@ elif [[ "${step}" = "esfc" ]]; then elif [[ "${step}" = "epos" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_epos})) + nth_max=$((npe_node_max / npe_node_epos)) export NTHREADS_EPOS=${nth_epos:-${nth_max}} [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} @@ -282,7 +282,7 @@ elif [[ "${step}" = "postsnd" ]]; then export MPICH_MPIIO_HINTS_DISPLAY=1 export OMP_NUM_THREADS=1 - nth_max=$((${npe_node_max} / ${npe_node_postsnd})) + nth_max=$((npe_node_max / npe_node_postsnd)) export NTHREADS_POSTSND=${nth_postsnd:-1} [[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} @@ -294,7 +294,7 @@ elif [[ "${step}" = "postsnd" ]]; then elif [[ "${step}" = "awips" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_awips})) + nth_max=$((npe_node_max / npe_node_awips)) export NTHREADS_AWIPS=${nth_awips:-2} [[ ${NTHREADS_AWIPS} -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} @@ -302,7 +302,7 @@ elif [[ "${step}" = "awips" ]]; then elif [[ "${step}" = "gempak" ]]; then - nth_max=$((${npe_node_max} / ${npe_node_gempak})) + nth_max=$((npe_node_max / npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} [[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} From 5ebd819f2d52a14cc055cfec1601daf376ab8d25 Mon Sep 17 00:00:00 2001 From: "kate.friedman" Date: Fri, 18 Nov 2022 12:27:03 -0600 Subject: [PATCH 7/7] Update WCOSS2 env file for SC2034 - SC2034 (warning): NTASKS appears unused. Verify use (or export if used externally). - Add "export" for NTASKS variable setting in waveprep if-block. Refs #397 --- env/WCOSS2.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/WCOSS2.env b/env/WCOSS2.env index 626315a1898..079ed6bcfeb 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -35,7 +35,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then - if [[ "${step}" = "waveprep" ]] && [[ "${CDUMP}" = "gfs" ]]; then NTASKS=${NTASKS_gfs} ; fi + if [[ "${step}" = "waveprep" ]] && [[ "${CDUMP}" = "gfs" ]]; then export NTASKS=${NTASKS_gfs} ; fi export wavempexec="${launcher} -np" export wave_mpmd=${mpmd_opt}