#!/usr/bin/env sh #### UNIX Script Documentation Block # # Script Name: JNWM_USGS_TIMESLICES #### date export PS4=' $SECONDS + ' set -xa ########################## # Specify NET and RUN Name ########################## export NET=nwm export RUN=nwm ######################################################## # Make working directory and file To Log Msgs ######################################################## export DATA=${DATA:-${DATAROOT:?}/${jobid}} if [ ! -e $DATA ]; then mkdir -p $DATA fi cd ${DATA} export cycle=t${cyc}z ############################################## #Set PDY ############################################## setpdy.sh . ./PDY #################################### # Specify Application Areas #################################### export HOMEnwm=${HOMEnwm:-${PACKAGEROOT:?}/${NET}.${nwm_ver}} export USHnwm=${USHnwm:-${HOMEnwm}/ush} export SCRIPTnwm=${SCRIPTnwm:-${HOMEnwm}/scripts} ################################### # define dbn_alert type ################################### export DBN_ALERT_TYPE=${DBN_ALERT_TYPE:-NWM_USGS_TIMESLICES} ################################### # Input data directory ################################### export COMIN=${COMIN:-$(compath.py -o ${RUN}/${nwm_ver})/$RUN.$PDY} export COMINm1=${COMINm1:-$(compath.py -o ${RUN}/${nwm_ver})/$RUN.$PDYm1} export DCOM=${DCOM:-${DCOMROOT}/usgs_streamflow} ################################### # Output data directory ################################### export COMOUT=${COMOUT:-$(compath.py -o ${RUN}/${nwm_ver})/$RUN.$PDY} export COMOUT_ROOT=${COMOUT_ROOT:-$(compath.py -o ${RUN}/${nwm_ver})} if [ ! -e $COMOUT ]; then mkdir -p $COMOUT fi #################################### # File To Log Msgs #################################### export DATAlogs=$DATA/logs export pgmout="${DATAlogs}/${job}_OUTPUT_${PDY}.$$" if [ ! -e $DATAlogs ]; then mkdir -p $DATAlogs fi export COMOUTlogs=${COMOUTlogs:-${COMOUT}/logs} if [ ! -e $COMOUTlogs ]; then mkdir -p $COMOUTlogs fi env ######################################################## # Execute the script. ######################################################## ${SCRIPTnwm}/exnwm_usgs_timeslices.sh msg="JOB $job FOR NWM USGS TIME SLICES HAS COMPLETED NORMALLY" postmsg $pgmout "$msg" if [ -e $pgmout ]; then cat $pgmout cpfs $pgmout $COMOUTlogs/ fi cd $DATA/.. if [ "$KEEPDATA" != YES ]; then rm -rf $DATA fi date