Skip to content

Commit

Permalink
Rename post scripts (#1038)
Browse files Browse the repository at this point in the history
Rename post scripts to remove the unnecessary "ncep" qualifier. Also changes the executable name for upp to be the one produced by upp (`upp.x`).

The ush/global_nceppost.sh script is removed as it is not used by any job. We may want to rename the gfs_post.sh script (the one that is used) to global_post.sh to be more reflective of its usage.
  • Loading branch information
WalterKolczynski-NOAA authored Oct 4, 2022
1 parent 065a0dd commit 948f941
Show file tree
Hide file tree
Showing 9 changed files with 428 additions and 878 deletions.
11 changes: 11 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# Global settings for Spellcheck (https://github.com/koalaman/shellcheck)
enable=all

external-sources=false

# Disable variable referenced but not assigned
disable=SC2154

# Disable following non-constant source
disable=SC1090

# Disable non-existent binary
disable=SC1091
58 changes: 30 additions & 28 deletions jobs/JGLOBAL_ATMOS_NCEPPOST → jobs/JGLOBAL_ATMOS_POST
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

export RUN_ENVIR=${RUN_ENVIR:-"nco"}

#############################
# Source relevant config files
#############################
configs="base post"
export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config}
config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config}
for config in $configs; do
. $config_path/config.$config
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}/config.${config}"
status=$?
[[ $status -ne 0 ]] && exit $status
(( status != 0 )) && exit "${status}"
done


##########################################
# Source machine runtime environment
##########################################
. $HOMEgfs/env/${machine}.env post
. "${HOMEgfs}/env/${machine}.env" post
status=$?
[[ $status -ne 0 ]] && exit $status
(( status != 0 )) && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL$job"}
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA
export outid=${outid:-"LL${job}"}
export DATA=${DATA:-${DATAROOT}/${jobid}}
mkdir -p "${DATA}"
cd "${DATA}" || exit 1


##############################################
Expand Down Expand Up @@ -68,30 +68,32 @@ export COMPONENT=${COMPONENT:-atmos}
##############################################
# Begin JOB SPECIFIC work
##############################################
export APRUNP=${APRUN:-$APRUN_NP}
export APRUNP=${APRUN:-${APRUN_NP}}
export RERUN=${RERUN:-NO}
export HOMECRTM=${HOMECRTM:-${PACKAGEROOT:?}/lib/crtm/${crtm_ver:?}}
export HOMECRTM=${HOMECRTM:-${PACKAGEROOT}/lib/crtm/${crtm_ver}}
export FIXCRTM=${CRTM_FIX:-${HOMECRTM}/fix}
export PARMpost=${PARMpost:-$HOMEgfs/parm/post}
export PARMpost=${PARMpost:-${HOMEgfs}/parm/post}
export INLINE_POST=${WRITE_DOPOST:-".false."}

export COMIN=${COMIN:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT}
export COMOUT=${COMOUT:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT}
export COMIN=${COMIN:-${ROTDIR}/${RUN}.${PDY}/${cyc}/${COMPONENT}}
export COMOUT=${COMOUT:-${ROTDIR}/${RUN}.${PDY}/${cyc}/${COMPONENT}}

[[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT
# shellcheck disable=SC2174
[[ ! -d "${COMOUT}" ]] && mkdir -m 775 -p "${COMOUT}"
# shellcheck disable=

if [ $RUN = gfs ];then
if [ "${RUN}" = gfs ];then
export FHOUT_PGB=${FHOUT_GFS:-3} #Output frequency of gfs pgb file at 1.0 and 0.5 deg.
fi
if [ $RUN = gdas ]; then
if [ "${RUN}" = gdas ]; then
export IGEN_GFS="gfs_avn"
export IGEN_ANL="anal_gfs"
export IGEN_FCST="gfs_avn"
export IGEN_GDAS_ANL="anal_gdas"
export FHOUT_PGB=${FHOUT:-1} #Output frequency of gfs pgb file at 1.0 and 0.5 deg.
fi

if [ $GRIBVERSION = grib2 ]; then
if [ "${GRIBVERSION}" = grib2 ]; then
export IGEN_ANL="anal_gfs"
export IGEN_FCST="gfs_avn"
export IGEN_GFS="gfs_avn"
Expand All @@ -100,7 +102,7 @@ fi
#######################################
# Specify Restart File Name to Key Off
#######################################
export restart_file=$COMIN/${RUN}.t${cyc}z.logf
export restart_file=${COMIN}/${RUN}.t${cyc}z.logf

####################################
# Specify Timeout Behavior of Post
Expand All @@ -117,9 +119,9 @@ export SLEEP_INT=5
###############################################################
# Run relevant exglobal script

$SCRgfs/ex${RUN}_atmos_nceppost.sh
"${SCRgfs}/ex${RUN}_atmos_post.sh"
status=$?
[[ $status -ne 0 ]] && exit $status
(( status != 0 )) && exit "${status}"

##############################################
# End JOB SPECIFIC work
Expand All @@ -128,15 +130,15 @@ status=$?
##############################################
# Final processing
##############################################
if [ -e "$pgmout" ]; then
cat $pgmout
if [ -e "${pgmout}" ]; then
cat "${pgmout}"
fi

##########################################
# Remove the Temporary working directory
##########################################
cd $DATAROOT
[[ $KEEPDATA = "NO" ]] && rm -rf $DATA
cd "${DATAROOT}" || exit 1
[[ "${KEEPDATA:-NO}" = "NO" ]] && rm -rf "${DATA}"


exit 0
2 changes: 1 addition & 1 deletion jobs/rocoto/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
#---------------------------------------------------------------
for fhr in $fhrlst; do
export post_times=$fhr
$HOMEgfs/jobs/JGLOBAL_ATMOS_NCEPPOST
$HOMEgfs/jobs/JGLOBAL_ATMOS_POST
status=$?
[[ $status -ne 0 ]] && exit $status
done
Expand Down
8 changes: 4 additions & 4 deletions parm/config/config.post
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ if [ $OUTPUT_FILE = "netcdf" ]; then
export MODEL_OUT_FORM=netcdfpara
fi

# Post driver job that calls gfs_nceppost.sh and downstream jobs
export POSTJJOBSH="$HOMEpost/jobs/JGLOBAL_NCEPPOST"
# Post driver job that calls gfs_post.sh and downstream jobs
export POSTJJOBSH="$HOMEpost/jobs/JGLOBAL_POST"
export GFSDOWNSH="$HOMEpost/ush/fv3gfs_downstream_nems.sh"
export GFSDWNSH="$HOMEpost/ush/fv3gfs_dwn_nems.sh"

export POSTGPSH="$HOMEpost/ush/gfs_nceppost.sh"
export POSTGPEXEC="$HOMEpost/exec/gfs_ncep_post"
export POSTGPSH="$HOMEpost/ush/gfs_post.sh"
export POSTGPEXEC="$HOMEpost/exec/upp.x"
export GOESF=NO # goes image
export FLXF=YES # grib2 flux file written by post

Expand Down
Loading

0 comments on commit 948f941

Please sign in to comment.