From 82bebd57aa061c67bd8f8e02fb24e03e255b5406 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Sat, 23 Jul 2022 07:42:32 +0000 Subject: [PATCH 01/14] Add preamble, convert to bash, and remove env This is the first in a wave of commits to improve and standardize the scripts within global workflow. In this commit, all scripts run during execution are converted to bash and a preamble is added to every script that is not sourced by another script. Every script executed during a forecast cycle is converted to bash. This was mostly straightforward, though there were a couple Korne-shell conventions (primarily using `typeset` to format strings) that had to be replaced with bash-compatable alternatives like `printf`. This in turn required a few modification to prevent zero-padded numbers from being treated as octals (other may have been pre-existing bugs). The preamble contains a number of feature to standardize code and improve script flow and debugging. First, it uses two variables, `$STRICT` and `$TRACE` to control the behavior of `set`. When `$STRICT` is `"YES"`, error on undefined variables (`set -u`) and exit on non-zero return (`set -e`) are turned on. When `$TRACE` is `"YES"`, command trace (`set -x`) is turned on and a useful string is set to `$PS4` that gives the name and line number of the script. Both `$STRICT` and `$TRACE` default to `"YES"`. They also set up commands, `$ERR_EXIT_ON` and `$TRACE_ON`, that will restore the setting of each in the event a script needs to temporarily turn them off. Second, the preamble sets up primative timing of scripts using Posix `date`. Third, it echos the script is beginning and at what time. Finally, it also establishes a postamble function and sets it to run as a trap of EXIT. The postamble will use the end time to calculate the run time of the script, then print that the script has ended at what time, how long has elapsed, and the exit code. By setting this up as a trap instead of just calling it at the end of the script, it ensures the postamble is called even if the script exits early because there is an error. In response to this standardization, parts of scripts that performed these preamble functions (announcing start/end, `set -x`, etc) have been deleted. For some scripts where temporarily turning off `-x` or `-e` is needed, they now use `$ERR_EXIT_ON` and `$TRACE_ON` to return to the correct state afterwards, instead of blindly turning the setting back on. Additionally, some modifications were needed to comply with `set -eu`. Mostly taking care of undefined variables, but also a couple instances where a non-zero return code had to be dealt with. If users wish to use their own preamble script instead, the default script can be overriden by setting `$PREAMBLE_SCRIPT` before the run begins. Instance where scripts would print the full list of environment variables have been removed. These can be spot added back in to debug as necessary. Alternatively, a future PR will add them back in in a standardized way. `rstprod.sh` is added to the link list from gsi_monitor.fd, as it is needed for the radmon scripts. The placeholders for AWIPS and GEMPAK in the Hera and Orion environment scripts were replaced with the correct definitions. There were also other modifications to AWIPS and GEMPAK scripts to get it working for development (AWIPS still isn't and will be fixed in the future). GSI scripts that were brought in recently had all of their backticks replaced with `$( )` as was done with all other script previously. Refs: #397 --- .gitignore | 1 + env/HERA.env | 14 +- env/ORION.env | 14 +- jobs/JGDAS_ATMOS_ANALYSIS_DIAG | 22 +-- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 22 +-- jobs/JGDAS_ATMOS_GEMPAK | 16 +- jobs/JGDAS_ATMOS_GEMPAK_META_NCDC | 14 +- jobs/JGDAS_EFSOI | 22 +-- jobs/JGDAS_EFSOI_ECEN | 22 +-- jobs/JGDAS_EFSOI_FCST | 23 +-- jobs/JGDAS_EFSOI_POST | 23 +-- jobs/JGDAS_EFSOI_SFC | 23 +-- jobs/JGDAS_EFSOI_UPDATE | 22 +-- jobs/JGDAS_ENKF_DIAG | 21 +-- jobs/JGDAS_ENKF_ECEN | 21 +-- jobs/JGDAS_ENKF_FCST | 21 +-- jobs/JGDAS_ENKF_POST | 21 +-- jobs/JGDAS_ENKF_SELECT_OBS | 21 +-- jobs/JGDAS_ENKF_SFC | 21 +-- jobs/JGDAS_ENKF_UPDATE | 20 +-- jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG | 15 +- jobs/JGFS_ATMOS_AWIPS_G2 | 15 +- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 24 +-- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 22 +-- jobs/JGFS_ATMOS_FBWIND | 14 +- jobs/JGFS_ATMOS_FSU_GENESIS | 20 +-- jobs/JGFS_ATMOS_GEMPAK | 41 +++-- jobs/JGFS_ATMOS_GEMPAK_META | 17 +- jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF | 17 +- jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC | 19 +-- jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS | 14 +- jobs/JGFS_ATMOS_POSTSND | 16 +- jobs/JGLOBAL_ATMOS_ANALYSIS | 21 +-- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 21 +-- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 18 +- jobs/JGLOBAL_ATMOS_NCEPPOST | 24 +-- jobs/JGLOBAL_ATMOS_POST_MANAGER | 11 +- jobs/JGLOBAL_ATMOS_SFCANL | 23 +-- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 22 +-- jobs/JGLOBAL_FORECAST | 20 +-- jobs/JGLOBAL_WAVE_GEMPAK | 16 +- jobs/JGLOBAL_WAVE_INIT | 12 +- jobs/JGLOBAL_WAVE_POST_BNDPNT | 21 +-- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 19 +-- jobs/JGLOBAL_WAVE_POST_PNT | 25 ++- jobs/JGLOBAL_WAVE_POST_SBS | 29 ++-- jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 13 +- jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 28 +--- jobs/JGLOBAL_WAVE_PREP | 12 +- jobs/rocoto/aerosol_init.sh | 9 +- jobs/rocoto/anal.sh | 11 +- jobs/rocoto/analcalc.sh | 9 +- jobs/rocoto/analdiag.sh | 9 +- jobs/rocoto/arch.sh | 65 ++++++-- jobs/rocoto/awips.sh | 11 +- jobs/rocoto/coupled_ic.sh | 17 +- jobs/rocoto/earc.sh | 19 ++- jobs/rocoto/ecen.sh | 9 +- jobs/rocoto/echgres.sh | 11 +- jobs/rocoto/ediag.sh | 9 +- jobs/rocoto/efcs.sh | 8 +- jobs/rocoto/eobs.sh | 9 +- jobs/rocoto/eomg.sh | 9 +- jobs/rocoto/epos.sh | 9 +- jobs/rocoto/esfc.sh | 9 +- jobs/rocoto/eupd.sh | 9 +- jobs/rocoto/fcst.sh | 9 +- jobs/rocoto/gempak.sh | 9 +- jobs/rocoto/getic.sh | 9 +- jobs/rocoto/gldas.sh | 8 +- jobs/rocoto/init.sh | 11 +- jobs/rocoto/metp.sh | 9 +- jobs/rocoto/ocnpost.sh | 10 +- jobs/rocoto/post.sh | 9 +- jobs/rocoto/postsnd.sh | 9 +- jobs/rocoto/prep.sh | 9 +- jobs/rocoto/sfcanl.sh | 9 +- jobs/rocoto/vrfy.sh | 11 +- jobs/rocoto/wafs.sh | 9 +- jobs/rocoto/wafsblending.sh | 12 +- jobs/rocoto/wafsblending0p25.sh | 12 +- jobs/rocoto/wafsgcip.sh | 12 +- jobs/rocoto/wafsgrib2.sh | 12 +- jobs/rocoto/wafsgrib20p25.sh | 12 +- jobs/rocoto/waveawipsbulls.sh | 10 +- jobs/rocoto/waveawipsgridded.sh | 9 +- jobs/rocoto/wavegempak.sh | 9 +- jobs/rocoto/waveinit.sh | 9 +- jobs/rocoto/wavepostbndpnt.sh | 9 +- jobs/rocoto/wavepostbndpntbll.sh | 9 +- jobs/rocoto/wavepostpnt.sh | 9 +- jobs/rocoto/wavepostsbs.sh | 9 +- jobs/rocoto/waveprep.sh | 8 +- parm/config/config.aero | 2 +- parm/config/config.aerosol_init | 2 +- parm/config/config.anal | 4 +- parm/config/config.analcalc | 2 +- parm/config/config.analdiag | 2 +- parm/config/config.arch | 2 +- parm/config/config.awips | 2 +- parm/config/config.base.emc.dyn | 2 +- parm/config/config.base.nco.static | 2 +- parm/config/config.coupled_ic | 2 +- parm/config/config.defaults.s2sw | 2 +- parm/config/config.earc | 2 +- parm/config/config.ecen | 2 +- parm/config/config.echgres | 2 +- parm/config/config.ediag | 2 +- parm/config/config.efcs | 2 +- parm/config/config.eobs | 2 +- parm/config/config.epos | 2 +- parm/config/config.esfc | 2 +- parm/config/config.eupd | 2 +- parm/config/config.fcst | 2 +- parm/config/config.fv3 | 2 +- parm/config/config.fv3.nco.static | 2 +- parm/config/config.gempak | 2 +- parm/config/config.getic | 2 +- parm/config/config.gldas | 2 +- parm/config/config.ice | 2 +- parm/config/config.init | 2 +- parm/config/config.metp | 2 +- parm/config/config.nsst | 2 +- parm/config/config.ocn | 2 +- parm/config/config.ocnpost | 2 +- parm/config/config.post | 2 +- parm/config/config.postsnd | 2 +- parm/config/config.prep | 2 +- parm/config/config.prepbufr | 2 +- parm/config/config.resources | 4 +- parm/config/config.sfcanl | 2 +- parm/config/config.vrfy | 2 +- parm/config/config.wafs | 2 +- parm/config/config.wafsblending | 2 +- parm/config/config.wafsblending0p25 | 2 +- parm/config/config.wafsgcip | 2 +- parm/config/config.wafsgrib2 | 2 +- parm/config/config.wafsgrib20p25 | 2 +- parm/config/config.wave | 2 +- parm/config/config.waveawipsbulls | 2 +- parm/config/config.waveawipsgridded | 2 +- parm/config/config.wavegempak | 2 +- parm/config/config.waveinit | 2 +- parm/config/config.wavepostbndpnt | 2 +- parm/config/config.wavepostbndpntbll | 2 +- parm/config/config.wavepostpnt | 2 +- parm/config/config.wavepostsbs | 2 +- parm/config/config.waveprep | 2 +- scripts/exgdas_atmos_chgres_forenkf.sh | 17 +- scripts/exgdas_atmos_gempak_gif_ncdc.sh | 12 +- scripts/exgdas_atmos_nawips.sh | 44 ++--- scripts/exgdas_atmos_nceppost.sh | 61 +++---- scripts/exgdas_efsoi.sh | 19 +-- scripts/exgdas_efsoi_update.sh | 20 +-- scripts/exgdas_enkf_ecen.sh | 17 +- scripts/exgdas_enkf_fcst.sh | 19 +-- scripts/exgdas_enkf_post.sh | 21 +-- scripts/exgdas_enkf_select_obs.sh | 17 +- scripts/exgdas_enkf_sfc.sh | 17 +- scripts/exgdas_enkf_update.sh | 20 +-- scripts/exgfs_atmos_awips_20km_1p0deg.sh | 39 ++--- scripts/exgfs_atmos_fbwind.sh | 65 +++----- scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh | 38 ++--- scripts/exgfs_atmos_gempak_meta.sh | 41 ++--- scripts/exgfs_atmos_goes_nawips.sh | 47 ++---- scripts/exgfs_atmos_grib2_special_npoess.sh | 49 ++---- scripts/exgfs_atmos_grib_awips.sh | 47 +++--- scripts/exgfs_atmos_nawips.sh | 47 ++---- scripts/exgfs_atmos_nceppost.sh | 87 +++++----- scripts/exgfs_atmos_postsnd.sh | 30 +--- scripts/exgfs_pmgr.sh | 20 +-- scripts/exgfs_prdgen_manager.sh | 19 ++- scripts/exgfs_wave_init.sh | 51 +++--- scripts/exgfs_wave_nawips.sh | 38 ++--- scripts/exgfs_wave_post_gridded_sbs.sh | 69 +++----- scripts/exgfs_wave_post_pnt.sh | 88 +++++----- scripts/exgfs_wave_prdgen_bulls.sh | 63 +++---- scripts/exgfs_wave_prdgen_gridded.sh | 44 +++-- scripts/exgfs_wave_prep.sh | 56 +++---- scripts/exglobal_atmos_analysis.sh | 18 +- scripts/exglobal_atmos_analysis_calc.sh | 18 +- scripts/exglobal_atmos_pmgr.sh | 17 +- scripts/exglobal_atmos_sfcanl.sh | 16 +- scripts/exglobal_atmos_tropcy_qc_reloc.sh | 50 ++---- scripts/exglobal_diag.sh | 22 +-- scripts/exglobal_forecast.sh | 21 +-- scripts/run_reg2grb2.sh | 9 +- scripts/run_regrid.sh | 10 +- sorc/link_workflow.sh | 2 +- ush/cplvalidate.sh | 2 +- ush/drive_makeprepbufr.sh | 9 +- ush/forecast_det.sh | 3 +- ush/forecast_postdet.sh | 8 +- ush/forecast_predet.sh | 7 +- ush/fv3gfs_downstream_nems.sh | 29 ++-- ush/fv3gfs_dwn_nems.sh | 11 +- ush/fv3gfs_nc2nemsio.sh | 11 +- ush/fv3gfs_regrid_nemsio.sh | 15 +- ush/fv3gfs_remap.sh | 9 +- ush/fv3gfs_remap_weights.sh | 2 +- ush/gaussian_sfcanl.sh | 24 +-- ush/getdump.sh | 11 +- ush/getges.sh | 22 ++- ush/gfs_bfr2gpk.sh | 8 +- ush/gfs_bufr.sh | 15 +- ush/gfs_bufr_netcdf.sh | 15 +- ush/gfs_nceppost.sh | 39 ++--- ush/gfs_sndp.sh | 15 +- ush/gfs_transfer.sh | 34 ++-- ush/gfs_truncate_enkf.sh | 10 +- ush/global_extrkr.sh | 157 +++++++++--------- ush/global_nceppost.sh | 21 +-- ush/global_savefits.sh | 8 +- ush/hpssarch_gen.sh | 8 +- ush/inter_flux.sh | 16 +- ush/link_crtm_fix.sh | 7 +- ush/load_fv3gfs_modules.sh | 14 +- ush/mod_icec.sh | 15 +- ush/nems_configure.sh | 2 +- ush/parsing_model_configure_DATM.sh | 2 +- ush/parsing_model_configure_FV3.sh | 2 +- ush/parsing_namelists_CICE.sh | 2 + ush/parsing_namelists_FV3.sh | 45 ++--- ush/parsing_namelists_MOM6.sh | 1 + ush/parsing_namelists_WW3.sh | 5 +- ush/preamble.sh | 86 ++++++++++ ush/scale_dec.sh | 10 +- ush/syndat_getjtbul.sh | 19 ++- ush/syndat_qctropcy.sh | 109 ++++-------- ush/trim_rh.sh | 10 +- ush/tropcy_relocate.sh | 35 ++-- ush/tropcy_relocate_extrkr.sh | 99 +++++------ ush/wave_grib2_sbs.sh | 49 +++--- ush/wave_grid_interp_sbs.sh | 41 ++--- ush/wave_grid_moddef.sh | 37 ++--- ush/wave_outp_cat.sh | 39 ++--- ush/wave_outp_spec.sh | 47 +++--- ush/wave_prnc_cur.sh | 11 +- ush/wave_prnc_ice.sh | 62 ++++--- ush/wave_tar.sh | 47 +++--- 240 files changed, 2091 insertions(+), 2180 deletions(-) create mode 100644 ush/preamble.sh diff --git a/.gitignore b/.gitignore index 6f5a7da9c58..21b129a3c01 100644 --- a/.gitignore +++ b/.gitignore @@ -196,6 +196,7 @@ ush/radmon_verf_bcoef.sh ush/radmon_verf_bcor.sh ush/radmon_verf_time.sh ush/ufsda +ush/rstprod.sh ush/wafs_blending.sh ush/wafs_grib2.regrid.sh ush/wafs_intdsk.sh diff --git a/env/HERA.env b/env/HERA.env index f5c0a5efcd7..124b3e8b9a2 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash if [ $# -ne 1 ]; then @@ -261,9 +261,17 @@ elif [ $step = "postsnd" ]; then elif [ $step = "awips" ]; then - echo "WARNING: $step is not enabled on $machine!" + 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 --multi-prog" elif [ $step = "gempak" ]; then - echo "WARNING: $step is not enabled on $machine!" + 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="$launcher -n $npe_gempak --multi-prog" fi diff --git a/env/ORION.env b/env/ORION.env index f3b58d987c7..bef0661f476 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash if [ $# -ne 1 ]; then @@ -259,9 +259,17 @@ elif [ $step = "postsnd" ]; then elif [ $step = "awips" ]; then - echo "WARNING: $step is not enabled on $machine!" + 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 --multi-prog" elif [ $step = "gempak" ]; then - echo "WARNING: $step is not enabled on $machine!" + 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="$launcher -n $npe_gempak --multi-prog" fi diff --git a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG index da16176ab3b..a9debda3928 100755 --- a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG +++ b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -112,11 +113,6 @@ fi ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - - ${ANALDIAGSH:-$SCRgfs/exglobal_diag.sh} status=$? [[ $status -ne 0 ]] && exit $status @@ -133,15 +129,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index cf69bdd770f..5873ad4e538 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -97,11 +98,6 @@ export COMIN_GES_ENS="$ROTDIR/enkfgdas.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - - ${CHGRESFCSTSH:-$SCRgfs/exgdas_atmos_chgres_forenkf.sh} status=$? [[ $status -ne 0 ]] && exit $status @@ -118,15 +114,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ATMOS_GEMPAK b/jobs/JGDAS_ATMOS_GEMPAK index e2d3d89da77..fce845b6118 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK +++ b/jobs/JGDAS_ATMOS_GEMPAK @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GDAS GEMPAK PRODUCT GENERATION @@ -73,7 +74,6 @@ fi export pgmout=OUTPUT.$$ -env if [ -f $DATA/poescrip ]; then rm $DATA/poescript @@ -107,11 +107,6 @@ APRUNCFP=$(eval echo $APRUN_GEMPAKCFP) $APRUNCFP $DATA/poescript export err=$?; err_chk -######################################################## - -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -126,4 +121,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC index 12951c2c53a..72314fa0200 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC +++ b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GDAS GEMPAK META NCDC PRODUCT GENERATION @@ -86,7 +87,6 @@ fi export pgmout=OUTPUT.$$ -env ######################################################## # Execute the script. @@ -107,9 +107,6 @@ $SRCgfs/exgdas_atmos_gempak_gif_ncdc.sh export err=$?; err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -124,4 +121,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGDAS_EFSOI b/jobs/JGDAS_EFSOI index af60ddeb7b3..8369aae5ff3 100755 --- a/jobs/JGDAS_EFSOI +++ b/jobs/JGDAS_EFSOI @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -97,10 +98,6 @@ mkdir -p $OSENSE_SAVE_DIR ############################################################### # Run relevant exglobal script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT ${EFSOIUPDSH:-$SCRgfs/exgdas_efsoi.sh} status=$? @@ -117,11 +114,6 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## @@ -129,5 +121,5 @@ cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_EFSOI_ECEN b/jobs/JGDAS_EFSOI_ECEN index 28d04b9f5cf..7dea0484ee8 100755 --- a/jobs/JGDAS_EFSOI_ECEN +++ b/jobs/JGDAS_EFSOI_ECEN @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -106,11 +107,6 @@ export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${ENKFRECENSH:-$SCRgfs/exgdas_enkf_ecen.sh} status=$? @@ -129,15 +125,11 @@ if [ -e "$pgmout" ] ; then fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_EFSOI_FCST b/jobs/JGDAS_EFSOI_FCST index a9e4fc78f1c..a3fb4cc4b42 100755 --- a/jobs/JGDAS_EFSOI_FCST +++ b/jobs/JGDAS_EFSOI_FCST @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -93,11 +94,6 @@ export ENSBEG=$((ENSEND - NMEM_EFCSGRP + 1)) ############################################################### # Run relevant script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${ENKFFCSTSH:-$SCRgfs/exgdas_enkf_fcst.sh} status=$? @@ -129,16 +125,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_EFSOI_POST b/jobs/JGDAS_EFSOI_POST index f71f865b7e4..f000f3e2ead 100755 --- a/jobs/JGDAS_EFSOI_POST +++ b/jobs/JGDAS_EFSOI_POST @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -84,11 +85,6 @@ export LEVS=$((LEVS-1)) ############################################################### # Run relevant script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${ENKFPOSTSH:-$SCRgfs/exgdas_enkf_post.sh} status=$? @@ -106,16 +102,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_EFSOI_SFC b/jobs/JGDAS_EFSOI_SFC index 5924393c33d..eed9ebd10fd 100755 --- a/jobs/JGDAS_EFSOI_SFC +++ b/jobs/JGDAS_EFSOI_SFC @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -118,11 +119,6 @@ export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${ENKFRESFCSH:-$SCRgfs/exgdas_enkf_sfc.sh} status=$? @@ -140,16 +136,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_EFSOI_UPDATE b/jobs/JGDAS_EFSOI_UPDATE index 3d730eab7e5..4bac26ce4c0 100755 --- a/jobs/JGDAS_EFSOI_UPDATE +++ b/jobs/JGDAS_EFSOI_UPDATE @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -92,10 +93,6 @@ mkdir -p $COMOUT_ANL_ENSFSOI ############################################################### # Run relevant exglobal script -env -msg="HAS BEGUN on `hostname`" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT ${EFSOIUPDSH:-$SCRgfs/exgdas_efsoi_update.sh} status=$? @@ -121,11 +118,6 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## @@ -133,5 +125,5 @@ cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index 1c26192569a..630ef6ee247 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -147,10 +148,6 @@ done ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ANALDIAGSH:-$SCRgfs/exglobal_diag.sh} status=$? @@ -168,15 +165,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index f52abfe4203..dbe0ee72baa 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -103,10 +104,6 @@ export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ENKFRECENSH:-$SCRgfs/exgdas_enkf_ecen.sh} status=$? @@ -124,15 +121,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_FCST b/jobs/JGDAS_ENKF_FCST index 88d61c08704..45fa462ac1a 100755 --- a/jobs/JGDAS_ENKF_FCST +++ b/jobs/JGDAS_ENKF_FCST @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -83,10 +84,6 @@ export ENSBEG=$((ENSEND - NMEM_EFCSGRP + 1)) ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ENKFFCSTSH:-$SCRgfs/exgdas_enkf_fcst.sh} status=$? @@ -126,15 +123,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index 7309305c0fb..33363564404 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -77,10 +78,6 @@ export LEVS=$((LEVS-1)) ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ENKFPOSTSH:-$SCRgfs/exgdas_enkf_post.sh} status=$? @@ -98,15 +95,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index 919eec5bc5e..716443f14d8 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -149,10 +150,6 @@ done ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${INVOBSSH:-$SCRgfs/exgdas_enkf_select_obs.sh} status=$? @@ -178,15 +175,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index a0383f2cf0a..88e24c45797 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -104,10 +105,6 @@ export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ENKFRESFCSH:-$SCRgfs/exgdas_enkf_sfc.sh} status=$? @@ -125,15 +122,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 07bf37f7f8e..87ddc29dfc5 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -81,9 +82,6 @@ export COMOUT_ANL_ENS="$ROTDIR/enkf$CDUMP.$PDY/$cyc/$COMPONENT" ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT ${ENKFUPDSH:-$SCRgfs/exgdas_enkf_update.sh} status=$? @@ -109,15 +107,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG index ea70ae7b148..52b84fffadc 100755 --- a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG +++ b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG @@ -1,9 +1,11 @@ -#!/bin/sh +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -set -xa -export PS4='$SECONDS + ' export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} -date ########################################### # GFS_AWIPS_20KM AWIPS PRODUCT GENERATION @@ -62,7 +64,6 @@ fi export pgmout=OUTPUT.$$ -env ######################################################## # Execute the script. @@ -76,9 +77,6 @@ $HOMEgfs/scripts/exgfs_atmos_awips_20km_1p0deg.sh $fcsthrs export err=$?; err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -93,4 +91,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_AWIPS_G2 b/jobs/JGFS_ATMOS_AWIPS_G2 index 634cf07cdd8..31f3ec4b43a 100755 --- a/jobs/JGFS_ATMOS_AWIPS_G2 +++ b/jobs/JGFS_ATMOS_AWIPS_G2 @@ -1,8 +1,10 @@ -#!/bin/sh +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -set -xa -export PS4='$SECONDS + ' -date export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} ######################################## @@ -63,7 +65,6 @@ fi export pgmout=OUTPUT.$$ -env ######################################################## # Execute the script. @@ -73,9 +74,6 @@ cd $DATA/awips_g1 $HOMEgfs/scripts/exgfs_atmos_grib_awips.sh $fcsthrs export err=$?; err_chk -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -90,4 +88,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index 090e1e1bfb9..a9edcc27e84 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -99,8 +100,6 @@ export COMOUT=${ROTDIR}/${RUN}.${PDY}/${cyc}/$COMPONENT export JYYYY=$(echo ${PDY} | cut -c1-4) export COMINgenvit=${COMINgenvit:-${COMOUT}/genesis_vital_${JYYYY}} export COMOUTgenvit=${COMOUTgenvit:-${COMOUT}/genesis_vital_${JYYYY}} -#export COMINgenvit=${COMINgenvit:-${DATA}/genesis_vital_${JYYYY}} -#export COMOUTgenvit=${COMOUTgenvit:-${DATA}/genesis_vital_${JYYYY}} export COMINsyn=${COMINsyn:-$(compath.py gfs/prod/syndat)} @@ -109,11 +108,6 @@ mkdir -m 775 -p $COMOUTgenvit ############################################## # Run relevant script ############################################## -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${SCRIPTens_tracker}/exgfs_tc_genesis.sh export err=$?; err_chk @@ -125,15 +119,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index b86a5e65345..0e17986a833 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -115,10 +116,6 @@ fi ############################################## # Run relevant script ############################################## -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT ############################################################# # Execute the script @@ -168,16 +165,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGFS_ATMOS_FBWIND b/jobs/JGFS_ATMOS_FBWIND index 0c43bf26434..5eb40a0dcb7 100755 --- a/jobs/JGFS_ATMOS_FBWIND +++ b/jobs/JGFS_ATMOS_FBWIND @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GFS FBWIND PRODUCT GENERATION @@ -62,7 +63,6 @@ fi export pgmout=OUTPUT.$$ -env ######################################################## # Execute the script. @@ -70,9 +70,6 @@ $HOMEgfs/scripts/exgfs_atmos_fbwind.sh export err=$?;err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -87,4 +84,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index 57aa709e069..d31d4a9009b 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -119,10 +120,6 @@ fi ############################################## # Run relevant script ############################################## -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT ############################################################# # Execute the script @@ -136,14 +133,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGFS_ATMOS_GEMPAK b/jobs/JGFS_ATMOS_GEMPAK index 173fad7d512..39b8f2f58e5 100755 --- a/jobs/JGFS_ATMOS_GEMPAK +++ b/jobs/JGFS_ATMOS_GEMPAK @@ -1,13 +1,33 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GFS GEMPAK PRODUCT GENERATION ############################################ +############################# +# Source relevant config files +############################# +configs="base gempak" +export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +for config in $configs; do + . $config_path/config.$config + status=$? + [[ $status -ne 0 ]] && exit $status +done + +########################################## +# Source machine runtime environment +########################################## +. $HOMEgfs/env/${machine}.env gempak +status=$? +[[ $status -ne 0 ]] && exit $status + ########################################################## # obtain unique process id (pid) and make temp directory ########################################################## @@ -73,7 +93,6 @@ fi export pgmout=OUTPUT.$$ -env rm -f poescript @@ -129,6 +148,10 @@ echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs35_atl 180 GFS_GEMPAK_WWB &> $DATA/g echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs40 180 GFS_GEMPAK_WWB &> $DATA/gfs40.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs40 180 GFS_GEMPAK_WWB &> $DATA/gfs40.$$.2 " >>poescript +# Add task number to the MPMD script +nl -n ln -v 0 poescript > poescript.new +mv poescript.new poescript + cat poescript chmod 775 $DATA/poescript @@ -139,7 +162,7 @@ ntasks=${NTASKS_GEMPAK:-$(cat $DATA/poescript | wc -l)} ptile=${PTILE_GEMPAK:-4} threads=${NTHREADS_GEMPAK:-1} export OMP_NUM_THREADS=$threads -APRUN="mpirun -n $ntasks cfp " +APRUN=${APRUN:-"mpirun -n $ntasks cfp "} APRUN_GEMPAKCFP=${APRUN_GEMPAKCFP:-$APRUN} APRUNCFP=$(eval echo $APRUN_GEMPAKCFP) @@ -147,11 +170,6 @@ APRUNCFP=$(eval echo $APRUN_GEMPAKCFP) $APRUNCFP $DATA/poescript export err=$?; err_chk -cat $DATA/gfs*.$$.? - -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -166,4 +184,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_GEMPAK_META b/jobs/JGFS_ATMOS_GEMPAK_META index d3590b88bfb..5371f2cb464 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_META +++ b/jobs/JGFS_ATMOS_GEMPAK_META @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GFS GEMPAK META PRODUCT GENERATION @@ -83,16 +84,12 @@ export COMINnam=${COMINnam:-$(compath.py nam/prod/nam)} export SENDDBN=${SENDDBN:-NO} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - if [ $SENDCOM = YES ] ; then mkdir -m 775 -p $COMOUT fi export pgmout=OUTPUT.$$ -env ######################################################## # Execute the script. @@ -100,9 +97,6 @@ $SRCgfs/exgfs_atmos_gempak_meta.sh export err=$?; err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -117,4 +111,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF index cc245568925..d1eec53e50d 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF +++ b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GFS GEMPAK NCDC PRODUCT GENERATION @@ -84,10 +85,6 @@ fi export pgmout=OUTPUT.$$ -env - -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" ######################################################## # Execute the script. @@ -95,9 +92,6 @@ $SRCgfs/exgfs_atmos_gempak_gif_ncdc_skew_t.sh export err=$?; err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -112,4 +106,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC index 0f57c6adb28..dff46fb7590 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC +++ b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################ # GFS_PGRB2_SPEC_GEMPAK PRODUCT GENERATION @@ -63,13 +64,9 @@ if [ $SENDCOM = YES ] ; then mkdir -m 775 -p $COMOUT fi -env export DATA_HOLD=$DATA -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - ################################################################# # Execute the script for the regular grib ################################################################# @@ -85,7 +82,6 @@ export finc=3 export fstart=000 echo "RUNS the Program" -set -xa ######################################################## # Execute the script. @@ -107,7 +103,6 @@ export finc=3 export fstart=000 echo "RUNS the Program" -set -xa ######################################################## # Execute the script. @@ -115,9 +110,6 @@ $SRCgfs/exgfs_atmos_goes_nawips.sh export err=$?; err_chk ######################################################## -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - echo "end of program" cd $DATA_HOLD echo "######################################" @@ -138,4 +130,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS index 7cc9f693098..08791fd04d4 100755 --- a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS +++ b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS @@ -1,8 +1,9 @@ -#!/bin/sh +#! /usr/bin/env bash -set -xa -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} @@ -65,7 +66,6 @@ fi export pgmout=OUTPUT.$$ -env #################################### # Specify Forecast Hour Range @@ -124,9 +124,6 @@ $HOMEgfs/scripts/exgfs_atmos_grib2_special_npoess.sh export err=$?;err_chk ############################################################# -msg="JOB $job HAS COMPLETED NORMALLY!" -postmsg $jlogfile "$msg" - ############################################ # print exec I/O output ############################################ @@ -141,4 +138,3 @@ if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi -date diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index 5faf16f7786..c1ffcd02da4 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -1,9 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date ############################# # Source relevant config files @@ -92,7 +94,6 @@ export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} [[ ! -d $pcom ]] && mkdir -p $pcom [[ ! -d $COMAWP ]] && mkdir -p $COMAWP -env ######################################################## # Execute the script. @@ -112,15 +113,12 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index af28afe3b6b..d5754cf3d66 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -140,10 +141,6 @@ fi ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ANALYSISSH:-$SCRgfs/exglobal_atmos_analysis.sh} status=$? @@ -171,15 +168,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 63c143200fe..27f601e665b 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -127,10 +128,6 @@ export DOGAUSFCANL=${DOGAUSFCANL:-"YES"} ############################################################### # Run relevant script -env -echo "HAS BEGUN on $(hostname)" -$LOGSCRIPT - ${ANALCALCSH:-$SCRgfs/exglobal_atmos_analysis_calc.sh} status=$? @@ -148,15 +145,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -echo "ENDED NORMALLY." - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index 22389d6f05a..751376aec5c 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -1,9 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date ############################# # Source relevant config files @@ -73,10 +75,6 @@ export BLENDED_ICE_FILE_m6hrs=${BLENDED_ICE_FILE_m6hrs:-${COMINgfs_m6hrs}/${RUN} # Run relevant script ############################################################### -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" - ${EMCSFCPREPSH:-$SCRgfs/exemcsfc_global_sfc_prep.sh} status=$? [[ $status -ne 0 ]] && exit $status @@ -92,15 +90,11 @@ if [ -e ${pgmout} ]; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGLOBAL_ATMOS_NCEPPOST b/jobs/JGLOBAL_ATMOS_NCEPPOST index d4b0983605b..cda119bb8f8 100755 --- a/jobs/JGLOBAL_ATMOS_NCEPPOST +++ b/jobs/JGLOBAL_ATMOS_NCEPPOST @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -72,7 +73,7 @@ export COMPONENT=${COMPONENT:-atmos} ############################################## export APRUNP=${APRUN:-$APRUN_NP} export RERUN=${RERUN:-NO} -export HOMECRTM=${HOMECRTM:-${NWROOT}/lib/crtm/${crtm_ver}} +export HOMECRTM=${HOMECRTM:-${NWROOT:-}/lib/crtm/${crtm_ver:-}} export FIXCRTM=${CRTM_FIX:-${HOMECRTM}/fix} export PARMpost=${PARMpost:-$HOMEgfs/parm/post} export INLINE_POST=${WRITE_DOPOST:-".false."} @@ -118,11 +119,6 @@ export SLEEP_INT=5 ############################################################### # Run relevant exglobal script -env -msg="HAS BEGUN on $(hostname)" -postmsg "$msg" -$LOGSCRIPT - $SCRgfs/ex${RUN}_atmos_nceppost.sh status=$? @@ -139,15 +135,11 @@ if [ -e "$pgmout" ]; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_ATMOS_POST_MANAGER b/jobs/JGLOBAL_ATMOS_POST_MANAGER index 94c848627f5..98d11163e98 100755 --- a/jobs/JGLOBAL_ATMOS_POST_MANAGER +++ b/jobs/JGLOBAL_ATMOS_POST_MANAGER @@ -1,17 +1,19 @@ -#!/bin/sh +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ######################################## # GFS post manager ######################################## export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date ############################# # Source relevant config files ############################# -set -x configs="base post" export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} @@ -101,4 +103,3 @@ export COMOUT=${COMOUT:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} $HOMEgfs/scripts/exglobal_atmos_pmgr.sh ######################################################## -date diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL index b5c7c7b9531..badeaee81e6 100755 --- a/jobs/JGLOBAL_ATMOS_SFCANL +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -1,10 +1,11 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -18,7 +19,6 @@ for config in $configs; do [[ $status -ne 0 ]] && exit $status done - ########################################## # Source machine runtime environment ########################################## @@ -105,10 +105,6 @@ fi ############################################################### # Run relevant script -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${SFCANALSH:-$SCRgfs/exglobal_atmos_sfcanl.sh} status=$? @@ -126,16 +122,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi - -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index e49e6a0244e..6eb54a1d37b 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -1,10 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash -export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi +export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# # Source relevant config files @@ -104,11 +105,6 @@ export BKGFREQ=1 # for hourly relocation ############################################## # Run relevant script ############################################## -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${TROPCYQCRELOSH:-$SCRgfs/exglobal_atmos_tropcy_qc_reloc.sh} status=$? @@ -122,15 +118,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_FORECAST b/jobs/JGLOBAL_FORECAST index d72a07614f9..155feb67064 100755 --- a/jobs/JGLOBAL_FORECAST +++ b/jobs/JGLOBAL_FORECAST @@ -1,9 +1,11 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4='$SECONDS + ' -date #-------------------------------- if [ $RUN_ENVIR = "emc" ]; then @@ -135,11 +137,6 @@ fi ############################################################### # Run relevant exglobal script -env -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" -$LOGSCRIPT - ${FORECASTSH:-$SCRgfs/exglobal_forecast.sh} status=$? @@ -157,14 +154,11 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -msg="ENDED NORMALLY." -postmsg "$jlogfile" "$msg" - ########################################## # Remove the Temporary working directory ########################################## cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index 1a613f020ae..a3d64431bda 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -1,9 +1,9 @@ -#!/bin/bash +#! /usr/bin/env bash - -date -set -xa -export PS4='$SECONDS + ' +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi # JY - 10/29, move the block in the front, otherwise PDY is not defined for COMIN export DATA=${DATA:-${DATAROOT}/${jobid:?}} @@ -18,10 +18,6 @@ export cycle=${cycle:-t${cyc}z} setpdy.sh . PDY -env -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - # export NET=${NET:-gfs} @@ -63,5 +59,5 @@ if [ "$KEEPDATA" != "YES" ]; then rm -rf $DATA fi -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_INIT b/jobs/JGLOBAL_WAVE_INIT index bab8f047422..0edce5c3857 100755 --- a/jobs/JGLOBAL_WAVE_INIT +++ b/jobs/JGLOBAL_WAVE_INIT @@ -1,9 +1,11 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files @@ -79,5 +81,5 @@ $HOMEgfs/scripts/exgfs_wave_init.sh cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 93b690ad1dd..502ded7fce0 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -1,9 +1,11 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files @@ -68,12 +70,9 @@ export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT} mkdir -p $COMOUT/station -env | sort # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic -# Set wave model ID tag to include member number -# if ensemble; waveMEMB var empty in deterministic membTAG='p' if [ "${waveMEMB}" == "00" ]; then membTAG='c'; fi export membTAG @@ -91,11 +90,9 @@ export DOBNDPNT_WAV='YES' #not boundary points $HOMEgfs/scripts/exgfs_wave_post_pnt.sh err=$? if [ $err -ne 0 ]; then - msg="FATAL ERROR: ex-script of GWES_POST failed!" -else - msg="$job completed normally!" + echo "FATAL ERROR: ex-script of GWES_POST failed!" + exit ${err} fi -postmsg "$jlogfile" "$msg" ########################################## # Remove the Temporary working directory @@ -103,5 +100,5 @@ postmsg "$jlogfile" "$msg" cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index 5d37dd35fcd..4393bf7620f 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -1,9 +1,11 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files @@ -69,7 +71,6 @@ export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT} mkdir -p $COMOUT/station -env | sort # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic @@ -92,11 +93,9 @@ export DOBNDPNT_WAV='YES' #boundary points $HOMEgfs/scripts/exgfs_wave_post_pnt.sh err=$? if [ $err -ne 0 ]; then - msg="FATAL ERROR: ex-script of GFS_WAVE_POST_PNT failed!" -else - msg="$job completed normally!" + echo "FATAL ERROR: ex-script of GFS_WAVE_POST_PNT failed!" + exit ${err} fi -postmsg "$jlogfile" "$msg" ########################################## # Remove the Temporary working directory @@ -104,5 +103,5 @@ postmsg "$jlogfile" "$msg" cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_PNT b/jobs/JGLOBAL_WAVE_POST_PNT index 092916b7f6f..15d2dda9291 100755 --- a/jobs/JGLOBAL_WAVE_POST_PNT +++ b/jobs/JGLOBAL_WAVE_POST_PNT @@ -1,16 +1,18 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files ############################# configs="base wave wavepostsbs wavepostpnt" export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +config_path=${EXPDIR:-${NWROOT:-}/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config status=$? @@ -29,8 +31,8 @@ export NET=${NET:-gfs} export RUN=${RUN:-gfs} export COMPONENT=${COMPONENT:-wave} -export HOMEgefs=${HOMEgefs:-$NWROOT/$NET.${gefs_ver}} -export HOMEgfs=${HOMEgfs:-$NWROOT/$NET.${gfs_ver}} +export HOMEgefs=${HOMEgefs:-${NWROOT:-}/$NET.${gefs_ver:-}} +export HOMEgfs=${HOMEgfs:-${NWROOT:-}/$NET.${gfs_ver}} # Add default errchk = err_chk export errchk=${errchk:-err_chk} @@ -68,7 +70,6 @@ export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT} mkdir -p $COMOUT/station -env | sort # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic @@ -91,11 +92,9 @@ export DOBNDPNT_WAV='NO' #not boundary points $HOMEgfs/scripts/exgfs_wave_post_pnt.sh err=$? if [ $err -ne 0 ]; then - msg="FATAL ERROR: ex-script of GWES_POST failed!" -else - msg="$job completed normally!" + echo "FATAL ERROR: ex-script of GWES_POST failed!" + exir ${err} fi -postmsg "$jlogfile" "$msg" ########################################## # Remove the Temporary working directory @@ -103,5 +102,5 @@ postmsg "$jlogfile" "$msg" cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index d798e28deff..ecc15f0122a 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -1,16 +1,18 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files ############################# configs="base wave wavepostsbs" export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +config_path=${EXPDIR:-${NWROOT:-}/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config status=$? @@ -29,8 +31,8 @@ export NET=${NET:-gfs} export RUN=${RUN:-gfs} export COMPONENT=${COMPONENT:-wave} -export HOMEgefs=${HOMEgefs:-$NWROOT/$NET.${gefs_ver}} -export HOMEgfs=${HOMEgfs:-$NWROOT/$NET.${gfs_ver}} +export HOMEgefs=${HOMEgefs:-${NWROOT:-}/$NET.${gefs_ver:-}} +export HOMEgfs=${HOMEgfs:-${NWROOT:-}/$NET.${gfs_ver}} # Add default errchk = err_chk export errchk=${errchk:-err_chk} @@ -66,13 +68,12 @@ fi export COMIN=${COMIN:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT} export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/$COMPONENT} -export COMINice=${COMINice:-${COMROOTp2}/omb/prod} +export COMINice=${COMINice:-${COMROOTp2:-${COMROOT}}/omb/prod} export COMINwnd=${COMINwnd:-${COMROOT}/gfs/prod} -export COMIN_WAV_CUR=${COMIN_WAV_CUR:-${COMROOTp2}/rtofs/prod} +export COMIN_WAV_CUR=${COMIN_WAV_CUR:-${COMROOTp2:-${COMROOT}}/rtofs/prod} mkdir -p $COMOUT/gridded -env | sort # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic @@ -89,11 +90,9 @@ export CFP_VERBOSE=1 $HOMEgfs/scripts/exgfs_wave_post_gridded_sbs.sh err=$? if [ $err -ne 0 ]; then - msg="FATAL ERROR: ex-script of GWES_POST failed!" -else - msg="$job completed normally!" + echo "FATAL ERROR: ex-script of GWES_POST failed!" + exit $err fi -postmsg "$jlogfile" "$msg" ########################################## # Remove the Temporary working directory @@ -101,5 +100,5 @@ postmsg "$jlogfile" "$msg" cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index db8738dcb9d..07f81b63e0f 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -1,8 +1,9 @@ -#!/bin/bash +#! /usr/bin/env bash -date -export PS4=' $SECONDS + ' -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export DATA=${DATA:-${DATAROOT}/${jobid:?}} mkdir -p $DATA @@ -16,7 +17,6 @@ export cycle=${cycle:-t${cyc}z} # Set PDY setpdy.sh . PDY -env export NET=${NET:-gfs} export RUN=${RUN:-gfs} @@ -56,6 +56,7 @@ if [ "$KEEPDATA" != "YES" ]; then cd $DATAROOT rm -rf $DATA fi -date + + exit 0 diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index 6e9f8ea5c27..ce811ae7504 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -1,8 +1,9 @@ -#!/bin/bash +#! /usr/bin/env bash -date -export PS4=' $SECONDS + ' -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export DATA=${DATA:-${DATAROOT}/${jobid:?}} mkdir -p $DATA @@ -16,7 +17,6 @@ export cycle=${cycle:-t${cyc}z} # Set PDY setpdy.sh . PDY - env # PATH for working directory export NET=${NET:-gfs} @@ -45,21 +45,6 @@ if [ $SENDCOM = YES ]; then mkdir -p $COMOUT $PCOM fi -# JY - move up -#export DATA=${DATA:-${DATAROOT}/${jobid:?}} -#mkdir -p $DATA -#cd $DATA -# -####################################### -### Set up the cycle variable -####################################### -#export cycle=${cycle:-t${cyc}z} - -## Set PDY -# setpdy.sh -# . PDY -# env - ################################### # Execute the Script ################################### @@ -73,6 +58,7 @@ if [ "$KEEPDATA" != "YES" ]; then cd $DATAROOT rm -rf $DATA fi -date + + exit 0 diff --git a/jobs/JGLOBAL_WAVE_PREP b/jobs/JGLOBAL_WAVE_PREP index 666ecb3b9e3..df74688c948 100755 --- a/jobs/JGLOBAL_WAVE_PREP +++ b/jobs/JGLOBAL_WAVE_PREP @@ -1,9 +1,11 @@ -#!/bin/bash +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -date export RUN_ENVIR=${RUN_ENVIR:-"nco"} -export PS4=' $SECONDS + ' -set -x -e ############################# # Source relevant config files @@ -101,5 +103,5 @@ $HOMEgfs/scripts/exgfs_wave_prep.sh cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date + exit 0 diff --git a/jobs/rocoto/aerosol_init.sh b/jobs/rocoto/aerosol_init.sh index d95f043e706..a10d90e56a1 100755 --- a/jobs/rocoto/aerosol_init.sh +++ b/jobs/rocoto/aerosol_init.sh @@ -1,6 +1,9 @@ -#!/bin/bash +#! /usr/bin/env bash -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -34,5 +37,5 @@ fi ############################################################## # Exit cleanly -set +x + exit 0 diff --git a/jobs/rocoto/anal.sh b/jobs/rocoto/anal.sh index 5f39309dbb0..0f8d1efabef 100755 --- a/jobs/rocoto/anal.sh +++ b/jobs/rocoto/anal.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_ATMOS_ANALYSIS status=$? -exit $status + + +exit ${status} diff --git a/jobs/rocoto/analcalc.sh b/jobs/rocoto/analcalc.sh index df5915086e3..41f7ec295bc 100755 --- a/jobs/rocoto/analcalc.sh +++ b/jobs/rocoto/analcalc.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC status=$? + + exit $status diff --git a/jobs/rocoto/analdiag.sh b/jobs/rocoto/analdiag.sh index 6e29a696002..e05b4afd342 100755 --- a/jobs/rocoto/analdiag.sh +++ b/jobs/rocoto/analdiag.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ATMOS_ANALYSIS_DIAG status=$? + + exit $status diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index e6ce577d1cc..544b083b4ae 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -57,12 +62,36 @@ PDY_MOS=$(echo $CDATE_MOS | cut -c1-8) # Archive online for verification and diagnostics ############################################################### +safe_copy() { + # + # Copy a file if it exists, print a warning otherwise but don't + # error. Syntax is the same as cp. + # + # Syntax + # safe_copy file_in file_out + # + # Arguments + # file_in: the file to copy + # file_out: the destination of the copy + # + # Environment variables + # NCP: Command to use to copy + # + _file_in=$1 + _file_out=$2 + if [[ -f ${_file_in} ]]; then + $NCP ${_file_in} ${_file_out} + else + echo "WARNING: No file ${_file_in} found in $(pwd)" + fi +} + COMIN=${COMINatmos:-"$ROTDIR/$CDUMP.$PDY/$cyc/atmos"} cd $COMIN [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR -$NCP ${APREFIX}gsistat $ARCDIR/gsistat.${CDUMP}.${CDATE} -$NCP ${APREFIX}pgrb2.1p00.anl $ARCDIR/pgbanl.${CDUMP}.${CDATE}.grib2 +safe_copy ${APREFIX}gsistat $ARCDIR/gsistat.${CDUMP}.${CDATE} +safe_copy ${APREFIX}pgrb2.1p00.anl $ARCDIR/pgbanl.${CDUMP}.${CDATE}.grib2 # Archive 1 degree forecast GRIB2 files for verification if [ $CDUMP = "gfs" ]; then @@ -71,16 +100,16 @@ if [ $CDUMP = "gfs" ]; then while [ $fhr -le $fhmax ]; do fhr2=$(printf %02i $fhr) fhr3=$(printf %03i $fhr) - $NCP ${APREFIX}pgrb2.1p00.f$fhr3 $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 - (( fhr = 10#$fhr + 10#$FHOUT_GFS )) + safe_copy ${APREFIX}pgrb2.1p00.f$fhr3 $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 + fhr=$((10#$fhr + 10#$FHOUT_GFS )) done fi if [ $CDUMP = "gdas" ]; then flist="000 003 006 009" for fhr in $flist; do fname=${APREFIX}pgrb2.1p00.f${fhr} - fhr2=$(printf %02i $fhr) - $NCP $fname $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 + fhr2=$(printf %02i $((10#$fhr))) + safe_copy $fname $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 done fi @@ -97,15 +126,17 @@ if [ $CDUMP = "gdas" -a -s gdas.t${cyc}z.cyclone.trackatcfunix ]; then fi if [ $CDUMP = "gfs" ]; then - $NCP storms.gfso.atcf_gen.$CDATE ${ARCDIR}/. - $NCP storms.gfso.atcf_gen.altg.$CDATE ${ARCDIR}/. - $NCP trak.gfso.atcfunix.$CDATE ${ARCDIR}/. - $NCP trak.gfso.atcfunix.altg.$CDATE ${ARCDIR}/. + safe_copy storms.gfso.atcf_gen.$CDATE ${ARCDIR}/. + safe_copy storms.gfso.atcf_gen.altg.$CDATE ${ARCDIR}/. + safe_copy trak.gfso.atcfunix.$CDATE ${ARCDIR}/. + safe_copy trak.gfso.atcfunix.altg.$CDATE ${ARCDIR}/. mkdir -p ${ARCDIR}/tracker.$CDATE/$CDUMP blist="epac natl" for basin in $blist; do - cp -rp $basin ${ARCDIR}/tracker.$CDATE/$CDUMP + if [[ -f $basin ]]; then + cp -rp $basin ${ARCDIR}/tracker.$CDATE/$CDUMP + fi done fi @@ -121,8 +152,8 @@ if [ $CDUMP = "gfs" -a $FITSARC = "YES" ]; then fhr3=$(printf %03i $fhr) sfcfile=${prefix}.sfcf${fhr3}${ASUFFIX} sigfile=${prefix}.atmf${fhr3}${ASUFFIX} - $NCP $sfcfile $VFYARC/${CDUMP}.$PDY/$cyc/ - $NCP $sigfile $VFYARC/${CDUMP}.$PDY/$cyc/ + safe_copy $sfcfile $VFYARC/${CDUMP}.$PDY/$cyc/ + safe_copy $sigfile $VFYARC/${CDUMP}.$PDY/$cyc/ (( fhr = 10#$fhr + 6 )) done fi @@ -228,12 +259,14 @@ if [ $CDUMP = "gfs" ]; then #--save mdl gfsmos output from all cycles in the 18Z archive directory if [ -d gfsmos.$PDY_MOS -a $cyc -eq 18 ]; then + set +e $TARCMD -P -cvf $ATARDIR/$CDATE_MOS/gfsmos.tar ./gfsmos.$PDY_MOS status=$? if [ $status -ne 0 -a $CDATE -ge $firstday ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE gfsmos.tar failed" exit $status fi + ${ERR_EXIT_ON:-set -e} fi elif [ $CDUMP = "gdas" ]; then @@ -260,12 +293,14 @@ fi # Turn on extended globbing options shopt -s extglob for targrp in $targrp_list; do + set +e $TARCMD -P -cvf $ATARDIR/$CDATE/${targrp}.tar $(cat $ARCH_LIST/${targrp}.txt) status=$? if [ $status -ne 0 -a $CDATE -ge $firstday ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE ${targrp}.tar failed" exit $status fi + ${ERR_EXIT_ON:-set -e} done # Turn extended globbing back off shopt -u extglob @@ -396,4 +431,6 @@ COMIN="$ROTDIR/$CDUMP.$rPDY" ############################################################### + + exit 0 diff --git a/jobs/rocoto/awips.sh b/jobs/rocoto/awips.sh index 8d94cdef20f..dea2fa57abb 100755 --- a/jobs/rocoto/awips.sh +++ b/jobs/rocoto/awips.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -73,7 +78,7 @@ for fhr in $fhrlst; do fhmax=84 if [ $fhr -ge $fhmin -a $fhr -le $fhmax ] ; then if [[ $(expr $fhr % 3) -eq 0 ]]; then - fhr3=$(printf %03i $fhr) + fhr3=$(printf %03d $((10#$fhr))) # Check for input file existence. If not present, sleep # Loop SLEEP_LOOP_MAX times. Abort if not found. @@ -145,4 +150,6 @@ done ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/coupled_ic.sh b/jobs/rocoto/coupled_ic.sh index 973d6b4ad41..df1f8b4fa90 100755 --- a/jobs/rocoto/coupled_ic.sh +++ b/jobs/rocoto/coupled_ic.sh @@ -1,6 +1,9 @@ -#!/bin/bash +#! /usr/bin/env bash -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -55,7 +58,7 @@ rc=$? if [[ $rc -ne 0 ]] ; then echo "FATAL: Unable to copy $BASE_CPLIC/$CPL_ATMIC/$CDATE/$CDUMP/* to $ICSDIR/$CDATE/atmos/ (Error code $rc)" fi -((err+=$rc)) +err=$((err + rc)) # Setup Ocean IC files @@ -64,7 +67,7 @@ rc=$? if [[ $rc -ne 0 ]] ; then echo "FATAL: Unable to copy $BASE_CPLIC/$CPL_OCNIC/$CDATE/ocn/$OCNRES/MOM*.nc to $ICSDIR/$CDATE/ocn/ (Error code $rc)" fi -((err+=$rc)) +err=$((err + rc)) #Setup Ice IC files cp $BASE_CPLIC/$CPL_ICEIC/$CDATE/ice/$ICERES/cice5_model_${ICERESdec}.res_$CDATE.nc $ICSDIR/$CDATE/ice/cice_model_${ICERESdec}.res_$CDATE.nc @@ -72,7 +75,7 @@ rc=$? if [[ $rc -ne 0 ]] ; then echo "FATAL: Unable to copy $BASE_CPLIC/$CPL_ICEIC/$CDATE/ice/$ICERES/cice5_model_${ICERESdec}.res_$CDATE.nc to $ICSDIR/$CDATE/ice/cice_model_${ICERESdec}.res_$CDATE.nc (Error code $rc)" fi -((err+=$rc)) +err=$((err + rc)) if [ $DO_WAVE = "YES" ]; then [[ ! -d $ICSDIR/$CDATE/wav ]] && mkdir -p $ICSDIR/$CDATE/wav @@ -83,7 +86,7 @@ if [ $DO_WAVE = "YES" ]; then if [[ $rc -ne 0 ]] ; then echo "FATAL: Unable to copy $BASE_CPLIC/$CPL_WAVIC/$CDATE/wav/$grdID/*restart.$grdID to $ICSDIR/$CDATE/wav/ (Error code $rc)" fi - ((err+=$rc)) + err=$((err + rc)) done fi @@ -112,5 +115,5 @@ fi ############################################################## # Exit cleanly -set +x + exit 0 diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index 5d57abf26e5..cbabaf7e05a 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -134,20 +139,26 @@ if [ $ENSGRP -eq 0 ]; then [ ! -d $ATARDIR/$CDATE ] && mkdir -p $ATARDIR/$CDATE fi + set +e $TARCMD -P -cvf $ATARDIR/$CDATE/enkf${CDUMP}.tar $(cat $ARCH_LIST/enkf${CDUMP}.txt) status=$? if [ $status -ne 0 -a $CDATE -ge $firstday ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE enkf${CDUMP}.tar failed" exit $status fi + ${ERR_EXIT_ON:-set -eu} fi #-- Archive online for verification and diagnostics [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR cd $ARCDIR - $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE - $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean + if [[ -f $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat ]]; then + $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE + fi + if [[ -f $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean ]]; then + $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean + fi if [ $CDUMP_ENKF != "GDAS" ]; then $NCP $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE @@ -219,4 +230,6 @@ for ctype in $clist; do done ############################################################### + + exit 0 diff --git a/jobs/rocoto/ecen.sh b/jobs/rocoto/ecen.sh index 8c88a63ef59..a6a2ca17643 100755 --- a/jobs/rocoto/ecen.sh +++ b/jobs/rocoto/ecen.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -24,4 +29,6 @@ done ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/echgres.sh b/jobs/rocoto/echgres.sh index 733257349e9..8ce3f6bb2e1 100755 --- a/jobs/rocoto/echgres.sh +++ b/jobs/rocoto/echgres.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ATMOS_CHGRES_FORENKF status=$? -exit $status + + +exit ${status} diff --git a/jobs/rocoto/ediag.sh b/jobs/rocoto/ediag.sh index cb9df99b9be..3121e457df2 100755 --- a/jobs/rocoto/ediag.sh +++ b/jobs/rocoto/ediag.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_DIAG status=$? + + exit $status diff --git a/jobs/rocoto/efcs.sh b/jobs/rocoto/efcs.sh index 04d5eb3c3eb..54933506389 100755 --- a/jobs/rocoto/efcs.sh +++ b/jobs/rocoto/efcs.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,5 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_FCST status=$? + exit $status diff --git a/jobs/rocoto/eobs.sh b/jobs/rocoto/eobs.sh index c635f9ed448..9602c037640 100755 --- a/jobs/rocoto/eobs.sh +++ b/jobs/rocoto/eobs.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_SELECT_OBS status=$? + + exit $status diff --git a/jobs/rocoto/eomg.sh b/jobs/rocoto/eomg.sh index a0519c53182..e3d9f100b92 100755 --- a/jobs/rocoto/eomg.sh +++ b/jobs/rocoto/eomg.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_INNOVATE_OBS status=$? + + exit $status diff --git a/jobs/rocoto/epos.sh b/jobs/rocoto/epos.sh index e7ad93e69e7..1a06ed2069a 100755 --- a/jobs/rocoto/epos.sh +++ b/jobs/rocoto/epos.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -25,4 +30,6 @@ done ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/esfc.sh b/jobs/rocoto/esfc.sh index 50ee46e97a1..cd8108764f7 100755 --- a/jobs/rocoto/esfc.sh +++ b/jobs/rocoto/esfc.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_SFC status=$? + + exit $status diff --git a/jobs/rocoto/eupd.sh b/jobs/rocoto/eupd.sh index 1d8dc3b119a..debc71926fc 100755 --- a/jobs/rocoto/eupd.sh +++ b/jobs/rocoto/eupd.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGDAS_ENKF_UPDATE status=$? + + exit $status diff --git a/jobs/rocoto/fcst.sh b/jobs/rocoto/fcst.sh index 199c89724a9..7f64066ed26 100755 --- a/jobs/rocoto/fcst.sh +++ b/jobs/rocoto/fcst.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_FORECAST status=$? + + exit $status diff --git a/jobs/rocoto/gempak.sh b/jobs/rocoto/gempak.sh index 2b119ab3f42..89e5c9977cd 100755 --- a/jobs/rocoto/gempak.sh +++ b/jobs/rocoto/gempak.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -66,4 +71,6 @@ $GEMPAKSH ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/getic.sh b/jobs/rocoto/getic.sh index 700799b6770..d83f1e9d7ca 100755 --- a/jobs/rocoto/getic.sh +++ b/jobs/rocoto/getic.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -158,4 +163,6 @@ cd $DATAROOT ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/gldas.sh b/jobs/rocoto/gldas.sh index 87fba5a2110..c0e1bed547a 100755 --- a/jobs/rocoto/gldas.sh +++ b/jobs/rocoto/gldas.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -12,4 +17,5 @@ status=$? $HOMEgfs/jobs/JGDAS_ATMOS_GLDAS status=$? + exit $status diff --git a/jobs/rocoto/init.sh b/jobs/rocoto/init.sh index ed03799e2b3..1eccab42fad 100755 --- a/jobs/rocoto/init.sh +++ b/jobs/rocoto/init.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -53,7 +58,7 @@ export RUNICSH=${RUNICSH:-${GDASINIT_DIR}/run_v16.chgres.sh} # Check if init is needed and run if so if [[ $gfs_ver = "v16" && $EXP_WARM_START = ".true." && $CASE = $OPS_RES ]]; then echo "Detected v16 $OPS_RES warm starts, will not run init. Exiting..." - exit 0 + else # Run chgres_cube if [ ! -d $OUTDIR ]; then mkdir -p $OUTDIR ; fi @@ -70,4 +75,6 @@ cd $DATAROOT ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/metp.sh b/jobs/rocoto/metp.sh index e18d35fc20f..2c0fdb016cc 100755 --- a/jobs/rocoto/metp.sh +++ b/jobs/rocoto/metp.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -73,4 +78,6 @@ fi ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/ocnpost.sh b/jobs/rocoto/ocnpost.sh index ad42680dbac..ec1ed54b9a5 100755 --- a/jobs/rocoto/ocnpost.sh +++ b/jobs/rocoto/ocnpost.sh @@ -1,5 +1,9 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## CICE5/MOM6 post driver script @@ -155,4 +159,6 @@ status=$? if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATA ; fi ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/post.sh b/jobs/rocoto/post.sh index 55cf654b4a3..ae4a58a392a 100755 --- a/jobs/rocoto/post.sh +++ b/jobs/rocoto/post.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## NCEP post driver script @@ -47,4 +52,6 @@ done ############################################################### # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/postsnd.sh b/jobs/rocoto/postsnd.sh index 5472a9206bd..a5175a1133d 100755 --- a/jobs/rocoto/postsnd.sh +++ b/jobs/rocoto/postsnd.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -12,5 +17,7 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_POSTSND status=$? + + exit $status diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index dd510db5d37..0261931b9d9 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -126,4 +131,6 @@ fi ################################################################################ # Exit out cleanly + + exit 0 diff --git a/jobs/rocoto/sfcanl.sh b/jobs/rocoto/sfcanl.sh index 457b205c436..a4c44227808 100755 --- a/jobs/rocoto/sfcanl.sh +++ b/jobs/rocoto/sfcanl.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### # Source FV3GFS workflow modules @@ -10,4 +15,6 @@ status=$? # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_ATMOS_SFCANL status=$? + + exit $status diff --git a/jobs/rocoto/vrfy.sh b/jobs/rocoto/vrfy.sh index ccc4f013886..697db929d13 100755 --- a/jobs/rocoto/vrfy.sh +++ b/jobs/rocoto/vrfy.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### ## Abstract: @@ -56,7 +61,7 @@ echo echo "=============== START TO GENERATE QUARTER DEGREE GRIB1 FILES ===============" if [ $MKPGB4PRCP = "YES" -a $CDUMP = "gfs" ]; then if [ ! -d $ARCDIR ]; then mkdir $ARCDIR ; fi - nthreads_env=${OMP_NUM_THREADS:-1} # get threads set in env + nthreads_env=${OMP_NUM_THREADS:-1} # get threads set in env export OMP_NUM_THREADS=1 cd $COMIN fhmax=${vhr_rain:-$FHMAX_GFS} @@ -180,4 +185,6 @@ fi ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wafs.sh b/jobs/rocoto/wafs.sh index f50f1b6801e..ede4757dc8e 100755 --- a/jobs/rocoto/wafs.sh +++ b/jobs/rocoto/wafs.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -52,4 +57,6 @@ done ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wafsblending.sh b/jobs/rocoto/wafsblending.sh index bbdb9f82050..69026aca4b0 100755 --- a/jobs/rocoto/wafsblending.sh +++ b/jobs/rocoto/wafsblending.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,9 +37,10 @@ echo "=============== START TO RUN WAFSBLENDING ===============" # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_WAFS_BLENDING status=$? -exit $status ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi -exit 0 + + +exit $status diff --git a/jobs/rocoto/wafsblending0p25.sh b/jobs/rocoto/wafsblending0p25.sh index 70f7c690055..a958759aa59 100755 --- a/jobs/rocoto/wafsblending0p25.sh +++ b/jobs/rocoto/wafsblending0p25.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,9 +37,10 @@ echo "=============== START TO RUN WAFSBLENDING0P25 ===============" # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_WAFS_BLENDING_0P25 status=$? -exit $status ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi -exit 0 + + +exit $status diff --git a/jobs/rocoto/wafsgcip.sh b/jobs/rocoto/wafsgcip.sh index 8ecc6fb922e..485f26d846c 100755 --- a/jobs/rocoto/wafsgcip.sh +++ b/jobs/rocoto/wafsgcip.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,9 +37,10 @@ echo "=============== START TO RUN WAFSGCIP ===============" # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_WAFS_GCIP status=$? -exit $status ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi -exit 0 + + +exit $status diff --git a/jobs/rocoto/wafsgrib2.sh b/jobs/rocoto/wafsgrib2.sh index d6c379db8e7..d1b12ade568 100755 --- a/jobs/rocoto/wafsgrib2.sh +++ b/jobs/rocoto/wafsgrib2.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,9 +37,10 @@ echo "=============== START TO RUN WAFSGRIB2 ===============" # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_WAFS_GRIB2 status=$? -exit $status ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi -exit 0 + + +exit $status diff --git a/jobs/rocoto/wafsgrib20p25.sh b/jobs/rocoto/wafsgrib20p25.sh index ef95f478679..d2df1cc74f0 100755 --- a/jobs/rocoto/wafsgrib20p25.sh +++ b/jobs/rocoto/wafsgrib20p25.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,9 +37,10 @@ echo "=============== START TO RUN WAFSGRIB20p25 ===============" # Execute the JJOB $HOMEgfs/jobs/JGFS_ATMOS_WAFS_GRIB2_0P25 status=$? -exit $status ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi -exit 0 + + +exit $status diff --git a/jobs/rocoto/waveawipsbulls.sh b/jobs/rocoto/waveawipsbulls.sh index 6461a7aac90..a15de9e7627 100755 --- a/jobs/rocoto/waveawipsbulls.sh +++ b/jobs/rocoto/waveawipsbulls.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,5 +37,6 @@ echo "=============== START TO RUN WAVE PRDGEN BULLS ===============" # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_WAVE_PRDGEN_BULLS status=$? -exit $status + +exit $status diff --git a/jobs/rocoto/waveawipsgridded.sh b/jobs/rocoto/waveawipsgridded.sh index 70e85dc2c77..ab8ab342fb9 100755 --- a/jobs/rocoto/waveawipsgridded.sh +++ b/jobs/rocoto/waveawipsgridded.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -32,4 +37,6 @@ echo "=============== START TO RUN WAVE PRDGEN GRIDDED ===============" # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED status=$? + + exit $status diff --git a/jobs/rocoto/wavegempak.sh b/jobs/rocoto/wavegempak.sh index 870f6281b4c..8f2910a23c9 100755 --- a/jobs/rocoto/wavegempak.sh +++ b/jobs/rocoto/wavegempak.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -30,4 +35,6 @@ echo "=============== START TO RUN WAVE GEMPAK ===============" # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_WAVE_GEMPAK status=$? + + exit $status diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index 14a6a5cdebd..556787952ba 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,6 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index 52c5d9fafed..24cfbe93316 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,6 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wavepostbndpntbll.sh b/jobs/rocoto/wavepostbndpntbll.sh index 72fb77bd1e8..3cd496c67c9 100755 --- a/jobs/rocoto/wavepostbndpntbll.sh +++ b/jobs/rocoto/wavepostbndpntbll.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,6 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wavepostpnt.sh b/jobs/rocoto/wavepostpnt.sh index f00c09550b8..abc0236456d 100755 --- a/jobs/rocoto/wavepostpnt.sh +++ b/jobs/rocoto/wavepostpnt.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,6 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/wavepostsbs.sh b/jobs/rocoto/wavepostsbs.sh index d8ec7cc2683..56ce7069b2b 100755 --- a/jobs/rocoto/wavepostsbs.sh +++ b/jobs/rocoto/wavepostsbs.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,6 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + + exit 0 diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh index 9705fbc31ae..e285b14e111 100755 --- a/jobs/rocoto/waveprep.sh +++ b/jobs/rocoto/waveprep.sh @@ -1,4 +1,9 @@ -#!/bin/bash -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ############################################################### echo @@ -18,4 +23,5 @@ status=$? ############################################################### # Force Exit out cleanly if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi + exit 0 diff --git a/parm/config/config.aero b/parm/config/config.aero index e05fc79770a..6f320761efb 100644 --- a/parm/config/config.aero +++ b/parm/config/config.aero @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash # # UFS-Aerosols settings # diff --git a/parm/config/config.aerosol_init b/parm/config/config.aerosol_init index 430640ad946..0e586e02315 100644 --- a/parm/config/config.aerosol_init +++ b/parm/config/config.aerosol_init @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.aerosol_init ########## diff --git a/parm/config/config.anal b/parm/config/config.anal index 01955c2da9a..6d3a48c82eb 100755 --- a/parm/config/config.anal +++ b/parm/config/config.anal @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.anal ########## # Analysis specific @@ -33,7 +33,7 @@ fi # Set parameters specific to L127 if [ $LEVS = "128" ]; then export GRIDOPTS="nlayers(63)=1,nlayers(64)=1," - export SETUP="gpstop=55,nsig_ext=56,$SETUP" + export SETUP="gpstop=55,nsig_ext=56,${SETUP:-}" fi # Set namelist option for LETKF diff --git a/parm/config/config.analcalc b/parm/config/config.analcalc index 5866ce5ac69..c02aafc2c34 100755 --- a/parm/config/config.analcalc +++ b/parm/config/config.analcalc @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.analcalc ########## # GFS post-anal specific (non-diag) diff --git a/parm/config/config.analdiag b/parm/config/config.analdiag index 285e614d373..7b128d3bad5 100755 --- a/parm/config/config.analdiag +++ b/parm/config/config.analdiag @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.analdiag ########## # GFS post-anal specific (diag) diff --git a/parm/config/config.arch b/parm/config/config.arch index fca519c414b..c705e0b7ed1 100755 --- a/parm/config/config.arch +++ b/parm/config/config.arch @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.arch ########## # Archive specific diff --git a/parm/config/config.awips b/parm/config/config.awips index 6167b91f7e0..9003e9f6b0d 100755 --- a/parm/config/config.awips +++ b/parm/config/config.awips @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.awips ########## # GFS awips step specific diff --git a/parm/config/config.base.emc.dyn b/parm/config/config.base.emc.dyn index 722818b22a6..63da678301a 100755 --- a/parm/config/config.base.emc.dyn +++ b/parm/config/config.base.emc.dyn @@ -1,4 +1,4 @@ -#!/bin/bash -x +#! /usr/bin/env bash ########## config.base ########## # Common to all steps diff --git a/parm/config/config.base.nco.static b/parm/config/config.base.nco.static index 48db9dd0209..8fd36ef1d62 100755 --- a/parm/config/config.base.nco.static +++ b/parm/config/config.base.nco.static @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.base ########## # Common to all steps diff --git a/parm/config/config.coupled_ic b/parm/config/config.coupled_ic index a7f33949833..159dc119069 100755 --- a/parm/config/config.coupled_ic +++ b/parm/config/config.coupled_ic @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.coupled_ic ########## diff --git a/parm/config/config.defaults.s2sw b/parm/config/config.defaults.s2sw index a2926ffff50..5032a998ad5 100644 --- a/parm/config/config.defaults.s2sw +++ b/parm/config/config.defaults.s2sw @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash # Empty variables must include a space otherwise they will be overwritten diff --git a/parm/config/config.earc b/parm/config/config.earc index 7cb1de235f0..de73a93731d 100755 --- a/parm/config/config.earc +++ b/parm/config/config.earc @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.earc ########## # Ensemble archive specific diff --git a/parm/config/config.ecen b/parm/config/config.ecen index c9609e3ff89..2b686c6b481 100755 --- a/parm/config/config.ecen +++ b/parm/config/config.ecen @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.ecen ########## # Ensemble recentering specific diff --git a/parm/config/config.echgres b/parm/config/config.echgres index cbf176c92f9..478c6b4bcf0 100755 --- a/parm/config/config.echgres +++ b/parm/config/config.echgres @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.echgres ########## # regrid full-res forecast for use in ensemble-res analysis generation diff --git a/parm/config/config.ediag b/parm/config/config.ediag index 192b5d0b48b..12b142088db 100755 --- a/parm/config/config.ediag +++ b/parm/config/config.ediag @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.ediag ########## # GFS ensemble post-eobs specific diff --git a/parm/config/config.efcs b/parm/config/config.efcs index af84dc730fb..a1f0fe49cc1 100755 --- a/parm/config/config.efcs +++ b/parm/config/config.efcs @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.efcs ########## # Ensemble forecast specific, dependency: config.fcst diff --git a/parm/config/config.eobs b/parm/config/config.eobs index e46dde2f341..21f982addc2 100755 --- a/parm/config/config.eobs +++ b/parm/config/config.eobs @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.eobs config.eomg ########## # Ensemble innovation specific, dependency config.anal diff --git a/parm/config/config.epos b/parm/config/config.epos index 441a1ff995e..8026a2ba2ea 100755 --- a/parm/config/config.epos +++ b/parm/config/config.epos @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.epos ########## # Ensemble post processing specific diff --git a/parm/config/config.esfc b/parm/config/config.esfc index 53cbb091757..2bb3d48bb49 100755 --- a/parm/config/config.esfc +++ b/parm/config/config.esfc @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.esfc ########## # Ensemble surface specific diff --git a/parm/config/config.eupd b/parm/config/config.eupd index 0e9d42e0935..1ac90d2b75f 100755 --- a/parm/config/config.eupd +++ b/parm/config/config.eupd @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.eupd ########## # Ensemble update specific, dependency config.anal diff --git a/parm/config/config.fcst b/parm/config/config.fcst index e73c35d15da..2c380b9111b 100755 --- a/parm/config/config.fcst +++ b/parm/config/config.fcst @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.fcst ########## # Forecast specific diff --git a/parm/config/config.fv3 b/parm/config/config.fv3 index 8c4b74ee87f..f8e6fbb620b 100755 --- a/parm/config/config.fv3 +++ b/parm/config/config.fv3 @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.fv3 ########## # FV3 model resolution specific parameters diff --git a/parm/config/config.fv3.nco.static b/parm/config/config.fv3.nco.static index f7c6981491d..bb84ffb55dd 100755 --- a/parm/config/config.fv3.nco.static +++ b/parm/config/config.fv3.nco.static @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.fv3 ########## # FV3 model resolution specific parameters diff --git a/parm/config/config.gempak b/parm/config/config.gempak index 2bc49dcf175..a2b5ecbaf58 100755 --- a/parm/config/config.gempak +++ b/parm/config/config.gempak @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.gempak ########## # GFS gempak step specific diff --git a/parm/config/config.getic b/parm/config/config.getic index 4671cc9c4ad..fce3f9ecf6b 100755 --- a/parm/config/config.getic +++ b/parm/config/config.getic @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.getic ########## # Fetching GFS initial conditions specific diff --git a/parm/config/config.gldas b/parm/config/config.gldas index 4410c2ceabd..8d503d03683 100755 --- a/parm/config/config.gldas +++ b/parm/config/config.gldas @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.gldas ########## # GDAS gldas step specific diff --git a/parm/config/config.ice b/parm/config/config.ice index 101fc824524..3a6916600f1 100644 --- a/parm/config/config.ice +++ b/parm/config/config.ice @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash export NX_GLB="1440" export NY_GLB="1080" diff --git a/parm/config/config.init b/parm/config/config.init index eeb04a7d409..2301b1cdc1f 100755 --- a/parm/config/config.init +++ b/parm/config/config.init @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.init ########## # Prepare initial conditions diff --git a/parm/config/config.metp b/parm/config/config.metp index 2c39d9b431f..4be7151ffa6 100755 --- a/parm/config/config.metp +++ b/parm/config/config.metp @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.metp ########## # METplus verification step specific diff --git a/parm/config/config.nsst b/parm/config/config.nsst index ef8767834d1..b4c58eedb3a 100755 --- a/parm/config/config.nsst +++ b/parm/config/config.nsst @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.nsst ########## # NSST specific diff --git a/parm/config/config.ocn b/parm/config/config.ocn index fbb750d90ba..1675713e7c3 100644 --- a/parm/config/config.ocn +++ b/parm/config/config.ocn @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash # OCNRES is currently being set in config.base # case "$CASE" in diff --git a/parm/config/config.ocnpost b/parm/config/config.ocnpost index b734bab758f..89304df7f4f 100755 --- a/parm/config/config.ocnpost +++ b/parm/config/config.ocnpost @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.ocnpost ########## diff --git a/parm/config/config.post b/parm/config/config.post index 71aaae22ecd..5f55c832c2b 100755 --- a/parm/config/config.post +++ b/parm/config/config.post @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.post ########## # Post specific diff --git a/parm/config/config.postsnd b/parm/config/config.postsnd index d64b401cdbc..53d66bf4f60 100755 --- a/parm/config/config.postsnd +++ b/parm/config/config.postsnd @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.postsnd ########## # GFS bufr sounding step specific diff --git a/parm/config/config.prep b/parm/config/config.prep index c04be70a095..ac172bf5b87 100755 --- a/parm/config/config.prep +++ b/parm/config/config.prep @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.prep ########## # Prep step specific diff --git a/parm/config/config.prepbufr b/parm/config/config.prepbufr index 904d9467744..b45ac1e9bee 100755 --- a/parm/config/config.prepbufr +++ b/parm/config/config.prepbufr @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.prepbufr ########## # PREPBUFR specific configuration diff --git a/parm/config/config.resources b/parm/config/config.resources index f9b3e4132a0..6613987cb76 100755 --- a/parm/config/config.resources +++ b/parm/config/config.resources @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.resources ########## # Set resource information for job tasks @@ -625,7 +625,7 @@ elif [ $step = "awips" ]; then elif [ $step = "gempak" ]; then export wtime_gempak="02:00:00" - export npe_gempak=17 + export npe_gempak=28 export npe_node_gempak=4 export nth_gempak=3 if [[ "$machine" == "WCOSS_C" ]]; then export memory_gempak="254M"; fi diff --git a/parm/config/config.sfcanl b/parm/config/config.sfcanl index 76da647eef5..9592fb77c91 100644 --- a/parm/config/config.sfcanl +++ b/parm/config/config.sfcanl @@ -1,4 +1,4 @@ -#!/bin/bash -x +#! /usr/bin/env bash ########## config.sfcanl ########## # GFS surface analysis specific diff --git a/parm/config/config.vrfy b/parm/config/config.vrfy index 0eda2537a95..c67201c69b9 100755 --- a/parm/config/config.vrfy +++ b/parm/config/config.vrfy @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.vrfy ########## # Verification step specific diff --git a/parm/config/config.wafs b/parm/config/config.wafs index 8bf55770303..fe2ba8cae7f 100755 --- a/parm/config/config.wafs +++ b/parm/config/config.wafs @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafs ########## diff --git a/parm/config/config.wafsblending b/parm/config/config.wafsblending index dfd7d1715eb..e49ffbdb88e 100755 --- a/parm/config/config.wafsblending +++ b/parm/config/config.wafsblending @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafsblending ########## diff --git a/parm/config/config.wafsblending0p25 b/parm/config/config.wafsblending0p25 index 28a2de90ff9..947baab2bb2 100755 --- a/parm/config/config.wafsblending0p25 +++ b/parm/config/config.wafsblending0p25 @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafsblending0p25 ########## diff --git a/parm/config/config.wafsgcip b/parm/config/config.wafsgcip index 793dae1694c..4909795c30e 100755 --- a/parm/config/config.wafsgcip +++ b/parm/config/config.wafsgcip @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafsgcip ########## diff --git a/parm/config/config.wafsgrib2 b/parm/config/config.wafsgrib2 index 27b137cd8ce..0d657788e0c 100755 --- a/parm/config/config.wafsgrib2 +++ b/parm/config/config.wafsgrib2 @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafsgrib2 ########## # Post specific diff --git a/parm/config/config.wafsgrib20p25 b/parm/config/config.wafsgrib20p25 index 8b55333c000..40cf80df220 100755 --- a/parm/config/config.wafsgrib20p25 +++ b/parm/config/config.wafsgrib20p25 @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wafsgrib20p25 ########## diff --git a/parm/config/config.wave b/parm/config/config.wave index a3b06a8041b..f69adda3ec4 100755 --- a/parm/config/config.wave +++ b/parm/config/config.wave @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wave ########## # Wave steps specific diff --git a/parm/config/config.waveawipsbulls b/parm/config/config.waveawipsbulls index ec39bfb646a..e3748e9cd11 100755 --- a/parm/config/config.waveawipsbulls +++ b/parm/config/config.waveawipsbulls @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.waveawipsbulls ########## # Wave steps specific diff --git a/parm/config/config.waveawipsgridded b/parm/config/config.waveawipsgridded index 7f2972bb24b..e84352558ed 100755 --- a/parm/config/config.waveawipsgridded +++ b/parm/config/config.waveawipsgridded @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.waveawipsgridded ########## # Wave steps specific diff --git a/parm/config/config.wavegempak b/parm/config/config.wavegempak index ec1f59d25c2..66af59f2a46 100755 --- a/parm/config/config.wavegempak +++ b/parm/config/config.wavegempak @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wavegempak ########## # Wave steps specific diff --git a/parm/config/config.waveinit b/parm/config/config.waveinit index 93960e5e252..61715f7f019 100755 --- a/parm/config/config.waveinit +++ b/parm/config/config.waveinit @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.waveinit ########## # Wave steps specific diff --git a/parm/config/config.wavepostbndpnt b/parm/config/config.wavepostbndpnt index eb3bb72ef88..eaa1626e628 100755 --- a/parm/config/config.wavepostbndpnt +++ b/parm/config/config.wavepostbndpnt @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wavepostbndpnt ########## # Wave steps specific diff --git a/parm/config/config.wavepostbndpntbll b/parm/config/config.wavepostbndpntbll index d26d70fa7ab..bb7224cc704 100755 --- a/parm/config/config.wavepostbndpntbll +++ b/parm/config/config.wavepostbndpntbll @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wavepostbndpntbll ########## # Wave steps specific diff --git a/parm/config/config.wavepostpnt b/parm/config/config.wavepostpnt index 276ca230a6d..8befb91760f 100755 --- a/parm/config/config.wavepostpnt +++ b/parm/config/config.wavepostpnt @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wavepostpnt ########## # Wave steps specific diff --git a/parm/config/config.wavepostsbs b/parm/config/config.wavepostsbs index 7eea92f1004..12880dd020b 100755 --- a/parm/config/config.wavepostsbs +++ b/parm/config/config.wavepostsbs @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.wavepostsbs ########## # Wave steps specific diff --git a/parm/config/config.waveprep b/parm/config/config.waveprep index 1a9770bf4ea..1c9a40c1d81 100755 --- a/parm/config/config.waveprep +++ b/parm/config/config.waveprep @@ -1,4 +1,4 @@ -#!/bin/ksh -x +#! /usr/bin/env bash ########## config.waveprep ########## # Wave steps specific diff --git a/scripts/exgdas_atmos_chgres_forenkf.sh b/scripts/exgdas_atmos_chgres_forenkf.sh index 805b8be6d05..2c555b70026 100755 --- a/scripts/exgdas_atmos_chgres_forenkf.sh +++ b/scripts/exgdas_atmos_chgres_forenkf.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#! /usr/bin/env bash ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,11 +18,9 @@ # ################################################################################ -# Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -150,7 +148,7 @@ if [ $DO_CALC_ANALYSIS == "YES" ]; then [[ -f $DATA/mp_chgres.sh ]] && rm $DATA/mp_chgres.sh fi - nfhrs=`echo $IAUFHRS_ENKF | sed 's/,/ /g'` + nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') for FHR in $nfhrs; do echo "Regridding deterministic forecast for forecast hour $FHR" rm -f chgres_nc_gauss0$FHR.nml @@ -204,8 +202,5 @@ fi cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err diff --git a/scripts/exgdas_atmos_gempak_gif_ncdc.sh b/scripts/exgdas_atmos_gempak_gif_ncdc.sh index 884ae1cf25a..79c593df2df 100755 --- a/scripts/exgdas_atmos_gempak_gif_ncdc.sh +++ b/scripts/exgdas_atmos_gempak_gif_ncdc.sh @@ -1,16 +1,17 @@ -#!/bin/sh +#! /usr/bin/env bash ############################################################## # Add the NCDC GIF processing to the end of the gempak_gif job # There is no timing issue with the NCDC GIF, so it is # okay to just add it here. If timing becomes a problem # in the future, we should move it above somewhere else. ############################################################## -export PS4='exgempakgif_ncdc:$SECONDS + ' -set -xa + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA -msg="The NCDC GIF processing has begun" -postmsg "$jlogfile" "$msg" export NTS=$USHgempak/restore @@ -60,4 +61,5 @@ then done fi + exit diff --git a/scripts/exgdas_atmos_nawips.sh b/scripts/exgdas_atmos_nawips.sh index 48146edf60a..b309b3af147 100755 --- a/scripts/exgdas_atmos_nawips.sh +++ b/scripts/exgdas_atmos_nawips.sh @@ -1,30 +1,29 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################### -echo "----------------------------------------------------" -echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" -echo "----------------------------------------------------" -echo "History: Mar 2000 - First implementation of this new script." -echo "S Lilly: May 2008 - add logic to make sure that all of the " -echo " data produced from the restricted ECMWF" -echo " data on the CCS is properly protected." +# echo "----------------------------------------------------" +# echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" +# echo "----------------------------------------------------" +# echo "History: Mar 2000 - First implementation of this new script." +# echo "S Lilly: May 2008 - add logic to make sure that all of the " +# echo " data produced from the restricted ECMWF" +# echo " data on the CCS is properly protected." ##################################################################### -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT ${2} +fi cd $DATA RUN=$1 fend=$2 DBN_ALERT_TYPE=$3 -export 'PS4=$RUN:$SECONDS + ' - DATA_RUN=$DATA/$RUN mkdir -p $DATA_RUN cd $DATA_RUN -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - cp $FIXgempak/g2varswmo2.tbl g2varswmo2.tbl export err=$? if [[ $err -ne 0 ]] ; then @@ -74,13 +73,10 @@ pdsext=no maxtries=180 fhcnt=$fstart while [ $fhcnt -le $fend ] ; do - typeset -Z3 fhr - - fhr=$fhcnt + fhr=$(printf "%03d" $fhcnt) fhcnt3=$(expr $fhr % 3) - fhr3=$fhcnt - typeset -Z3 fhr3 + fhr3=$(printf "%03d" $fhcnt) GEMGRD=${RUN}_${PDY}${cyc}f${fhr3} @@ -173,16 +169,6 @@ done $GEMEXE/gpend ##################################################################### -# GOOD RUN -set +x -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -set -x -##################################################################### -msg='Job completed normally.' -echo $msg -postmsg "$jlogfile" "$msg" ############################### END OF SCRIPT ####################### diff --git a/scripts/exgdas_atmos_nceppost.sh b/scripts/exgdas_atmos_nceppost.sh index 8616b354535..dfc45e12692 100755 --- a/scripts/exgdas_atmos_nceppost.sh +++ b/scripts/exgdas_atmos_nceppost.sh @@ -1,34 +1,36 @@ +#! /usr/bin/env bash + ##################################################################### -echo "-----------------------------------------------------" -echo " exgdas_nceppost.sh" -echo " Sep 07 - Chuang - Modified script to run unified post" -echo " July 14 - Carlis - Changed to 0.25 deg grib2 master file" -echo " Feb 16 - Lin - Modify to use Vertical Structure" -echo " Aug 17 - Meng - Modify to use 3-digit forecast hour naming" -echo " master and flux files" -echo " Dec 17 - Meng - Link sfc data file to flxfile " -echo " since fv3gfs does not output sfc files any more." -echo " Dec 17 - Meng - Add fv3gfs_downstream_nems.sh for pgb processing " -echo " and remove writing data file to /nwges" -echo " Jan 18 - Meng - For EE2 standard, move IDRT POSTGPVARS setting" -echo " from j-job script." -echo " Feb 18 - Meng - Removed legacy setting for generating grib1 data" -echo " and reading sigio model outputs." -echo " Aug 20 - Meng - Remove .ecf extentsion per EE2 review." -echo " Sep 20 - Meng - Update clean up files per EE2 review." -echo " Mar 21 - Meng - Update POSTGRB2TBL default setting." -echo " Oct 21 - Meng - Remove jlogfile for wcoss2 transition." -echo " Feb 22 - Lin - Exception handling if anl input not found." -echo "-----------------------------------------------------" +# echo "-----------------------------------------------------" +# echo " exgdas_nceppost.sh" +# echo " Sep 07 - Chuang - Modified script to run unified post" +# echo " July 14 - Carlis - Changed to 0.25 deg grib2 master file" +# echo " Feb 16 - Lin - Modify to use Vertical Structure" +# echo " Aug 17 - Meng - Modify to use 3-digit forecast hour naming" +# echo " master and flux files" +# echo " Dec 17 - Meng - Link sfc data file to flxfile " +# echo " since fv3gfs does not output sfc files any more." +# echo " Dec 17 - Meng - Add fv3gfs_downstream_nems.sh for pgb processing " +# echo " and remove writing data file to /nwges" +# echo " Jan 18 - Meng - For EE2 standard, move IDRT POSTGPVARS setting" +# echo " from j-job script." +# echo " Feb 18 - Meng - Removed legacy setting for generating grib1 data" +# echo " and reading sigio model outputs." +# echo " Aug 20 - Meng - Remove .ecf extentsion per EE2 review." +# echo " Sep 20 - Meng - Update clean up files per EE2 review." +# echo " Mar 21 - Meng - Update POSTGRB2TBL default setting." +# echo " Oct 21 - Meng - Remove jlogfile for wcoss2 transition." +# echo " Feb 22 - Lin - Exception handling if anl input not found." +# echo "-----------------------------------------------------" ##################################################################### -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA -msg="HAS BEGUN on $(hostname)" -postmsg "$msg" - export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_nceppost.sh} export GFSDOWNSH=${GFSDOWNSH:-$USHgfs/fv3gfs_downstream_nems.sh} export GFSDWNSH=${GFSDWNSH:-$USHgfs/fv3gfs_dwn_nems.sh} @@ -185,7 +187,6 @@ else ## not_anl if_stimes # Start Looping for the # existence of the restart files ############################### - set -x export pgm="postcheck" ic=1 while [ $ic -le $SLEEP_LOOP_MAX ]; do @@ -206,10 +207,6 @@ else ## not_anl if_stimes err_chk fi done - set -x - - msg="Starting post for fhr=$fhr" - postmsg "$msg" ############################### # Put restart files into /nwges @@ -351,10 +348,6 @@ else ## not_anl if_stimes done fi ## end_if_times -#cat $pgmout -#msg='ENDED NORMALLY.' -#postmsg "$jlogfile" "$msg" - exit 0 ################## END OF SCRIPT ####################### diff --git a/scripts/exgdas_efsoi.sh b/scripts/exgdas_efsoi.sh index 3ca5d05eb9d..2803fc5aa38 100755 --- a/scripts/exgdas_efsoi.sh +++ b/scripts/exgdas_efsoi.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -141,7 +140,7 @@ $NLN $VLOCALEIG vlocal_eig.dat ################################################################################ # Ensemble guess, observational data and analyses/increments -nfhrs=`echo $IAUFHRS_ENKF | sed 's/,/ /g'` +nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') for imem in $(seq 1 $NMEM_ENKF); do memchar="mem"$(printf %03i $imem) mkdir ${memchar} @@ -258,8 +257,6 @@ $NCP osense_${CDATE}.dat $OSENSE_SAVE_DIR/$OSENSEOUT cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_efsoi_update.sh b/scripts/exgdas_efsoi_update.sh index ca1ca5917fb..0e8f4b7bda2 100755 --- a/scripts/exgdas_efsoi_update.sh +++ b/scripts/exgdas_efsoi_update.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,11 +19,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -175,7 +174,6 @@ for ftype in \$flist; do tar -xvf \$fname done EOFuntar - set -x chmod 755 $DATA/untar.sh fi @@ -194,7 +192,7 @@ else tar -xvf $fname done fi -nfhrs=`echo $IAUFHRS_ENKF | sed 's/,/ /g'` +nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') for imem in $(seq 1 $NMEM_ENKF); do memchar="mem"$(printf %03i $imem) if [ $lobsdiag_forenkf = ".false." ]; then @@ -422,8 +420,6 @@ cat stdout stderr > $COMOUT_ANL_ENSFSOI/$ENKFSTAT cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_ecen.sh b/scripts/exgdas_enkf_ecen.sh index f3671968ffc..e6748be021b 100755 --- a/scripts/exgdas_enkf_ecen.sh +++ b/scripts/exgdas_enkf_ecen.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -370,8 +369,6 @@ done # loop over analysis times in window # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_fcst.sh b/scripts/exgdas_enkf_fcst.sh index 32631150574..2656f644e25 100755 --- a/scripts/exgdas_enkf_fcst.sh +++ b/scripts/exgdas_enkf_fcst.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,11 +19,9 @@ #### ################################################################################ -# Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -177,7 +176,7 @@ for imem in $(seq $ENSBEG $ENSEND); do err_exit "FATAL ERROR: forecast of member $cmem FAILED. Aborting job" fi - ((rc+=ra)) + rc=$((rc+ra)) fi @@ -228,8 +227,6 @@ export err=$rc; err_chk # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATATOP -set +x -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_post.sh b/scripts/exgdas_enkf_post.sh index ebf877b3ccf..d6beef67dbc 100755 --- a/scripts/exgdas_enkf_post.sh +++ b/scripts/exgdas_enkf_post.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -113,7 +112,7 @@ for fhr in $(seq $FHMIN $FHOUT $FHMAX); do $APRUN_EPOS ${DATA}/$(basename $GETSFCENSMEANEXEC) ./ sfcf${fhrchar}.ensmean sfcf${fhrchar} $NMEM_ENKF ra=$? - ((rc+=ra)) + rc=$((rc+ra)) export_pgm=$GETATMENSMEANEXEC . prep_step @@ -124,7 +123,7 @@ for fhr in $(seq $FHMIN $FHOUT $FHMAX); do $APRUN_EPOS ${DATA}/$(basename $GETATMENSMEANEXEC) ./ atmf${fhrchar}.ensmean atmf${fhrchar} $NMEM_ENKF fi ra=$? - ((rc+=ra)) + rc=$((rc+ra)) done export err=$rc; err_chk @@ -162,8 +161,6 @@ fi # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_select_obs.sh b/scripts/exgdas_enkf_select_obs.sh index 4a0f0d3ee33..8f1548e907c 100755 --- a/scripts/exgdas_enkf_select_obs.sh +++ b/scripts/exgdas_enkf_select_obs.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -120,8 +119,6 @@ export err=$?; err_chk # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_sfc.sh b/scripts/exgdas_enkf_sfc.sh index 407a6097a7f..eae5240e23e 100755 --- a/scripts/exgdas_enkf_sfc.sh +++ b/scripts/exgdas_enkf_sfc.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -197,8 +196,6 @@ fi # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgdas_enkf_update.sh b/scripts/exgdas_enkf_update.sh index 0f639d12e37..373b6507c6b 100755 --- a/scripts/exgdas_enkf_update.sh +++ b/scripts/exgdas_enkf_update.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -17,11 +18,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -172,7 +171,6 @@ for ftype in \$flist; do tar -xvf \$fname done EOFuntar - set -x chmod 755 $DATA/untar.sh fi @@ -191,7 +189,7 @@ else tar -xvf $fname done fi -nfhrs=`echo $IAUFHRS_ENKF | sed 's/,/ /g'` +nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g') for imem in $(seq 1 $NMEM_ENKF); do memchar="mem"$(printf %03i $imem) if [ $lobsdiag_forenkf = ".false." ]; then @@ -399,8 +397,6 @@ cat stdout stderr > $COMOUT_ANL_ENS/$ENKFSTAT # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + + exit $err diff --git a/scripts/exgfs_atmos_awips_20km_1p0deg.sh b/scripts/exgfs_atmos_awips_20km_1p0deg.sh index 1f4414c1b4a..d407f067519 100755 --- a/scripts/exgfs_atmos_awips_20km_1p0deg.sh +++ b/scripts/exgfs_atmos_awips_20km_1p0deg.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ############################################################################## # UTILITY SCRIPT NAME : exgfs_awips_20km_1p0deg.sh # DATE WRITTEN : 11/01/2017 @@ -10,13 +11,19 @@ # 1st argument - Forecast Hour - format of 3I (3 digits) # ############################################################################### -echo "------------------------------------------------" -echo "JGFS_AWIPS_00/06/12/18 GFS postprocessing" -echo "------------------------------------------------" -echo "History: NOV 2017 - First implementation of this new script to " -echo " process GFS AWIPS 20km and 1.0 deg grids products " -echo " " +# echo "------------------------------------------------" +# echo "JGFS_AWIPS_00/06/12/18 GFS postprocessing" +# echo "------------------------------------------------" +# echo "History: NOV 2017 - First implementation of this new script to " +# echo " process GFS AWIPS 20km and 1.0 deg grids products " +# echo " " ############################################################################### + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + fcsthrs="$1" num=$# job_name=$(echo $job|sed 's/[jpt]gfs/gfs/') @@ -38,8 +45,6 @@ fi cd $DATA -set -x - ############################################### # Wait for the availability of the pgrb file ############################################### @@ -60,9 +65,6 @@ do fi done -######################################## -msg="HAS BEGUN!" -postmsg "$jlogfile" "$msg" ######################################## echo " ------------------------------------------" @@ -75,7 +77,7 @@ echo "#######################################" echo " Process GRIB AWIP GRIB2 PRODUCTS " echo "#######################################" echo " " -set -x +${TRACE_ON:-set -x} # Set type of Interpolation for WGRIB2 export opt1=' -set_grib_type same -new_grid_winds earth ' @@ -251,16 +253,5 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -############################################################################################ -# GOOD RUN -set +x -echo "**************JOB EXGFS_AWIPS_20KM_1P0DEG.SH.ECF COMPLETED NORMALLY ON THE WCOSS" -echo "**************JOB EXGFS_AWIPS_20KM_1P0DEG.SH.ECF COMPLETED NORMALLY ON THE WCOSS" -echo "**************JOB EXGFS_AWIPS_20KM_1P0DEG.SH.ECF COMPLETED NORMALLY ON THE WCOSS" -set -x -############################################################################################ - -msg="HAS COMPLETED NORMALLY!" -postmsg "$jlogfile" "$msg" ############## END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_fbwind.sh b/scripts/exgfs_atmos_fbwind.sh index 2ca5870cbff..38d4a07a2ea 100755 --- a/scripts/exgfs_atmos_fbwind.sh +++ b/scripts/exgfs_atmos_fbwind.sh @@ -1,27 +1,30 @@ -#!/bin/ksh -echo "------------------------------------------------" -echo "JGFS_BULLS - 24hr GFS processing" -echo "------------------------------------------------" -echo "History: Jul 2004 - First implementation of this new script." -echo " FBWNDGFS (FB Winds) program for 15 sites outside" -echo " the Hawaiian Islands." -echo " Feb 2006 - L Sager Send bulletins to TOC via NTC. " -echo " Jul 2014 - B Vuong Modified to use GFS master GRIB2" -echo " and Add bulletins WINTEMV process." -echo " Sep 2016 - B Vuong Modified to use GFS 0p25 deg GRIB2" -echo " Nov 2019 - B Vuong Removed WINTEMV bulletin (retired)" +#! /usr/bin/env bash + +##################################################################### +# echo "------------------------------------------------" +# echo "JGFS_BULLS - 24hr GFS processing" +# echo "------------------------------------------------" +# echo "History: Jul 2004 - First implementation of this new script." +# echo " FBWNDGFS (FB Winds) program for 15 sites outside" +# echo " the Hawaiian Islands." +# echo " Feb 2006 - L Sager Send bulletins to TOC via NTC. " +# echo " Jul 2014 - B Vuong Modified to use GFS master GRIB2" +# echo " and Add bulletins WINTEMV process." +# echo " Sep 2016 - B Vuong Modified to use GFS 0p25 deg GRIB2" +# echo " Nov 2019 - B Vuong Removed WINTEMV bulletin (retired)" ##################################################################### +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + cd $DATA ###################### # Set up Here Files. ###################### -set -x -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - job_name=$(echo $job|sed 's/[jpt]gfs/gfs/') set +x @@ -31,7 +34,7 @@ echo " Process Bulletins of forecast winds and temps for Hawaii " echo " and 15 sites outside of the Hawaiian Islands. " echo "#############################################################" echo " " -set -x +${TRACE_ON:-set -x} export pgm=bulls_fbwndgfs . prep_step @@ -82,35 +85,7 @@ then ${UTILgfs}/ush/make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name fi -# -# EMC is proposing to retire WINTEMV bulletin in GFS v16.0 -# - -# if test ${cycle} = 't00z' -o ${cycle} = 't12z' -# then -# -# set +x -# echo " " -# echo "#################################################" -# echo " Process 06, 12, 18 and 24 fcsthrs WINTEM Bulletins. " -# echo "#################################################" -# echo " " -# set -x -# sh $USHgfs/mkwintem.sh -# -#fi - -##################################################################### -# GOOD RUN -set +x -echo "**************JOB JGFS_FBWIND COMPLETED NORMALLY ON IBM-SP" -echo "**************JOB JGFS_FBWIND COMPLETED NORMALLY ON IBM-SP" -echo "**************JOB JGFS_FBWIND COMPLETED NORMALLY ON IBM-SP" -set -x ##################################################################### -msg='Job completed normally.' -echo $msg -postmsg "$jlogfile" "$msg" ############################### END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh index 4de9d33736e..63e4a1de5e7 100755 --- a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh +++ b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh @@ -1,16 +1,18 @@ -#!/bin/sh +#! /usr/bin/env bash + ############################################################## # Add the NCDC GIF processing to the end of the gempak_gif job # There is no timing issue with the NCDC GIF, so it is # okay to just add it here. If timing becomes a problem # in the future, we should move it above somewhere else. ############################################################## -export PS4='exgempakgif_ncdc_skewt:$SECONDS + ' -set -xa + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA -msg="The NCDC GIF processing has begun" -postmsg "$jlogfile" "$msg" export NTS=$USHgempak/restore @@ -58,21 +60,19 @@ then fi #################################################################################### -echo "-----------------------------------------------------------------------------" -echo "GFS MAG postprocessing script exmag_sigman_skew_k_gfs_gif_ncdc_skew_t.sh " -echo "-----------------------------------------------------------------------------" -echo "History: Mar 2012 added to processing for enhanced MAG skew_t" -echo "2012-03-11 Mabe -- reworked script to add significant level " -echo " data to existing mandatory level data in a new file" -echo "2013-04-24 Mabe -- Reworked to remove unneeded output with " -echo " conversion to WCOSS" +# echo "-----------------------------------------------------------------------------" +# echo "GFS MAG postprocessing script exmag_sigman_skew_k_gfs_gif_ncdc_skew_t.sh " +# echo "-----------------------------------------------------------------------------" +# echo "History: Mar 2012 added to processing for enhanced MAG skew_t" +# echo "2012-03-11 Mabe -- reworked script to add significant level " +# echo " data to existing mandatory level data in a new file" +# echo "2013-04-24 Mabe -- Reworked to remove unneeded output with " +# echo " conversion to WCOSS" # Add ms to filename to make it different since it has both mandatory # and significant level data $COMOUT/${RUN}.${cycle}.msupperair # $COMOUT/${RUN}.${cycle}.msupperairtble ##################################################################################### -set -x - cd $DATA export RSHPDY=$(echo $PDY | cut -c5-)$(echo $PDY | cut -c3-4) @@ -112,14 +112,10 @@ fi fi ############################################################ -# GOOD RUN -set +x -echo "********** JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF COMPLETED" -set -x -############################################################ + if [ -e "$pgmout" ] ; then cat $pgmout fi -msg="HAS COMPLETED NORMALLY!" + exit diff --git a/scripts/exgfs_atmos_gempak_meta.sh b/scripts/exgfs_atmos_gempak_meta.sh index dfd5b383921..1162a36b119 100755 --- a/scripts/exgfs_atmos_gempak_meta.sh +++ b/scripts/exgfs_atmos_gempak_meta.sh @@ -1,9 +1,9 @@ -#!/bin/ksh +#! /usr/bin/env bash -set -x - -msg="JOB $job HAS BEGUN" -postmsg "$jlogfile" "$msg" +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA @@ -14,13 +14,13 @@ fhr=$fhend export numproc=23 while [ $fhr -ge $fhbeg ] ; do - typeset -Z3 fhr - ls -l $COMIN/$GEMGRD1${fhr} - err1=$? - if [ $err1 -eq 0 -o $fhr -eq $fhbeg ] ; then - break - fi - fhr=$(expr $fhr - $fhinc) + fhr=$(printf "%03d" $fhr) + ls -l $COMIN/$GEMGRD1${fhr} + err1=$? + if [ $err1 -eq 0 -o $fhr -eq $fhbeg ] ; then + break + fi + fhr=$(expr $fhr - $fhinc) done maxtries=180 @@ -73,9 +73,7 @@ do rm $DATA/poescript # fi - if [ $fhr -lt 100 ] ; then - typeset -Z2 fhr - fi + fhr=$(printf "%02d" $fhr) if [ $do_all -eq 1 ] ; then do_all=0 @@ -110,7 +108,7 @@ do # If this is the final fcst hour, alert the # file to all centers. # - if [ $fhr -ge $fhend ] ; then + if [ 10#$fhr -ge $fhend ] ; then export DBN_ALERT_TYPE=GFS_METAFILE_LAST fi @@ -130,7 +128,7 @@ do $APRUNCFP $DATA/poescript export err=$?; err_chk - typeset -Z3 fhr + fhr=$(printf "%03d" $fhr) if [ $fhr -eq 126 ] ; then let fhr=fhr+6 else @@ -139,14 +137,7 @@ do done ##################################################################### -# GOOD RUN -set +x -echo "**************JOB GFS_META COMPLETED NORMALLY on the IBM-SP" -echo "**************JOB GFS_META COMPLETED NORMALLY on the IBM-SP" -echo "**************JOB GFS_META COMPLETED NORMALLY on the IBM-SP" -set -x -##################################################################### -echo EXITING $0 + exit # diff --git a/scripts/exgfs_atmos_goes_nawips.sh b/scripts/exgfs_atmos_goes_nawips.sh index c18f2b8b425..9a67d54b7cf 100755 --- a/scripts/exgfs_atmos_goes_nawips.sh +++ b/scripts/exgfs_atmos_goes_nawips.sh @@ -1,16 +1,20 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################### -echo "----------------------------------------------------" -echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" -echo "----------------------------------------------------" -echo "History: Mar 2000 - First implementation of this new script." -echo "S Lilly: May 2008 - add logic to make sure that all of the " -echo " data produced from the restricted ECMWF" -echo " data on the CCS is properly protected." -echo "C. Magee: 10/2013 - swap X and Y for rtgssthr Atl and Pac." +# echo "----------------------------------------------------" +# echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" +# echo "----------------------------------------------------" +# echo "History: Mar 2000 - First implementation of this new script." +# echo "S Lilly: May 2008 - add logic to make sure that all of the " +# echo " data produced from the restricted ECMWF" +# echo " data on the CCS is properly protected." +# echo "C. Magee: 10/2013 - swap X and Y for rtgssthr Atl and Pac." ##################################################################### -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA @@ -19,9 +23,6 @@ cp $FIXgempak/g2vcrdwmo2.tbl g2vcrdwmo2.tbl cp $FIXgempak/g2varsncep1.tbl g2varsncep1.tbl cp $FIXgempak/g2vcrdncep1.tbl g2vcrdncep1.tbl -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - # # NAGRIB_TABLE=$FIXgempak/nagrib.tbl NAGRIB=$GEMEXE/nagrib2 @@ -53,16 +54,10 @@ pdsext=no maxtries=180 fhcnt=$fstart while [ $fhcnt -le $fend ] ; do -# if [ $fhcnt -ge 100 ] ; then - typeset -Z3 fhr -# else -# typeset -Z2 fhr -# fi - fhr=$fhcnt + fhr=$(printf "%03d" $fhcnt) fhcnt3=$(expr $fhr % 3) - fhr3=$fhcnt - typeset -Z3 fhr3 + fhr3=$(printf "03d" $fhcnt) GRIBIN=$COMIN/${model}.${cycle}.${GRIB}${fhr}${EXT} GEMGRD=${RUN}_${PDY}${cyc}f${fhr3} @@ -126,17 +121,7 @@ EOF let fhcnt=fhcnt+finc done -##################################################################### -# GOOD RUN -set +x -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -set -x ##################################################################### -msg='Job completed normally.' -echo $msg -postmsg "$jlogfile" "$msg" ############################### END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 1e81f9815b8..80cd0902e24 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -1,18 +1,19 @@ -#!/bin/ksh +#! /usr/bin/env bash + ##################################################################### -echo "-----------------------------------------------------" -echo " exglobal_grib2_special_npoess.sh" -echo " Jan 2008 - Chuang - Produces 1x1 degree special Grib from master." -echo "-----------------------------------------------------" +# echo "-----------------------------------------------------" +# echo " exglobal_grib2_special_npoess.sh" +# echo " Jan 2008 - Chuang - Produces 1x1 degree special Grib from master." +# echo "-----------------------------------------------------" ##################################################################### -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" - ############################################################ # Define Variables: # ----------------- @@ -49,12 +50,12 @@ SLEEP_LOOP_MAX=$(expr $SLEEP_TIME / $SLEEP_INT) ############################################################################## export SHOUR=000 export FHOUR=024 -export fhr=$SHOUR -typeset -Z3 fhr +export fhr=$(printf "%03d" $SHOUR) + ############################################################ # Loop Through the Post Forecast Files ############################################################ -while test $fhr -le $FHOUR +while test 10#$fhr -le $FHOUR do ############################### @@ -87,10 +88,6 @@ do ###################################################################### # Process Global NPOESS 0.50 GFS GRID PRODUCTS IN GRIB2 F000 - F024 # ###################################################################### - set -x - msg="Starting half degree grib generation for fhr=$fhr" - postmsg "$jlogfile" "$msg" - paramlist=${PARMproduct}/global_npoess_paramlist_g2 cp $COMIN/gfs.t${cyc}z.pgrb2.0p50.f${fhr} tmpfile2 cp $COMIN/gfs.t${cyc}z.pgrb2b.0p50.f${fhr} tmpfile2b @@ -112,8 +109,7 @@ do echo "$PDY$cyc$fhr" > $COMOUT/${RUN}.t${cyc}z.control.halfdeg.npoess fi rm tmpfile pgb2file - export fhr=$(expr $fhr + $FHINC) - typeset -Z3 fhr + export fhr=$(printf "%03d" $(expr $fhr + $FHINC)) done @@ -122,14 +118,13 @@ done ################################################################ export SHOUR=000 export FHOUR=180 -export fhr=$SHOUR -typeset -Z3 fhr +export fhr=$(printf "%03d" $SHOUR) ################################# # Process GFS PGRB2_SPECIAL_POST ################################# -while test $fhr -le $FHOUR +while test 10#$fhr -le $FHOUR do ############################### # Start Looping for the @@ -158,10 +153,7 @@ do err_chk fi done - set -x - - msg="Starting special grib file generation for fhr=$fhr" - postmsg "$jlogfile" "$msg" + ${TRACE_ON:-set -x} ############################### # Put restart files into /nwges @@ -208,13 +200,8 @@ do export fhour=$(expr ${fhr} % 6 ) fi - export fhr=$(expr $fhr + $FHINC) - typeset -Z3 fhr + export fhr=$(printf "%03d" $(expr $fhr + $FHINC)) done -######################################################## - -msg='ENDED NORMALLY.' -postmsg "$jlogfile" "$msg" ################## END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_grib_awips.sh b/scripts/exgfs_atmos_grib_awips.sh index 2e5ec915265..6ce4ac7a1ba 100755 --- a/scripts/exgfs_atmos_grib_awips.sh +++ b/scripts/exgfs_atmos_grib_awips.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ###################################################################### # UTILITY SCRIPT NAME : exgfs_grib_awips.sh # DATE WRITTEN : 10/04/2004 @@ -9,29 +10,30 @@ # 1st argument - Forecast Hour - format of 2I # ##################################################################### -echo "------------------------------------------------" -echo "JGFS_AWIPS_00/06/12/18 GFS postprocessing" -echo "------------------------------------------------" -echo "History: OCT 2004 - First implementation of this new script." -echo " JUN 2014 - Modified to remove process for AWIPS in GRIB2" -echo " to script exgfs_grib_awips_g2.sh and this " -echo " script only process AWIPS GRIB1 (211 and 225)" -echo " AUG 2015 - Modified for WCOSS phase2" -echo " FEB 2019 - Removed grid 225" +# echo "------------------------------------------------" +# echo "JGFS_AWIPS_00/06/12/18 GFS postprocessing" +# echo "------------------------------------------------" +# echo "History: OCT 2004 - First implementation of this new script." +# echo " JUN 2014 - Modified to remove process for AWIPS in GRIB2" +# echo " to script exgfs_grib_awips_g2.sh and this " +# echo " script only process AWIPS GRIB1 (211 and 225)" +# echo " AUG 2015 - Modified for WCOSS phase2" +# echo " FEB 2019 - Removed grid 225" ##################################################################### -set +x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + fcsthrs="$1" num=$# job_name=$(echo $job|sed 's/[jpt]gfs/gfs/') -typeset -Z3 fcsthrs +fcsthrs=$(printf "%03d" $fcsthrs) -export PS4='gfs_grib_awips:f$fcsthrs:$SECONDS + ' export SCALEDEC=${SCALDEC:-$USHgfs/scale_dec.sh} -#if [ $fhcsthrs -t 100 ]; then -# fcsthrs=0$fcsthrs -#fi if test "$num" -ge 1 then echo "" @@ -49,8 +51,6 @@ fi cd $DATA/awips_g1 -set -x - ############################################### # Wait for the availability of the pgrb file ############################################### @@ -86,7 +86,7 @@ echo "###############################################" echo " Process GFS GRIB1 AWIP PRODUCTS (211) " echo "###############################################" echo " " -set -x +${TRACE_ON:-set -x} cp $COMIN/gfs.t${cyc}z.pgrb2.0p25.f${fcsthrs} tmpfile2 cp $COMIN/gfs.t${cyc}z.pgrb2b.0p25.f${fcsthrs} tmpfile2b @@ -149,16 +149,7 @@ if [ -e "$pgmout" ] ; then cat $pgmout fi -############################################################################### -# GOOD RUN -set +x -echo "**************JOB EXGFS_GRIB_AWIPS.SH.ECF COMPLETED NORMALLY ON THE IBM" -echo "**************JOB EXGFS_GRIB_AWIPS.SH.ECF COMPLETED NORMALLY ON THE IBM" -echo "**************JOB EXGFS_GRIB_AWIPS.SH.ECF COMPLETED NORMALLY ON THE IBM" -set -x ############################################################################### -msg="HAS COMPLETED NORMALLY!" -postmsg "$jlogfile" "$msg" ############## END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_nawips.sh b/scripts/exgfs_atmos_nawips.sh index 8e1ba652d6a..54385cb09ee 100755 --- a/scripts/exgfs_atmos_nawips.sh +++ b/scripts/exgfs_atmos_nawips.sh @@ -1,15 +1,19 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################### -echo "----------------------------------------------------" -echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" -echo "----------------------------------------------------" -echo "History: Mar 2000 - First implementation of this new script." -echo "S Lilly: May 2008 - add logic to make sure that all of the " -echo " data produced from the restricted ECMWF" -echo " data on the CCS is properly protected." +# echo "----------------------------------------------------" +# echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" +# echo "----------------------------------------------------" +# echo "History: Mar 2000 - First implementation of this new script." +# echo "S Lilly: May 2008 - add logic to make sure that all of the " +# echo " data produced from the restricted ECMWF" +# echo " data on the CCS is properly protected." ##################################################################### -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT ${2} +fi #### If EMC GFS PARA runs hourly file are not available, The ILPOST #### will set to 3 hour in EMC GFS PARA. @@ -21,16 +25,10 @@ RUN=$1 fend=$2 DBN_ALERT_TYPE=$3 -export 'PS4=$RUN:$SECONDS + ' - DATA_RUN=$DATA/$RUN mkdir -p $DATA_RUN cd $DATA_RUN -msg="Begin job for $job" -postmsg "$jlogfile" "$msg" - - # NAGRIB=$GEMEXE/nagrib2_nc # @@ -49,20 +47,17 @@ maxtries=360 fhcnt=$fstart while [ $fhcnt -le $fend ] ; do -if mkdir lock.$fhcnt ; then +if [[ $(mkdir lock.${fhcnt}) == 0 ]] ; then cd lock.$fhcnt cp $FIXgempak/g2varswmo2.tbl g2varswmo2.tbl cp $FIXgempak/g2vcrdwmo2.tbl g2vcrdwmo2.tbl cp $FIXgempak/g2varsncep1.tbl g2varsncep1.tbl cp $FIXgempak/g2vcrdncep1.tbl g2vcrdncep1.tbl - typeset -Z3 fhr - - fhr=$fhcnt + fhr=$(printf "%03d" $fhcnt) fhcnt3=$(expr $fhr % 3) - fhr3=$fhcnt - typeset -Z3 fhr3 + fhr3=$(printf "%03d" $fhcnt) GEMGRD=${RUN}_${PDY}${cyc}f${fhr3} @@ -189,16 +184,6 @@ done $GEMEXE/gpend ##################################################################### -# GOOD RUN -set +x -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -set -x -##################################################################### -msg='Job completed normally.' -echo $msg -postmsg "$jlogfile" "$msg" ############################### END OF SCRIPT ####################### diff --git a/scripts/exgfs_atmos_nceppost.sh b/scripts/exgfs_atmos_nceppost.sh index e653a36e39d..e47cab6f92e 100755 --- a/scripts/exgfs_atmos_nceppost.sh +++ b/scripts/exgfs_atmos_nceppost.sh @@ -1,47 +1,49 @@ +#! /usr/bin/env bash + ##################################################################### -echo "-----------------------------------------------------" -echo " exgfs_nceppost.sh" -echo " Apr 99 - Michaud - Generated to post global forecast" -echo " Mar 03 - Zhu - Add post for 0.5x0.5 degree" -echo " Nov 03 - Gilbert - Modified from exglobal_post.sh.sms" -echo " to run only one master post job." -echo " Jan 07 - Cooke - Add DBNet Alert for Master files" -echo " May 07 - Chuang - Modified scripts to run unified post" -echo " Feb 10 - Carlis - Add 12-hr accum precip bucket at f192" -echo " Jun 12 - Wang - Add option for grb2" -echo " Jul 14 - Carlis - Add 0.25 deg master " -echo " Mar 17 - F Yang - Modified for running fv3gfs" -echo " Aug 17 - Meng - Add flags for turning on/off flx, gtg " -echo " and satellite look like file creation" -echo " and use 3-digit forecast hour naming" -echo " post output files" -echo " Dec 17 - Meng - Link sfc data file to flxfile " -echo " since fv3gfs does not output sfc files any more." -echo " Dec 17 - Meng - Add fv3gfs_downstream_nems.sh for pgb processing " -echo " Jan 18 - Meng - Add flag PGBF for truning on/off pgb processing. " -echo " Jan 18 - Meng - For EE2 standard, move IDRT POSTGPVARS setting" -echo " from j-job script." -echo " Feb 18 - Meng - Removed legacy setting for generating grib1 data" -echo " and reading sigio model outputs." -echo " Aug 20 - Meng - Remove .ecf extentsion per EE2 review." -echo " Sep 20 - Meng - Update clean up files per EE2 review." -echo " Dec 20 - Meng - Add alert for special data file." -echo " Mar 21 - Meng - Update POSTGRB2TBL default setting." -echo " Jun 21 - Mao - Instead of err_chk, catch err and print out" -echo " WAFS failure warnings to avoid job crashing" -echo " Oct 21 - Meng - Remove jlogfile for wcoss2 transition." -echo " Feb 22 - Lin - Exception handling if anl input not found." -echo "-----------------------------------------------------" +# echo "-----------------------------------------------------" +# echo " exgfs_nceppost.sh" +# echo " Apr 99 - Michaud - Generated to post global forecast" +# echo " Mar 03 - Zhu - Add post for 0.5x0.5 degree" +# echo " Nov 03 - Gilbert - Modified from exglobal_post.sh.sms" +# echo " to run only one master post job." +# echo " Jan 07 - Cooke - Add DBNet Alert for Master files" +# echo " May 07 - Chuang - Modified scripts to run unified post" +# echo " Feb 10 - Carlis - Add 12-hr accum precip bucket at f192" +# echo " Jun 12 - Wang - Add option for grb2" +# echo " Jul 14 - Carlis - Add 0.25 deg master " +# echo " Mar 17 - F Yang - Modified for running fv3gfs" +# echo " Aug 17 - Meng - Add flags for turning on/off flx, gtg " +# echo " and satellite look like file creation" +# echo " and use 3-digit forecast hour naming" +# echo " post output files" +# echo " Dec 17 - Meng - Link sfc data file to flxfile " +# echo " since fv3gfs does not output sfc files any more." +# echo " Dec 17 - Meng - Add fv3gfs_downstream_nems.sh for pgb processing " +# echo " Jan 18 - Meng - Add flag PGBF for truning on/off pgb processing. " +# echo " Jan 18 - Meng - For EE2 standard, move IDRT POSTGPVARS setting" +# echo " from j-job script." +# echo " Feb 18 - Meng - Removed legacy setting for generating grib1 data" +# echo " and reading sigio model outputs." +# echo " Aug 20 - Meng - Remove .ecf extentsion per EE2 review." +# echo " Sep 20 - Meng - Update clean up files per EE2 review." +# echo " Dec 20 - Meng - Add alert for special data file." +# echo " Mar 21 - Meng - Update POSTGRB2TBL default setting." +# echo " Jun 21 - Mao - Instead of err_chk, catch err and print out" +# echo " WAFS failure warnings to avoid job crashing" +# echo " Oct 21 - Meng - Remove jlogfile for wcoss2 transition." +# echo " Feb 22 - Lin - Exception handling if anl input not found." +# echo "-----------------------------------------------------" ##################################################################### -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA # specify model output format type: 4 for nemsio, 3 for sigio -msg="HAS BEGUN on $(hostname)" -postmsg "$msg" - export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_nceppost.sh} export GFSDOWNSH=${GFSDOWNSH:-$USHgfs/fv3gfs_downstream_nems.sh} export GFSDOWNSHF=${GFSDOWNSHF:-$USHgfs/inter_flux.sh} @@ -242,7 +244,6 @@ else ## not_anl if_stime # Start Looping for the # existence of the restart files ############################### - set -x export pgm="postcheck" ic=1 while [ $ic -le $SLEEP_LOOP_MAX ]; do @@ -263,10 +264,6 @@ else ## not_anl if_stime err_chk fi done - set -x - - msg="Starting post for fhr=$fhr" - postmsg "$msg" ############################### # Put restart files into /nwges @@ -478,7 +475,7 @@ else ## not_anl if_stime ########################## WAFS start ########################## # Generate WAFS products on ICAO standard level. # Do not need to be sent out to public, WAFS package will process the data. - if [[ $WAFSF = "YES" && $fhr -le 120 ]]; then + if [[ $WAFSF = "YES" && 10#$fhr -le 120 ]]; then if [[ $RUN = gfs && $GRIBVERSION = 'grib2' ]]; then export OUTTYP=${OUTTYP:-4} @@ -527,9 +524,7 @@ else ## not_anl if_stime #---------------------------------- fi ## end_if_stime -#cat $pgmout -#msg='ENDED NORMALLY.' -#postmsg "$jlogfile" "$msg" + exit 0 diff --git a/scripts/exgfs_atmos_postsnd.sh b/scripts/exgfs_atmos_postsnd.sh index 67b9ce56fa4..2be499cf266 100755 --- a/scripts/exgfs_atmos_postsnd.sh +++ b/scripts/exgfs_atmos_postsnd.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################ # Script Name: exgfs_atmos_postsnd.sh.sms # Script Description: Generate GFS BUFR sounding files @@ -18,12 +19,14 @@ # 8) 2019-10-18 Guang Ping Lou Transition to reading in NetCDF model data # 9) 2019-12-18 Guang Ping Lou generalizing to reading in NetCDF or nemsio ################################################################ -set -xa + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi cd $DATA -######################################## -msg="HAS BEGUN" -#postmsg "$jlogfile" "$msg" + ######################################## ################################################### @@ -165,21 +168,6 @@ ${APRUN_POSTSNDCFP} cmdfile sh $USHbufrsnd/gfs_bfr2gpk.sh fi -################################################ -# Convert the bufr soundings into GEMPAK files -################################################ -##$USHbufrsnd/gfs_bfr2gpk.sh - -##################################################################### -# GOOD RUN -set +x -echo "**************JOB GFS_meteogrm COMPLETED NORMALLY ON THE IBM" -echo "**************JOB GFS_meteogrm COMPLETED NORMALLY ON THE IBM" -echo "**************JOB GFS_meteogrm COMPLETED NORMALLY ON THE IBM" -set -x -##################################################################### - -msg='HAS COMPLETED NORMALLY.' -#postmsg "$jlogfile" "$msg" + ############## END OF SCRIPT ####################### diff --git a/scripts/exgfs_pmgr.sh b/scripts/exgfs_pmgr.sh index d16db660320..7aaa4ecccf2 100755 --- a/scripts/exgfs_pmgr.sh +++ b/scripts/exgfs_pmgr.sh @@ -1,13 +1,17 @@ -#! /bin/ksh +#! /usr/bin/env bash + # # Script name: exgfs_pmgr.sh.sms # # This script monitors the progress of the gfs_fcst job # -set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi hour=00 -typeset -Z2 hour TEND=384 TCP=385 @@ -17,15 +21,12 @@ fi while [ $hour -lt $TCP ]; do + hour=$(printf "%02d" $hour) echo $hour >>posthours - if [ $hour -lt 240 ] + if [ 10#$hour -lt 240 ] then - if [ $hour -eq 99 ] - then - typeset -Z3 hour - fi # JY if [ $hour -lt 12 ] - if [ $hour -lt 120 ] + if [ 10#$hour -lt 120 ] then let "hour=hour+1" else @@ -74,6 +75,5 @@ do done -echo Exiting $0 exit diff --git a/scripts/exgfs_prdgen_manager.sh b/scripts/exgfs_prdgen_manager.sh index 6584178a7ed..3cfa3acb6b0 100755 --- a/scripts/exgfs_prdgen_manager.sh +++ b/scripts/exgfs_prdgen_manager.sh @@ -1,13 +1,17 @@ -#! /bin/ksh +#! /usr/bin/env bash + # # Script name: exgfs_pmgr.sh.sms # # This script monitors the progress of the gfs_fcst job # -set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi hour=00 -typeset -Z2 hour TEND=384 TCP=385 @@ -17,13 +21,11 @@ fi while [ $hour -lt $TCP ]; do + hour=$(printf "%02d" $hour) echo $hour >>pgrb2_hours - if [ $hour -lt 240 ] + if [ 10#$hour -lt 240 ] then - if [ $hour -eq 99 ]; then - typeset -Z3 hour - fi - if [ $hour -lt 120 ] + if [ 10#$hour -lt 120 ] then let "hour=hour+1" else @@ -71,6 +73,5 @@ do done -echo Exiting $0 exit diff --git a/scripts/exgfs_wave_init.sh b/scripts/exgfs_wave_init.sh index 83d7859cb87..0c4f44dc8c1 100755 --- a/scripts/exgfs_wave_init.sh +++ b/scripts/exgfs_wave_init.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -26,20 +26,18 @@ # # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + +# 0.a Basic modes of operation err=0 - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x cd $DATA - echo "HAS BEGUN on $(hostname)" - echo "Starting MWW3 INIT CONFIG SCRIPT for ${CDUMP}wave" - set +x echo ' ' echo ' ********************************' @@ -50,7 +48,7 @@ echo ' ' echo "Starting at : $(date)" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Script will run only if pre-defined NTASKS # The actual work is distributed over these tasks. @@ -64,7 +62,7 @@ echo ' ' echo " Script set to run with $NTASKS tasks " echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # --------------------------------------------------------------------------- # @@ -74,7 +72,7 @@ echo 'Preparing input files :' echo '-----------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a Model definition files @@ -94,14 +92,14 @@ then set +x echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp $COMIN/rundata/${CDUMP}wave.mod_def.${grdID} mod_def.$grdID else set +x echo " Mod def file for $grdID not found in ${COMIN}/rundata. Setting up to generate ..." echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ -f $PARMwave/ww3_grid.inp.$grdID ] then cp $PARMwave/ww3_grid.inp.$grdID ww3_grid.inp.$grdID @@ -113,7 +111,7 @@ echo ' ' echo " ww3_grid.inp.$grdID copied ($PARMwave/ww3_grid.inp.$grdID)." echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -122,7 +120,7 @@ echo '*********************************************************** ' echo " grdID = $grdID" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2;export err;${errchk} fi @@ -147,7 +145,7 @@ echo ' ' echo " Generating $nmoddef mod def files" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Set number of processes for mpmd wavenproc=$(wc -l cmdfile | awk '{print $1}') @@ -160,7 +158,7 @@ echo " Executing the mod_def command file at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$NTASKS" -gt '1' ] then @@ -184,7 +182,7 @@ echo '********************************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi fi @@ -199,7 +197,7 @@ echo ' ' echo " mod_def.$grdID succesfully created/copied " echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -209,7 +207,7 @@ echo " grdID = $grdID" echo ' ' sed "s/^/$grdID.out : /g" $grdID.out - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=3;export err;${errchk} fi done @@ -217,14 +215,5 @@ # --------------------------------------------------------------------------- # # 2. Ending - set +x - echo ' ' - echo "Ending at : $(date)" - echo ' ' - echo ' *** End of MWW3 Init Config ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - - exit $err # End of MWW3 init config script ------------------------------------------- # diff --git a/scripts/exgfs_wave_nawips.sh b/scripts/exgfs_wave_nawips.sh index c4fa9e764df..23f2cd6bba4 100755 --- a/scripts/exgfs_wave_nawips.sh +++ b/scripts/exgfs_wave_nawips.sh @@ -1,16 +1,20 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################### -echo "----------------------------------------------------" -echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" -echo "----------------------------------------------------" -echo "History: Mar 2000 - First implementation of this new script." -echo "Sept 2011 - First implementation of this new script based on" -echo " /nwprod/scripts/exnawips.sh.sms" -echo " March 2020- Modified for GEFSv12.0" +# echo "----------------------------------------------------" +# echo "exnawips - convert NCEP GRIB files into GEMPAK Grids" +# echo "----------------------------------------------------" +# echo "History: Mar 2000 - First implementation of this new script." +# echo "Sept 2011 - First implementation of this new script based on" +# echo " /nwprod/scripts/exnawips.sh.sms" +# echo " March 2020- Modified for GEFSv12.0" # March-2020 Roberto.Padilla@noaa.gov ##################################################################### -set -xa +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi #export grids=${grids:-'glo_30m at_10m ep_10m wc_10m ao_9km'} #Interpolated grids export grids=${grids:-'glo_10m gso_15m ao_9km'} #Native grids @@ -90,7 +94,7 @@ while [ $fhcnt -le $FHMAX_WAV ]; do echo '**************************** ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "$RUNwave $grdID ${fhr} prdgen $date $cycle : GRIB file missing." >> $wavelog err=1;export err;${errchk} || exit ${err} fi @@ -111,7 +115,7 @@ while [ $fhcnt -le $FHMAX_WAV ]; do echo '************************************************************* ' echo ' ' echo $msg - #[[ "$LOUD" = YES ]] && set -x + #${TRACE_ON:-set -x} echo "$RUNwave $grdID prdgen $date $cycle : error in grbindex." >> $wavelog err=2;export err;err_chk else @@ -177,14 +181,6 @@ while [ $fhcnt -le $FHMAX_WAV ]; do let fhcnt=fhcnt+inc done ##################################################################### -# GOOD RUN -set +x -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -echo "**************JOB $RUN NAWIPS COMPLETED NORMALLY ON THE IBM" -set -x -##################################################################### -msg='Job completed normally.' -echo $msg -postmsg "$jlogfile" "$msg" + + ############################### END OF SCRIPT ####################### diff --git a/scripts/exgfs_wave_post_gridded_sbs.sh b/scripts/exgfs_wave_post_gridded_sbs.sh index 2eb6a82211f..82d8166f295 100755 --- a/scripts/exgfs_wave_post_gridded_sbs.sh +++ b/scripts/exgfs_wave_post_gridded_sbs.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -30,12 +30,13 @@ # # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - set -x - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + +# 0.a Basic modes of operation # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic @@ -43,7 +44,6 @@ cd $DATA - echo "HAS BEGUN on $(hostname)" echo "Starting WAVE POSTPROCESSOR SCRIPT for $WAV_MOD_TAG" set +x @@ -55,7 +55,7 @@ echo "Starting at : $(date)" echo '-------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Script will run only if pre-defined NTASKS # The actual work is distributed over these tasks. @@ -85,7 +85,7 @@ echo " Interpolated grids : $waveinterpGRD" echo " Post-process grids : $wavepostGRD" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.c.3 Define CDATE_POST @@ -104,7 +104,7 @@ echo ' ' echo 'Preparing input files :' echo '-----------------------' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a Model definition files and output files (set up using poe) @@ -115,7 +115,7 @@ then set +x echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp -f $COMIN/rundata/${CDUMP}wave.mod_def.${grdID} mod_def.$grdID fi @@ -132,14 +132,14 @@ echo " FATAL ERROR : NO MOD_DEF FILE mod_def.$grdID " echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2; export err;${errchk} exit $err DOGRB_WAV='NO' else set +x echo "File mod_def.$grdID found. Syncing to all nodes ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi done @@ -159,7 +159,7 @@ then set +x echo " ${intGRD}_interp.inp.tmpl copied. Syncing to all nodes ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -167,7 +167,7 @@ echo '*** ERROR : NO TEMPLATE FOR GRINT INPUT FILE *** ' echo '*********************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "$WAV_MOD_TAG post $date $cycle : GRINT template file missing." exit_code=1 DOGRI_WAV='NO' @@ -188,7 +188,7 @@ then set +x echo " ww3_grib2.${grbGRD}.inp.tmpl copied. Syncing to all nodes ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -196,7 +196,7 @@ echo "*** ERROR : NO TEMPLATE FOR ${grbGRD} GRIB INPUT FILE *** " echo '*********************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit_code=2 DOGRB_WAV='NO' fi @@ -215,7 +215,7 @@ echo " Sufficient data for GRID interpolation : $DOGRI_WAV" echo " Sufficient data for GRIB files : $DOGRB_WAV" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # --------------------------------------------------------------------------- # # 2. Make consolidated grib2 file for side-by-side grids and interpolate @@ -225,12 +225,12 @@ set +x echo ' Making command file for sbs grib2 and GRID Interpolation ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a.2 Loop over forecast time to generate post files # When executed side-by-side, serial mode (cfp when run after the fcst step) # Contingency for RERUN=YES - if [ "${RERUN}" = "YES" ]; then + if [ "${RERUN-NO}" = "YES" ]; then fhr=$((FHRUN + FHMIN_WAV)) if [ $FHMAX_HF_WAV -gt 0 ] && [ $FHOUT_HF_WAV -gt 0 ] && [ $fhr -lt $FHMAX_HF_WAV ]; then FHINCG=$FHOUT_HF_WAV @@ -276,7 +276,7 @@ echo " FATAL ERROR : NO RAW FIELD OUTPUT FILE out_grd.$grdID " echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "$WAV_MOD_TAG post $grdID $date $cycle : field output missing." err=3; export err;${errchk} exit $err @@ -371,7 +371,7 @@ echo " Executing the grib2_sbs scripts at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$wavenproc" -gt '1' ] then @@ -396,7 +396,7 @@ echo '*************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=4; export err;${errchk} exit $err fi @@ -420,7 +420,7 @@ echo '********************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=5; export err;${errchk} exit $err fi @@ -440,23 +440,6 @@ # --------------------------------------------------------------------------- # # 7. Ending output - set +x - echo ' ' - echo "Ending at : $(date)" - echo '-----------' - echo ' ' - echo ' *** End of MWW3 postprocessor ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - - if [ "$exit_code" -ne '0' ] - then - echo " FATAL ERROR: Problem in MWW3 POST" - err=6; export err;${errchk} - exit $err - else - echo " Side-by-Side Wave Post Completed Normally " - exit 0 - fi +echo "$exit_code" # End of MWW3 prostprocessor script ---------------------------------------- # diff --git a/scripts/exgfs_wave_post_pnt.sh b/scripts/exgfs_wave_post_pnt.sh index f515e35d01a..23f2ab7156c 100755 --- a/scripts/exgfs_wave_post_pnt.sh +++ b/scripts/exgfs_wave_post_pnt.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -32,12 +32,13 @@ # # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - set -x - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + +# 0.a Basic modes of operation cd $DATA @@ -57,7 +58,7 @@ echo "Starting at : $(date)" echo '-------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Script will run only if pre-defined NTASKS # The actual work is distributed over these tasks. @@ -94,7 +95,7 @@ echo '-------------------' echo " Output points : $waveuoutpGRD" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # --------------------------------------------------------------------------- # # 1. Get files that are used by most child scripts @@ -105,7 +106,7 @@ echo ' ' echo 'Preparing input files :' echo '-----------------------' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a Model definition files and output files (set up using poe) @@ -115,16 +116,17 @@ touch cmdfile chmod 744 cmdfile - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Copy model definition files + iloop=0 for grdID in $waveuoutpGRD do if [ -f "$COMIN/rundata/${CDUMP}wave.mod_def.${grdID}" ] then set +x echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp -f $COMIN/rundata/${CDUMP}wave.mod_def.${grdID} mod_def.$grdID iloop=$(expr $iloop + 1) @@ -141,13 +143,13 @@ echo " FATAL ERROR : NO MOD_DEF FILE mod_def.$grdID " echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2; export err;${errchk} exit $err else set +x echo "File mod_def.$grdID found. Syncing to all nodes ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi done @@ -171,7 +173,7 @@ then set +x echo " buoy.loc and buoy.ibp copied and processed ($PARMwave/wave_${NET}.buoys)." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -179,7 +181,7 @@ echo ' FATAL ERROR : NO BUOY LOCATION FILE ' echo '************************************* ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=3; export err;${errchk} exit $err DOSPC_WAV='NO' @@ -197,7 +199,7 @@ then set +x echo " ww3_outp_spec.inp.tmpl copied. Syncing to all grids ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -205,7 +207,7 @@ echo '*** ERROR : NO TEMPLATE FOR SPEC INPUT FILE *** ' echo '*********************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit_code=3 DOSPC_WAV='NO' DOBLL_WAV='NO' @@ -220,7 +222,7 @@ then set +x echo " ww3_outp_bull.inp.tmpl copied. Syncing to all nodes ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -228,7 +230,7 @@ echo '*** ERROR : NO TEMPLATE FOR BULLETIN INPUT FILE *** ' echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit_code=4 DOBLL_WAV='NO' fi @@ -258,7 +260,7 @@ echo " FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.${waveuoutpGRD}.${YMD}.${HMS} " echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "$WAV_MOD_TAG post $waveuoutpGRD $CDATE $cycle : field output missing." err=4; export err;${errchk} fi @@ -282,7 +284,7 @@ echo ' ' cat buoy_tmp.loc echo "$WAV_MOD_TAG post $date $cycle : buoy log file failed to be created." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=5;export err;${errchk} DOSPC_WAV='NO' DOBLL_WAV='NO' @@ -305,7 +307,7 @@ then set +x echo 'Buoy log file created. Syncing to all nodes ...' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -313,7 +315,7 @@ echo '*** ERROR : NO BUOY LOG FILE CREATED *** ' echo '**************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=6;export err;${errchk} DOSPC_WAV='NO' DOBLL_WAV='NO' @@ -333,7 +335,7 @@ echo " Sufficient data for bulletins : $DOBLL_WAV ($Nb points)" echo " Boundary points : $DOBNDPNT_WAV" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # --------------------------------------------------------------------------- # # 2. Make files for processing boundary points @@ -342,7 +344,7 @@ set +x echo ' Making command file for wave post points ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} rm -f cmdfile touch cmdfile @@ -376,7 +378,7 @@ else echo " FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD.${YMD}.${HMS} " echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=7; export err;${errchk} exit $err fi @@ -470,7 +472,7 @@ echo " Executing the wave point scripts at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$wavenproc" -gt '1' ] then @@ -495,7 +497,7 @@ echo '*************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=8; export err;${errchk} exit $err fi @@ -562,7 +564,7 @@ echo " Executing the boundary point cat script at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$wavenproc" -gt '1' ] then @@ -587,7 +589,7 @@ echo '*************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=9; export err;${errchk} exit $err fi @@ -606,7 +608,7 @@ echo ' ' echo ' Making command file for taring all point output files.' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 6.b Spectral data files @@ -664,7 +666,7 @@ echo " Executing the wave_tar scripts at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$wavenproc" -gt '1' ] then @@ -689,7 +691,7 @@ echo '*************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=10; export err;${errchk} exit $err fi @@ -697,23 +699,7 @@ # --------------------------------------------------------------------------- # # 4. Ending output - set +x - echo ' ' - echo "Ending at : $(date)" - echo '-----------' - echo ' ' - echo ' *** End of MWW3 pnt postprocessor ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - if [ "$exit_code" -ne '0' ] - then - echo " FATAL ERROR: Problem in MWW3 PNT POST" - err=11; export err;${errchk} - exit $err - else - echo " Point Wave Post Completed Normally " - exit 0 - fi +exit $exit_code # End of MWW3 point prostprocessor script ---------------------------------------- # diff --git a/scripts/exgfs_wave_prdgen_bulls.sh b/scripts/exgfs_wave_prdgen_bulls.sh index dc46136a54a..7411f9f626a 100755 --- a/scripts/exgfs_wave_prdgen_bulls.sh +++ b/scripts/exgfs_wave_prdgen_bulls.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ############################################################################### # # # This script is the product generator ("graphics job") for the # @@ -16,11 +17,13 @@ ############################################################################### # --------------------------------------------------------------------------- # # 0. Preparations + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + # 0.a Basic modes of operation - set -xa - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x # PATH for working and home directories export RUNwave=${RUNwave:-${RUN}${COMPONENT}} @@ -40,10 +43,6 @@ cd $DATA export wavelog=${DATA}/${RUNwave}_prdgbulls.log - postmsg "$jlogfile" "HAS BEGUN on $(hostname)" - - msg="Starting MWW3 BULLETINS PRODUCTS SCRIPT" - postmsg "$jlogfile" "$msg" touch $wavelog # 0.b Date and time stuff export date=$PDY @@ -58,12 +57,12 @@ echo "Starting at : $(date)" echo ' ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1. Get necessary files set +x echo " Copying bulletins from $COMIN" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a Link the input file and untar it BullIn=$COMIN/station/${RUNwave}.$cycle.cbull_tar @@ -79,7 +78,7 @@ echo '************************************ ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} msg="FATAL ERROR ${RUNwave} prdgen $date $cycle : bulletin tar missing." echo $msg >> $wavelog export err=1; ${errchk} @@ -88,14 +87,14 @@ set +x echo " Untarring bulletins ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} tar -xf cbull.tar OK=$? if [ "$OK" = '0' ]; then set +x echo " Unpacking successfull ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} rm -f cbull.tar else msg="ABNORMAL EXIT: ERROR IN BULLETIN UNTAR" @@ -107,7 +106,7 @@ echo '****************************************** ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "${RUNwave} prdgen $date $cycle : bulletin untar error." >> $wavelog err=2;export err;err_chk exit $err @@ -117,7 +116,7 @@ set +x echo ' Nb=$(ls -1 *.cbull | wc -l)' Nb=$(ls -1 *.cbull | wc -l) - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo ' ' echo " Number of bulletin files : $Nb" echo ' --------------------------' @@ -135,7 +134,7 @@ echo '******************************************* ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "${RUNwave} prdgen $date $cycle : Bulletin header data file missing." >> $wavelog err=3;export err;err_chk exit $err @@ -148,7 +147,7 @@ echo ' Sourcing data file with header info ...' # 2.b Set up environment variables - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} . awipsbull.data # 2.c Generate list of bulletins to process @@ -166,9 +165,8 @@ echo " Processing $bull ($headr $oname) ..." if [ -z "$headr" ] || [ ! -s $fname ]; then - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} msg="ABNORMAL EXIT: MISSING BULLETING INFO" - postmsg "$jlogfile" "$msg" set +x echo ' ' echo '******************************************** ' @@ -176,20 +174,20 @@ echo '******************************************** ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "${RUNwave} prdgen $date $cycle : Missing bulletin data." >> $wavelog err=4;export err;err_chk exit $err fi - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} formbul.pl -d $headr -f $fname -j $job -m ${RUNwave} \ -p $PCOM -s NO -o $oname > formbul.out 2>&1 OK=$? if [ "$OK" != '0' ] || [ ! -f $oname ]; then - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cat formbul.out msg="ABNORMAL EXIT: ERROR IN formbul" postmsg "$jlogfile" "$msg" @@ -200,7 +198,7 @@ echo '************************************** ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "${RUNwave} prdgen $date $cycle : error in formbul." >> $wavelog err=5;export err;err_chk exit $err @@ -211,7 +209,7 @@ done # 3. Send output files to the proper destination - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$SENDCOM" = YES ]; then cp awipsbull.$cycle.${RUNwave} $PCOM/awipsbull.$cycle.${RUNwave} if [ "$SENDDBN_NTC" = YES ]; then @@ -219,7 +217,7 @@ else if [ "${envir}" = "para" ] || [ "${envir}" = "test" ] || [ "${envir}" = "dev" ]; then echo "Making NTC bulletin for parallel environment, but do not alert." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} (export SENDDBN=NO; make_ntc_bull.pl WMOBH NONE KWBC NONE \ $DATA/awipsbull.$cycle.${RUNwave} $PCOM/awipsbull.$cycle.${RUNwave}) fi @@ -229,23 +227,12 @@ # --------------------------------------------------------------------------- # # 4. Clean up - set +x; [[ "$LOUD" = YES ]] && set -v + set -v rm -f ${RUNwave}.*.cbull awipsbull.data set +v # --------------------------------------------------------------------------- # # 5. Ending output - set +x - echo ' ' - echo ' ' - echo "Ending at : $(date)" - echo ' ' - echo ' *** End of MWW3 BULLETINS product generation ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - - msg="$job completed normally" - postmsg "$jlogfile" "$msg" # End of MWW3 product generation script -------------------------------------- # diff --git a/scripts/exgfs_wave_prdgen_gridded.sh b/scripts/exgfs_wave_prdgen_gridded.sh index ed6141afec3..9b2e49f0d7f 100755 --- a/scripts/exgfs_wave_prdgen_gridded.sh +++ b/scripts/exgfs_wave_prdgen_gridded.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ############################################################################### # # # This script is the product generator ("graphics job") for the # @@ -17,11 +18,13 @@ ############################################################################### # --------------------------------------------------------------------------- # # 0. Preparations + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + # 0.a Basic modes of operation - set -xa - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x export RUNwave=${RUNwave:-${RUN}${COMPONENT}} export envir=${envir:-ops} @@ -63,14 +66,14 @@ echo " AWIPS grib fields" echo " Wave Grids : $grids" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # --------------------------------------------------------------------------- # # 1. Get necessary files echo ' ' echo 'Preparing input files :' echo '-----------------------' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} #======================================================================= ASWELL=(SWELL1 SWELL2) # Indices of HS from partitions @@ -120,7 +123,7 @@ echo '**************************** ' echo ' ' echo $msg - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} echo "$RUNwave $grdID ${fhr} prdgen $date $cycle : GRIB file missing." >> $wavelog err=1;export err;${errchk} || exit ${err} fi @@ -177,12 +180,12 @@ # 2.a.1 Set up for tocgrib2 echo " Do set up for tocgrib2." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} #AWIPSGRB=awipsgrib.$grdID.f${fhr} AWIPSGRB=awipsgrib # 2.a.2 Make GRIB index echo " Make GRIB index for tocgrib2." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} $GRB2INDEX gribfile.$grdID.f${fhr} gribindex.$grdID.f${fhr} OK=$? @@ -197,7 +200,7 @@ echo '******************************************** ' echo ' ' echo $msg - #[[ "$LOUD" = YES ]] && set -x + #${TRACE_ON:-set -x} echo "$RUNwave $grdID prdgen $date $cycle : error in grbindex." >> $wavelog err=4;export err;err_chk fi @@ -205,7 +208,7 @@ # 2.a.3 Run AWIPS GRIB packing program tocgrib2 echo " Run tocgrib2" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} export pgm=tocgrib2 export pgmout=tocgrib2.out . prep_step @@ -227,7 +230,7 @@ echo '*************************************** ' echo ' ' echo $msg - #[[ "$LOUD" = YES ]] && set -x + #${TRACE_ON:-set -x} echo "$RUNwave prdgen $date $cycle : error in tocgrib2." >> $wavelog err=5;export err;err_chk else @@ -236,13 +239,13 @@ # 2.a.7 Get the AWIPS grib bulletin out ... #set +x echo " Get awips GRIB bulletins out ..." - #[[ "$LOUD" = YES ]] && set -x + #${TRACE_ON:-set -x} if [ "$SENDCOM" = 'YES' ] then #set +x echo " Saving $AWIPSGRB.$grdOut.f${fhr} as grib2.$cycle.awipsww3_${grdID}.f${fhr}" echo " in $PCOM" - #[[ "$LOUD" = YES ]] && set -x + #${TRACE_ON:-set -x} cp $AWIPSGRB.$grdID.f${fhr} $PCOM/grib2.$cycle.f${fhr}.awipsww3_${grdOut} #set +x fi @@ -268,22 +271,13 @@ # --------------------------------------------------------------------------- # # 5. Clean up - set +x; [[ "$LOUD" = YES ]] && set -v + set -v rm -f gribfile gribindex.* awipsgrb.* awipsbull.data set +v # --------------------------------------------------------------------------- # # 6. Ending output - echo ' ' - echo ' ' - echo "Ending at : $(date)" - echo ' ' - echo ' *** End of MWW3 product generation ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - msg="$job completed normally" - postmsg "$jlogfile" "$msg" # End of GFSWAVE product generation script -------------------------------------- # diff --git a/scripts/exgfs_wave_prep.sh b/scripts/exgfs_wave_prep.sh index 2e2e18985f2..b9fd0528985 100755 --- a/scripts/exgfs_wave_prep.sh +++ b/scripts/exgfs_wave_prep.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -39,12 +39,13 @@ ############################################################################### # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - set -x - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + +# 0.a Basic modes of operation # Set wave model ID tag to include member number # if ensemble; waveMEMB var empty in deterministic @@ -66,7 +67,7 @@ echo ' ' echo "Starting at : $(date)" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$INDRUN" = 'no' ] then @@ -138,7 +139,7 @@ echo " starting time : $time_beg" echo " ending time : $time_end" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Script will run only if pre-defined NTASKS # The actual work is distributed over these tasks. @@ -155,7 +156,7 @@ echo 'Preparing input files :' echo '-----------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 1.a Model definition files @@ -175,7 +176,7 @@ then set +x echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp $COMIN/rundata/${CDUMP}wave.mod_def.${grdID} mod_def.$grdID else @@ -187,7 +188,7 @@ echo " grdID = $grdID" echo ' ' echo "FATAL ERROR: NO MODEL DEFINITION FILE" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2;export err;${errchk} fi done @@ -227,7 +228,7 @@ echo ' ' echo " ww3_prnc.${type}.$grdID.inp.tmpl copied ($PARMwave)." echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else set +x echo ' ' @@ -238,7 +239,7 @@ echo ' ' echo "ABNORMAL EXIT: NO FILE $file" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=4;export err;${errchk} fi done @@ -267,7 +268,7 @@ echo ' ' sed "s/^/wave_prnc_ice.out : /g" wave_prnc_ice.out echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=5;export err;${errchk} else mv -f wave_prnc_ice.out $DATA/outtmp @@ -275,7 +276,7 @@ echo ' ' echo ' Ice field unpacking successful.' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi else echo ' ' @@ -297,7 +298,7 @@ echo '*** FATAL ERROR : Not set-up to preprocess wind *** ' echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=6;export err;${errchk} fi @@ -315,7 +316,7 @@ echo ' ' echo ' Concatenate binary current fields ...' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # Prepare files for cfp process rm -f cmdfile @@ -386,13 +387,13 @@ else curfile=${curfile3h} fi - set $setoff + set -x echo ' ' echo '************************************** ' echo "*** FATAL ERROR: NO CUR FILE $curfile *** " echo '************************************** ' echo ' ' - set $seton + ${TRACE_ON:-set -x} echo "FATAL ERROR - NO CURRENT FILE (RTOFS)" err=11;export err;${errchk} exit $err @@ -425,7 +426,7 @@ echo " Executing the curr prnc cmdfile at : $(date)" echo ' ------------------------------------' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ $wavenproc -gt '1' ] then @@ -450,7 +451,7 @@ echo '********************************************' echo ' See Details Below ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi files=$(ls ${WAVECUR_DID}.* 2> /dev/null) @@ -464,7 +465,7 @@ echo '******************************************** ' echo ' ' echo "ABNORMAL EXIT: NO ${WAVECUR_FID}.* FILES FOUND" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=11;export err;${errchk} fi @@ -495,14 +496,7 @@ # --------------------------------------------------------------------------- # # 4. Ending output - set +x - echo ' ' - echo "Ending at : $(date)" - echo ' ' - echo ' *** End of MWW3 preprocessor ***' - echo ' ' - [[ "$LOUD" = YES ]] && set -x - exit $err +exit $err # End of MWW3 preprocessor script ------------------------------------------- # diff --git a/scripts/exglobal_atmos_analysis.sh b/scripts/exglobal_atmos_analysis.sh index 5984ba78952..76b8ad283b0 100755 --- a/scripts/exglobal_atmos_analysis.sh +++ b/scripts/exglobal_atmos_analysis.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,10 +19,10 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -1012,13 +1013,10 @@ cd $pwd if [ $SENDECF = "YES" -a "$RUN" != "enkf" ]; then ecflow_client --event release_fcst fi -echo "$CDUMP $CDATE atminc done at `date`" > $COMOUT/${APREFIX}loginc.txt +echo "$CDUMP $CDATE atminc done at $(date)" > $COMOUT/${APREFIX}loginc.txt ################################################################################ -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err ################################################################################ diff --git a/scripts/exglobal_atmos_analysis_calc.sh b/scripts/exglobal_atmos_analysis_calc.sh index 5160815b445..84efad788f7 100755 --- a/scripts/exglobal_atmos_analysis_calc.sh +++ b/scripts/exglobal_atmos_analysis_calc.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,10 +19,10 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -200,16 +201,13 @@ if [ $DOGAUSFCANL = "YES" ]; then export err=$?; err_chk fi -echo "$CDUMP $CDATE atmanl and sfcanl done at `date`" > $COMOUT/${APREFIX}loganl.txt +echo "$CDUMP $CDATE atmanl and sfcanl done at $(date)" > $COMOUT/${APREFIX}loganl.txt ################################################################################ # Postprocessing cd $pwd [[ $mkdata = "YES" ]] && rm -rf $DATA -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err diff --git a/scripts/exglobal_atmos_pmgr.sh b/scripts/exglobal_atmos_pmgr.sh index 1a00eda1a62..bc9ee5c022e 100755 --- a/scripts/exglobal_atmos_pmgr.sh +++ b/scripts/exglobal_atmos_pmgr.sh @@ -1,13 +1,17 @@ -#! /bin/ksh +#! /usr/bin/env bash + # # Script name: exgfs_pmgr.sh.sms # # This script monitors the progress of the gfs_fcst job # -set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi hour=00 -typeset -Z2 hour case $RUN in gfs) @@ -25,11 +29,9 @@ if [ -e posthours ]; then fi while [ $hour -lt $TCP ]; do + hour=$(printf "%02d" $hour) echo $hour >>posthours - if [ $hour -lt 120 ]; then - if [ $hour -eq 99 ]; then - typeset -Z3 hour - fi + if [ 10#$hour -lt 120 ]; then let "hour=hour+1" else let "hour=hour+3" @@ -69,6 +71,5 @@ while [ $icnt -lt 1000 ]; do fi done -echo Exiting $0 exit diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh index 50a6f42d005..5622e9bbbe6 100755 --- a/scripts/exglobal_atmos_sfcanl.sh +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,10 +19,10 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -218,10 +219,7 @@ cd $pwd ################################################################################ -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err ################################################################################ diff --git a/scripts/exglobal_atmos_tropcy_qc_reloc.sh b/scripts/exglobal_atmos_tropcy_qc_reloc.sh index f158b10ff9e..30648224a45 100755 --- a/scripts/exglobal_atmos_tropcy_qc_reloc.sh +++ b/scripts/exglobal_atmos_tropcy_qc_reloc.sh @@ -1,21 +1,23 @@ +#! /usr/bin/env bash + ############################################################################ -echo "---------------------------------------------------------------------" -echo "exglobal_atmos_tropcy_qc_reloc.sh - Tropical Cyclone QC/Relocation Prcocessing" -echo "---------------------------------------------------------------------" -echo "History: Jun 13 2006 - Original script." -echo " March 2013 - No changes needed for WCOSS transition" -echo " MP_LABELIO default added" -echo " Oct 2013 - Use main USH vars as part of minor pkg cleanup" +# echo "---------------------------------------------------------------------" +# echo "exglobal_atmos_tropcy_qc_reloc.sh - Tropical Cyclone QC/Relocation Prcocessing" +# echo "---------------------------------------------------------------------" +# echo "History: Jun 13 2006 - Original script." +# echo " March 2013 - No changes needed for WCOSS transition" +# echo " MP_LABELIO default added" +# echo " Oct 2013 - Use main USH vars as part of minor pkg cleanup" ############################################################################ -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi # Make sure we are in the $DATA directory cd $DATA -msg="HAS BEGUN on $(hostname)" -postmsg "$jlogfile" "$msg" - cat break > $pgmout export COMSP=$COMOUT/${RUN}.${cycle}. @@ -26,9 +28,6 @@ cdate10=$( ${NDATE:?} -$tmhr $PDY$cyc) NET_uc=$(echo $RUN | tr [a-z] [A-Z]) tmmark_uc=$(echo $tmmark | tr [a-z] [A-Z]) -msg="$NET_uc ANALYSIS TIME IS $PDY$cyc" -postmsg "$jlogfile" "$msg" - iflag=0 if [ $RUN = ndas ]; then if [ $DO_RELOCATE = NO ]; then @@ -71,9 +70,7 @@ if [ "$PROCESS_TROPCY" = 'YES' ]; then cd $COMOUT pwd - set +x ls -ltr *syndata* - set -x cd $ARCHSYND pwd;ls -ltr cat syndat_dateck @@ -156,27 +153,8 @@ fi ######################################################## -# GOOD RUN -set +x -echo " " -echo " ****** PROCESSING COMPLETED NORMALLY" -echo " ****** PROCESSING COMPLETED NORMALLY" -echo " ****** PROCESSING COMPLETED NORMALLY" -echo " ****** PROCESSING COMPLETED NORMALLY" -echo " " -set -x - - # save standard output -cat break $pgmout break > allout -cat allout -# rm allout - -sleep 10 +cat break $pgmout break -if [ $iflag -eq 0 ]; then - msg='ENDED NORMALLY.' - postmsg "$jlogfile" "$msg" -fi ################## END OF SCRIPT ####################### diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index 89d23a992ee..426d2c973d3 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -18,10 +19,10 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXECUTING $0 $* >&2 - set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi # Directories. @@ -248,7 +249,9 @@ EOFdiag # Restrict diagnostic files containing rstprod data rlist="conv_gps conv_ps conv_pw conv_q conv_sst conv_t conv_uv saphir" for rtype in $rlist; do - ${CHGRP_CMD} *${rtype}* + set +e + ${CHGRP_CMD} *${rtype}* + ${STRICT_ON:-set -e} done # If requested, create diagnostic file tarballs @@ -286,11 +289,8 @@ if [[ "$REMOVE_DIAG_DIR" = "YES" && "$err" = "0" ]]; then fi cd $pwd -[[ $mkdata = "YES" ]] && rm -rf $DATA +[[ "${mkdata:-YES}" = "YES" ]] && rm -rf $DATA + -set +x -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXITING $0 with return code $err >&2 -fi exit $err diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 4c398e5055e..830575d8c87 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ################################################################################ ## UNIX Script Documentation Block ## Script name: exglobal_fcst_nemsfv3gfs.sh @@ -76,10 +77,9 @@ # Main body starts here ####################### -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi SCRIPTDIR=$(dirname $(readlink -f "$0") )/../ush @@ -219,14 +219,5 @@ fi echo "MAIN: Output copied to COMROT" #------------------------------------------------------------------ -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXITING $0 with return code $err >&2 -fi -if [ $err != 0 ]; then - echo "MAIN: $confignamevarfornems Forecast failed" - exit $err -else - echo "MAIN: $confignamevarfornems Forecast completed at normal status" - exit 0 -fi +exit $err diff --git a/scripts/run_reg2grb2.sh b/scripts/run_reg2grb2.sh index e1b1e927bfa..9ff59a75470 100755 --- a/scripts/run_reg2grb2.sh +++ b/scripts/run_reg2grb2.sh @@ -1,5 +1,9 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi #requires grib_util module @@ -69,3 +73,4 @@ $executable > reg2grb2.$CDATE.$IDATE.out grid2p05="0 6 0 0 0 0 0 0 720 361 0 0 90000000 0 48 -90000000 359500000 500000 500000 0" #### $NWPROD/util/exec/copygb2 -g "${grid2p05}" -i0 -x $outfile $outfile0p5 $COPYGB2 -g "${grid2p05}" -i0 -x $outfile $outfile0p5 + diff --git a/scripts/run_regrid.sh b/scripts/run_regrid.sh index 2e59e0aafe4..ea50a432457 100755 --- a/scripts/run_regrid.sh +++ b/scripts/run_regrid.sh @@ -1,7 +1,10 @@ -#!/bin/bash -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi -echo "Entered $0" MOM6REGRID=${MOM6REGRID:-$HOMEgfs} export EXEC_DIR=$MOM6REGRID/exec export USH_DIR=$MOM6REGRID/ush @@ -23,3 +26,4 @@ ls -alrt $NCL $USH_DIR/icepost.ncl $NCL $USH_DIR/ocnpost.ncl ##################################################################### + diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 1ac7ad5b56e..8fda0799958 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -221,9 +221,9 @@ if [ -d ../sorc/gsi_monitor.fd ]; then $LINK ../sorc/gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/ush/radmon_verf_bcoef.sh . $LINK ../sorc/gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/ush/radmon_verf_bcor.sh . $LINK ../sorc/gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/ush/radmon_verf_time.sh . + $LINK ../sorc/gsi_monitor.fd/src/Radiance_Monitor/nwprod/radmon_shared/ush/rstprod.sh . fi - #------------------------------ #--link executables #------------------------------ diff --git a/ush/cplvalidate.sh b/ush/cplvalidate.sh index 29db7b3ad92..754fa72102a 100755 --- a/ush/cplvalidate.sh +++ b/ush/cplvalidate.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ##### ## This script validates $confignamevarfornems diff --git a/ush/drive_makeprepbufr.sh b/ush/drive_makeprepbufr.sh index e945b367433..15d95d1b115 100755 --- a/ush/drive_makeprepbufr.sh +++ b/ush/drive_makeprepbufr.sh @@ -1,4 +1,5 @@ -#!/bin/sh -x +#! /usr/bin/env bash + ############################################################### # < next few lines under version control, D O N O T E D I T > # $Date$ @@ -17,6 +18,11 @@ ## CDUMP : cycle name (gdas / gfs) ############################################################### +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + ############################################################### # Source relevant configs configs="base prep prepbufr" @@ -135,4 +141,5 @@ $NCP $DATA/prepbufr.acft_profiles $COMOUT/${APREFIX}prepbufr.acft_profiles ############################################################### # Exit out cleanly if [ $KEEPDATA = "NO" ] ; then rm -rf $DATA ; fi + exit 0 diff --git a/ush/forecast_det.sh b/ush/forecast_det.sh index 206fa1884cc..f3823cde992 100755 --- a/ush/forecast_det.sh +++ b/ush/forecast_det.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ##### ## "forecast_det.sh" @@ -8,7 +8,6 @@ ## This script is a definition of functions. ##### - # For all non-evironment variables # Cycling and forecast hour specific parameters diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 140e41ba558..4a5d722e5ca 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ##### ## This script defines functions for data I/O and namelist. @@ -91,7 +91,7 @@ EOF exit 1 fi $NLN $increment_file $DATA/INPUT/fv_increment$i.nc - IAU_INC_FILES="'fv_increment$i.nc',$IAU_INC_FILES" + IAU_INC_FILES="'fv_increment$i.nc',${IAU_INC_FILES:-}" done read_increment=".false." res_latlon_dynamics="" @@ -643,7 +643,7 @@ WW3_postdet() { export WRDIR=${ROTDIR}/${CDUMPRSTwave}.${WRPDY}/${WRcyc}/wave/restart export RSTDIR_WAVE=$ROTDIR/${CDUMP}.${PDY}/${cyc}/wave/restart export datwave=$COMOUTwave/rundata - export wavprfx=${CDUMPwave}${WAV_MEMBER} + export wavprfx=${CDUMPwave}${WAV_MEMBER:-} #Copy initial condition files: for wavGRD in $waveGRD ; do @@ -820,7 +820,7 @@ MOM6_postdet() { if [ $fhr = 'anl' ]; then continue fi - if [ -z $last_fhr ]; then + if [ -z ${last_fhr:-} ]; then last_fhr=$fhr continue fi diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index ac536d72de7..12496af3520 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ##### ## "forecast_def.sh" @@ -8,7 +8,6 @@ ## This script is a definition of functions. ##### - # For all non-evironment variables # Cycling and forecast hour specific parameters common_predet(){ @@ -125,9 +124,9 @@ FV3_GFS_predet(){ cores_per_node=${cores_per_node:-${npe_node_fcst:-24}} ntiles=${ntiles:-6} if [ $MEMBER -lt 0 ]; then - NTASKS_TOT=${NTASKS_TOT:-$npe_fcst_gfs} + NTASKS_TOT=${NTASKS_TOT:-${npe_fcst_gfs:-0}} else - NTASKS_TOT=${NTASKS_TOT:-$npe_efcs} + NTASKS_TOT=${NTASKS_TOT:-${npe_efcs:-0}} fi TYPE=${TYPE:-"nh"} # choices: nh, hydro diff --git a/ush/fv3gfs_downstream_nems.sh b/ush/fv3gfs_downstream_nems.sh index 3138fe75f0c..124e0dc14ed 100755 --- a/ush/fv3gfs_downstream_nems.sh +++ b/ush/fv3gfs_downstream_nems.sh @@ -1,5 +1,4 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash #----------------------------------------------------------------------- #-Hui-Ya Chuang, January 2014: First version. @@ -31,8 +30,10 @@ set -x # 1. Modify sea icea cover via land-sea mask. #----------------------------------------------------------------------- - -echo "!!!!!CREATING $RUN DOWNSTREAM PRODUCTS FOR FH = $FH !!!!!!" +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT $FH +fi export downset=${downset:-1} export DATA=${DATA:-/ptmpd2/$LOGNAME/test} @@ -134,16 +135,27 @@ while [ $nset -le $totalset ]; do # if final record of each piece is ugrd, add vgrd # copygb will only interpolate u and v together #$WGRIB2 -d $end $tmpfile |grep -i ugrd - $WGRIB2 -d $end $tmpfile |egrep -i "ugrd|ustm|uflx|u-gwd" + # grep returns 1 if no match is found, so temporarily turn off exit on non-zero rc + set +e + $WGRIB2 -d $end $tmpfile | egrep -i "ugrd|ustm|uflx|u-gwd" export rc=$? + ${ERR_EXIT_ON:-set -eu} if [[ $rc -eq 0 ]] ; then export end=$(expr ${end} + 1) + elif [[ $rc -gt 1 ]]; then + echo "FATAL: WGRIB2 failed with error code ${rc}" + exit $rc fi # if final record is land, add next record icec - $WGRIB2 -d $end $tmpfile |egrep -i "land" + set +e + $WGRIB2 -d $end $tmpfile | egrep -i "land" export rc=$? + ${ERR_EXIT_ON:-set -eu} if [[ $rc -eq 0 ]] ; then export end=$(expr ${end} + 1) + elif [[ $rc -gt 1 ]]; then + echo "FATAL: WGRIB2 failed with error code ${rc}" + exit $rc fi if [ $iproc -eq $nproc ]; then export end=$ncount @@ -180,6 +192,7 @@ while [ $nset -le $totalset ]; do echo "$nm $line" >> $DATA/poescript_srun nm=$((nm+1)) done + nm=$(wc -l < $DATA/poescript_srun) ${launcher:-"srun --export=ALL"} -n $nm --multi-prog $DATA/poescript_srun else $launcher @@ -287,8 +300,4 @@ while [ $nset -le $totalset ]; do export nset=$(expr $nset + 1 ) done -echo "!!!!!!CREATION OF SELECT $RUN DOWNSTREAM PRODUCTS COMPLETED FOR FHR = $FH !!!!!!!" -#--------------------------------------------------------------- - - exit 0 diff --git a/ush/fv3gfs_dwn_nems.sh b/ush/fv3gfs_dwn_nems.sh index b49daee45c4..94af24a4d8e 100755 --- a/ush/fv3gfs_dwn_nems.sh +++ b/ush/fv3gfs_dwn_nems.sh @@ -1,5 +1,4 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash # this script generates 0.25/0.5/1/2.5 deg pgb files for each small Grib file # Hui-Ya Chuang 01/2014: First Version @@ -12,6 +11,11 @@ set -x # Wen Meng 10/2019: Use bilinear interpolation for LAND, It can trancate land-sea mask as 0 or 1. # Wen Meng 11/2019: Teak sea ice cover via land-sea mask. +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + export tmpfile=$1 export fhr3=$2 export iproc=$3 @@ -42,6 +46,7 @@ export grid2p5="latlon 0:144:2.5 90:73:-2.5" export PGB1F=${PGB1F:-"NO"} export PGBS=${PGBS:-"NO"} +optncpu=${optncpu:-} if [ $nset = 1 ]; then if [ "$PGBS" = "YES" ]; then @@ -105,5 +110,3 @@ fi # $CNVGRIB -g21 pgb2file_${fhr3}_${iproc}_1p0 pgbfile_${fhr3}_${iproc}_1p0 # $CNVGRIB -g21 pgb2file_${fhr3}_${iproc}_2p5 pgbfile_${fhr3}_${iproc}_2p5 #---------------------------------------------------------------------------------------------- - -exit 0 diff --git a/ush/fv3gfs_nc2nemsio.sh b/ush/fv3gfs_nc2nemsio.sh index 4b239e18a35..c2382503d9c 100755 --- a/ush/fv3gfs_nc2nemsio.sh +++ b/ush/fv3gfs_nc2nemsio.sh @@ -1,5 +1,5 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + #---------------------------------------------------------------------------- #--Fanglin Yang, October 2016: convert FV3 NetCDF files to NEMSIO format. # Note FV3 lat-lon grid is located at the center of each grid box, @@ -8,6 +8,11 @@ set -x # X(1,1)=[0.25E,89.75S], X(nlon,nlat)=[359.75E,89.75N] #--------------------------------------------------------------------------- +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + export CDATE=${CDATE:-"2016100300"} export GG=${master_grid:-"0p25deg"} # 1deg 0p5deg 0p25deg 0p125deg export FHZER=${FHZER:-6} # accumulation bucket in hours @@ -67,5 +72,5 @@ for fhour in $(echo $fdiag | sed "s/,/ /g"); do done #--------------------------------------------------- -echo $(date) EXITING $0 with return code $err >&2 + exit $err diff --git a/ush/fv3gfs_regrid_nemsio.sh b/ush/fv3gfs_regrid_nemsio.sh index d43f5a5503b..df92864b338 100755 --- a/ush/fv3gfs_regrid_nemsio.sh +++ b/ush/fv3gfs_regrid_nemsio.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ################################################################################ # UNIX Script Documentation Block @@ -20,11 +20,9 @@ # Machine: WCOSS-CRAY, Theia ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = YES ] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi #------------------------------------------------------- @@ -121,8 +119,5 @@ for ftype in atm sfc; do done #------------------------------------------------------------------ -set +x -if [ $VERBOSE = "YES" ] ; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err diff --git a/ush/fv3gfs_remap.sh b/ush/fv3gfs_remap.sh index d5258e0975b..32361782a2d 100755 --- a/ush/fv3gfs_remap.sh +++ b/ush/fv3gfs_remap.sh @@ -1,11 +1,15 @@ -#!/bin/ksh -set -ax +#! /usr/bin/env bash #-------------------------------------- #-- remap FV3 6 tiles to global array #-- Fanglin Yang, October 2016 #-------------------------------------- +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + export CDATE=${CDATE:-"2016100300"} export CASE=${CASE:-"C192"} # C48 C96 C192 C384 C768 C1152 C3072 export GG=${master_grid:-"0p25deg"} # 1deg 0p5deg 0p25deg 0p125deg @@ -114,6 +118,5 @@ for type in atmos_4xdaily nggps2d nggps3d ; do done -echo $(date) EXITING $0 with return code $err >&2 exit $err diff --git a/ush/fv3gfs_remap_weights.sh b/ush/fv3gfs_remap_weights.sh index a4140a7c88e..15dfc73e3f0 100755 --- a/ush/fv3gfs_remap_weights.sh +++ b/ush/fv3gfs_remap_weights.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash #BSUB -L /bin/sh #BSUB -P FV3GFS-T2O #BSUB -oo log.weights diff --git a/ush/gaussian_sfcanl.sh b/ush/gaussian_sfcanl.sh index 866cd6d255d..63d18aacf80 100755 --- a/ush/gaussian_sfcanl.sh +++ b/ush/gaussian_sfcanl.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################################ #### UNIX Script Documentation Block # . . @@ -109,11 +110,9 @@ # ################################################################################ -# Set environment. -VERBOSE=${VERBOSE:-"NO"} -if [[ "$VERBOSE" = "YES" ]] ; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi CASE=${CASE:-C768} @@ -144,7 +143,7 @@ DATA=${DATA:-$(pwd)} COMOUT=${COMOUT:-$(pwd)} # Filenames. -XC=${XC} +XC=${XC:-} GAUSFCANLEXE=${GAUSFCANLEXE:-$EXECgfs/gaussian_sfcanl.exe} SIGLEVEL=${SIGLEVEL:-$FIXam/global_hyblev.l${LEVSP1}.txt} @@ -160,7 +159,7 @@ export REDERR=${REDERR:-'2>'} # Set defaults ################################################################################ # Preprocessing -$INISCRIPT +${INISCRIPT:-} pwd=$(pwd) if [[ -d $DATA ]] then @@ -236,10 +235,5 @@ $ERRSCRIPT||exit 2 # Postprocessing cd $pwd [[ $mkdata = YES ]]&&rmdir $DATA -$ENDSCRIPT -set +x -if [[ "$VERBOSE" = "YES" ]] -then - echo $(date) EXITING $0 with return code $err >&2 -fi -exit $err + +exit ${err} diff --git a/ush/getdump.sh b/ush/getdump.sh index e5487e34a26..0b284204363 100755 --- a/ush/getdump.sh +++ b/ush/getdump.sh @@ -1,5 +1,9 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi COMPONENT=${COMPONENT:-atmos} @@ -38,6 +42,3 @@ else fi exit 0 - - - diff --git a/ush/getges.sh b/ush/getges.sh index 62ce0eea3fe..51a9650d7a1 100755 --- a/ush/getges.sh +++ b/ush/getges.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################################ # # Name: getges.sh Author: Mark Iredell @@ -74,6 +75,12 @@ # ################################################################################ #------------------------------------------------------------------------------- + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + # Set some default parameters. fhbeg=03 # hour to begin searching backward for guess fhinc=03 # hour to increment backward in search @@ -151,7 +158,7 @@ if [[ $gfile = '?' || $# -gt 1 || $err -ne 0 || -z $valid ||\ fi exit 1 fi -[[ $quiet = NO ]]&&set -x + if [[ $envir != prod && $envir != test && $envir != para && $envir != dump && $envir != pr? && $envir != dev ]];then netwk=$envir envir=prod @@ -1345,8 +1352,9 @@ while [[ $fh -le $fhend ]];do ghp2=$fhp2;[[ $ghp2 -lt 100 ]]&&ghp2=0$ghp2 ghp3=$fhp3;[[ $ghp3 -lt 100 ]]&&ghp3=0$ghp3 id=$($NDATE -$fh $valid) - typeset -L8 day=$id - typeset -R2 cyc=$id + + day=$(echo $id | xargs | cut -c8) + cyc=$(echo $id | xargs | rev | cut -c1-2 | rev) eval list=\$getlist$fh [[ -z "$list" ]]&&list=${geslist} for ges_var in $list;do @@ -1369,8 +1377,10 @@ fi # Either copy guess to a file or write guess name to standard output. if [[ -z "$gfile" ]];then echo $ges - exit $? + err=$? else cp $ges $gfile - exit $? + err=$? fi + +exit ${err} diff --git a/ush/gfs_bfr2gpk.sh b/ush/gfs_bfr2gpk.sh index 5971817f004..9344a3740bf 100755 --- a/ush/gfs_bfr2gpk.sh +++ b/ush/gfs_bfr2gpk.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#! /usr/bin/env bash + ######################################################################### # # # Script: gfs_bfr2gpk # @@ -9,7 +10,10 @@ # Log: # # K. Brill/HPC 04/12/05 # ######################################################################### -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi # Set GEMPAK paths. diff --git a/ush/gfs_bufr.sh b/ush/gfs_bufr.sh index 5788bbcc436..60e9bc38970 100755 --- a/ush/gfs_bufr.sh +++ b/ush/gfs_bufr.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + # # UTILITY SCRIPT NAME : gfsbufr.sh # AUTHOR : Hua-Lu Pan @@ -16,10 +17,12 @@ # 2018-05-22 Guang Ping Lou: Making it work for both GFS and FV3GFS # 2018-05-30 Guang Ping Lou: Make sure all files are available. # 2019-10-10 Guang Ping Lou: Read in NetCDF files -echo "History: February 2003 - First implementation of this utility script" +# echo "History: February 2003 - First implementation of this utility script" # - -set -ax +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi if test "$F00FLAG" = "YES" then @@ -112,4 +115,6 @@ ln -sf ${STNLIST:-$PARMbufrsnd/bufr_stalist.meteo.gfs} fort.8 ln -sf $PARMbufrsnd/bufr_ij13km.txt fort.7 ${APRUN_POSTSND} $EXECbufrsnd/gfs_bufr < gfsparm > out_gfs_bufr_$FEND -export err=$?;err_chk +export err=$? + +exit ${err} diff --git a/ush/gfs_bufr_netcdf.sh b/ush/gfs_bufr_netcdf.sh index 9733e02c3d7..da3d72f744b 100755 --- a/ush/gfs_bufr_netcdf.sh +++ b/ush/gfs_bufr_netcdf.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + # # UTILITY SCRIPT NAME : gfsbufr.sh # AUTHOR : Hua-Lu Pan @@ -16,10 +17,12 @@ # 2018-05-22 Guang Ping Lou: Making it work for both GFS and FV3GFS # 2018-05-30 Guang Ping Lou: Make sure all files are available. # 2019-10-10 Guang Ping Lou: Read in NetCDF files -echo "History: February 2003 - First implementation of this utility script" +# echo "History: February 2003 - First implementation of this utility script" # - -set -ax +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi if test "$F00FLAG" = "YES" then @@ -112,4 +115,6 @@ ln -sf ${STNLIST:-$PARMbufrsnd/bufr_stalist.meteo.gfs} fort.8 ln -sf $PARMbufrsnd/bufr_ij13km.txt fort.7 ${APRUN_POSTSND} $EXECbufrsnd/gfs_bufr < gfsparm > out_gfs_bufr_$FEND -export err=$?;err_chk +export err=$? + +exit ${err} diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index 6c75572d100..be34672ade1 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash ################################################################################ #### UNIX Script Documentation Block @@ -187,16 +188,16 @@ #### ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"NO"} -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi + # Command line arguments. -export SIGINP=${1:-${SIGINP}} -export FLXINP=${2:-${FLXINP}} -export FLXIOUT=${3:-${FLXIOUT}} -export PGBOUT=${4:-${PGBOUT}} +export SIGINP=${1:-${SIGINP:-}} +export FLXINP=${2:-${FLXINP:-}} +export FLXIOUT=${3:-${FLXIOUT:-}} +export PGBOUT=${4:-${PGBOUT:-}} #export PGIOUT=${5:-${PGIOUT}} export PGIOUT=${PGIOUT:-pgb.idx} export IO=${6:-${IO:-0}} @@ -210,15 +211,15 @@ export EXECgfs=${EXECgfs:-$NWPROD/exec} export USHgfs=${USHgfs:-$NWPROD/ush} export DATA=${DATA:-$(pwd)} # Filenames. -export MP=${MP:-$([[ $LOADL_STEP_TYPE = PARALLEL ]]&&echo "p"||echo "s")} -export XC=${XC} +export MP=${MP:-$([[ ${LOADL_STEP_TYPE:-SERIAL} = PARALLEL ]]&&echo "p"||echo "s")} +export XC=${XC:-} export POSTGPEXEC=${POSTGPEXEC:-${EXECgfs}/gfs_ncep_post} export OVERPARMEXEC=${OVERPARMEXEC:-${EXECgfs}/overparm_grib} export POSTGPLIST=${POSTGPLIST:-/dev/null} -export INISCRIPT=${INISCRIPT} +export INISCRIPT=${INISCRIPT:-} export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'} -export LOGSCRIPT=${LOGSCRIPT} -export ENDSCRIPT=${ENDSCRIPT} +export LOGSCRIPT=${LOGSCRIPT:-} +export ENDSCRIPT=${ENDSCRIPT:-} export GFSOUT=${GFSOUT:-gfsout} export CTLFILE=${CTLFILE:-$NWPROD/parm/gfs_cntrl.parm} #export MODEL_OUT_FORM=${MODEL_OUT_FORM:-binarynemsiompiio} @@ -236,15 +237,13 @@ export GENPSICHI=${GENPSICHI:-NO} export GENPSICHIEXE=${GENPSICHIEXE:-${EXECgfs}/genpsiandchi} export ens=${ens:-NO} #export D3DINP=${D3DINP:-/dev/null} -typeset -L1 l=$PGMOUT +l=$(echo $PGMOUT | xargs | cut -c1) [[ $l = '&' ]]&&a=''||a='>' export REDOUT=${REDOUT:-'1>'$a} -typeset -L1 l=$PGMERR +l=$(echo $PGMERR | xargs | cut -c1) [[ $l = '&' ]]&&a=''||a='>' export REDERR=${REDERR:-'2>'$a} ################################################################################ -# Preprocessing -$INISCRIPT # Chuang: Run chgres if OUTTYP=1 or 0 @@ -420,9 +419,5 @@ fi # Postprocessing cd $pwd [[ $mkdata = YES ]]&&rmdir $DATA -$ENDSCRIPT -set +x -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err diff --git a/ush/gfs_sndp.sh b/ush/gfs_sndp.sh index 53bc6fd9d67..d222e36c7cd 100755 --- a/ush/gfs_sndp.sh +++ b/ush/gfs_sndp.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + ################################################################ # Script Name: gfs_sndp.sh # Script Description: Format GFS BUFR sounding files for AWIPS @@ -6,7 +7,10 @@ # 1) 2004-09-10 Steve Gilbert First Implementation ################################################################ -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi # Create "collectives" consisting of groupings of the soundings # into files designated by geographical region. Each input @@ -16,7 +20,6 @@ export m=$1 mkdir $DATA/$m cd $DATA/$m cp $FIXbufrsnd/gfs_collective${m}.list $DATA/$m/. -set +x CCCC=KWBC file_list=gfs_collective${m}.list @@ -60,7 +63,6 @@ EOF rm $DATA/${m}/bufrout done -set -x # if test $SENDCOM = 'NO' if test $SENDCOM = 'YES' then @@ -71,8 +73,3 @@ set -x cp $DATA/${m}/gfs_collective$m.fil ${COMOUT}/bufr.${cycle}/. fi -## let "m=m+1" - -## done - -#exit diff --git a/ush/gfs_transfer.sh b/ush/gfs_transfer.sh index f8b00ea6230..480e3681616 100755 --- a/ush/gfs_transfer.sh +++ b/ush/gfs_transfer.sh @@ -1,21 +1,25 @@ -#!/bin/ksh +#! /usr/bin/env bash ##################################################################### -echo "-----------------------------------------------------" -echo " Script: gfs_transfer.sh" -echo " " -echo " Purpose - Copy GFS Posts to /nwges and /com" -echo " Alert posted files to DBNet" -echo " " -echo " History - " -echo " Cooke - 04/21/05 - Inital version, based off of" -echo " global_transfer.sh" -echo " Meng - 01/04/18 - Remove writing data file to /nwges." -echo " Meng - 09/14/20 - Update model output format to netcdf for GFS V16" -echo "-----------------------------------------------------" +# echo "-----------------------------------------------------" +# echo " Script: gfs_transfer.sh" +# echo " " +# echo " Purpose - Copy GFS Posts to /nwges and /com" +# echo " Alert posted files to DBNet" +# echo " " +# echo " History - " +# echo " Cooke - 04/21/05 - Inital version, based off of" +# echo " global_transfer.sh" +# echo " Meng - 01/04/18 - Remove writing data file to /nwges." +# echo " Meng - 09/14/20 - Update model output format to netcdf for GFS V16" +# echo "-----------------------------------------------------" ##################################################################### -set -xa - + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + # export CNVGRIB=/nwprod/util/exec/cnvgrib # export GRB2INDX=/nwprod/util/exec/grb2index # export WGRIB2=/nwprod/util/exec/wgrib2 diff --git a/ush/gfs_truncate_enkf.sh b/ush/gfs_truncate_enkf.sh index 8d9e2b959c5..5b3a363bed8 100755 --- a/ush/gfs_truncate_enkf.sh +++ b/ush/gfs_truncate_enkf.sh @@ -1,6 +1,9 @@ -#!/bin/ksh +#! /usr/bin/env bash -set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi member=$1 export SIGINP=$2 @@ -45,12 +48,11 @@ export APRUNC=${APRUNC:-""} export VERBOSE=YES echo "execute $CHGRESSH for $member" -eval "$CHGRESSH" +$CHGRESSH rc=$? export ERR=$rc export err=$ERR -echo EXITING $0 with return code $err exit $err diff --git a/ush/global_extrkr.sh b/ush/global_extrkr.sh index 67624a9898e..ebc438f8523 100755 --- a/ush/global_extrkr.sh +++ b/ush/global_extrkr.sh @@ -1,54 +1,54 @@ -#!/bin/ksh +#! /usr/bin/env bash -#module load ics -export PS4='+t+$SECONDS extrkr.sh:$LINENO -- ' +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi userid=$LOGNAME -set +x ############################################################################## -cat< $(date)" -set -x +${TRACE_ON:-set -x} set +x echo " " echo "TIMING: Before call to gettrk at $(date)" echo " " -set -x +${TRACE_ON:-set -x} ##/usrx/local/bin/getrusage -a /hwrf/save/Qingfu.Liu/trak/para/exec/gettrk <${namelist} @@ -1462,11 +1459,11 @@ set +x echo " " echo "TIMING: After call to gettrk at $(date)" echo " " -set -x +${TRACE_ON:-set -x} set +x echo "+++ TIMING: AFTER gettrk ---> $(date)" -set -x +${TRACE_ON:-set -x} #--------------------------------------------------------------# # Send a message to the jlogfile for each storm that used @@ -1496,7 +1493,7 @@ echo " -----------------------------------------------" echo " NOW COPYING OUTPUT TRACK FILES TO COM " echo " -----------------------------------------------" echo " " -set -x +${TRACE_ON:-set -x} if [[ ! -e "$track_file_path" ]] ; then $postmsg "$jlogfile" "WARNING: tracker output file does not exist. This is probably an error. File: $track_file_path" @@ -1665,12 +1662,12 @@ if [ ${gettrk_rcc} -eq 0 ]; then echo " " echo "+++ Adding records to TPC ATCFUNIX directory: /tpcprd/atcf_unix/${at}${NO}${syyyy}" echo " " - set -x + ${TRACE_ON:-set -x} else set +x echo " " echo "There is no TPC ATCFUNIX directory for: /tpcprd/atcf_unix/${at}${NO}${syyyy}" - set -x + ${TRACE_ON:-set -x} fi done fi @@ -1697,7 +1694,7 @@ else echo "!!! model= ${atcfout}, forecast initial time = ${PDY}${CYL}" echo "!!! Exiting...." echo " " - set -x + ${TRACE_ON:-set -x} err_exit " FAILED ${jobid} - ERROR RUNNING GETTRK IN TRACKER SCRIPT- ABNORMAL EXIT" fi diff --git a/ush/global_nceppost.sh b/ush/global_nceppost.sh index cbc9ba6cccb..31bc757028e 100755 --- a/ush/global_nceppost.sh +++ b/ush/global_nceppost.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash ################################################################################ #### UNIX Script Documentation Block @@ -183,11 +184,11 @@ #### ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"NO"} -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXECUTING $0 $* >&2 - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT fi + # Command line arguments. export SIGINP=${1:-${SIGINP}} export FLXINP=${2:-${FLXINP}} @@ -233,15 +234,13 @@ export GENPSICHI=${GENPSICHI:-NO} export GENPSICHIEXE=${GENPSICHIEXE:-${EXECglobal}/genpsiandchi} export ens=${ens:-NO} #export D3DINP=${D3DINP:-/dev/null} -typeset -L1 l=$PGMOUT +l=$(echo $PGMOUT | xargs | cut -c1) [[ $l = '&' ]]&&a=''||a='>' export REDOUT=${REDOUT:-'1>'$a} -typeset -L1 l=$PGMERR +l=$(echo $PGMERR | xargs | cut -c1) [[ $l = '&' ]]&&a=''||a='>' export REDERR=${REDERR:-'2>'$a} ################################################################################ -# Preprocessing -$INISCRIPT # Chuang: Run chgres if OUTTYP=1 or 0 @@ -484,9 +483,5 @@ fi # Postprocessing cd $pwd [[ $mkdata = YES ]]&&rmdir $DATA -$ENDSCRIPT -set +x -if [[ "$VERBOSE" = "YES" ]]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err diff --git a/ush/global_savefits.sh b/ush/global_savefits.sh index 9efbf778af9..ec823067d13 100755 --- a/ush/global_savefits.sh +++ b/ush/global_savefits.sh @@ -1,9 +1,13 @@ -#!/bin/ksh -set -xeua +#! /usr/bin/env bash ######################################################## # save fit and horiz files for all analysis cycles ######################################################## +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + export FIT_DIR=${FIT_DIR:-$COMOUT/fits} export HORZ_DIR=${HORZ_DIR:-$COMOUT/horiz} export fh1=06 diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index ab90f3351a9..434aae408f7 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -1,11 +1,13 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash ################################################### # Fanglin Yang, 20180318 # --create bunches of files to be archived to HPSS ################################################### - +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi type=${1:-gfs} ##gfs, gdas, enkfgdas or enkfggfs diff --git a/ush/inter_flux.sh b/ush/inter_flux.sh index 98a9248cafa..a0132ff18aa 100755 --- a/ush/inter_flux.sh +++ b/ush/inter_flux.sh @@ -1,5 +1,9 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT $FH +fi #----------------------------------------------------------------------- #-Wen Meng, 03/2019: First version. @@ -7,9 +11,6 @@ set -x # into lat-lon grids. #----------------------------------------------------------------------- - -echo "!!!!!CREATING $RUN FLUX PRODUCTS FOR FH = $FH !!!!!!" - export CNVGRIB=${CNVGRIB:-${NWPROD:-/nwprod}/util/exec/cnvgrib21} export COPYGB2=${COPYGB2:-${NWPROD:-/nwprod}/util/exec/copygb2} export WGRIB2=${WGRIB2:-${NWPROD:-/nwprod}/util/exec/wgrib2} @@ -62,7 +63,10 @@ fi cp fluxfile_${fhr3}_1p00 $COMOUT/${PREFIX}flux.1p00.f${fhr3} #--------------------------------------------------------------- -echo "!!!!!CREATION OF SELECT $RUN FLUX PRODUCTS COMPLETED FOR FHR = $FH !!!!!" +POSTAMBLE_SCRIPT="${POSTAMBLE_SCRIPT:-$HOMEgfs/ush/postamble.sh}" +if [ -f "${POSTAMBLE_SCRIPT}" ]; then + source $POSTAMBLE_SCRIPT +fi #--------------------------------------------------------------- diff --git a/ush/link_crtm_fix.sh b/ush/link_crtm_fix.sh index 3307b5f6dd6..981b263c6c7 100755 --- a/ush/link_crtm_fix.sh +++ b/ush/link_crtm_fix.sh @@ -1,4 +1,9 @@ -#! /bin/sh +#! /usr/bin/env bash + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi # Get CRTM fix directory from (in this order): # 1. First argument to script, or diff --git a/ush/load_fv3gfs_modules.sh b/ush/load_fv3gfs_modules.sh index 2f1a301db02..d598de390c4 100755 --- a/ush/load_fv3gfs_modules.sh +++ b/ush/load_fv3gfs_modules.sh @@ -1,13 +1,15 @@ -#!/bin/sh -#set -x +#! /usr/bin/env bash ############################################################### +if [[ "${DEBUG_WORKFLOW:-NO}" == "NO" ]]; then + echo "Loading modules quietly..." + set +x +fi + # Setup runtime environment by loading modules ulimit_s=$( ulimit -S -s ) #ulimit -S -s 10000 -set +x - # Find module command and purge: source "$HOMEgfs/modulefiles/module-setup.sh.inc" @@ -42,8 +44,8 @@ else echo WARNING: UNKNOWN PLATFORM fi -set -x - # Restore stack soft limit: ulimit -S -s "$ulimit_s" unset ulimit_s + +${TRACE_ON:-set -x} diff --git a/ush/mod_icec.sh b/ush/mod_icec.sh index bb8c22182f3..5da8ae7eea9 100755 --- a/ush/mod_icec.sh +++ b/ush/mod_icec.sh @@ -1,13 +1,18 @@ -#!/bin/sh -set -x +#! /usr/bin/env bash + #This script is used for modifing icee via land-sea mask #Wen Meng 11/2019: First Version +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + f=$1 export WGRIB2=${WGRIB2:-${NWPROD:-/nwprod}/util/exec/wgrib2} -$WGRIB2 $optncpu $f \ +$WGRIB2 ${optncpu:-} $f \ -if 'LAND' -rpn 'sto_1' -fi \ -if 'ICEC' -rpn 'rcl_1:0:==:*' -fi \ -set_grib_type same \ @@ -17,7 +22,3 @@ export err=$?; err_chk mv $f.new $f exit 0 - -#-if 'ICEC' -rpn 'rcl_1:-1:*:1:+:*' -fi \ - - diff --git a/ush/nems_configure.sh b/ush/nems_configure.sh index 990272a41fe..04fea90f354 100755 --- a/ush/nems_configure.sh +++ b/ush/nems_configure.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /usr/bin/env bash ##### ## This script writes nems.configure file diff --git a/ush/parsing_model_configure_DATM.sh b/ush/parsing_model_configure_DATM.sh index a2e7c8c9185..ecd3fa6dd6a 100755 --- a/ush/parsing_model_configure_DATM.sh +++ b/ush/parsing_model_configure_DATM.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash ##### ## "parsing_model_configure_DATM.sh" diff --git a/ush/parsing_model_configure_FV3.sh b/ush/parsing_model_configure_FV3.sh index 4c35179e905..4574b6e3528 100755 --- a/ush/parsing_model_configure_FV3.sh +++ b/ush/parsing_model_configure_FV3.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /usr/bin/env bash ##### ## "parsing_model_configure_FV3.sh" diff --git a/ush/parsing_namelists_CICE.sh b/ush/parsing_namelists_CICE.sh index 0c7dbd0d430..f7e00fd0700 100755 --- a/ush/parsing_namelists_CICE.sh +++ b/ush/parsing_namelists_CICE.sh @@ -1,3 +1,5 @@ +#! /usr/bin/env bash + # parsing namelist of CICE CICE_namelists(){ diff --git a/ush/parsing_namelists_FV3.sh b/ush/parsing_namelists_FV3.sh index 63e46dc20ab..41fdb04f1bc 100755 --- a/ush/parsing_namelists_FV3.sh +++ b/ush/parsing_namelists_FV3.sh @@ -1,4 +1,5 @@ -#! /bin/sh +#! /usr/bin/env bash + ##### ## "parsing_namelist_FV3.sh" ## This script writes namelist for FV3 model @@ -34,7 +35,7 @@ EOF cat $DIAG_TABLE >> diag_table fi -if [ ! -z "${AERO_DIAG_TABLE}" ]; then +if [ ! -z "${AERO_DIAG_TABLE:-}" ]; then cat ${AERO_DIAG_TABLE} >> diag_table fi @@ -44,7 +45,7 @@ cat $DIAG_TABLE_APPEND >> diag_table $NCP $DATA_TABLE data_table # build field_table -if [ ! -z "${AERO_FIELD_TABLE}" ]; then +if [ ! -z "${AERO_FIELD_TABLE:-}" ]; then nrec=$( cat ${FIELD_TABLE} | wc -l ) prec=${nrec} if (( dnats > 0 )); then @@ -69,20 +70,20 @@ cat > input.nml < input.nml < input.nml < input.nml <> input.nml <> input.nml <> input.nml <> input.nml << EOF - $nam_stochy_nml + ${nam_stochy_nml:-} / EOF @@ -635,13 +636,13 @@ EOF ISEED_LNDP = ${ISEED_LNDP:-$ISEED} lndp_var_list = ${lndp_var_list} lndp_prt_list = ${lndp_prt_list} - $nam_sfcperts_nml + ${nam_sfcperts_nml:-} / EOF else cat >> input.nml << EOF &nam_sfcperts - $nam_sfcperts_nml + ${nam_sfcperts_nml:-} / EOF fi diff --git a/ush/parsing_namelists_MOM6.sh b/ush/parsing_namelists_MOM6.sh index 617c7744832..49d6ea5ff58 100755 --- a/ush/parsing_namelists_MOM6.sh +++ b/ush/parsing_namelists_MOM6.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash MOM6_namelists(){ diff --git a/ush/parsing_namelists_WW3.sh b/ush/parsing_namelists_WW3.sh index 06d22814bb0..209fe9d11ae 100755 --- a/ush/parsing_namelists_WW3.sh +++ b/ush/parsing_namelists_WW3.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash WW3_namelists(){ @@ -69,7 +70,7 @@ WW3_namelists(){ echo " starting time : $time_beg" echo " ending time : $time_end" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} @@ -107,7 +108,7 @@ WW3_namelists(){ then set +x echo " buoy.loc copied ($PARMwave/wave_${NET}.buoys)." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} else echo " FATAL ERROR : buoy.loc ($PARMwave/wave_${NET}.buoys) NOT FOUND" exit 12 diff --git a/ush/preamble.sh b/ush/preamble.sh new file mode 100644 index 00000000000..396ac654422 --- /dev/null +++ b/ush/preamble.sh @@ -0,0 +1,86 @@ +#! /usr/bin/env bash + +####### +# Preamble script to be SOURCED at the beginning of every script. Sets +# useful PS4 and optionally turns on set -x and set -eu. Also sets up +# crude script timing and provides a postamble that runs on exit. +# +# Syntax: +# preamble.sh [id] +# +# Aruguments: +# id: Optional identifier string. Use when running the same script +# multiple times in the same job (e.g. MPMD) +# +# Input environment variables: +# TRACE (YES/NO): Whether to echo every command (set -x) [default: "YES"] +# STRICT (YES/NO): Whether to exit immediately on error or undefined variable +# (set -eu) [default: "YES"] +# +####### +set +x +if [[ -v '1' ]]; then + id="(${1})" +else + id="" +fi + +# Record the start time so we can calculate the elapsed time later +start_time=$(date +%s) + +# Get the base name of the calling script +_calling_script=$(basename ${BASH_SOURCE[1]}) + +# Announce the script has begun +echo "Begin ${_calling_script} at $(date -u)" + +# Stage our variables +export STRICT=${STRICT:-"YES"} +export TRACE=${TRACE:-"YES"} +export ERR_EXIT_ON="" +export TRACE_ON="" + +if [[ $STRICT == "YES" ]]; then + # Exit on error and undefined variable + export ERR_EXIT_ON="set -eu" +fi +if [[ $TRACE == "YES" ]]; then + export TRACE_ON="set -x" + # Print the script name and line number of each command as it is executed + export PS4='+ $(basename $BASH_SOURCE)[$LINENO]'"$id: " +fi + +postamble() { + # + # Commands to execute when a script ends. + # + # Syntax: + # postamble script start_time rc + # + # Arguments: + # script: name of the script ending + # start_time: start time of script (in seconds) + # rc: the exit code of the script + # + + set +x + script=${1} + start_time=${2} + rc=${3} + + # Calculate the elapsed time + end_time=$(date +%s) + elapsed_sec=$((end_time - start_time)) + elapsed=$(date -d@${elapsed_sec} -u +%H:%M:%S) + + # Announce the script has ended, then pass the error code up + echo "End ${script} at $(date -u) with error code ${rc:-0} (time elapsed: ${elapsed})" + exit ${rc} +} + +# Place the postable in a trap so it is always called no matter how the script exits +trap "postamble ${_calling_script} ${start_time} \$?" EXIT + +# Turn on our settings +$ERR_EXIT_ON +$TRACE_ON diff --git a/ush/scale_dec.sh b/ush/scale_dec.sh index 8fba2f703b6..63204c11bb7 100755 --- a/ush/scale_dec.sh +++ b/ush/scale_dec.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + # # This script uses WGRIB2 to change binary scale factor # and Decimal scale factor in GRIB2 file @@ -7,7 +8,11 @@ # D = decimal scaling or the text 'same' with no quotes # B = binary scaling or the text 'same' with no quotes # -set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi f=$1 @@ -22,4 +27,5 @@ $WGRIB2 $f -not_if ':(TMP|PWAT|WEASD):' -grib $f.new \ -set_scaling 0 0 -grib_out $f.new export err=$?; err_chk mv $f.new $f + exit 0 diff --git a/ush/syndat_getjtbul.sh b/ush/syndat_getjtbul.sh index dc3c0f6482b..040f4e5e183 100755 --- a/ush/syndat_getjtbul.sh +++ b/ush/syndat_getjtbul.sh @@ -1,3 +1,4 @@ +#! /usr/bin/env bash # Script to recover JTWC Bulletins from Tank # $TANK_TROPCY/$ymddir/wtxtbul/tropcyc @@ -25,8 +26,10 @@ # jlogfile - path to job log file (skipped over by this script if not # passed in) - -set -xua +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi EXECSYND=${EXECSYND:-${HOMESYND}/exec} @@ -39,7 +42,7 @@ positional parameter 1" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout set +u [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" @@ -94,7 +97,7 @@ echo " pdym1 is $pdym1" echo echo " ymddir is $ymddir" echo -set -x +${TRACE_ON:-set -x} find=$ymd" "$hour echo "looking for string $find in $jtwcdir/tropcyc" >> $pgmout @@ -159,7 +162,7 @@ set +x echo echo 'The foreground exit status for SYNDAT_GETJTBUL is ' $errget echo -set -x +${TRACE_ON:-set -x} if [ "$errget" -gt '0' ];then if [ "$errget" -eq '1' ];then msg="No JTWC bulletins in $jtwcdir/tropcyc, no JTWC tcvitals \ @@ -182,7 +185,7 @@ RETURN CODE $errget" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout set +u [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" @@ -194,7 +197,7 @@ rec. passed to qctropcy" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout set +u [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" @@ -206,7 +209,7 @@ echo "----------------------------------------------------------" echo "*********** COMPLETED PROGRAM syndat_getjtbul **********" echo "----------------------------------------------------------" echo -set -x +${TRACE_ON:-set -x} if [ "$errget" -eq '0' ];then echo "Completed JTWC tcvitals records are:" >> $pgmout diff --git a/ush/syndat_qctropcy.sh b/ush/syndat_qctropcy.sh index 1f1f64b5480..8c6633dd49b 100755 --- a/ush/syndat_qctropcy.sh +++ b/ush/syndat_qctropcy.sh @@ -1,5 +1,4 @@ - -set +x +#! /usr/bin/env bash # SCRIPT NAME : syndat_qctropcy.sh # AUTHOR : Steven Lord/Hua-Lu pan/Dennis Keyser/Diane Stokes @@ -12,19 +11,19 @@ set +x # prediction centers by the executable syndat_qctropcy # # -echo "History: JUN 1997 - First implementation of this utility script" -echo " JUL 1997 - Added tcvitals made manually by SDM; Added " -echo " jtwc/fnoc tcvitals " -echo " MAR 2000 Converted to IBM-SP " -echo " MAR 2013 Converted to WCOSS " -echo " Added option files_override which can set " -echo " namelist var used for logical variable " -echo " FILES in syndat_qctropcy to control final " -echo " copying of records and file manipulation. " -echo " (typically F for testing, otherwise not set)" -echo " Added dateck fallback if archive file misg." -echo " OCT 2013 Remove defaults for parm, exec, fix and ush " -echo " directories. These must now be passed in. " +# echo "History: JUN 1997 - First implementation of this utility script" +# echo " JUL 1997 - Added tcvitals made manually by SDM; Added " +# echo " jtwc/fnoc tcvitals " +# echo " MAR 2000 Converted to IBM-SP " +# echo " MAR 2013 Converted to WCOSS " +# echo " Added option files_override which can set " +# echo " namelist var used for logical variable " +# echo " FILES in syndat_qctropcy to control final " +# echo " copying of records and file manipulation. " +# echo " (typically F for testing, otherwise not set)" +# echo " Added dateck fallback if archive file misg." +# echo " OCT 2013 Remove defaults for parm, exec, fix and ush " +# echo " directories. These must now be passed in. " # # # Positional parameters passed in: @@ -72,7 +71,10 @@ echo " directories. These must now be passed in. " # (Default: not set) # TIMEIT - optional time and resource reporting (Default: not set) -set -xua +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ARCHSYND=${ARCHSYND:-$COMROOTp3/gfs/prod/syndat} HOMENHCp1=${HOMENHCp1:-/gpfs/?p1/nhc/save/guidance/storm-data/ncep} @@ -96,11 +98,8 @@ set +x echo echo $msg echo -set -x +${TRACE_ON:-set -x} echo $msg >> $pgmout -set +u -[ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" -set -u if [ "$#" -ne '1' ]; then msg="**NON-FATAL ERROR PROGRAM SYNDAT_QCTROPCY run date not in \ @@ -109,21 +108,15 @@ positional parameter 1" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u msg="**NO TROPICAL CYCLONE tcvitals processed --> non-fatal" set +x echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u # Copy null files into "${COMSP}syndata.tcvitals.$tmmark" and # "${COMSP}jtwc-fnoc.tcvitals.$tmmark" so later ftp attempts will find and @@ -147,7 +140,7 @@ set +x echo echo "Run date is $CDATE10" echo -set -x +${TRACE_ON:-set -x} year=$(echo $CDATE10 | cut -c1-4) @@ -169,11 +162,8 @@ if [ $dateck_size -lt 10 ]; then echo 1900010100 > dateck set +x echo -e "\n${msg}\n" - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u fi @@ -201,11 +191,8 @@ if [ -n "$files_override" ]; then # for testing, typically want FILES=F fi set +x echo -e "\n${msg}\n" - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u fi echo " &INPUT RUNID = '${net}_${tmmark}_${cyc}', FILES = $files " > vitchk.inp @@ -289,28 +276,22 @@ set +x echo echo "The foreground exit status for SYNDAT_QCTROPCY is " $errqct echo -set -x +${TRACE_ON:-set -x} if [ "$errqct" -gt '0' ];then msg="**NON-FATAL ERROR PROGRAM SYNDAT_QCTROPCY RETURN CODE $errqct" set +x echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u msg="**NO TROPICAL CYCLONE tcvitals processed --> non-fatal" set +x echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u # In the event of a ERROR in PROGRAM SYNDAT_QCTROPCY, copy null files into # "${COMSP}syndata.tcvitals.$tmmark" and "${COMSP}jtwc-fnoc.tcvitals.$tmmark" @@ -333,19 +314,7 @@ echo "----------------------------------------------------------" echo "********** COMPLETED PROGRAM syndat_qctropcy **********" echo "----------------------------------------------------------" echo -set -x - -if [ -s current ]; then - msg="program SYNDAT_QCTROPCY completed normally - tcvitals records \ -processed" -else -msg="no records available for program SYNDAT_QCTROPCY - null tcvitals file \ -produced" -fi -set +u -[ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" -set -u - +${TRACE_ON:-set -x} if [ "$copy_back" = 'YES' ]; then cat lthistry>>$ARCHSYND/syndat_lthistry.$year @@ -390,11 +359,8 @@ $HOMENHC/tcvitals successfully updated by syndat_qctropcy" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u fi else @@ -405,11 +371,8 @@ not changed by syndat_qctropcy" echo echo $msg echo - set -x + ${TRACE_ON:-set -x} echo $msg >> $pgmout - set +u - [ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" - set -u fi @@ -428,16 +391,4 @@ fi # Write JTWC/FNOC Tcvitals to /com path since not saved anywhere else [ $SENDCOM = YES ] && cp fnoc ${COMSP}jtwc-fnoc.tcvitals.$tmmark -msg="TROPICAL CYCLONE TCVITALS QC PROCESSING HAS COMPLETED FOR $CDATE10" -set +x -echo -echo $msg -echo -set -x -echo $msg >> $pgmout -echo " " >> $pgmout -set +u -[ -n "$jlogfile" ] && postmsg "$jlogfile" "$msg" -set -u - exit diff --git a/ush/trim_rh.sh b/ush/trim_rh.sh index 9140e97124d..65b2776b9fb 100755 --- a/ush/trim_rh.sh +++ b/ush/trim_rh.sh @@ -1,14 +1,18 @@ -#!/bin/ksh -set -x +#! /usr/bin/env bash #This is scripts is used to trim RH vaule larger than 100. # Wen Meng 12/2017: First Version +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + f=$1 export WGRIB2=${WGRIB2:-${NWPROD:-/nwprod}/util/exec/wgrib2} -$WGRIB2 $optncpu $f -not_if ':RH:' -grib $f.new \ +$WGRIB2 ${optncpu:-} $f -not_if ':RH:' -grib $f.new \ -if ':RH:' -rpn "10:*:0.5:+:floor:1000:min:10:/" -set_grib_type same \ -set_scaling -1 0 -grib_out $f.new export err=$?; err_chk diff --git a/ush/tropcy_relocate.sh b/ush/tropcy_relocate.sh index 44205b18466..059958c8ac4 100755 --- a/ush/tropcy_relocate.sh +++ b/ush/tropcy_relocate.sh @@ -1,4 +1,5 @@ -#!/bin/ksh +#! /usr/bin/env bash + #### UNIX Script Documentation Block # # Script name: tropcy_relocate.sh @@ -210,7 +211,10 @@ # #### -set -aux +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi MACHINE=${MACHINE:-$(hostname -s | cut -c 1-3)} @@ -255,7 +259,7 @@ then echo "problem with obtaining date record;" echo "ABNORMAL EXIT!!!!!!!!!!!" echo - set -x + ${TRACE_ON:-set -x} if [ -s $DATA/err_exit ]; then $DATA/err_exit else @@ -273,7 +277,7 @@ set +x echo echo "CENTER DATE/TIME FOR RELOCATION PROCESSING IS $CDATE10" echo -set -x +${TRACE_ON:-set -x} #---------------------------------------------------------------------------- @@ -343,7 +347,7 @@ if [ $modhr -ne 0 ]; then not a multiple of 3-hrs;" echo "ABNORMAL EXIT!!!!!!!!!!!" echo - set -x + ${TRACE_ON:-set -x} if [ -s $DATA/err_exit ]; then $DATA/err_exit else @@ -366,14 +370,14 @@ echo " Get TCVITALS file valid for -$fhr hrs relative to center" echo " relocation processing date/time" echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} $USHGETGES/getges.sh -e $envir_getges -n $network_getges \ -v $CDATE10 -f $fhr -t tcvges tcvitals.m${fhr} set +x echo echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} fi done @@ -416,7 +420,7 @@ echo " Get global sigma GUESS valid for $fhr hrs relative to center" echo " relocation processing date/time" echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} $USHGETGES/getges.sh -e $envir_getges -n $network_getges \ -v $CDATE10 -t $stype $sges errges=$? @@ -428,7 +432,7 @@ echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" to center relocation date/time;" echo "ABNORMAL EXIT!!!!!!!!!!!" echo - set -x + ${TRACE_ON:-set -x} if [ -s $DATA/err_exit ]; then $DATA/err_exit else @@ -460,7 +464,7 @@ to center relocation date/time;" echo echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} fi if [ ! -s $pges ]; then set +x @@ -470,7 +474,7 @@ echo " Get global pressure grib GUESS valid for $fhr hrs relative to center" echo " relocation processing date/time" echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} $USHGETGES/getges.sh -e $envir_getges -n $network_getges \ -v $CDATE10 -t $ptype $pges errges=$? @@ -482,7 +486,7 @@ echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" relative to center relocation date/time;" echo "ABNORMAL EXIT!!!!!!!!!!!" echo - set -x + ${TRACE_ON:-set -x} if [ -s $DATA/err_exit ]; then $DATA/err_exit else @@ -495,7 +499,7 @@ relative to center relocation date/time;" echo echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" echo - set -x + ${TRACE_ON:-set -x} fi done @@ -567,7 +571,7 @@ else echo "$USHRELO/tropcy_relocate_extrkr.sh failed" echo "ABNORMAL EXIT!!!!!!!!!!!" echo - set -x + ${TRACE_ON:-set -x} if [ -s $DATA/err_exit ]; then $DATA/err_exit "Script $USHRELO/tropcy_relocate_extrkr.sh failed" else @@ -650,7 +654,7 @@ else # check for success # ----------------- - echo; set -x + echo; ${TRACE_ON:-set -x} if [ "$errSTATUS" -gt '0' ]; then if [ -s $DATA/err_exit ]; then $DATA/err_exit "Script RELOCATE_GES failed" @@ -737,5 +741,6 @@ $CDATE10" fi + exit 0 diff --git a/ush/tropcy_relocate_extrkr.sh b/ush/tropcy_relocate_extrkr.sh index a245dca98e2..26d35d2e31a 100755 --- a/ush/tropcy_relocate_extrkr.sh +++ b/ush/tropcy_relocate_extrkr.sh @@ -1,8 +1,12 @@ -#!/bin/ksh +#! /usr/bin/env bash + # This script is executed by the script tropcy_relocate.sh # -------------------------------------------------------- -set -aeux +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi export machine=${machine:-ZEUS} export machine=$(echo $machine|tr '[a-z]' '[A-Z]') @@ -238,7 +242,7 @@ cmodel=$(echo ${cmodel} | tr "[A-Z]" "[a-z]") case ${cmodel} in - gdas) set +x; echo " "; echo " ++ operational GDAS chosen"; set -x; + gdas) set +x; echo " "; echo " ++ operational GDAS chosen"; ${TRACE_ON:-set -x}; fcstlen=9 ; fcsthrs="" for fhr in $( seq 0 $BKGFREQ 9); do @@ -271,48 +275,48 @@ case ${cmodel} in # jpdtn=0 for deterministic data. g2_jpdtn=0 model=8;; - gfs) set +x; echo " "; echo " ++ operational GFS chosen"; set -x; + gfs) set +x; echo " "; echo " ++ operational GFS chosen"; ${TRACE_ON:-set -x}; fcsthrsgfs=' 00 06 12 18 24 30 36 42 48 54 60 66 72 78'; gfsdir=$COMIN; gfsgfile=gfs.t${dishh}z.pgrbf; model=1;; - mrf) set +x; echo " "; echo " ++ operational MRF chosen"; set -x; + mrf) set +x; echo " "; echo " ++ operational MRF chosen"; ${TRACE_ON:-set -x}; fcsthrsmrf=' 00 12 24 36 48 60 72'; mrfdir=$COMIN; mrfgfile=drfmr.t${dishh}z.pgrbf; model=2;; - ukmet) set +x; echo " "; echo " ++ operational UKMET chosen"; set -x; + ukmet) set +x; echo " "; echo " ++ operational UKMET chosen"; ${TRACE_ON:-set -x}; fcsthrsukmet=' 00 12 24 36 48 60 72'; ukmetdir=$COMIN; ukmetgfile=ukmet.t${dishh}z.ukmet; model=3;; - ecmwf) set +x; echo " "; echo " ++ operational ECMWF chosen"; set -x; + ecmwf) set +x; echo " "; echo " ++ operational ECMWF chosen"; ${TRACE_ON:-set -x}; fcsthrsecmwf=' 00 24 48 72'; ecmwfdir=$COMIN; ecmwfgfile=ecmgrb25.t12z; model=4;; - ngm) set +x; echo " "; echo " ++ operational NGM chosen"; set -x; + ngm) set +x; echo " "; echo " ++ operational NGM chosen"; ${TRACE_ON:-set -x}; fcsthrsngm=' 00 06 12 18 24 30 36 42 48'; ngmdir=$COMIN; ngmgfile=ngm.t${dishh}z.pgrb.f; model=5;; - nam) set +x; echo " "; echo " ++ operational Early NAM chosen"; set -x; + nam) set +x; echo " "; echo " ++ operational Early NAM chosen"; ${TRACE_ON:-set -x}; fcsthrsnam=' 00 06 12 18 24 30 36 42 48'; namdir=$COMIN; namgfile=nam.t${dishh}z.awip32; model=6;; - ngps) set +x; echo " "; echo " ++ operational NAVGEM chosen"; set -x; + ngps) set +x; echo " "; echo " ++ operational NAVGEM chosen"; ${TRACE_ON:-set -x}; fcsthrsngps=' 00 12 24 36 48 60 72'; #ngpsdir=/com/hourly/prod/hourly.${CENT}${symd}; ngpsdir=$OMIN; ngpsgfile=fnoc.t${dishh}z; model=7;; other) set +x; echo " "; echo " Model selected by user is ${cmodel}, which is a "; - echo "user-defined model, NOT operational...."; echo " "; set -x; + echo "user-defined model, NOT operational...."; echo " "; ${TRACE_ON:-set -x}; model=9;; *) set +x; echo " "; echo " !!! Model selected is not recognized."; echo " Model= ---> ${cmodel} <--- ..... Please submit the script again...."; - echo " "; set -x; exit 8;; + echo " "; ${TRACE_ON:-set -x}; exit 8;; esac @@ -376,7 +380,7 @@ if [ ${cmodel} = 'other' ]; then echo " replace the forecast hour characters 00 with XX. Please check the" echo " name in the kickoff script and qsub it again. Exiting....." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -399,7 +403,7 @@ if [ ${cmodel} = 'other' ]; then echo " " echo " !!! Exiting loop, only processing 14 forecast files ...." echo " " - set -x + ${TRACE_ON:-set -x} break fi @@ -414,7 +418,7 @@ if [ ${cmodel} = 'other' ]; then echo " " echo " +++ Found file ${fnamebeg}${fhour}${fnameend}" echo " " - set -x + ${TRACE_ON:-set -x} let fhrct=fhrct+1 else fflag='n' @@ -434,7 +438,7 @@ if [ ${cmodel} = 'other' ]; then echo " !!! Please check the directory to make sure the file" echo " !!! is there and then submit this job again." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -443,7 +447,7 @@ if [ ${cmodel} = 'other' ]; then echo " Max forecast hour is $maxhour" echo " List of forecast hours: $fcsthrsother" echo " " - set -x + ${TRACE_ON:-set -x} # -------------------------------------------------- # In order for the fortran program to know how many @@ -525,7 +529,7 @@ if [ ${numvitrecs} -eq 0 ]; then echo "!!! It could just be that there are no storms for the current" echo "!!! time. Please check the dates and submit this job again...." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -573,19 +577,17 @@ pgm=$(basename $SUPVX) if [ -s $DATA/prep_step ]; then set +e . $DATA/prep_step - set -e + ${ERR_EXIT_ON:-set -eu} else [ -f errfile ] && rm errfile export XLFUNITS=0 unset $(env | grep XLFUNIT | awk -F= '{print $1}') - set +u - if [ -z "$XLFRTEOPTS" ]; then + if [ -z "${XLFRTEOPTS:-}" ]; then export XLFRTEOPTS="unit_vars=yes" else export XLFRTEOPTS="${XLFRTEOPTS}:unit_vars=yes" fi - set -u fi @@ -614,14 +616,14 @@ set +x echo echo 'The foreground exit status for SUPVIT is ' $err echo -set -x +${TRACE_ON:-set -x} if [ $err -eq 0 ]; then set +x echo " " echo " Normal end for program supvitql (which updates TC vitals file)." echo " " - set -x + ${TRACE_ON:-set -x} else set +x echo " " @@ -631,7 +633,7 @@ else echo "!!! model= ${cmodel}, forecast initial time = ${symd}${dishh}" echo "!!! Exiting...." echo " " - set -x + ${TRACE_ON:-set -x} fi if [ -s $DATA/err_chk ]; then $DATA/err_chk @@ -661,7 +663,7 @@ if [ ${numvitrecs} -eq 0 ]; then echo "!!! File ${vdir}/vitals.upd.${cmodel}.${symd}${dishh} is empty." echo "!!! Please check the dates and submit this job again...." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -677,7 +679,7 @@ echo " Below is a list of the storms to be processed: " | tee -a storm_list echo " " | tee -a storm_list cat ${vdir}/vitals.upd.${cmodel}.${symd}${dishh} | tee -a storm_list echo " " | tee -a storm_list -set -x +${TRACE_ON:-set -x} set +u [ -n "../$pgmout" ] && cat storm_list >> ../$pgmout @@ -730,7 +732,7 @@ echo " NOW CUTTING APART INPUT GRIB FILES TO " echo " CREATE 1 BIG GRIB INPUT FILE " echo " -----------------------------------------" echo " " -set -x +${TRACE_ON:-set -x} #grid='255 0 151 71 70000 190000 128 0000 340000 1000 1000 64' #grid='255 0 360 181 90000 0000 128 -90000 -1000 1000 1000 64' @@ -757,7 +759,7 @@ if [ ${model} -eq 5 ]; then echo " !!! in the analysis data." echo " *******************************************************************" echo " " - set -x + ${TRACE_ON:-set -x} fi if [ -s ${vdir}/ngmlatlon.pgrb.${symd}${dishh} ]; then @@ -773,7 +775,7 @@ if [ ${model} -eq 5 ]; then echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " !!! NGM File missing: ${ngmdir}/${ngmgfile}${fhour}" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - set -x + ${TRACE_ON:-set -x} continue fi if [ -s $TMPDIR/tmpixfile ]; then rm $TMPDIR/tmpixfile; fi @@ -784,7 +786,7 @@ if [ ${model} -eq 5 ]; then echo " " echo " Extracting NGM GRIB data for forecast hour = $fhour" echo " " - set -x + ${TRACE_ON:-set -x} g1=${ngmdir}/${ngmgfile}${fhour} @@ -808,7 +810,7 @@ if [ ${model} -eq 5 ]; then echo "!!! sure you've allocated enough memory for this job (error 134 using $COPYGB is " echo "!!! typically due to using more memory than you've allocated). Exiting....." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -847,7 +849,7 @@ if [ ${model} -eq 6 ]; then echo " !!! in the analysis data." echo " *******************************************************************" echo " " - set -x + ${TRACE_ON:-set -x} fi if [ -s ${vdir}/namlatlon.pgrb.${symd}${dishh} ]; then @@ -863,7 +865,7 @@ if [ ${model} -eq 6 ]; then echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " !!! Early NAM File missing: ${namdir}/${namgfile}${fhour}.tm00" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - set -x + ${TRACE_ON:-set -x} continue fi if [ -s $TMPDIR/tmpixfile ]; then rm $TMPDIR/tmpixfile; fi @@ -874,7 +876,7 @@ if [ ${model} -eq 6 ]; then echo " " echo " Extracting Early NAM GRIB data for forecast hour = $fhour" echo " " - set -x + ${TRACE_ON:-set -x} g1=${namdir}/${namgfile}${fhour}.tm00 @@ -899,7 +901,7 @@ if [ ${model} -eq 6 ]; then echo "!!! sure you've allocated enough memory for this job (error 134 using $COPYGB is " echo "!!! typically due to using more memory than you've allocated). Exiting....." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -947,7 +949,7 @@ if [ ${model} -eq 4 ]; then echo " " echo " !!! Due to missing ECMWF file, execution is ending...." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -990,7 +992,7 @@ if [ ${model} -eq 1 ]; then echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " !!! GFS File missing: ${gfsdir}/${gfsgfile}${fhour}" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - set -x + ${TRACE_ON:-set -x} continue fi @@ -1061,7 +1063,7 @@ if [ ${model} -eq 8 ]; then echo " !!! gdas File missing: $gfile" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " " - set -x + ${TRACE_ON:-set -x} continue fi @@ -1110,7 +1112,7 @@ if [ ${model} -eq 8 ]; then echo " !!! gdas File missing: $gfile" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " " - set -x + ${TRACE_ON:-set -x} continue fi @@ -1165,7 +1167,7 @@ if [ ${model} -eq 2 ]; then echo " !!! MRF File missing: ${mrfdir}/${mrfgfile}${fhour}" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " " - set -x + ${TRACE_ON:-set -x} continue fi @@ -1220,7 +1222,7 @@ if [ ${model} -eq 3 ]; then echo " !!! UKMET File missing: ${ukmetdir}/${ukmetgfile}${fhour}" echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " " - set -x + ${TRACE_ON:-set -x} continue fi @@ -1261,7 +1263,7 @@ if [ ${model} -eq 7 ]; then echo " " echo " !!! Due to missing NAVGEM file, execution is ending...." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -1336,7 +1338,7 @@ if [ ${model} -eq 9 ]; then echo "!!! Forecast File missing: ${otherdir}/${fnamebeg}00${fnameend}" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo " " - set -x + ${TRACE_ON:-set -x} continue fi @@ -1410,7 +1412,7 @@ if [ ${model} -eq 9 ]; then echo "!!! sure you've allocated enough memory for this job (error 134 using $COPYGB is " echo "!!! typically due to using more memory than you've allocated). Exiting....." echo " " - set -x + ${TRACE_ON:-set -x} exit 8 fi @@ -1441,9 +1443,9 @@ while [ $ist -le 15 ] do if [ ${stormflag[${ist}]} -ne 1 ] then - set +x; echo "Storm number $ist NOT selected for processing"; set -x + set +x; echo "Storm number $ist NOT selected for processing"; ${TRACE_ON:-set -x} else - set +x; echo "Storm number $ist IS selected for processing...."; set -x + set +x; echo "Storm number $ist IS selected for processing...."; ${TRACE_ON:-set -x} fi let ist=ist+1 done @@ -1562,7 +1564,7 @@ set +x echo echo 'The foreground exit status for GETTRK is ' $err echo -set -x +${TRACE_ON:-set -x} if [ -s $DATA/err_chk ]; then $DATA/err_chk @@ -1581,5 +1583,6 @@ fi cp ${vdir}/trak.${cmodel}.all.${symdh} ${DATA}/model_track.all + exit 0 diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh index 20f6b8b1e0f..d326f02b36f 100755 --- a/ush/wave_grib2_sbs.sh +++ b/ush/wave_grib2_sbs.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -25,15 +25,13 @@ ################################################################################ # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +# 0.a Basic modes of operation cd $GRIBDATA @@ -52,7 +50,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_grib2 (COULD NOT CREATE TEMP DIRECTORY) *** ' echo '******************************************************************************* ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 fi @@ -87,7 +85,7 @@ echo '! Make GRIB files |' echo '+--------------------------------+' echo " Model ID : $WAV_MOD_TAG" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ -z "$CDATE" ] || [ -z "$cycle" ] || [ -z "$EXECwave" ] || \ [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ @@ -100,7 +98,7 @@ echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' echo '***************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 fi @@ -114,7 +112,7 @@ echo " Number of times : Single SBS echo " GRIB field flags : $gribflags" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.e Links to working directory @@ -128,7 +126,7 @@ set +x echo " Generate input file for ww3_grib2" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} sed -e "s/TIME/$tstart/g" \ -e "s/DT/$dtgrib/g" \ @@ -146,7 +144,7 @@ set +x echo " Run ww3_grib2" echo " Executing $EXECwave/ww3_grib" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} export pgm=ww3_grib;. prep_step $EXECwave/ww3_grib > grib2_${grdnam}_${FH3}.out 2>&1 @@ -159,11 +157,11 @@ echo '*** FATAL ERROR : ERROR IN ww3_grib encoding *** ' echo '************************************************ ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi - if [ $fht -gt 0 ]; then + if [ $fhr -gt 0 ]; then $WGRIB2 gribfile -set_date $CDATE -set_ftime "$fhr hour fcst" -grib ${COMOUT}/gridded/${outfile} err=$? else @@ -179,7 +177,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' echo '********************************************* ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -210,7 +208,7 @@ echo ' ' echo " Error in moving grib file ${outfile} to com" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi if [ ! -s $COMOUT/gridded/${outfile} ] @@ -223,7 +221,7 @@ echo ' ' echo " Error in moving grib file ${outfile}.idx to com" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi @@ -232,7 +230,7 @@ set +x echo " Alerting GRIB file as $COMOUT/gridded/${outfile}" echo " Alerting GRIB index file as $COMOUT/gridded/${outfile}.idx" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} $DBNROOT/bin/dbn_alert MODEL ${alertName}_WAVE_GB2 $job $COMOUT/gridded/${outfile} $DBNROOT/bin/dbn_alert MODEL ${alertName}_WAVE_GB2_WIDX $job $COMOUT/gridded/${outfile}.idx else @@ -247,7 +245,7 @@ set +x echo " Removing work directory after success." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cd ../ mv -f ${gribDIR} done.${gribDIR} @@ -257,13 +255,8 @@ echo ' ' echo " File ${COMOUT}/gridded/${outfile} found, skipping generation process" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} fi - set +x - echo ' ' - echo "End of ww3_grib2.sh at" - date - [[ "$LOUD" = YES ]] && set -x # End of ww3_grib2.sh -------------------------------------------------- # diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index 5fb1ce7bcbf..c0373205d73 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -25,15 +25,13 @@ ################################################################################ # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +# 0.a Basic modes of operation cd $GRDIDATA @@ -54,7 +52,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_grid_interp (COULD NOT CREATE TEMP DIRECTORY) *** ' echo '************************************************************************************* ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 fi @@ -69,7 +67,7 @@ echo '! Make GRID files |' echo '+--------------------------------+' echo " Model ID : $WAV_MOD_TAG" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ -z "$CDATE" ] || [ -z "$cycle" ] || [ -z "$EXECwave" ] || \ [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ @@ -82,7 +80,7 @@ echo '***************************************************' echo ' ' echo "$CDATE $cycle $EXECwave $COMOUT $WAV_MOD_TAG $SENDCOM $SENDDBN $waveGRD" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 fi @@ -124,7 +122,7 @@ set +x echo ' ' echo " Copying $FIXwave/WHTGRIDINT.bin.${grdID} " - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp $FIXwave/WHTGRIDINT.bin.${grdID} ${DATA} wht_OK='yes' else @@ -144,7 +142,7 @@ set +x echo " Run ww3_gint echo " Executing $EXECwave/ww3_gint - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} export pgm=ww3_gint;. prep_step $EXECwave/ww3_gint 1> gint.${grdID}.out 2>&1 @@ -166,7 +164,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_gint interpolation * ' echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -182,14 +180,14 @@ then set +x echo " Saving GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE}" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp ${DATA}/output_${ymdh}0000/out_grd.$grdID $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE} # if [ "$SENDDBN" = 'YES' ] # then # set +x # echo " Alerting GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE} -# [[ "$LOUD" = YES ]] && set -x +# ${TRACE_ON:-set -x} # # PUT DBNET ALERT HERE .... @@ -201,16 +199,7 @@ # --------------------------------------------------------------------------- # # 2. Clean up the directory - set +x - echo " Removing work directory after success." - [[ "$LOUD" = YES ]] && set -x - cd ../ mv -f grint_${grdID}_${ymdh} done.grint_${grdID}_${ymdh} - set +x - echo ' ' - echo "End of ww3_interp.sh at" - date - # End of ww3_grid_interp.sh -------------------------------------------- # diff --git a/ush/wave_grid_moddef.sh b/ush/wave_grid_moddef.sh index a9a12b6efea..6dba5f4458f 100755 --- a/ush/wave_grid_moddef.sh +++ b/ush/wave_grid_moddef.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -19,15 +19,13 @@ # # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +# 0.a Basic modes of operation echo "Generating mod_def file" @@ -43,7 +41,7 @@ echo '+--------------------------------+' echo " Grid : $1" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.b Check if grid set @@ -55,7 +53,7 @@ echo '*** Grid not identifife in ww3_mod_def.sh ***' echo '**************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 else grdID=$1 @@ -72,7 +70,7 @@ echo '*** EXPORTED VARIABLES IN ww3_mod_def.sh NOT SET ***' echo '*********************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 2 fi @@ -84,7 +82,7 @@ echo ' Creating mod_def file ...' echo " Executing $EXECwave/ww3_grid" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} rm -f ww3_grid.inp ln -sf ../ww3_grid.inp.$grdID ww3_grid.inp @@ -100,7 +98,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_grid *** ' echo '******************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -115,19 +113,14 @@ echo '*** FATAL ERROR : MOD DEF FILE NOT FOUND *** ' echo '******************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi # --------------------------------------------------------------------------- # # 3. Clean up - cd .. - rm -rf moddef_$grdID - - set +x - echo ' ' - echo 'End of ww3_mod_def.sh at' - date +cd .. +rm -rf moddef_$grdID # End of ww3_mod_def.sh ------------------------------------------------- # diff --git a/ush/wave_outp_cat.sh b/ush/wave_outp_cat.sh index 56d1b638967..6e1d6226fee 100755 --- a/ush/wave_outp_cat.sh +++ b/ush/wave_outp_cat.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -21,15 +21,13 @@ ################################################################################ # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +# 0.a Basic modes of operation bloc=$1 MAXHOUR=$2 @@ -45,7 +43,7 @@ echo '*** LOCATION ID IN ww3_outp_spec.sh NOT SET ***' echo '***********************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 else buoy=$bloc @@ -63,7 +61,7 @@ echo '*** EXPORTED VARIABLES IN ww3_outp_cat.sh NOT SET ***' echo '******************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -73,16 +71,20 @@ set +x echo " Generate input file for ww3_outp." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$specdir" = "bull" ] then outfile=${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.bull coutfile=${STA_DIR}/c${specdir}/$WAV_MOD_TAG.$buoy.cbull - rm outfile coutfile + for f in outfile coutfile; do + if [[ -f ${f} ]]; then rm ${f}; fi + done else outfile=${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.spec - rm outfile + if [[ -f ${outfile} ]]; then + rm ${outfile} + fi fi fhr=$FHMIN_WAV @@ -116,7 +118,7 @@ echo "*** FATAL ERROR : OUTPUT DATA FILE FOR BOUY $bouy at ${ymdh} NOT FOUND *** " echo '************************************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2; export err;${errchk} exit $err fi @@ -140,14 +142,9 @@ echo " FATAL ERROR : OUTPUTFILE ${outfile} not created " echo '*************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} err=2; export err;${errchk} exit $err fi - set +x - echo ' ' - echo 'End of ww3_outp_cat.sh at' - date - # End of ww3_outp_cat.sh ---------------------------------------------------- # diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh index da91d3f17fd..ad59c704f19 100755 --- a/ush/wave_outp_spec.sh +++ b/ush/wave_outp_spec.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -22,15 +22,13 @@ ################################################################################ # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set +x +# 0.a Basic modes of operation bloc=$1 ymdh=$2 @@ -52,7 +50,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_outp_spec (COULD NOT CREATE TEMP DIRECTORY) *** ' echo '****************************************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 fi @@ -64,7 +62,7 @@ echo '! Make spectral file |' echo '+--------------------------------+' echo " Model ID : $WAV_MOD_TAG" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.b Check if buoy location set @@ -76,7 +74,7 @@ echo '*** LOCATION ID IN ww3_outp_spec.sh NOT SET ***' echo '***********************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 else buoy=$bloc @@ -91,7 +89,7 @@ echo " Location ID/# : $buoy (${point})" echo " Spectral output start time : $ymdh " echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} break fi done < tmp_list.loc @@ -102,7 +100,7 @@ echo '*** LOCATION ID IN ww3_outp_spec.sh NOT RECOGNIZED ***' echo '******************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 2 fi fi @@ -120,7 +118,7 @@ echo '*** EXPORTED VARIABLES IN ww3_outp_spec.sh NOT SET ***' echo '******************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -132,7 +130,7 @@ set +x echo " Output starts at $tstart." echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.e sync important files @@ -151,7 +149,7 @@ set +x echo " Generate input file for ww3_outp." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} if [ "$specdir" = "bull" ] then @@ -178,7 +176,7 @@ set +x echo " Executing $EXECwave/ww3_outp" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} export pgm=ww3_outp;. prep_step $EXECwave/ww3_outp 1> outp_${specdir}_${buoy}.out 2>&1 @@ -193,7 +191,7 @@ echo '*** FATAL ERROR : ERROR IN ww3_outp *** ' echo '******************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi @@ -237,18 +235,13 @@ echo '*** FATAL ERROR : OUTPUT DATA FILE FOR BOUY $bouy NOT FOUND *** ' echo '***************************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 5 fi # 3.b Clean up the rest - cd .. - rm -rf ${specdir}_${bloc} - - set +x - echo ' ' - echo 'End of ww3_outp_spec.sh at' - date +cd .. +rm -rf ${specdir}_${bloc} # End of ww3_outp_spec.sh ---------------------------------------------------- # diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh index d48af0c71fc..b9a0a15ab71 100755 --- a/ush/wave_prnc_cur.sh +++ b/ush/wave_prnc_cur.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# +#! /usr/bin/env bash + ################################################################################ # # UNIX Script Documentation Block @@ -22,7 +22,11 @@ # ################################################################################ # -set -x + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi ymdh_rtofs=$1 curfile=$2 @@ -95,4 +99,3 @@ fi mv -f current.ww3 ${DATA}/${WAVECUR_DID}.${ymdh_rtofs} cd ${DATA} - diff --git a/ush/wave_prnc_ice.sh b/ush/wave_prnc_ice.sh index f73646a07a8..d83798906c2 100755 --- a/ush/wave_prnc_ice.sh +++ b/ush/wave_prnc_ice.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#! /usr/bin/env bash + ############################################################################### # # # This script preprocesses ice fields for the ocean wave models. # @@ -25,13 +26,16 @@ # # --------------------------------------------------------------------------- # # 0. Preparations + +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi + # 0.a Basic modes of operation cd $DATA - seton='-xa' - setoff='+xa' - set $seton - + rm -rf ice mkdir ice cd ice @@ -40,7 +44,7 @@ # 0.b Define directories and the search path. # The tested variables should be exported by the postprocessor script. - set $setoff + set +x echo ' ' echo '+--------------------------------+' echo '! Make ice fields |' @@ -50,7 +54,7 @@ echo " Ice grid ID : $WAVEICE_FID" echo " Ice file : $WAVICEFILE" echo ' ' - set $seton + ${TRACE_ON:-set -x} echo "Making ice fields." if [ -z "$YMDH" ] || [ -z "$cycle" ] || \ @@ -58,14 +62,14 @@ [ -z "$WAV_MOD_TAG" ] || [ -z "$WAVEICE_FID" ] || [ -z "$SENDCOM" ] || \ [ -z "$COMIN_WAV_ICE" ] then - set $setoff + set +x echo ' ' echo '**************************************************' echo '*** EXPORTED VARIABLES IN preprocessor NOT SET ***' echo '**************************************************' echo ' ' exit 1 - set $seton + ${TRACE_ON:-set -x} echo "NON-FATAL ERROR - EXPORTED VARIABLES IN preprocessor NOT SET" fi @@ -86,17 +90,17 @@ if [ -f ice.grib ] then - set $setoff + set +x echo " ice.grib copied ($file)." - set $seton + ${TRACE_ON:-set -x} else - set $setoff + set +x echo ' ' echo '************************************** ' echo "*** FATAL ERROR: NO ICE FILE $file *** " echo '************************************** ' echo ' ' - set $seton + ${TRACE_ON:-set -x} echo "FATAL ERROR - NO ICE FILE (GFS GRIB)" exit 2 fi @@ -105,9 +109,9 @@ # 2. Process the GRIB packed ice file # 2.a Unpack data - set $setoff + set +x echo ' Extracting data from ice.grib ...' - set $seton + ${TRACE_ON:-set -x} $WGRIB2 ice.grib -netcdf icean_5m.nc 2>&1 > wgrib.out @@ -117,13 +121,13 @@ if [ "$err" != '0' ] then cat wgrib.out - set $setoff + set +x echo ' ' echo '**************************************** ' echo '*** ERROR IN UNPACKING GRIB ICE FILE *** ' echo '**************************************** ' echo ' ' - set $seton + ${TRACE_ON:-set -x} echo "ERROR IN UNPACKING GRIB ICE FILE." exit 3 fi @@ -135,10 +139,10 @@ # 2.d Run through preprocessor wave_prep - set $setoff + set +x echo ' Run through preprocessor ...' echo ' ' - set $seton + ${TRACE_ON:-set -x} cp -f ${DATA}/ww3_prnc.ice.$WAVEICE_FID.inp.tmpl ww3_prnc.inp @@ -150,13 +154,13 @@ if [ "$err" != '0' ] then cat prnc_${WAVEICE_FID}_${cycle}.out - set $setoff + set +x echo ' ' echo '******************************************** ' echo '*** WARNING: NON-FATAL ERROR IN ww3_prnc *** ' echo '******************************************** ' echo ' ' - set $seton + ${TRACE_ON:-set -x} echo "WARNING: NON-FATAL ERROR IN ww3_prnc." exit 4 fi @@ -177,25 +181,17 @@ icefile=${CDUMP}wave.${WAVEICE_FID}.$cycle.ice fi - set $setoff + set +x echo " Saving ice.ww3 as $COMOUT/rundata/${icefile}" - set $seton + ${TRACE_ON:-set -x} cp ice.ww3 $COMOUT/rundata/${icefile} rm -f ice.ww3 # --------------------------------------------------------------------------- # # 4. Clean up the directory - set $setoff - echo " Removing work directory after success." - set $seton +cd .. - cd .. - rm -rf ice - - set $setoff - echo ' ' - echo 'End of waveice.sh at' - date +rm -rf ice # End of waveice.sh --------------------------------------------------------- # diff --git a/ush/wave_tar.sh b/ush/wave_tar.sh index f071d2d4907..695b8a2e4d5 100755 --- a/ush/wave_tar.sh +++ b/ush/wave_tar.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#! /usr/bin/env bash + ############################################################################### # # # This script tars the sectral or bulletin files into a single file and # @@ -23,15 +24,13 @@ # # --------------------------------------------------------------------------- # # 0. Preparations -# 0.a Basic modes of operation - # set execution trace prompt. ${0##*/} adds the script's basename - PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " - set -x +PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" +if [ -f "${PREAMBLE_SCRIPT}" ]; then + source $PREAMBLE_SCRIPT +fi - # Use LOUD variable to turn on/off trace. Defaults to YES (on). - export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES - [[ "$LOUD" != YES ]] && set -x +# 0.a Basic modes of operation cd $DATA echo "Making TAR FILE" @@ -46,7 +45,7 @@ echo " ID : $1" echo " Type : $2" echo " Number of files : $3" - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} # 0.b Check if type set @@ -59,7 +58,7 @@ echo '*** VARIABLES IN ww3_tar.sh NOT SET ***' echo '********************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 1 else ID=$1 @@ -89,7 +88,7 @@ echo '*** EXPORTED VARIABLES IN ww3_tar.sh NOT SET ***' echo '*****************************************************' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 2 fi @@ -101,7 +100,7 @@ set +x echo ' ' echo ' Making tar file ...' - set -x + ${TRACE_ON:-set -x} count=0 countMAX=5 @@ -125,7 +124,7 @@ echo '*** FATAL ERROR : TAR CREATION FAILED *** ' echo '***************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -136,7 +135,7 @@ else set +x echo ' All files not found for tar. Sleeping 10 seconds and trying again ..' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} sleep 10 count=$(expr $count + 1) fi @@ -151,7 +150,7 @@ echo '*** FATAL ERROR : TAR CREATION FAILED *** ' echo '***************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 3 fi @@ -171,7 +170,7 @@ echo '*** FATAL ERROR : SPECTRAL TAR COMPRESSION FAILED *** ' echo '***************************************************** ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi fi @@ -185,7 +184,7 @@ set +x echo ' ' echo " Moving tar file ${file_name} to $COMOUT ..." - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} cp ${file_name} $COMOUT/station/. @@ -199,7 +198,7 @@ echo '*** FATAL ERROR : TAR COPY FAILED *** ' echo '************************************* ' echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} exit 4 fi @@ -209,21 +208,19 @@ echo ' ' echo " Alerting TAR file as $COMOUT/station/${file_name}" echo ' ' - [[ "$LOUD" = YES ]] && set -x + ${TRACE_ON:-set -x} $DBNROOT/bin/dbn_alert MODEL ${alertName}_WAVE_TAR $job $COMOUT/station/${file_name} fi # --------------------------------------------------------------------------- # # 4. Final clean up - cd $DATA +cd $DATA - set +x; [[ "$LOUD" = YES ]] && set -v +if [[ ${KEEPDATA:-NO} == "NO" ]]; then + set -v rm -rf ${STA_DIR}/${type} set +v - - echo ' ' - echo 'End of ww3_tar.sh at' - date +fi # End of ww3_tar.sh ----------------------------------------------------- # From 954ea2d917786cbbf47b5e88a3aca95b78aeccce Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Tue, 26 Jul 2022 16:23:44 +0000 Subject: [PATCH 02/14] Remove ability to override preamble script Change all the scripts to always use the preable in ush instead of allowing users to override with their own script. Refs: #397 --- jobs/JGDAS_ATMOS_ANALYSIS_DIAG | 5 +---- jobs/JGDAS_ATMOS_CHGRES_FORENKF | 5 +---- jobs/JGDAS_ATMOS_GEMPAK | 5 +---- jobs/JGDAS_ATMOS_GEMPAK_META_NCDC | 5 +---- jobs/JGDAS_EFSOI | 5 +---- jobs/JGDAS_EFSOI_ECEN | 5 +---- jobs/JGDAS_EFSOI_FCST | 5 +---- jobs/JGDAS_EFSOI_POST | 5 +---- jobs/JGDAS_EFSOI_SFC | 5 +---- jobs/JGDAS_EFSOI_UPDATE | 5 +---- jobs/JGDAS_ENKF_DIAG | 5 +---- jobs/JGDAS_ENKF_ECEN | 5 +---- jobs/JGDAS_ENKF_FCST | 5 +---- jobs/JGDAS_ENKF_POST | 5 +---- jobs/JGDAS_ENKF_SELECT_OBS | 5 +---- jobs/JGDAS_ENKF_SFC | 5 +---- jobs/JGDAS_ENKF_UPDATE | 5 +---- jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG | 5 +---- jobs/JGFS_ATMOS_AWIPS_G2 | 5 +---- jobs/JGFS_ATMOS_CYCLONE_GENESIS | 5 +---- jobs/JGFS_ATMOS_CYCLONE_TRACKER | 5 +---- jobs/JGFS_ATMOS_FBWIND | 5 +---- jobs/JGFS_ATMOS_FSU_GENESIS | 5 +---- jobs/JGFS_ATMOS_GEMPAK | 5 +---- jobs/JGFS_ATMOS_GEMPAK_META | 5 +---- jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF | 5 +---- jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC | 5 +---- jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS | 5 +---- jobs/JGFS_ATMOS_POSTSND | 5 +---- jobs/JGLOBAL_ATMOS_ANALYSIS | 5 +---- jobs/JGLOBAL_ATMOS_ANALYSIS_CALC | 5 +---- jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP | 5 +---- jobs/JGLOBAL_ATMOS_NCEPPOST | 5 +---- jobs/JGLOBAL_ATMOS_POST_MANAGER | 5 +---- jobs/JGLOBAL_ATMOS_SFCANL | 5 +---- jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC | 5 +---- jobs/JGLOBAL_FORECAST | 5 +---- jobs/JGLOBAL_WAVE_GEMPAK | 5 +---- jobs/JGLOBAL_WAVE_INIT | 5 +---- jobs/JGLOBAL_WAVE_POST_BNDPNT | 5 +---- jobs/JGLOBAL_WAVE_POST_BNDPNTBLL | 5 +---- jobs/JGLOBAL_WAVE_POST_PNT | 5 +---- jobs/JGLOBAL_WAVE_POST_SBS | 5 +---- jobs/JGLOBAL_WAVE_PRDGEN_BULLS | 5 +---- jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED | 5 +---- jobs/JGLOBAL_WAVE_PREP | 5 +---- jobs/rocoto/aerosol_init.sh | 5 +---- jobs/rocoto/anal.sh | 5 +---- jobs/rocoto/analcalc.sh | 5 +---- jobs/rocoto/analdiag.sh | 5 +---- jobs/rocoto/arch.sh | 5 +---- jobs/rocoto/awips.sh | 5 +---- jobs/rocoto/coupled_ic.sh | 5 +---- jobs/rocoto/earc.sh | 5 +---- jobs/rocoto/ecen.sh | 5 +---- jobs/rocoto/echgres.sh | 5 +---- jobs/rocoto/ediag.sh | 5 +---- jobs/rocoto/efcs.sh | 5 +---- jobs/rocoto/eobs.sh | 5 +---- jobs/rocoto/eomg.sh | 5 +---- jobs/rocoto/epos.sh | 5 +---- jobs/rocoto/esfc.sh | 5 +---- jobs/rocoto/eupd.sh | 5 +---- jobs/rocoto/fcst.sh | 5 +---- jobs/rocoto/gempak.sh | 5 +---- jobs/rocoto/getic.sh | 5 +---- jobs/rocoto/gldas.sh | 5 +---- jobs/rocoto/init.sh | 5 +---- jobs/rocoto/metp.sh | 5 +---- jobs/rocoto/ocnpost.sh | 5 +---- jobs/rocoto/post.sh | 5 +---- jobs/rocoto/postsnd.sh | 5 +---- jobs/rocoto/prep.sh | 5 +---- jobs/rocoto/sfcanl.sh | 5 +---- jobs/rocoto/vrfy.sh | 5 +---- jobs/rocoto/wafs.sh | 5 +---- jobs/rocoto/wafsblending.sh | 5 +---- jobs/rocoto/wafsblending0p25.sh | 5 +---- jobs/rocoto/wafsgcip.sh | 5 +---- jobs/rocoto/wafsgrib2.sh | 5 +---- jobs/rocoto/wafsgrib20p25.sh | 5 +---- jobs/rocoto/waveawipsbulls.sh | 5 +---- jobs/rocoto/waveawipsgridded.sh | 5 +---- jobs/rocoto/wavegempak.sh | 5 +---- jobs/rocoto/waveinit.sh | 5 +---- jobs/rocoto/wavepostbndpnt.sh | 5 +---- jobs/rocoto/wavepostbndpntbll.sh | 5 +---- jobs/rocoto/wavepostpnt.sh | 5 +---- jobs/rocoto/wavepostsbs.sh | 5 +---- jobs/rocoto/waveprep.sh | 5 +---- scripts/exgdas_atmos_chgres_forenkf.sh | 5 +---- scripts/exgdas_atmos_gempak_gif_ncdc.sh | 5 +---- scripts/exgdas_atmos_nceppost.sh | 5 +---- scripts/exgdas_efsoi.sh | 5 +---- scripts/exgdas_efsoi_update.sh | 5 +---- scripts/exgdas_enkf_ecen.sh | 5 +---- scripts/exgdas_enkf_fcst.sh | 5 +---- scripts/exgdas_enkf_post.sh | 5 +---- scripts/exgdas_enkf_select_obs.sh | 5 +---- scripts/exgdas_enkf_sfc.sh | 5 +---- scripts/exgdas_enkf_update.sh | 5 +---- scripts/exgfs_atmos_awips_20km_1p0deg.sh | 5 +---- scripts/exgfs_atmos_fbwind.sh | 5 +---- scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh | 5 +---- scripts/exgfs_atmos_gempak_meta.sh | 5 +---- scripts/exgfs_atmos_goes_nawips.sh | 5 +---- scripts/exgfs_atmos_grib2_special_npoess.sh | 5 +---- scripts/exgfs_atmos_grib_awips.sh | 5 +---- scripts/exgfs_atmos_nceppost.sh | 5 +---- scripts/exgfs_atmos_postsnd.sh | 5 +---- scripts/exgfs_pmgr.sh | 5 +---- scripts/exgfs_prdgen_manager.sh | 5 +---- scripts/exgfs_wave_init.sh | 5 +---- scripts/exgfs_wave_nawips.sh | 5 +---- scripts/exgfs_wave_post_gridded_sbs.sh | 5 +---- scripts/exgfs_wave_post_pnt.sh | 5 +---- scripts/exgfs_wave_prdgen_bulls.sh | 5 +---- scripts/exgfs_wave_prdgen_gridded.sh | 5 +---- scripts/exgfs_wave_prep.sh | 5 +---- scripts/exglobal_atmos_analysis.sh | 5 +---- scripts/exglobal_atmos_analysis_calc.sh | 5 +---- scripts/exglobal_atmos_pmgr.sh | 5 +---- scripts/exglobal_atmos_sfcanl.sh | 5 +---- scripts/exglobal_atmos_tropcy_qc_reloc.sh | 5 +---- scripts/exglobal_diag.sh | 5 +---- scripts/exglobal_forecast.sh | 5 +---- scripts/run_reg2grb2.sh | 5 +---- scripts/run_regrid.sh | 5 +---- ush/drive_makeprepbufr.sh | 5 +---- ush/fv3gfs_dwn_nems.sh | 5 +---- ush/fv3gfs_nc2nemsio.sh | 5 +---- ush/fv3gfs_regrid_nemsio.sh | 5 +---- ush/fv3gfs_remap.sh | 5 +---- ush/gaussian_sfcanl.sh | 5 +---- ush/getdump.sh | 5 +---- ush/getges.sh | 5 +---- ush/gfs_bfr2gpk.sh | 5 +---- ush/gfs_bufr.sh | 5 +---- ush/gfs_bufr_netcdf.sh | 5 +---- ush/gfs_nceppost.sh | 5 +---- ush/gfs_sndp.sh | 5 +---- ush/gfs_transfer.sh | 5 +---- ush/gfs_truncate_enkf.sh | 5 +---- ush/global_extrkr.sh | 5 +---- ush/global_nceppost.sh | 5 +---- ush/global_savefits.sh | 5 +---- ush/hpssarch_gen.sh | 5 +---- ush/link_crtm_fix.sh | 5 +---- ush/mod_icec.sh | 5 +---- ush/scale_dec.sh | 5 +---- ush/syndat_getjtbul.sh | 5 +---- ush/syndat_qctropcy.sh | 5 +---- ush/trim_rh.sh | 5 +---- ush/tropcy_relocate.sh | 5 +---- ush/tropcy_relocate_extrkr.sh | 5 +---- ush/wave_grib2_sbs.sh | 5 +---- ush/wave_grid_interp_sbs.sh | 5 +---- ush/wave_grid_moddef.sh | 5 +---- ush/wave_outp_cat.sh | 5 +---- ush/wave_outp_spec.sh | 5 +---- ush/wave_prnc_cur.sh | 5 +---- ush/wave_prnc_ice.sh | 5 +---- ush/wave_tar.sh | 5 +---- 163 files changed, 163 insertions(+), 652 deletions(-) diff --git a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG index a9debda3928..4b2728e13f4 100755 --- a/jobs/JGDAS_ATMOS_ANALYSIS_DIAG +++ b/jobs/JGDAS_ATMOS_ANALYSIS_DIAG @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ATMOS_CHGRES_FORENKF b/jobs/JGDAS_ATMOS_CHGRES_FORENKF index 5873ad4e538..d2268df7672 100755 --- a/jobs/JGDAS_ATMOS_CHGRES_FORENKF +++ b/jobs/JGDAS_ATMOS_CHGRES_FORENKF @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ATMOS_GEMPAK b/jobs/JGDAS_ATMOS_GEMPAK index fce845b6118..88654324501 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK +++ b/jobs/JGDAS_ATMOS_GEMPAK @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GDAS GEMPAK PRODUCT GENERATION diff --git a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC index 72314fa0200..ffb46db0f92 100755 --- a/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC +++ b/jobs/JGDAS_ATMOS_GEMPAK_META_NCDC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GDAS GEMPAK META NCDC PRODUCT GENERATION diff --git a/jobs/JGDAS_EFSOI b/jobs/JGDAS_EFSOI index 8369aae5ff3..6c90468989f 100755 --- a/jobs/JGDAS_EFSOI +++ b/jobs/JGDAS_EFSOI @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_EFSOI_ECEN b/jobs/JGDAS_EFSOI_ECEN index 7dea0484ee8..864bb1ae4a0 100755 --- a/jobs/JGDAS_EFSOI_ECEN +++ b/jobs/JGDAS_EFSOI_ECEN @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_EFSOI_FCST b/jobs/JGDAS_EFSOI_FCST index a3fb4cc4b42..2794ee9c93f 100755 --- a/jobs/JGDAS_EFSOI_FCST +++ b/jobs/JGDAS_EFSOI_FCST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_EFSOI_POST b/jobs/JGDAS_EFSOI_POST index f000f3e2ead..aca5bd51ed6 100755 --- a/jobs/JGDAS_EFSOI_POST +++ b/jobs/JGDAS_EFSOI_POST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_EFSOI_SFC b/jobs/JGDAS_EFSOI_SFC index eed9ebd10fd..5ba5fb63939 100755 --- a/jobs/JGDAS_EFSOI_SFC +++ b/jobs/JGDAS_EFSOI_SFC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_EFSOI_UPDATE b/jobs/JGDAS_EFSOI_UPDATE index 4bac26ce4c0..e5efd6241a5 100755 --- a/jobs/JGDAS_EFSOI_UPDATE +++ b/jobs/JGDAS_EFSOI_UPDATE @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_DIAG b/jobs/JGDAS_ENKF_DIAG index 630ef6ee247..5ce8d86b78d 100755 --- a/jobs/JGDAS_ENKF_DIAG +++ b/jobs/JGDAS_ENKF_DIAG @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_ECEN b/jobs/JGDAS_ENKF_ECEN index dbe0ee72baa..1e7a51b5ae7 100755 --- a/jobs/JGDAS_ENKF_ECEN +++ b/jobs/JGDAS_ENKF_ECEN @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_FCST b/jobs/JGDAS_ENKF_FCST index 45fa462ac1a..68b3a532045 100755 --- a/jobs/JGDAS_ENKF_FCST +++ b/jobs/JGDAS_ENKF_FCST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_POST b/jobs/JGDAS_ENKF_POST index 33363564404..dcc6335e449 100755 --- a/jobs/JGDAS_ENKF_POST +++ b/jobs/JGDAS_ENKF_POST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_SELECT_OBS b/jobs/JGDAS_ENKF_SELECT_OBS index 716443f14d8..92bd78b04c0 100755 --- a/jobs/JGDAS_ENKF_SELECT_OBS +++ b/jobs/JGDAS_ENKF_SELECT_OBS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_SFC b/jobs/JGDAS_ENKF_SFC index 88e24c45797..54f196234af 100755 --- a/jobs/JGDAS_ENKF_SFC +++ b/jobs/JGDAS_ENKF_SFC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGDAS_ENKF_UPDATE b/jobs/JGDAS_ENKF_UPDATE index 87ddc29dfc5..dafd9b13f26 100755 --- a/jobs/JGDAS_ENKF_UPDATE +++ b/jobs/JGDAS_ENKF_UPDATE @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG index 52b84fffadc..2528013e39f 100755 --- a/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG +++ b/jobs/JGFS_ATMOS_AWIPS_20KM_1P0DEG @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} diff --git a/jobs/JGFS_ATMOS_AWIPS_G2 b/jobs/JGFS_ATMOS_AWIPS_G2 index 31f3ec4b43a..9dd2fdca636 100755 --- a/jobs/JGFS_ATMOS_AWIPS_G2 +++ b/jobs/JGFS_ATMOS_AWIPS_G2 @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} diff --git a/jobs/JGFS_ATMOS_CYCLONE_GENESIS b/jobs/JGFS_ATMOS_CYCLONE_GENESIS index a9edcc27e84..79d43ebb1ed 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_GENESIS +++ b/jobs/JGFS_ATMOS_CYCLONE_GENESIS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGFS_ATMOS_CYCLONE_TRACKER b/jobs/JGFS_ATMOS_CYCLONE_TRACKER index 0e17986a833..94458ed92cd 100755 --- a/jobs/JGFS_ATMOS_CYCLONE_TRACKER +++ b/jobs/JGFS_ATMOS_CYCLONE_TRACKER @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGFS_ATMOS_FBWIND b/jobs/JGFS_ATMOS_FBWIND index 5eb40a0dcb7..42e459dd0bc 100755 --- a/jobs/JGFS_ATMOS_FBWIND +++ b/jobs/JGFS_ATMOS_FBWIND @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GFS FBWIND PRODUCT GENERATION diff --git a/jobs/JGFS_ATMOS_FSU_GENESIS b/jobs/JGFS_ATMOS_FSU_GENESIS index d31d4a9009b..eb3069bfcb9 100755 --- a/jobs/JGFS_ATMOS_FSU_GENESIS +++ b/jobs/JGFS_ATMOS_FSU_GENESIS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGFS_ATMOS_GEMPAK b/jobs/JGFS_ATMOS_GEMPAK index 39b8f2f58e5..502bb96a7a8 100755 --- a/jobs/JGFS_ATMOS_GEMPAK +++ b/jobs/JGFS_ATMOS_GEMPAK @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GFS GEMPAK PRODUCT GENERATION diff --git a/jobs/JGFS_ATMOS_GEMPAK_META b/jobs/JGFS_ATMOS_GEMPAK_META index 5371f2cb464..9d6683a521b 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_META +++ b/jobs/JGFS_ATMOS_GEMPAK_META @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GFS GEMPAK META PRODUCT GENERATION diff --git a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF index d1eec53e50d..4b8a04e6a94 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF +++ b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GFS GEMPAK NCDC PRODUCT GENERATION diff --git a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC index dff46fb7590..d8d05b27f2c 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC +++ b/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################ # GFS_PGRB2_SPEC_GEMPAK PRODUCT GENERATION diff --git a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS index 08791fd04d4..8ae1170800d 100755 --- a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS +++ b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} diff --git a/jobs/JGFS_ATMOS_POSTSND b/jobs/JGFS_ATMOS_POSTSND index c1ffcd02da4..013e6d16486 100755 --- a/jobs/JGFS_ATMOS_POSTSND +++ b/jobs/JGFS_ATMOS_POSTSND @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS b/jobs/JGLOBAL_ATMOS_ANALYSIS index d5754cf3d66..df1f4ab474d 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC index 27f601e665b..39438e32b7c 100755 --- a/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC +++ b/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP index 751376aec5c..c0aab4e9215 100755 --- a/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP +++ b/jobs/JGLOBAL_ATMOS_EMCSFC_SFC_PREP @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_NCEPPOST b/jobs/JGLOBAL_ATMOS_NCEPPOST index cda119bb8f8..4014ebf5e6c 100755 --- a/jobs/JGLOBAL_ATMOS_NCEPPOST +++ b/jobs/JGLOBAL_ATMOS_NCEPPOST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_POST_MANAGER b/jobs/JGLOBAL_ATMOS_POST_MANAGER index 98d11163e98..b931a7aa90e 100755 --- a/jobs/JGLOBAL_ATMOS_POST_MANAGER +++ b/jobs/JGLOBAL_ATMOS_POST_MANAGER @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ######################################## # GFS post manager diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL index badeaee81e6..7d0e70782b3 100755 --- a/jobs/JGLOBAL_ATMOS_SFCANL +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC index 6eb54a1d37b..5496861e5f5 100755 --- a/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC +++ b/jobs/JGLOBAL_ATMOS_TROPCY_QC_RELOC @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_FORECAST b/jobs/JGLOBAL_FORECAST index 155feb67064..40e8f46051a 100755 --- a/jobs/JGLOBAL_FORECAST +++ b/jobs/JGLOBAL_FORECAST @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index a3d64431bda..c0b1bda0f97 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # JY - 10/29, move the block in the front, otherwise PDY is not defined for COMIN export DATA=${DATA:-${DATAROOT}/${jobid:?}} diff --git a/jobs/JGLOBAL_WAVE_INIT b/jobs/JGLOBAL_WAVE_INIT index 0edce5c3857..013dff7e707 100755 --- a/jobs/JGLOBAL_WAVE_INIT +++ b/jobs/JGLOBAL_WAVE_INIT @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNT b/jobs/JGLOBAL_WAVE_POST_BNDPNT index 502ded7fce0..0821a9fdaf8 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNT +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNT @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL index 4393bf7620f..404ab14d9ef 100755 --- a/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL +++ b/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_POST_PNT b/jobs/JGLOBAL_WAVE_POST_PNT index 15d2dda9291..acde66e7a58 100755 --- a/jobs/JGLOBAL_WAVE_POST_PNT +++ b/jobs/JGLOBAL_WAVE_POST_PNT @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_POST_SBS b/jobs/JGLOBAL_WAVE_POST_SBS index ecc15f0122a..868cf8b2424 100755 --- a/jobs/JGLOBAL_WAVE_POST_SBS +++ b/jobs/JGLOBAL_WAVE_POST_SBS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS index 07f81b63e0f..617217dfac9 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_BULLS +++ b/jobs/JGLOBAL_WAVE_PRDGEN_BULLS @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export DATA=${DATA:-${DATAROOT}/${jobid:?}} mkdir -p $DATA diff --git a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED index ce811ae7504..45cea6d4e2c 100755 --- a/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED +++ b/jobs/JGLOBAL_WAVE_PRDGEN_GRIDDED @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export DATA=${DATA:-${DATAROOT}/${jobid:?}} mkdir -p $DATA diff --git a/jobs/JGLOBAL_WAVE_PREP b/jobs/JGLOBAL_WAVE_PREP index df74688c948..5878e36444f 100755 --- a/jobs/JGLOBAL_WAVE_PREP +++ b/jobs/JGLOBAL_WAVE_PREP @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} diff --git a/jobs/rocoto/aerosol_init.sh b/jobs/rocoto/aerosol_init.sh index a10d90e56a1..34ccc0fe262 100755 --- a/jobs/rocoto/aerosol_init.sh +++ b/jobs/rocoto/aerosol_init.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/anal.sh b/jobs/rocoto/anal.sh index 0f8d1efabef..cd7fdc932a1 100755 --- a/jobs/rocoto/anal.sh +++ b/jobs/rocoto/anal.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/analcalc.sh b/jobs/rocoto/analcalc.sh index 41f7ec295bc..d80756cfc76 100755 --- a/jobs/rocoto/analcalc.sh +++ b/jobs/rocoto/analcalc.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/analdiag.sh b/jobs/rocoto/analdiag.sh index e05b4afd342..f9d97360c65 100755 --- a/jobs/rocoto/analdiag.sh +++ b/jobs/rocoto/analdiag.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index 544b083b4ae..738263672a0 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/awips.sh b/jobs/rocoto/awips.sh index dea2fa57abb..f8e5646aa67 100755 --- a/jobs/rocoto/awips.sh +++ b/jobs/rocoto/awips.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/coupled_ic.sh b/jobs/rocoto/coupled_ic.sh index df1f8b4fa90..1be2a216b5c 100755 --- a/jobs/rocoto/coupled_ic.sh +++ b/jobs/rocoto/coupled_ic.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index cbabaf7e05a..20d9df912b3 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/ecen.sh b/jobs/rocoto/ecen.sh index a6a2ca17643..dd4a8ac8a69 100755 --- a/jobs/rocoto/ecen.sh +++ b/jobs/rocoto/ecen.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/echgres.sh b/jobs/rocoto/echgres.sh index 8ce3f6bb2e1..3171388f6ad 100755 --- a/jobs/rocoto/echgres.sh +++ b/jobs/rocoto/echgres.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/ediag.sh b/jobs/rocoto/ediag.sh index 3121e457df2..b09a7f49637 100755 --- a/jobs/rocoto/ediag.sh +++ b/jobs/rocoto/ediag.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/efcs.sh b/jobs/rocoto/efcs.sh index 54933506389..4454ad6c8b7 100755 --- a/jobs/rocoto/efcs.sh +++ b/jobs/rocoto/efcs.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/eobs.sh b/jobs/rocoto/eobs.sh index 9602c037640..f6dc275578d 100755 --- a/jobs/rocoto/eobs.sh +++ b/jobs/rocoto/eobs.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/eomg.sh b/jobs/rocoto/eomg.sh index e3d9f100b92..de981c02bb4 100755 --- a/jobs/rocoto/eomg.sh +++ b/jobs/rocoto/eomg.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/epos.sh b/jobs/rocoto/epos.sh index 1a06ed2069a..1039b8ab20c 100755 --- a/jobs/rocoto/epos.sh +++ b/jobs/rocoto/epos.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/esfc.sh b/jobs/rocoto/esfc.sh index cd8108764f7..d830c59c50e 100755 --- a/jobs/rocoto/esfc.sh +++ b/jobs/rocoto/esfc.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/eupd.sh b/jobs/rocoto/eupd.sh index debc71926fc..d202c45aef3 100755 --- a/jobs/rocoto/eupd.sh +++ b/jobs/rocoto/eupd.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/fcst.sh b/jobs/rocoto/fcst.sh index 7f64066ed26..d59872c60ca 100755 --- a/jobs/rocoto/fcst.sh +++ b/jobs/rocoto/fcst.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/gempak.sh b/jobs/rocoto/gempak.sh index 89e5c9977cd..5b7f43ce47c 100755 --- a/jobs/rocoto/gempak.sh +++ b/jobs/rocoto/gempak.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/getic.sh b/jobs/rocoto/getic.sh index d83f1e9d7ca..84008e6ca01 100755 --- a/jobs/rocoto/getic.sh +++ b/jobs/rocoto/getic.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/gldas.sh b/jobs/rocoto/gldas.sh index c0e1bed547a..db16dd883f1 100755 --- a/jobs/rocoto/gldas.sh +++ b/jobs/rocoto/gldas.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/init.sh b/jobs/rocoto/init.sh index 1eccab42fad..0432750e72c 100755 --- a/jobs/rocoto/init.sh +++ b/jobs/rocoto/init.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/metp.sh b/jobs/rocoto/metp.sh index 2c0fdb016cc..80138b90265 100755 --- a/jobs/rocoto/metp.sh +++ b/jobs/rocoto/metp.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/ocnpost.sh b/jobs/rocoto/ocnpost.sh index ec1ed54b9a5..0f6413ec43e 100755 --- a/jobs/rocoto/ocnpost.sh +++ b/jobs/rocoto/ocnpost.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## CICE5/MOM6 post driver script diff --git a/jobs/rocoto/post.sh b/jobs/rocoto/post.sh index ae4a58a392a..0a7c33aae0b 100755 --- a/jobs/rocoto/post.sh +++ b/jobs/rocoto/post.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## NCEP post driver script diff --git a/jobs/rocoto/postsnd.sh b/jobs/rocoto/postsnd.sh index a5175a1133d..fadfaa6d9ed 100755 --- a/jobs/rocoto/postsnd.sh +++ b/jobs/rocoto/postsnd.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index 0261931b9d9..3344477aa65 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/sfcanl.sh b/jobs/rocoto/sfcanl.sh index a4c44227808..7b9812f37be 100755 --- a/jobs/rocoto/sfcanl.sh +++ b/jobs/rocoto/sfcanl.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source FV3GFS workflow modules diff --git a/jobs/rocoto/vrfy.sh b/jobs/rocoto/vrfy.sh index 697db929d13..8f80aedd1ae 100755 --- a/jobs/rocoto/vrfy.sh +++ b/jobs/rocoto/vrfy.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### ## Abstract: diff --git a/jobs/rocoto/wafs.sh b/jobs/rocoto/wafs.sh index ede4757dc8e..8aab955cc8a 100755 --- a/jobs/rocoto/wafs.sh +++ b/jobs/rocoto/wafs.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wafsblending.sh b/jobs/rocoto/wafsblending.sh index 69026aca4b0..2793986e80c 100755 --- a/jobs/rocoto/wafsblending.sh +++ b/jobs/rocoto/wafsblending.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wafsblending0p25.sh b/jobs/rocoto/wafsblending0p25.sh index a958759aa59..fb06284f558 100755 --- a/jobs/rocoto/wafsblending0p25.sh +++ b/jobs/rocoto/wafsblending0p25.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wafsgcip.sh b/jobs/rocoto/wafsgcip.sh index 485f26d846c..f3e98a03dac 100755 --- a/jobs/rocoto/wafsgcip.sh +++ b/jobs/rocoto/wafsgcip.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wafsgrib2.sh b/jobs/rocoto/wafsgrib2.sh index d1b12ade568..c7dbead30da 100755 --- a/jobs/rocoto/wafsgrib2.sh +++ b/jobs/rocoto/wafsgrib2.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wafsgrib20p25.sh b/jobs/rocoto/wafsgrib20p25.sh index d2df1cc74f0..e99ee210d91 100755 --- a/jobs/rocoto/wafsgrib20p25.sh +++ b/jobs/rocoto/wafsgrib20p25.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/waveawipsbulls.sh b/jobs/rocoto/waveawipsbulls.sh index a15de9e7627..1e1e1cd4e20 100755 --- a/jobs/rocoto/waveawipsbulls.sh +++ b/jobs/rocoto/waveawipsbulls.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/waveawipsgridded.sh b/jobs/rocoto/waveawipsgridded.sh index ab8ab342fb9..3627ba62c4d 100755 --- a/jobs/rocoto/waveawipsgridded.sh +++ b/jobs/rocoto/waveawipsgridded.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wavegempak.sh b/jobs/rocoto/wavegempak.sh index 8f2910a23c9..d4cf1667fc6 100755 --- a/jobs/rocoto/wavegempak.sh +++ b/jobs/rocoto/wavegempak.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index 556787952ba..ad92e0017af 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index 24cfbe93316..f9ba74ae1fd 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wavepostbndpntbll.sh b/jobs/rocoto/wavepostbndpntbll.sh index 3cd496c67c9..5447b298994 100755 --- a/jobs/rocoto/wavepostbndpntbll.sh +++ b/jobs/rocoto/wavepostbndpntbll.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wavepostpnt.sh b/jobs/rocoto/wavepostpnt.sh index abc0236456d..51ae05795eb 100755 --- a/jobs/rocoto/wavepostpnt.sh +++ b/jobs/rocoto/wavepostpnt.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/wavepostsbs.sh b/jobs/rocoto/wavepostsbs.sh index 56ce7069b2b..e4b119efef1 100755 --- a/jobs/rocoto/wavepostsbs.sh +++ b/jobs/rocoto/wavepostsbs.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh index e285b14e111..8308b3fd562 100755 --- a/jobs/rocoto/waveprep.sh +++ b/jobs/rocoto/waveprep.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### echo diff --git a/scripts/exgdas_atmos_chgres_forenkf.sh b/scripts/exgdas_atmos_chgres_forenkf.sh index 2c555b70026..df7eb773078 100755 --- a/scripts/exgdas_atmos_chgres_forenkf.sh +++ b/scripts/exgdas_atmos_chgres_forenkf.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_atmos_gempak_gif_ncdc.sh b/scripts/exgdas_atmos_gempak_gif_ncdc.sh index 79c593df2df..3671d5511fa 100755 --- a/scripts/exgdas_atmos_gempak_gif_ncdc.sh +++ b/scripts/exgdas_atmos_gempak_gif_ncdc.sh @@ -6,10 +6,7 @@ # in the future, we should move it above somewhere else. ############################################################## -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgdas_atmos_nceppost.sh b/scripts/exgdas_atmos_nceppost.sh index dfc45e12692..bf9fb7b4c93 100755 --- a/scripts/exgdas_atmos_nceppost.sh +++ b/scripts/exgdas_atmos_nceppost.sh @@ -24,10 +24,7 @@ # echo "-----------------------------------------------------" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgdas_efsoi.sh b/scripts/exgdas_efsoi.sh index 2803fc5aa38..c30f2351fd9 100755 --- a/scripts/exgdas_efsoi.sh +++ b/scripts/exgdas_efsoi.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_efsoi_update.sh b/scripts/exgdas_efsoi_update.sh index 0e8f4b7bda2..3db7631f3cb 100755 --- a/scripts/exgdas_efsoi_update.sh +++ b/scripts/exgdas_efsoi_update.sh @@ -19,10 +19,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_ecen.sh b/scripts/exgdas_enkf_ecen.sh index e6748be021b..7159ba017ac 100755 --- a/scripts/exgdas_enkf_ecen.sh +++ b/scripts/exgdas_enkf_ecen.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_fcst.sh b/scripts/exgdas_enkf_fcst.sh index 2656f644e25..63ef329e6c4 100755 --- a/scripts/exgdas_enkf_fcst.sh +++ b/scripts/exgdas_enkf_fcst.sh @@ -19,10 +19,7 @@ #### ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_post.sh b/scripts/exgdas_enkf_post.sh index d6beef67dbc..902bce9c357 100755 --- a/scripts/exgdas_enkf_post.sh +++ b/scripts/exgdas_enkf_post.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_select_obs.sh b/scripts/exgdas_enkf_select_obs.sh index 8f1548e907c..e60bc931f92 100755 --- a/scripts/exgdas_enkf_select_obs.sh +++ b/scripts/exgdas_enkf_select_obs.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_sfc.sh b/scripts/exgdas_enkf_sfc.sh index eae5240e23e..cb8a2239e61 100755 --- a/scripts/exgdas_enkf_sfc.sh +++ b/scripts/exgdas_enkf_sfc.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgdas_enkf_update.sh b/scripts/exgdas_enkf_update.sh index 373b6507c6b..c33de65e4fb 100755 --- a/scripts/exgdas_enkf_update.sh +++ b/scripts/exgdas_enkf_update.sh @@ -18,10 +18,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exgfs_atmos_awips_20km_1p0deg.sh b/scripts/exgfs_atmos_awips_20km_1p0deg.sh index d407f067519..3f9f84f2372 100755 --- a/scripts/exgfs_atmos_awips_20km_1p0deg.sh +++ b/scripts/exgfs_atmos_awips_20km_1p0deg.sh @@ -19,10 +19,7 @@ # echo " " ############################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" fcsthrs="$1" num=$# diff --git a/scripts/exgfs_atmos_fbwind.sh b/scripts/exgfs_atmos_fbwind.sh index 38d4a07a2ea..a4ecd248f00 100755 --- a/scripts/exgfs_atmos_fbwind.sh +++ b/scripts/exgfs_atmos_fbwind.sh @@ -14,10 +14,7 @@ # echo " Nov 2019 - B Vuong Removed WINTEMV bulletin (retired)" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh index 63e4a1de5e7..394c5c30d88 100755 --- a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh +++ b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh @@ -7,10 +7,7 @@ # in the future, we should move it above somewhere else. ############################################################## -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_gempak_meta.sh b/scripts/exgfs_atmos_gempak_meta.sh index 1162a36b119..cb64138c612 100755 --- a/scripts/exgfs_atmos_gempak_meta.sh +++ b/scripts/exgfs_atmos_gempak_meta.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_goes_nawips.sh b/scripts/exgfs_atmos_goes_nawips.sh index 9a67d54b7cf..7aae2e143cb 100755 --- a/scripts/exgfs_atmos_goes_nawips.sh +++ b/scripts/exgfs_atmos_goes_nawips.sh @@ -11,10 +11,7 @@ # echo "C. Magee: 10/2013 - swap X and Y for rtgssthr Atl and Pac." ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 80cd0902e24..ad24bf64354 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -7,10 +7,7 @@ # echo "-----------------------------------------------------" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_grib_awips.sh b/scripts/exgfs_atmos_grib_awips.sh index 6ce4ac7a1ba..5252d71983e 100755 --- a/scripts/exgfs_atmos_grib_awips.sh +++ b/scripts/exgfs_atmos_grib_awips.sh @@ -21,10 +21,7 @@ # echo " FEB 2019 - Removed grid 225" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" fcsthrs="$1" num=$# diff --git a/scripts/exgfs_atmos_nceppost.sh b/scripts/exgfs_atmos_nceppost.sh index e47cab6f92e..ae94472aeba 100755 --- a/scripts/exgfs_atmos_nceppost.sh +++ b/scripts/exgfs_atmos_nceppost.sh @@ -36,10 +36,7 @@ # echo "-----------------------------------------------------" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_atmos_postsnd.sh b/scripts/exgfs_atmos_postsnd.sh index 2be499cf266..114ab4e2344 100755 --- a/scripts/exgfs_atmos_postsnd.sh +++ b/scripts/exgfs_atmos_postsnd.sh @@ -20,10 +20,7 @@ # 9) 2019-12-18 Guang Ping Lou generalizing to reading in NetCDF or nemsio ################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" cd $DATA diff --git a/scripts/exgfs_pmgr.sh b/scripts/exgfs_pmgr.sh index 7aaa4ecccf2..a417bbed55b 100755 --- a/scripts/exgfs_pmgr.sh +++ b/scripts/exgfs_pmgr.sh @@ -6,10 +6,7 @@ # This script monitors the progress of the gfs_fcst job # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" hour=00 TEND=384 diff --git a/scripts/exgfs_prdgen_manager.sh b/scripts/exgfs_prdgen_manager.sh index 3cfa3acb6b0..7d0a95696b1 100755 --- a/scripts/exgfs_prdgen_manager.sh +++ b/scripts/exgfs_prdgen_manager.sh @@ -6,10 +6,7 @@ # This script monitors the progress of the gfs_fcst job # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" hour=00 TEND=384 diff --git a/scripts/exgfs_wave_init.sh b/scripts/exgfs_wave_init.sh index 0c4f44dc8c1..20f09800d1f 100755 --- a/scripts/exgfs_wave_init.sh +++ b/scripts/exgfs_wave_init.sh @@ -27,10 +27,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exgfs_wave_nawips.sh b/scripts/exgfs_wave_nawips.sh index 23f2cd6bba4..8d41578d7e1 100755 --- a/scripts/exgfs_wave_nawips.sh +++ b/scripts/exgfs_wave_nawips.sh @@ -11,10 +11,7 @@ # March-2020 Roberto.Padilla@noaa.gov ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" #export grids=${grids:-'glo_30m at_10m ep_10m wc_10m ao_9km'} #Interpolated grids export grids=${grids:-'glo_10m gso_15m ao_9km'} #Native grids diff --git a/scripts/exgfs_wave_post_gridded_sbs.sh b/scripts/exgfs_wave_post_gridded_sbs.sh index 82d8166f295..3be4ea700de 100755 --- a/scripts/exgfs_wave_post_gridded_sbs.sh +++ b/scripts/exgfs_wave_post_gridded_sbs.sh @@ -31,10 +31,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exgfs_wave_post_pnt.sh b/scripts/exgfs_wave_post_pnt.sh index 23f2ab7156c..902dff7e965 100755 --- a/scripts/exgfs_wave_post_pnt.sh +++ b/scripts/exgfs_wave_post_pnt.sh @@ -33,10 +33,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exgfs_wave_prdgen_bulls.sh b/scripts/exgfs_wave_prdgen_bulls.sh index 7411f9f626a..10bdee523b0 100755 --- a/scripts/exgfs_wave_prdgen_bulls.sh +++ b/scripts/exgfs_wave_prdgen_bulls.sh @@ -18,10 +18,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exgfs_wave_prdgen_gridded.sh b/scripts/exgfs_wave_prdgen_gridded.sh index 9b2e49f0d7f..b56fb15819f 100755 --- a/scripts/exgfs_wave_prdgen_gridded.sh +++ b/scripts/exgfs_wave_prdgen_gridded.sh @@ -19,10 +19,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exgfs_wave_prep.sh b/scripts/exgfs_wave_prep.sh index b9fd0528985..f3ecf388beb 100755 --- a/scripts/exgfs_wave_prep.sh +++ b/scripts/exgfs_wave_prep.sh @@ -40,10 +40,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/scripts/exglobal_atmos_analysis.sh b/scripts/exglobal_atmos_analysis.sh index 76b8ad283b0..991ffb87116 100755 --- a/scripts/exglobal_atmos_analysis.sh +++ b/scripts/exglobal_atmos_analysis.sh @@ -20,10 +20,7 @@ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exglobal_atmos_analysis_calc.sh b/scripts/exglobal_atmos_analysis_calc.sh index 84efad788f7..ef99181d969 100755 --- a/scripts/exglobal_atmos_analysis_calc.sh +++ b/scripts/exglobal_atmos_analysis_calc.sh @@ -20,10 +20,7 @@ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exglobal_atmos_pmgr.sh b/scripts/exglobal_atmos_pmgr.sh index bc9ee5c022e..6e4c2ed3f49 100755 --- a/scripts/exglobal_atmos_pmgr.sh +++ b/scripts/exglobal_atmos_pmgr.sh @@ -6,10 +6,7 @@ # This script monitors the progress of the gfs_fcst job # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" hour=00 diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh index 5622e9bbbe6..d4596941b83 100755 --- a/scripts/exglobal_atmos_sfcanl.sh +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -20,10 +20,7 @@ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exglobal_atmos_tropcy_qc_reloc.sh b/scripts/exglobal_atmos_tropcy_qc_reloc.sh index 30648224a45..6f96d7cfb43 100755 --- a/scripts/exglobal_atmos_tropcy_qc_reloc.sh +++ b/scripts/exglobal_atmos_tropcy_qc_reloc.sh @@ -10,10 +10,7 @@ # echo " Oct 2013 - Use main USH vars as part of minor pkg cleanup" ############################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Make sure we are in the $DATA directory cd $DATA diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index 426d2c973d3..33fe6f76711 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -20,10 +20,7 @@ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Directories. pwd=$(pwd) diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 830575d8c87..0a0ed0988af 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -77,10 +77,7 @@ # Main body starts here ####################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" SCRIPTDIR=$(dirname $(readlink -f "$0") )/../ush echo "MAIN: environment loaded for $machine platform,Current Script locates in $SCRIPTDIR." diff --git a/scripts/run_reg2grb2.sh b/scripts/run_reg2grb2.sh index 9ff59a75470..2284088f47e 100755 --- a/scripts/run_reg2grb2.sh +++ b/scripts/run_reg2grb2.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" #requires grib_util module diff --git a/scripts/run_regrid.sh b/scripts/run_regrid.sh index ea50a432457..6d18eeb6930 100755 --- a/scripts/run_regrid.sh +++ b/scripts/run_regrid.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" MOM6REGRID=${MOM6REGRID:-$HOMEgfs} export EXEC_DIR=$MOM6REGRID/exec diff --git a/ush/drive_makeprepbufr.sh b/ush/drive_makeprepbufr.sh index 15d95d1b115..31154c10bb7 100755 --- a/ush/drive_makeprepbufr.sh +++ b/ush/drive_makeprepbufr.sh @@ -18,10 +18,7 @@ ## CDUMP : cycle name (gdas / gfs) ############################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ############################################################### # Source relevant configs diff --git a/ush/fv3gfs_dwn_nems.sh b/ush/fv3gfs_dwn_nems.sh index 94af24a4d8e..eb29445b363 100755 --- a/ush/fv3gfs_dwn_nems.sh +++ b/ush/fv3gfs_dwn_nems.sh @@ -11,10 +11,7 @@ # Wen Meng 10/2019: Use bilinear interpolation for LAND, It can trancate land-sea mask as 0 or 1. # Wen Meng 11/2019: Teak sea ice cover via land-sea mask. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export tmpfile=$1 export fhr3=$2 diff --git a/ush/fv3gfs_nc2nemsio.sh b/ush/fv3gfs_nc2nemsio.sh index c2382503d9c..99eea9ce5f3 100755 --- a/ush/fv3gfs_nc2nemsio.sh +++ b/ush/fv3gfs_nc2nemsio.sh @@ -8,10 +8,7 @@ # X(1,1)=[0.25E,89.75S], X(nlon,nlat)=[359.75E,89.75N] #--------------------------------------------------------------------------- -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export CDATE=${CDATE:-"2016100300"} export GG=${master_grid:-"0p25deg"} # 1deg 0p5deg 0p25deg 0p125deg diff --git a/ush/fv3gfs_regrid_nemsio.sh b/ush/fv3gfs_regrid_nemsio.sh index df92864b338..c6d7e1ac118 100755 --- a/ush/fv3gfs_regrid_nemsio.sh +++ b/ush/fv3gfs_regrid_nemsio.sh @@ -20,10 +20,7 @@ # Machine: WCOSS-CRAY, Theia ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" #------------------------------------------------------- # Directories and paths diff --git a/ush/fv3gfs_remap.sh b/ush/fv3gfs_remap.sh index 32361782a2d..b1c3546d979 100755 --- a/ush/fv3gfs_remap.sh +++ b/ush/fv3gfs_remap.sh @@ -5,10 +5,7 @@ #-- Fanglin Yang, October 2016 #-------------------------------------- -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export CDATE=${CDATE:-"2016100300"} export CASE=${CASE:-"C192"} # C48 C96 C192 C384 C768 C1152 C3072 diff --git a/ush/gaussian_sfcanl.sh b/ush/gaussian_sfcanl.sh index 63d18aacf80..147afd5497b 100755 --- a/ush/gaussian_sfcanl.sh +++ b/ush/gaussian_sfcanl.sh @@ -110,10 +110,7 @@ # ################################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" CASE=${CASE:-C768} res=$(echo $CASE | cut -c2-) diff --git a/ush/getdump.sh b/ush/getdump.sh index 0b284204363..462ca5e7551 100755 --- a/ush/getdump.sh +++ b/ush/getdump.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" COMPONENT=${COMPONENT:-atmos} diff --git a/ush/getges.sh b/ush/getges.sh index 51a9650d7a1..2fb54fccc7d 100755 --- a/ush/getges.sh +++ b/ush/getges.sh @@ -76,10 +76,7 @@ ################################################################################ #------------------------------------------------------------------------------- -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Set some default parameters. fhbeg=03 # hour to begin searching backward for guess diff --git a/ush/gfs_bfr2gpk.sh b/ush/gfs_bfr2gpk.sh index 9344a3740bf..c11ec62735f 100755 --- a/ush/gfs_bfr2gpk.sh +++ b/ush/gfs_bfr2gpk.sh @@ -10,10 +10,7 @@ # Log: # # K. Brill/HPC 04/12/05 # ######################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Set GEMPAK paths. diff --git a/ush/gfs_bufr.sh b/ush/gfs_bufr.sh index 60e9bc38970..07bebd5ac0a 100755 --- a/ush/gfs_bufr.sh +++ b/ush/gfs_bufr.sh @@ -19,10 +19,7 @@ # 2019-10-10 Guang Ping Lou: Read in NetCDF files # echo "History: February 2003 - First implementation of this utility script" # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" if test "$F00FLAG" = "YES" then diff --git a/ush/gfs_bufr_netcdf.sh b/ush/gfs_bufr_netcdf.sh index da3d72f744b..30d7631da32 100755 --- a/ush/gfs_bufr_netcdf.sh +++ b/ush/gfs_bufr_netcdf.sh @@ -19,10 +19,7 @@ # 2019-10-10 Guang Ping Lou: Read in NetCDF files # echo "History: February 2003 - First implementation of this utility script" # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" if test "$F00FLAG" = "YES" then diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index be34672ade1..a8bee62d4d7 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -188,10 +188,7 @@ #### ################################################################################ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Command line arguments. export SIGINP=${1:-${SIGINP:-}} diff --git a/ush/gfs_sndp.sh b/ush/gfs_sndp.sh index d222e36c7cd..a0616e27b4a 100755 --- a/ush/gfs_sndp.sh +++ b/ush/gfs_sndp.sh @@ -7,10 +7,7 @@ # 1) 2004-09-10 Steve Gilbert First Implementation ################################################################ -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Create "collectives" consisting of groupings of the soundings # into files designated by geographical region. Each input diff --git a/ush/gfs_transfer.sh b/ush/gfs_transfer.sh index 480e3681616..9d23ec849ae 100755 --- a/ush/gfs_transfer.sh +++ b/ush/gfs_transfer.sh @@ -15,10 +15,7 @@ # echo "-----------------------------------------------------" ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # export CNVGRIB=/nwprod/util/exec/cnvgrib # export GRB2INDX=/nwprod/util/exec/grb2index diff --git a/ush/gfs_truncate_enkf.sh b/ush/gfs_truncate_enkf.sh index 5b3a363bed8..c7bdfad0c46 100755 --- a/ush/gfs_truncate_enkf.sh +++ b/ush/gfs_truncate_enkf.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" member=$1 export SIGINP=$2 diff --git a/ush/global_extrkr.sh b/ush/global_extrkr.sh index ebc438f8523..ad0b249b28a 100755 --- a/ush/global_extrkr.sh +++ b/ush/global_extrkr.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" userid=$LOGNAME diff --git a/ush/global_nceppost.sh b/ush/global_nceppost.sh index 31bc757028e..45aebe8e4f0 100755 --- a/ush/global_nceppost.sh +++ b/ush/global_nceppost.sh @@ -184,10 +184,7 @@ #### ################################################################################ # Set environment. -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Command line arguments. export SIGINP=${1:-${SIGINP}} diff --git a/ush/global_savefits.sh b/ush/global_savefits.sh index ec823067d13..f26132dd8a6 100755 --- a/ush/global_savefits.sh +++ b/ush/global_savefits.sh @@ -3,10 +3,7 @@ ######################################################## # save fit and horiz files for all analysis cycles ######################################################## -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export FIT_DIR=${FIT_DIR:-$COMOUT/fits} export HORZ_DIR=${HORZ_DIR:-$COMOUT/horiz} diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index 434aae408f7..9785de98acf 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -4,10 +4,7 @@ # Fanglin Yang, 20180318 # --create bunches of files to be archived to HPSS ################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" type=${1:-gfs} ##gfs, gdas, enkfgdas or enkfggfs diff --git a/ush/link_crtm_fix.sh b/ush/link_crtm_fix.sh index 981b263c6c7..0d4d8dc55b0 100755 --- a/ush/link_crtm_fix.sh +++ b/ush/link_crtm_fix.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # Get CRTM fix directory from (in this order): # 1. First argument to script, or diff --git a/ush/mod_icec.sh b/ush/mod_icec.sh index 5da8ae7eea9..f62131846e3 100755 --- a/ush/mod_icec.sh +++ b/ush/mod_icec.sh @@ -3,10 +3,7 @@ #This script is used for modifing icee via land-sea mask #Wen Meng 11/2019: First Version -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" f=$1 diff --git a/ush/scale_dec.sh b/ush/scale_dec.sh index 63204c11bb7..59e2bab14eb 100755 --- a/ush/scale_dec.sh +++ b/ush/scale_dec.sh @@ -9,10 +9,7 @@ # B = binary scaling or the text 'same' with no quotes # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" f=$1 diff --git a/ush/syndat_getjtbul.sh b/ush/syndat_getjtbul.sh index 040f4e5e183..89196d05966 100755 --- a/ush/syndat_getjtbul.sh +++ b/ush/syndat_getjtbul.sh @@ -26,10 +26,7 @@ # jlogfile - path to job log file (skipped over by this script if not # passed in) -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" EXECSYND=${EXECSYND:-${HOMESYND}/exec} diff --git a/ush/syndat_qctropcy.sh b/ush/syndat_qctropcy.sh index 8c6633dd49b..571a7543b53 100755 --- a/ush/syndat_qctropcy.sh +++ b/ush/syndat_qctropcy.sh @@ -71,10 +71,7 @@ # (Default: not set) # TIMEIT - optional time and resource reporting (Default: not set) -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ARCHSYND=${ARCHSYND:-$COMROOTp3/gfs/prod/syndat} HOMENHCp1=${HOMENHCp1:-/gpfs/?p1/nhc/save/guidance/storm-data/ncep} diff --git a/ush/trim_rh.sh b/ush/trim_rh.sh index 65b2776b9fb..2de2e17c7bb 100755 --- a/ush/trim_rh.sh +++ b/ush/trim_rh.sh @@ -3,10 +3,7 @@ #This is scripts is used to trim RH vaule larger than 100. # Wen Meng 12/2017: First Version -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" f=$1 diff --git a/ush/tropcy_relocate.sh b/ush/tropcy_relocate.sh index 059958c8ac4..e3a82efaf7c 100755 --- a/ush/tropcy_relocate.sh +++ b/ush/tropcy_relocate.sh @@ -211,10 +211,7 @@ # #### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" MACHINE=${MACHINE:-$(hostname -s | cut -c 1-3)} diff --git a/ush/tropcy_relocate_extrkr.sh b/ush/tropcy_relocate_extrkr.sh index 26d35d2e31a..79295cead0a 100755 --- a/ush/tropcy_relocate_extrkr.sh +++ b/ush/tropcy_relocate_extrkr.sh @@ -3,10 +3,7 @@ # This script is executed by the script tropcy_relocate.sh # -------------------------------------------------------- -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" export machine=${machine:-ZEUS} export machine=$(echo $machine|tr '[a-z]' '[A-Z]') diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh index d326f02b36f..58c483adf55 100755 --- a/ush/wave_grib2_sbs.sh +++ b/ush/wave_grib2_sbs.sh @@ -26,10 +26,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index c0373205d73..9fe88eb1fb1 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -26,10 +26,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_grid_moddef.sh b/ush/wave_grid_moddef.sh index 6dba5f4458f..80c041df37c 100755 --- a/ush/wave_grid_moddef.sh +++ b/ush/wave_grid_moddef.sh @@ -20,10 +20,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_outp_cat.sh b/ush/wave_outp_cat.sh index 6e1d6226fee..52974eb9398 100755 --- a/ush/wave_outp_cat.sh +++ b/ush/wave_outp_cat.sh @@ -22,10 +22,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh index ad59c704f19..2d04901d53d 100755 --- a/ush/wave_outp_spec.sh +++ b/ush/wave_outp_spec.sh @@ -23,10 +23,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh index b9a0a15ab71..2c395f6ae31 100755 --- a/ush/wave_prnc_cur.sh +++ b/ush/wave_prnc_cur.sh @@ -23,10 +23,7 @@ ################################################################################ # -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" ymdh_rtofs=$1 curfile=$2 diff --git a/ush/wave_prnc_ice.sh b/ush/wave_prnc_ice.sh index d83798906c2..16473dbd1f2 100755 --- a/ush/wave_prnc_ice.sh +++ b/ush/wave_prnc_ice.sh @@ -27,10 +27,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation diff --git a/ush/wave_tar.sh b/ush/wave_tar.sh index 695b8a2e4d5..452601dceb4 100755 --- a/ush/wave_tar.sh +++ b/ush/wave_tar.sh @@ -25,10 +25,7 @@ # --------------------------------------------------------------------------- # # 0. Preparations -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT -fi +source "$HOMEgfs/ush/preamble.sh" # 0.a Basic modes of operation From 62c408148b2dcf498fc47df120e69d2cae280d21 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Wed, 27 Jul 2022 16:20:38 +0000 Subject: [PATCH 03/14] Replace remaining preamble script blocks In the earlier commit replacing the variable preamble script with a static one in ush, those scripts that were using the preamble label were omitted from the find/replace. Those are now also replaced. Refs: #397 --- scripts/exgdas_atmos_nawips.sh | 5 +---- scripts/exgfs_atmos_nawips.sh | 5 +---- ush/fv3gfs_downstream_nems.sh | 5 +---- ush/inter_flux.sh | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/scripts/exgdas_atmos_nawips.sh b/scripts/exgdas_atmos_nawips.sh index b309b3af147..4836065aa72 100755 --- a/scripts/exgdas_atmos_nawips.sh +++ b/scripts/exgdas_atmos_nawips.sh @@ -10,10 +10,7 @@ # echo " data on the CCS is properly protected." ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT ${2} -fi +source "$HOMEgfs/ush/preamble.sh" "${2}" cd $DATA RUN=$1 diff --git a/scripts/exgfs_atmos_nawips.sh b/scripts/exgfs_atmos_nawips.sh index 54385cb09ee..5b751735067 100755 --- a/scripts/exgfs_atmos_nawips.sh +++ b/scripts/exgfs_atmos_nawips.sh @@ -10,10 +10,7 @@ # echo " data on the CCS is properly protected." ##################################################################### -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT ${2} -fi +source "$HOMEgfs/ush/preamble.sh" "${2}" #### If EMC GFS PARA runs hourly file are not available, The ILPOST #### will set to 3 hour in EMC GFS PARA. diff --git a/ush/fv3gfs_downstream_nems.sh b/ush/fv3gfs_downstream_nems.sh index 48f9242df1f..a1257ec4af2 100755 --- a/ush/fv3gfs_downstream_nems.sh +++ b/ush/fv3gfs_downstream_nems.sh @@ -30,10 +30,7 @@ # 1. Modify sea icea cover via land-sea mask. #----------------------------------------------------------------------- -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT $FH -fi +source "$HOMEgfs/ush/preamble.sh" "$FH" export downset=${downset:-1} export DATA=${DATA:-/ptmpd2/$LOGNAME/test} diff --git a/ush/inter_flux.sh b/ush/inter_flux.sh index a0132ff18aa..edbde9e40c0 100755 --- a/ush/inter_flux.sh +++ b/ush/inter_flux.sh @@ -1,9 +1,6 @@ #! /usr/bin/env bash -PREAMBLE_SCRIPT="${PREAMBLE_SCRIPT:-$HOMEgfs/ush/preamble.sh}" -if [ -f "${PREAMBLE_SCRIPT}" ]; then - source $PREAMBLE_SCRIPT $FH -fi +source "$HOMEgfs/ush/preamble.sh" "$FH" #----------------------------------------------------------------------- #-Wen Meng, 03/2019: First version. From ec8eb260ba3bb45a403e051d461395647e3cf995 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Wed, 27 Jul 2022 17:10:57 +0000 Subject: [PATCH 04/14] Abstract safe_copy into new file_utils script Moves the new safe_copy function out of `arch.sh` to a new `file_utils.sh` script, as it will be more widely useful. Also replace file checks in earc with safe_copy. Refs: #397 --- jobs/rocoto/arch.sh | 26 ++------------------------ jobs/rocoto/earc.sh | 13 +++++-------- ush/file_utils.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 32 deletions(-) create mode 100644 ush/file_utils.sh diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index 738263672a0..294da5002d7 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -59,33 +59,11 @@ PDY_MOS=$(echo $CDATE_MOS | cut -c1-8) # Archive online for verification and diagnostics ############################################################### -safe_copy() { - # - # Copy a file if it exists, print a warning otherwise but don't - # error. Syntax is the same as cp. - # - # Syntax - # safe_copy file_in file_out - # - # Arguments - # file_in: the file to copy - # file_out: the destination of the copy - # - # Environment variables - # NCP: Command to use to copy - # - _file_in=$1 - _file_out=$2 - if [[ -f ${_file_in} ]]; then - $NCP ${_file_in} ${_file_out} - else - echo "WARNING: No file ${_file_in} found in $(pwd)" - fi -} - COMIN=${COMINatmos:-"$ROTDIR/$CDUMP.$PDY/$cyc/atmos"} cd $COMIN +source "${HOMEgfs}/ush/file_utils.sh" + [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR safe_copy ${APREFIX}gsistat $ARCDIR/gsistat.${CDUMP}.${CDATE} safe_copy ${APREFIX}pgrb2.1p00.anl $ARCDIR/pgbanl.${CDUMP}.${CDATE}.grib2 diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index 20d9df912b3..0f0bcee78a8 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -58,6 +58,7 @@ fi cd $ROTDIR +source "${HOMEgfs}/ush/file_utils.sh" ################################################################### # ENSGRP > 0 archives a group of ensemble members @@ -150,16 +151,12 @@ if [ $ENSGRP -eq 0 ]; then [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR cd $ARCDIR - if [[ -f $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat ]]; then - $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE - fi - if [[ -f $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean ]]; then - $NCP $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean - fi + safe_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE + safe_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean if [ $CDUMP_ENKF != "GDAS" ]; then - $NCP $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE - $NCP $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.gfs.${CDATE}.ensmean + safe_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE + safe_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.gfs.${CDATE}.ensmean fi fi diff --git a/ush/file_utils.sh b/ush/file_utils.sh new file mode 100644 index 00000000000..30cac11b252 --- /dev/null +++ b/ush/file_utils.sh @@ -0,0 +1,27 @@ +#! /usr/bin/env bash + +safe_copy() { + # + # TODO - Extend this to take multiple arguments for file_in (like cp) + # + # Copy a file if it exists, print a warning otherwise but don't + # error. + # + # Syntax + # safe_copy file_in file_out + # + # Arguments + # file_in: the file to copy + # file_out: the destination of the copy + # + # Environment variables + # NCP: Command to use to copy (default: cp) + # + local file_in="${1}" + local file_out="${2}" + if [[ -f ${file_in} ]]; then + ${NCP:-cp} ${file_in} ${file_out} + else + echo "WARNING: No file ${file_in} found (pwd: $(pwd))" + fi +} From dfc957de16784d9d5b300d2c0418b6740c814272 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Wed, 27 Jul 2022 18:30:15 +0000 Subject: [PATCH 05/14] Change safe_copy to nb_copy Refs: #397 --- jobs/rocoto/arch.sh | 20 ++++++++++---------- jobs/rocoto/earc.sh | 8 ++++---- ush/file_utils.sh | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index 294da5002d7..c9441b5a755 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -65,8 +65,8 @@ cd $COMIN source "${HOMEgfs}/ush/file_utils.sh" [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR -safe_copy ${APREFIX}gsistat $ARCDIR/gsistat.${CDUMP}.${CDATE} -safe_copy ${APREFIX}pgrb2.1p00.anl $ARCDIR/pgbanl.${CDUMP}.${CDATE}.grib2 +nb_copy ${APREFIX}gsistat $ARCDIR/gsistat.${CDUMP}.${CDATE} +nb_copy ${APREFIX}pgrb2.1p00.anl $ARCDIR/pgbanl.${CDUMP}.${CDATE}.grib2 # Archive 1 degree forecast GRIB2 files for verification if [ $CDUMP = "gfs" ]; then @@ -75,7 +75,7 @@ if [ $CDUMP = "gfs" ]; then while [ $fhr -le $fhmax ]; do fhr2=$(printf %02i $fhr) fhr3=$(printf %03i $fhr) - safe_copy ${APREFIX}pgrb2.1p00.f$fhr3 $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 + nb_copy ${APREFIX}pgrb2.1p00.f$fhr3 $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 fhr=$((10#$fhr + 10#$FHOUT_GFS )) done fi @@ -84,7 +84,7 @@ if [ $CDUMP = "gdas" ]; then for fhr in $flist; do fname=${APREFIX}pgrb2.1p00.f${fhr} fhr2=$(printf %02i $((10#$fhr))) - safe_copy $fname $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 + nb_copy $fname $ARCDIR/pgbf${fhr2}.${CDUMP}.${CDATE}.grib2 done fi @@ -101,10 +101,10 @@ if [ $CDUMP = "gdas" -a -s gdas.t${cyc}z.cyclone.trackatcfunix ]; then fi if [ $CDUMP = "gfs" ]; then - safe_copy storms.gfso.atcf_gen.$CDATE ${ARCDIR}/. - safe_copy storms.gfso.atcf_gen.altg.$CDATE ${ARCDIR}/. - safe_copy trak.gfso.atcfunix.$CDATE ${ARCDIR}/. - safe_copy trak.gfso.atcfunix.altg.$CDATE ${ARCDIR}/. + nb_copy storms.gfso.atcf_gen.$CDATE ${ARCDIR}/. + nb_copy storms.gfso.atcf_gen.altg.$CDATE ${ARCDIR}/. + nb_copy trak.gfso.atcfunix.$CDATE ${ARCDIR}/. + nb_copy trak.gfso.atcfunix.altg.$CDATE ${ARCDIR}/. mkdir -p ${ARCDIR}/tracker.$CDATE/$CDUMP blist="epac natl" @@ -127,8 +127,8 @@ if [ $CDUMP = "gfs" -a $FITSARC = "YES" ]; then fhr3=$(printf %03i $fhr) sfcfile=${prefix}.sfcf${fhr3}${ASUFFIX} sigfile=${prefix}.atmf${fhr3}${ASUFFIX} - safe_copy $sfcfile $VFYARC/${CDUMP}.$PDY/$cyc/ - safe_copy $sigfile $VFYARC/${CDUMP}.$PDY/$cyc/ + nb_copy $sfcfile $VFYARC/${CDUMP}.$PDY/$cyc/ + nb_copy $sigfile $VFYARC/${CDUMP}.$PDY/$cyc/ (( fhr = 10#$fhr + 6 )) done fi diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index 0f0bcee78a8..8b80b4b9e88 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -151,12 +151,12 @@ if [ $ENSGRP -eq 0 ]; then [[ ! -d $ARCDIR ]] && mkdir -p $ARCDIR cd $ARCDIR - safe_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE - safe_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean + nb_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.${CDUMP}.$CDATE + nb_copy $ROTDIR/enkf${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.${CDUMP}.${CDATE}.ensmean if [ $CDUMP_ENKF != "GDAS" ]; then - safe_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE - safe_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.gfs.${CDATE}.ensmean + nb_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE + nb_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.gfs.${CDATE}.ensmean fi fi diff --git a/ush/file_utils.sh b/ush/file_utils.sh index 30cac11b252..544a270b0a9 100644 --- a/ush/file_utils.sh +++ b/ush/file_utils.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash -safe_copy() { +nb_copy() { # # TODO - Extend this to take multiple arguments for file_in (like cp) # @@ -8,7 +8,7 @@ safe_copy() { # error. # # Syntax - # safe_copy file_in file_out + # nb_copy file_in file_out # # Arguments # file_in: the file to copy From dcb993ca6b69d8aeffe8cf034738b711e9da7d20 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Wed, 27 Jul 2022 19:43:10 +0000 Subject: [PATCH 06/14] Remove stray POSTAMBLE_SCRIPT One postamble block from an earlier iteration was missed. Refs: #397 --- ush/inter_flux.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ush/inter_flux.sh b/ush/inter_flux.sh index edbde9e40c0..6b3d4340697 100755 --- a/ush/inter_flux.sh +++ b/ush/inter_flux.sh @@ -60,11 +60,6 @@ fi cp fluxfile_${fhr3}_1p00 $COMOUT/${PREFIX}flux.1p00.f${fhr3} #--------------------------------------------------------------- -POSTAMBLE_SCRIPT="${POSTAMBLE_SCRIPT:-$HOMEgfs/ush/postamble.sh}" -if [ -f "${POSTAMBLE_SCRIPT}" ]; then - source $POSTAMBLE_SCRIPT -fi -#--------------------------------------------------------------- exit 0 From 0e4f2da4365d0b614042a20aad5be6e6e934f750 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Wed, 27 Jul 2022 20:10:32 +0000 Subject: [PATCH 07/14] Fix a couple minor typos Refs: #397 --- jobs/rocoto/vrfy.sh | 2 +- ush/preamble.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs/rocoto/vrfy.sh b/jobs/rocoto/vrfy.sh index 8f80aedd1ae..57bf1814b98 100755 --- a/jobs/rocoto/vrfy.sh +++ b/jobs/rocoto/vrfy.sh @@ -58,7 +58,7 @@ echo echo "=============== START TO GENERATE QUARTER DEGREE GRIB1 FILES ===============" if [ $MKPGB4PRCP = "YES" -a $CDUMP = "gfs" ]; then if [ ! -d $ARCDIR ]; then mkdir $ARCDIR ; fi - nthreads_env=${OMP_NUM_THREADS:-1} # get threads set in env + nthreads_env=${OMP_NUM_THREADS:-1} # get threads set in env export OMP_NUM_THREADS=1 cd $COMIN fhmax=${vhr_rain:-$FHMAX_GFS} diff --git a/ush/preamble.sh b/ush/preamble.sh index 396ac654422..bfa326f1030 100644 --- a/ush/preamble.sh +++ b/ush/preamble.sh @@ -78,7 +78,7 @@ postamble() { exit ${rc} } -# Place the postable in a trap so it is always called no matter how the script exits +# Place the postamble in a trap so it is always called no matter how the script exits trap "postamble ${_calling_script} ${start_time} \$?" EXIT # Turn on our settings From e9ec9cec5d89f33e590ea7b379ee2a3254786df4 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 01:42:22 +0000 Subject: [PATCH 08/14] Add accidentally delete else back in During script updates, an `else` accidentally got deleted from the wave init script, so both true and false code blocks were being executed. Refs: #397 --- scripts/exgfs_wave_init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/exgfs_wave_init.sh b/scripts/exgfs_wave_init.sh index 0e6d8daf545..31c39fd52a7 100755 --- a/scripts/exgfs_wave_init.sh +++ b/scripts/exgfs_wave_init.sh @@ -193,6 +193,7 @@ source "$HOMEgfs/ush/preamble.sh" echo " mod_def.$grdID succesfully created/copied " echo ' ' ${TRACE_ON:-set -x} + else set +x echo ' ' echo '********************************************** ' From c4501078690a3fce06113ecaf289613757292982 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 01:47:04 +0000 Subject: [PATCH 09/14] Remove unneeded rundir cleanup in wave init Refs: #397 --- jobs/rocoto/waveinit.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh index ad92e0017af..5995b85302a 100755 --- a/jobs/rocoto/waveinit.sh +++ b/jobs/rocoto/waveinit.sh @@ -17,9 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_INIT status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - - exit 0 From b92f9385e254f6449d313d947825dbcdc68d37ec Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 19:00:52 +0000 Subject: [PATCH 10/14] Remove wait in rocoto post script The rocoto pre-job script for post would wait once if the post file didn't exist. However (a) the exscript will already sleep (b) the rocoto task doesn't run until the file exists or forecast is comp- lete anyway. Refs: #397 --- jobs/rocoto/post.sh | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/jobs/rocoto/post.sh b/jobs/rocoto/post.sh index 0a7c33aae0b..c3f3e6655bf 100755 --- a/jobs/rocoto/post.sh +++ b/jobs/rocoto/post.sh @@ -26,25 +26,10 @@ fi #--------------------------------------------------------------- for fhr in $fhrlst; do - - if [ ! -f $restart_file${fhr}.nemsio -a ! -f $restart_file${fhr}.nc -a ! -f $restart_file${fhr}.txt ]; then - echo "Nothing to process for FHR = $fhr, cycle, wait for 5 minutes" - sleep 300 - fi - if [ ! -f $restart_file${fhr}.nemsio -a ! -f $restart_file${fhr}.nc -a ! -f $restart_file${fhr}.txt ]; then - echo "Nothing to process for FHR = $fhr, cycle, skip" - continue - fi - - #master=$ROTDIR/${CDUMP}.${PDY}/${cyc}/$COMPONENT/${CDUMP}.t${cyc}z.master.grb2f${fhr} - pgb0p25=$ROTDIR/${CDUMP}.${PDY}/${cyc}/$COMPONENT/${CDUMP}.t${cyc}z.pgrb2.0p25.f${fhr} - if [ ! -s $pgb0p25 ]; then - export post_times=$fhr - $HOMEgfs/jobs/JGLOBAL_ATMOS_NCEPPOST - status=$? - [[ $status -ne 0 ]] && exit $status - fi - + export post_times=$fhr + $HOMEgfs/jobs/JGLOBAL_ATMOS_NCEPPOST + status=$? + [[ $status -ne 0 ]] && exit $status done ############################################################### From a1687c75774b7f1286a9c7df7da1a3ffd7534dd0 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 19:05:40 +0000 Subject: [PATCH 11/14] Enamble WW3 predet The WW3 predet function was not being called, but it sets RSTDIR_WAVE, which is needed by det to determine if it is a rerun. Refs: #397 --- scripts/exglobal_forecast.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exglobal_forecast.sh b/scripts/exglobal_forecast.sh index 0a0ed0988af..3f2ad87cafd 100755 --- a/scripts/exglobal_forecast.sh +++ b/scripts/exglobal_forecast.sh @@ -128,7 +128,7 @@ case $RUN in 'gefs') FV3_GEFS_predet;; esac [[ $cplflx = .true. ]] && MOM6_predet -#[[ $cplwav = .true. ]] && WW3_predet #no WW3_predet at this time +[[ $cplwav = .true. ]] && WW3_predet [[ $cplice = .true. ]] && CICE_predet case $RUN in From c61a673b895013edaad5b49cf6c7bfaf98b6fc74 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 19:47:51 +0000 Subject: [PATCH 12/14] Fix rc check in gocart postdet GOCART postdet wasn't redefining the status variable before checking for a non-zero error code. Also, the short-circuit wasn't working properly for some reason even when the rc was 0, so it is changed to a proper if/then. Refs: #397 --- ush/forecast_postdet.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 4a5d722e5ca..089ff7dd5b4 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -651,7 +651,7 @@ WW3_postdet() { if [ $RERUN = "NO" ]; then waverstfile=${WRDIR}/${sPDY}.${scyc}0000.restart.${wavGRD} else - waverstfile=${RSTDIR_WAVE}/${PDYT}.${cyct}0000.restart.${wavGRD} + waverstfile=${RSTDIR_WAVE}/${PDYT}.${cyct}0000.restart.${wavGRD} fi else waverstfile=${RSTDIR_WAVE}/${sPDY}.${scyc}0000.restart.${wavGRD} @@ -997,7 +997,8 @@ GOCART_rc() { cat ${AERO_CONFIG_DIR}/ExtData.${AERO_EMIS_FIRE:-none} ; \ echo "%%" ; \ } > $DATA/AERO_ExtData.rc - [[ $status -ne 0 ]] && exit $status + status=$? + if (( status != 0 )); then exit $status; fi fi fi } From 6ca239dcf994cd2021da5e7fa9aa7a8ee4bef786 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 28 Jul 2022 20:03:01 +0000 Subject: [PATCH 13/14] Add preamble to new GDAS scripts Updated the new GDAS scripts to be in line with the changes made to other scripts in this branch. Also replaced the backticks. Refs: #397 --- jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_POST | 8 +------- jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_PREP | 8 +------- jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_RUN | 8 +------- jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_POST | 8 +------- jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_PREP | 8 +------- jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_RUN | 8 +------- scripts/exgdas_global_atmos_analysis_run.sh | 13 +++---------- scripts/exgdas_global_atmos_ensanal_run.sh | 13 +++---------- 8 files changed, 12 insertions(+), 62 deletions(-) diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_POST b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_POST index 77846954453..d8cd0416cdd 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_POST +++ b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_POST @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -119,5 +114,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_PREP b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_PREP index cde886e36b3..01895d4d5c9 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_PREP +++ b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_PREP @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -119,5 +114,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_RUN b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_RUN index aadf4d7a420..79986238518 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_RUN +++ b/jobs/JGDAS_GLOBAL_ATMOS_ANALYSIS_RUN @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -119,5 +114,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_POST b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_POST index f1e85447d25..871ba7a35f6 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_POST +++ b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_POST @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -122,5 +117,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_PREP b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_PREP index 618984bcab1..b284e90e67f 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_PREP +++ b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_PREP @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -122,5 +117,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_RUN b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_RUN index d3b2c7f90ea..b3f5c0fa90a 100755 --- a/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_RUN +++ b/jobs/JGDAS_GLOBAL_ATMOS_ENSANAL_RUN @@ -1,11 +1,6 @@ #!/bin/bash -##set -ex -set -x -set -u - -export PS4='$SECONDS + ' -date +source "$HOMEgfs/ush/preamble.sh" ############################# # Source relevant config files @@ -122,5 +117,4 @@ fi cd $DATAROOT [[ $KEEPDATA = "NO" ]] && rm -rf $DATA -date exit 0 diff --git a/scripts/exgdas_global_atmos_analysis_run.sh b/scripts/exgdas_global_atmos_analysis_run.sh index b5aaf24cbc2..0f2edbd7464 100755 --- a/scripts/exgdas_global_atmos_analysis_run.sh +++ b/scripts/exgdas_global_atmos_analysis_run.sh @@ -19,11 +19,7 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x -fi +source "$HOMEgfs/ush/preamble.sh" # Directories pwd=$(pwd) @@ -155,7 +151,7 @@ err_chk ################################################################################ # Create log file noting creating of analysis increment file -echo "$CDUMP $CDATE atminc and tiled sfcanl done at `date`" > $COMOUT/${CDUMP}.${cycle}.loginc.txt +echo "$CDUMP $CDATE atminc and tiled sfcanl done at $(date)" > $COMOUT/${CDUMP}.${cycle}.loginc.txt ################################################################################ # Copy diags and YAML to $COMOUT @@ -172,10 +168,7 @@ for abias in $alist; do done ################################################################################ -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err ################################################################################ diff --git a/scripts/exgdas_global_atmos_ensanal_run.sh b/scripts/exgdas_global_atmos_ensanal_run.sh index 27f3339b588..68d53d3695d 100755 --- a/scripts/exgdas_global_atmos_ensanal_run.sh +++ b/scripts/exgdas_global_atmos_ensanal_run.sh @@ -19,11 +19,7 @@ ################################################################################ # Set environment. -export VERBOSE=${VERBOSE:-"YES"} -if [ $VERBOSE = "YES" ]; then - echo $(date) EXECUTING $0 $* >&2 - set -x -fi +source "$HOMEgfs/ush/preamble.sh" # Directories pwd=$(pwd) @@ -154,7 +150,7 @@ done ################################################################################ # Create log file noting creating of analysis increment file -echo "$CDUMP $CDATE atminc done at `date`" > $COMOUT_ENS/${CDUMP}.${cycle}.loginc.txt +echo "$CDUMP $CDATE atminc done at $(date)" > $COMOUT_ENS/${CDUMP}.${cycle}.loginc.txt ################################################################################ # Copy diags and YAML to $COMOUT @@ -163,10 +159,7 @@ cp -rf $DATA/diags $COMOUT_ENS/ ################################################################################ -set +x -if [ $VERBOSE = "YES" ]; then - echo $(date) EXITING $0 with return code $err >&2 -fi + exit $err ################################################################################ From c19cfe0839c28cf8488f3e3f18daa74e83a8557c Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Fri, 29 Jul 2022 17:35:49 +0000 Subject: [PATCH 14/14] Removed unncessary DATA cleanup in job/rocoto scripts Some of the rocoto job scripts were attempting to remove DATA based on a DATAROOT variable that was not defined (it is defined in config.base, which these scripts were not sourcing). Since the real j-job takes care of DATA cleaning, these are unnecessary anyway. Refs: #397 --- jobs/rocoto/post.sh | 4 ---- jobs/rocoto/wavepostbndpnt.sh | 5 ----- jobs/rocoto/wavepostbndpntbll.sh | 5 ----- jobs/rocoto/wavepostpnt.sh | 5 ----- jobs/rocoto/wavepostsbs.sh | 5 ----- jobs/rocoto/waveprep.sh | 4 ---- 6 files changed, 28 deletions(-) diff --git a/jobs/rocoto/post.sh b/jobs/rocoto/post.sh index c3f3e6655bf..b32e8c511d7 100755 --- a/jobs/rocoto/post.sh +++ b/jobs/rocoto/post.sh @@ -32,8 +32,4 @@ for fhr in $fhrlst; do [[ $status -ne 0 ]] && exit $status done -############################################################### -# Exit out cleanly - - exit 0 diff --git a/jobs/rocoto/wavepostbndpnt.sh b/jobs/rocoto/wavepostbndpnt.sh index f9ba74ae1fd..fe0e2a07233 100755 --- a/jobs/rocoto/wavepostbndpnt.sh +++ b/jobs/rocoto/wavepostbndpnt.sh @@ -17,9 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_POST_BNDPNT status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - - exit 0 diff --git a/jobs/rocoto/wavepostbndpntbll.sh b/jobs/rocoto/wavepostbndpntbll.sh index 5447b298994..cea3c0bc6b2 100755 --- a/jobs/rocoto/wavepostbndpntbll.sh +++ b/jobs/rocoto/wavepostbndpntbll.sh @@ -17,9 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_POST_BNDPNTBLL status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - - exit 0 diff --git a/jobs/rocoto/wavepostpnt.sh b/jobs/rocoto/wavepostpnt.sh index 51ae05795eb..1b1d8c97650 100755 --- a/jobs/rocoto/wavepostpnt.sh +++ b/jobs/rocoto/wavepostpnt.sh @@ -17,9 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_POST_PNT status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - - exit 0 diff --git a/jobs/rocoto/wavepostsbs.sh b/jobs/rocoto/wavepostsbs.sh index e4b119efef1..fb4fdfbd8b6 100755 --- a/jobs/rocoto/wavepostsbs.sh +++ b/jobs/rocoto/wavepostsbs.sh @@ -17,9 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_POST_SBS status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - - exit 0 diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh index 8308b3fd562..c55c8526d98 100755 --- a/jobs/rocoto/waveprep.sh +++ b/jobs/rocoto/waveprep.sh @@ -17,8 +17,4 @@ $HOMEgfs/jobs/JGLOBAL_WAVE_PREP status=$? [[ $status -ne 0 ]] && exit $status -############################################################### -# Force Exit out cleanly -if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi - exit 0