Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename post scripts #1038

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
Fixed Show fixed Hide fixed
status=$?
[[ $status -ne 0 ]] && exit $status
(( status != 0 )) && exit "${status}"
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
done


##########################################
# Source machine runtime environment
##########################################
. $HOMEgfs/env/${machine}.env post
. "${HOMEgfs}/env/${machine}.env" post
Fixed Show fixed Hide fixed
status=$?
[[ $status -ne 0 ]] && exit $status
(( status != 0 )) && exit "${status}"
aerorahul marked this conversation as resolved.
Show resolved Hide resolved


##############################################
# 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}}
aerorahul marked this conversation as resolved.
Show resolved Hide resolved
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"
aerorahul marked this conversation as resolved.
Show resolved Hide resolved
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