#!/bin/bash set -x export RUN_ENVIR=${RUN_ENVIR:-"nco"} export PS4='$SECONDS + ' date ############################# # Source relevant config files ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} configs="base anal echgres" 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 anal 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 ############################################## # Set variables used in the script ############################################## export CDATE=${CDATE:-${PDY}${cyc}} export CDUMP=${CDUMP:-${RUN:-"gfs"}} export COMPONENT=${COMPONENT:-atmos} export DO_CALC_ANALYSIS=${DO_CALC_ANALYSIS:-"YES"} ############################################## # Begin JOB SPECIFIC work ############################################## GDATE=$($NDATE -$assim_freq $CDATE) gPDY=$(echo $GDATE | cut -c1-8) gcyc=$(echo $GDATE | cut -c9-10) GDUMP=${GDUMP:-"gdas"} export OPREFIX="${CDUMP}.t${cyc}z." export GPREFIX="${GDUMP}.t${gcyc}z." export APREFIX="${CDUMP}.t${cyc}z." export GSUFFIX=${GSUFFIX:-$SUFFIX} export ASUFFIX=${ASUFFIX:-$SUFFIX} if [ $RUN_ENVIR = "nco" -o ${ROTDIR_DUMP:-NO} = "YES" ]; then export COMIN=${COMIN:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} export COMOUT=${COMOUT:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} export COMOUT_ENS=${COMOUT_ENS:-$ROTDIR/enkfgdas.$PDY/$cyc/$COMPONENT} export COMIN_OBS=${COMIN_OBS:-$(compath.py ${envir}/obsproc/${obsproc_ver})/$RUN.$PDY/$cyc/$COMPONENT} export COMIN_GES_OBS=${COMIN_GES_OBS:-$(compath.py ${envir}/obsproc/${obsproc_ver})/$GDUMP.$gPDY/$gcyc/$COMPONENT} else export COMOUT="$ROTDIR/$CDUMP.$PDY/$cyc/$COMPONENT" export COMOUT_ENS="$ROTDIR/enkfgdas.$PDY/$cyc/$COMPONENT" export COMIN_OBS="$DMPDIR/$CDUMP.$PDY/$cyc/$COMPONENT" export COMIN_GES_OBS="$DMPDIR/$GDUMP.$gPDY/$gcyc/$COMPONENT" fi mkdir -m 775 -p $COMOUT # COMIN_GES and COMIN_GES_ENS are used in script export COMIN_GES="$ROTDIR/$GDUMP.$gPDY/$gcyc/$COMPONENT" 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 ############################################## # End JOB SPECIFIC work ############################################## ############################################## # Final processing ############################################## 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