Skip to content

Commit

Permalink
Move remaining global post scripts over from UPP
Browse files Browse the repository at this point in the history
Several scripts currently located under NOAA-EMC/UPP are only used for global, so
they have been moved within global-workflow so they can be managed by the global-
workflow team.

Fixes NOAA-EMC#769
  • Loading branch information
WalterKolczynski-NOAA committed May 23, 2022
1 parent f8f5f2f commit df02289
Show file tree
Hide file tree
Showing 14 changed files with 1,951 additions and 20 deletions.
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,10 @@ jobs/JGFS_ATMOS_WAFS_GRIB2
jobs/JGFS_ATMOS_WAFS_GRIB2_0P25
jobs/JGLOBAL_ATMOS_ANALYSIS
jobs/JGLOBAL_ATMOS_ANALYSIS_CALC
jobs/JGLOBAL_ATMOS_NCEPPOST
jobs/JGLOBAL_ATMOS_POST_MANAGER
# scripts symlinks
scripts/exemcsfc_global_sfc_prep.sh
scripts/exgdas_atmos_chgres_forenkf.sh
scripts/exgdas_atmos_gldas.sh
scripts/exgdas_atmos_nceppost.sh
scripts/exgdas_atmos_verfozn.sh
scripts/exgdas_atmos_verfrad.sh
scripts/exgdas_atmos_vminmon.sh
Expand All @@ -132,23 +129,18 @@ scripts/exgfs_atmos_wafs_grib2.sh
scripts/exgfs_atmos_wafs_grib2_0p25.sh
scripts/exglobal_atmos_analysis.sh
scripts/exglobal_atmos_analysis_calc.sh
scripts/exglobal_atmos_pmgr.sh
scripts/exglobal_diag.sh
# ush symlinks
ush/calcanl_gfs.py
ush/calcinc_gfs.py
ush/chgres_cube.sh
ush/emcsfc_ice_blend.sh
ush/emcsfc_snow.sh
ush/fix_precip.sh
ush/fv3gfs_driver_grid.sh
ush/fv3gfs_dwn_nems.sh
ush/fv3gfs_filter_topo.sh
ush/fv3gfs_make_grid.sh
ush/fv3gfs_make_orog.sh
ush/getncdimlen
ush/gfs_nceppost.sh
ush/gfs_transfer.sh
ush/gldas_archive.sh
ush/gldas_forcing.sh
ush/gldas_get_data.sh
Expand All @@ -160,20 +152,17 @@ ush/global_chgres_driver.sh
ush/global_cycle.sh
ush/global_cycle_driver.sh
ush/gsi_utils.py
ush/link_crtm_fix.sh
ush/minmon_xtrct_costs.pl
ush/minmon_xtrct_gnorms.pl
ush/minmon_xtrct_reduct.pl
ush/mkwfsgbl.sh
ush/mod_icec.sh
ush/ozn_xtrct.sh
ush/radmon_ck_stdout.sh
ush/radmon_err_rpt.sh
ush/radmon_verf_angle.sh
ush/radmon_verf_bcoef.sh
ush/radmon_verf_bcor.sh
ush/radmon_verf_time.sh
ush/trim_rh.sh
ush/wafs_blending.sh
ush/wafs_grib2.regrid.sh
ush/wafs_intdsk.sh
153 changes: 153 additions & 0 deletions jobs/JGLOBAL_ATMOS_NCEPPOST
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
#!/bin/ksh
set -x

export RUN_ENVIR=${RUN_ENVIR:-"nco"}
export PS4='$SECONDS + '
date


#############################
# Source relevant config files
#############################
configs="base post"
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 post
status=$?
[[ $status -ne 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


##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY


##############################################
# Determine Job Output Name on System
##############################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile

####################################
# Specify version numbers
####################################
export crtm_ver=${post_crtm_ver:-v2.2.6}
export gfs_ver=${gfs_ver:-v15.0.0}
export hwrf_ver=${hwrf_ver:-v11.0.5}
export g2tmpl_ver=${g2tmpl_ver:-v1.5.0}

##############################################
# Set variables used in the exglobal script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-atmos}


##############################################
# Begin JOB SPECIFIC work
##############################################
export APRUNP=${APRUN:-$APRUN_NP}
export RERUN=${RERUN:-NO}
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."}

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

[[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT

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
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
export IGEN_ANL="anal_gfs"
export IGEN_FCST="gfs_avn"
export IGEN_GFS="gfs_avn"
fi

#######################################
# Specify Restart File Name to Key Off
#######################################
export restart_file=$COMIN/${RUN}.t${cyc}z.logf

####################################
# Specify Timeout Behavior of Post
#
# SLEEP_TIME - Amount of time to wait for
# a restart file before exiting
# SLEEP_INT - Amount of time to wait between
# checking for restart files
####################################
export SLEEP_TIME=900
export SLEEP_INT=5


###############################################################
# Run relevant exglobal script
env
msg="HAS BEGUN on `hostname`"
postmsg "$msg"
$LOGSCRIPT


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

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
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
104 changes: 104 additions & 0 deletions jobs/JGLOBAL_ATMOS_POST_MANAGER
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/sh

########################################
# 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}
for config in $configs; do
. $config_path/config.$config
status=$?
[[ $status -ne 0 ]] && exit $status
done


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

set -xue
# #### 07/30/1999 ###################
# SET SHELL PROCESSING VARIABLES
# ###################################
export PS4='$SECONDS + '
date

####################################
# Specify NET and RUN Name and model
####################################
export NET=${NET:-gfs}
export RUN=${RUN:-gfs}
export COMPONENT=${COMPONENT:-atmos}

####################################
# obtain unique process id (pid) and make temp directories
####################################
export pid=${pid:-$$}
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir $DATA
cd $DATA

####################################
# Determine Job Output Name on System
####################################
export outid="LL$job"
export jobid="${outid}.o${pid}"
export pgmout="OUTPUT.${pid}"

####################################
# Specify version numbers
####################################
export gfs_ver=${gfs_ver:-v15.0.0}

####################################
# Specify Execution Areas
####################################
export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export EXECgfs=${HOMEgfs:-$HOMEgfs/exec}
export FIXgfs=${HOMEgfs:-$HOMEgfs/fix}
export PARMgfs=${HOMEgfs:-$HOMEgfs/parm}
export USHgfs=${HOMEgfs:-$HOMEgfs/ush}

###########################
# Set up EXT variable
###########################
export EXT_FCST=NO

###################################
# Set up the UTILITIES
###################################
# export HOMEutil=${HOMEutil:-/nw${envir}/util.${util_ver}}
# export utilscript=${utilscript:-$HOMEutil/ush}
# export utilexec=${utilexec:-$HOMEutil/exec}

###########################################
# Run setpdy and initialize PDY variables
###########################################
export cycle=t${cyc}z
setpdy.sh
. ./PDY

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


########################################################
# Execute the script.
$HOMEgfs/scripts/exglobal_atmos_pmgr.sh
########################################################

date
Loading

0 comments on commit df02289

Please sign in to comment.