Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ufs-threading
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Mar 22, 2024
2 parents 668ede0 + daeb0c8 commit 3f0062b
Show file tree
Hide file tree
Showing 13 changed files with 1,918 additions and 22 deletions.
16 changes: 0 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,8 @@ sorc/ocnicepost.fd
# Ignore scripts from externals
#------------------------------
# jobs symlinks
jobs/JGFS_ATMOS_WAFS
jobs/JGFS_ATMOS_WAFS_BLENDING
jobs/JGFS_ATMOS_WAFS_BLENDING_0P25
jobs/JGFS_ATMOS_WAFS_GCIP
jobs/JGFS_ATMOS_WAFS_GRIB2
jobs/JGFS_ATMOS_WAFS_GRIB2_0P25
# scripts symlinks
scripts/exemcsfc_global_sfc_prep.sh
scripts/exgfs_atmos_wafs_blending.sh
scripts/exgfs_atmos_wafs_blending_0p25.sh
scripts/exgfs_atmos_wafs_gcip.sh
scripts/exgfs_atmos_wafs_grib.sh
scripts/exgfs_atmos_wafs_grib2.sh
scripts/exgfs_atmos_wafs_grib2_0p25.sh
# ush symlinks
ush/chgres_cube.sh
ush/emcsfc_ice_blend.sh
Expand All @@ -185,11 +173,7 @@ ush/global_chgres_driver.sh
ush/global_cycle.sh
ush/global_cycle_driver.sh
ush/jediinc2fv3.py
ush/mkwfsgbl.sh
ush/ufsda
ush/wafs_blending.sh
ush/wafs_grib2.regrid.sh
ush/wafs_intdsk.sh
ush/finddate.sh
ush/make_NTC_file.pl
ush/make_ntc_bull.pl
Expand Down
13 changes: 7 additions & 6 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ pipeline {
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_all_batch_jobs ${HOME}/RUNTESTS")
ws(HOME) {
if (fileExists('RUNTESTS/error.logs')) {
def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim()
try {
pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}")
} catch (Exception error) {
echo "Failed to comment on PR: ${error.getMessage()}"
}
def fileContent = readFile 'RUNTESTS/error.logs'
def lines = fileContent.readLines()
for (line in lines) {
echo "archiving: ${line}"
archiveArtifacts artifacts: "${line}", fingerprint: true
}
sh(script: 'sed -i "s#RUNTESTS#${HOME}/RUNTESTS#g" RUNTESTS/error.logs')
def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim()
try {
pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}")
} catch (Exception error) {
echo "Failed to comment on PR: ${error.getMessage()}"
}
}
}
error("Failed to run experiments ${Case} on ${Machine}")
Expand Down
96 changes: 96 additions & 0 deletions jobs/JGFS_ATMOS_WAFS
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/sh

########################################
# GFS AWIPS PRODUCT GENERATION
########################################
date
export PS4='$SECONDS + '
set -xa

export KEEPDATA=${KEEPDATA:-NO}

############################################
# Working Directory
############################################
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA

############################################
# Output for executables
############################################
export pgmout=OUTPUT.$$

############################################
# Load the UTILITIES module
############################################
#### module load prod_util
#### module load grib_util

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

export RERUN=${RERUN:-NO}

############################################
# Set up the NET and RUN
############################################
export NET=${NET:-gfs}
export RUN=${RUN:-gfs}
export COMPONENT=${COMPONENT:-atmos}

############################################
# Specify HOME Directory
############################################
export gfs_ver=${gfs_ver:-v16.3.0}
export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export EXECgfs=$HOMEgfs/exec
export FIXgfs=$HOMEgfs/fix/wafs
export PARMgfs=$HOMEgfs/parm/wafs
export USHgfs=$HOMEgfs/ush
export SCRIPTSgfs=$HOMEgfs/scripts

################################################
# Set up the input/output directory
################################################
export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${gfs_ver})/${RUN}.${PDY}/${cyc}/$COMPONENT}
export COMOUT=${COMOUT:-$(compath.py -o $NET/$gfs_ver)/$RUN.$PDY/$cyc/$COMPONENT}
export PCOM=${PCOM:-$COMOUT/wmo}

if [ $SENDCOM = YES ] ; then
mkdir -p $COMOUT $PCOM
fi

############################################
# print current environment
############################################
env

############################################
# Execute the script.
############################################

${SCRIPTSgfs}/exgfs_atmos_wafs_grib.sh $fcsthrs
export err=$?; err_chk

echo "JOB $job HAS COMPLETED NORMALLY!"

############################################
# print exec output
############################################
if [ -e "$pgmout" ] ; then
cat $pgmout
fi

############################################
# remove temporary working directory
############################################
if [ $KEEPDATA != YES ] ; then
rm -rf $DATA
fi

date
153 changes: 153 additions & 0 deletions jobs/JGFS_ATMOS_WAFS_BLENDING_0P25
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
#!/bin/sh
########################################################
# This job runs the code to blend US's and UK's WAFS products at 0.25 deg
########################################################

date
export PS4='$SECONDS + '
set -x

# keep the working directory or not
export KEEPDATA=${KEEPDATA:-NO}

############################################
# Working Directory
############################################
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
mkdir -p $DATA
cd $DATA

############################################
# Output for executables
############################################
export pgmout=OUTPUT.$$

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

export RERUN=${RERUN:-NO}

############################################
# Set up the NET and RUN
############################################
export NET=${NET:-gfs}
export RUN=${RUN:-gfs}
export COMPONENT=${COMPONENT:-atmos}

############################################
# Specify HOME Directory
############################################
export gfs_ver=${gfs_ver:-v16.3.0}
export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}}
export EXECgfs=$HOMEgfs/exec
export FIXgfs=$HOMEgfs/fix/wafs
export PARMgfs=$HOMEgfs/parm/wafs
export USHgfs=$HOMEgfs/ush
export SCRIPTSgfs=$HOMEgfs/scripts

################################################
# Set up the INPUT and OUTPUT directories
################################################
export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${gfs_ver})/${RUN}.${PDY}/${cyc}/$COMPONENT}
export COMOUT=${COMOUT:-$(compath.py -o $NET/$gfs_ver)/$RUN.$PDY/$cyc/$COMPONENT}
export PCOM=${PCOM:-$COMOUT/wmo}

if [ $SENDCOM = YES ] ; then
mkdir -p $COMOUT $PCOM
fi

export COMINus=${COMINus:-$COMIN}
export COMINuk=${COMINuk:-$DCOMROOT/$PDY/wgrbbul/ukmet_wafs}

############################################
# print current environment
############################################
env

##############################################
# Set up the forecast hours
##############################################
export SHOUR=${SHOUR:-06}
export EHOUR=${EHOUR:-48}
export FHOUT_GFS=${FHOUT_GFS:-1}

###############################################
# Specify Timeout Behavior of WAFS blending
#
# SLEEP_TIME - Amount of time to wait for
# a input file before exiting
# SLEEP_INT - Amount of time to wait between
# checking for input files
###############################################
# export SLEEP_TIME=300 # changed to 60 to avoid hitting wall_clock when miss umket wafs files ...
# JY -0129: export SLEEP_TIME=600
export SLEEP_TIME=900
export SLEEP_INT=10

####################################
# Check if this is a restart
####################################
if test -f $COMOUT/$RUN.t${cyc}z.control.wafsblending_0p25
then
modelrecvy=`cat < $COMOUT/${RUN}.t${cyc}z.control.wafsblending_0p25`
recvy_pdy=`echo $modelrecvy | cut -c1-8`
recvy_cyc=`echo $modelrecvy | cut -c9-10`
recvy_shour=`echo $modelrecvy | cut -c11-`

if [ $FHOUT_GFS -eq 3 ] ; then
FHINC=03
else
if [ $recvy_shour -lt 24 ] ; then
FHINC=01
else
FHINC=03
fi
fi

if test $RERUN = "NO"
then
if [ $recvy_shour -lt $EHOUR ]
then
new_shour=`expr $recvy_shour + $FHINC`
fi
if test $new_shour -ge $SHOUR
then
export SHOUR=$new_shour
if [ $SHOUR -lt 10 ]; then SHOUR=0$SHOUR; fi
fi
if test $recvy_shour -ge $EHOUR
then
echo "WAFS blending Already Completed to $EHOUR"
else
echo "Starting: PDY=$PDY cycle=t${recvy_cyc}z SHOUR=$SHOUR ."
fi
fi
fi

############################################
# Execute the script.
############################################
${SCRIPTSgfs}/exgfs_atmos_wafs_blending_0p25.sh
export err=$?; err_chk

echo "JOB $job HAS COMPLETED NORMALLY."

############################################
# print exec output
############################################
if [ -e "$pgmout" ] ; then
cat $pgmout
fi

############################################
# remove temporary working directory
############################################
if [ $KEEPDATA != YES ] ; then
rm -rf $DATA
fi

date
Loading

0 comments on commit 3f0062b

Please sign in to comment.