#!/bin/sh # ----------------------------------------------------------- # UNIX Shell Script File # Tested Operating System(s): RHEL 5,6 # Tested Run Level(s): 3, 5 # Shell Used: BASH shell # Original Author(s): Andre van der Westhuysen # File Creation Date: 09/17/2015 # Date Last Modified: # # Version control: 1.00 # # Support Team: # # Contributors: Floyd fayton # # ----------------------------------------------------------- # ------------- Program Description and Details ------------- # ----------------------------------------------------------- # # Job Card to set the resources required for a NWPS run # # ----------------------------------------------------------- date export PS4='$SECONDS ${0/\/nw.*\/nwps.*\/} + ' set -xa #################################### # Specify NET and RUN Name and model #################################### export NET=${model} export RUN=$(echo ${job}|awk -F"_" '{print $2}') # ############################################# # SETUP NWPS SHELL VARIABLES # ############################################# #export DATA=/lfs/h2/emc/ptmp/${DEVWCOSS_USER}/data/ # Add the ${siteid} ??? #export COMROOT=${DATA}/com #export GESROOT=${DATA}/nwges export ver=${nwps_ver} export DATA=/lfs/h2/emc/ptmp/${DEVWCOSS_USER}/$NET/$ver/ export COMROOT=/lfs/h2/emc/ptmp/${DEVWCOSS_USER}/com mkdir -p $DATA cd $DATA #AW curhour=$(date -u +%H) curhour=0 if [ $curhour -lt 12 ]; then CYCLE="00"; fi if [ $curhour -ge 12 ] && [ $curhour -lt 18 ]; then CYCLE="06"; fi if [ $curhour -ge 18 ] && [ $curhour -lt 22 ]; then CYCLE="12"; fi if [ $curhour -ge 22 ]; then CYCLE="18"; fi echo "" echo "INFO - Current hour is ${curhour}, setting model cycle to ${CYCLE}" export cyc=${CYCLE} export cycle=t${cyc}z #################################### # SENDECF - Flag Events on ECFLOW # SENDCOM - Copy Files From TMPDIR to $COMOUT # SENDDBN - Issue DBNet Client Calls #################################### export SENDCOM=${SENDCOM:-YES} export SENDECF=${SENDECF:-YES} export SENDDBN=${SENDDBN:-NO} #################################### # Specify Execution Areas #################################### export HOMEnwps=${HOMEnwps:-${NWROOT}/${model}.${nwps_ver}} export FIXnwps=${FIXnwps:-${HOMEnwps}/fix} export EXECnwps=${EXECnwps:-${HOMEnwps}/exec} export SORCnwps=${SORCnwps:-${HOMEnwps}/sorc} export PARMnwps=${PARMnwps:-${HOMEnwps}/parm} export USHnwps=${USHnwps:-${HOMEnwps}/ush} export PMnwps=${PMnwps:-${USHnwps}/pm} export BATHYdb=${BATHYdb:-${FIXnwps}/bathy_db} export SHAPEFILEdb=${SHAPEFILEdb:-${FIXnwps}/shapefile_db} # Set NWPS run conditions export DEBUGGING=${DEBUGGING:-TRUE} export DEBUG_LEVEL=${DEBUG_LEVEL:-1} export ISPRODUCTION=${ISPRODUCTION:-TRUE} export SITETYPE=${SITETYPE:-EMC} export MODELTYPE="SWAN" #export pgmout=OUTPUT.$$ export utilscript=${UTILROOT}/ush export USHutil=${UTILROOT}/ush sh $utilscript/setpdy.sh #echo 'export PDYm7=20220118' > PDY #echo 'export PDYm6=20220119' >> PDY #echo 'export PDYm5=20220120' >> PDY #echo 'export PDYm4=20220121' >> PDY #echo 'export PDYm3=20220122' >> PDY #echo 'export PDYm2=20220123' >> PDY #echo 'export PDYm1=20220124' >> PDY #echo 'export PDY=20220125' >> PDY #echo 'export PDYp1=20220126' >> PDY #echo 'export PDYp2=20220127' >> PDY #echo 'export PDYp3=20220128' >> PDY #echo 'export PDYp4=20220129' >> PDY #echo 'export PDYp5=20220130' >> PDY #echo 'export PDYp6=20220131' >> PDY #echo 'export PDYp7=20220201' >> PDY . ./PDY ############################################## # Define COM directory ############################################## export GESOUT=${COMROOT}/${NET}/$ver/${NET}.${PDY}/nwges export GESOUTm1=${COMROOT}/${NET}/$ver/${NET}.${PDYm1}/nwges export dcom_hist="$GESOUT/dcom_hist.txt" export dcom_histm1="$GESOUTm1/dcom_hist.txt" export web_status_file="$GESOUT/status_file.txt" export dcom=/lfs/h1/ops/prod/dcom #export dcom="/lfs/h2/emc/couple/noscrub/Andre.VanderWesthuysen/nwps/dcom/prod/" export FORECASTWINDdir="${dcom}/${PDY}/wgrbbul/${NET}" # make sure NWPS COM directory exists if [ "${SENDCOM}" = YES ]; then mkdir -p $GESOUT fi ############################################## # Execute the script ${HOMEnwps}/dev/scripts/exnwps_datachk.sh ############################################## #msg="JOB $job HAS COMPLETED NORMALLY." #postmsg $jlogfile "$msg" if [ -e $pgmout ]; then cat $pgmout fi cd $DATAROOT if [ "$KEEPDATA" != YES ]; then rm -rf $DATA fi date