#! /bin/csh # # This script sends a forecast based on user input. # # e.g. ./send.csh 11 HUSKR # # In the example above, I'm sending forecast 11 for site HUSKR. ####################################################################### #Do not make any edits below here, unless you know what you are doing.# ####################################################################### echo "works!" #Set directory. set dir=`pwd`"/" #Get AWIPS version. set checkawips=`cat /awips/Release_ID` if ($checkawips == AWIPSII) then set awips_ver=2 else set awips_ver=1 endif #Check variables, just in case. if ($awips_ver == 1) then set shef_dir=/data/fxa/ispan/hydro/ echo "You are on AWIPS $awips_ver" else if ($awips_ver == 2) then set shef_dir=/awips2/edex/data/share/hydroapps/shefdecode/input/ echo "You are on AWIPS $awips_ver" else echo "Bad AWIPS variable entry" echo " " echo "Exiting, contact david.pearson@noaa.gov for assistance!" exit 0 endif #Check if $1 is correct. if ($1 != 11 && $1 != 12 && $1 != 13 && $1 != 14 && $1 != 21 && $1 != 22 && $1 != 23 && $1 != 24 && $1 != 41 && $1 != 42 && $1 != 43 && $1 != 99) then echo "$1 is a bad forecast entry" echo " " echo "Exiting!" exit 0 else endif #Begin script. cd $dir #Remove old file. rm -f ./file #Create date variables for SHEF message. set y = `date '+%Y'` set y2 = `date "+%Y" --date='2 days ago'` set mon = `date '+%m'` set mon2 = `date "+%m" --date='2 days ago'` set d = `date '+%d'` set d2 = `date "+%d" --date='2 days ago'` set h = `date '+%H'` set h2 = `date "+%H" --date='2 days ago'` set min = `date '+%M'` set min2 = `date "+%M" --date='2 days ago'` ###################### #Short Term Forecasts# ###################### if ($1 == 11 || $1 == 12 || $1 == 13 || $1 == 14) then echo ".ER $2 $y2$mon2$d2 Z DH18/DC$mon$d$h$min/HGIRZ/DIH06 :6-Hr Obs Stage (ft)" > ./file echo ".E1 21.3/ 21.4/ 21.6/ 21.7/" >> ././file echo ".E2 21.8/ 22.0/ 22.1/ 22.4/" >> ././file endif if ($1 == 11) then #Minor echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 22.6/ 22.8/ 23.1/ 23.4/ 23.8/ 23.9/ 23.8/ 23.6/" >> ./file echo ".E2 23.2/ 22.8/ 22.4/ 22.0/ 21.6/ 21.3/" >> ./file endif #Moderate if ($1 == 12) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 22.6/ 22.8/ 24.1/ 24.6/ 24.8/ 25.1/ 25.2/ 25.1/" >> ./file echo ".E2 24.8/ 23.8/ 23.4/ 22.7/ 21.6/ 21.3/" >> ./file endif #Major if ($1 == 13) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 22.6/ 23.2/ 23.7/ 24.6/ 24.8/ 24.9/ 25.2/ 25.6/" >> ./file echo ".E2 26.1/ 26.5/ 26.8/ 26.5/ 26.3/ 25.8/" >> ./file endif #Below FS if ($1 == 14) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 22.2/ 22.4/ 22.5/ 22.6/ 22.8/ 22.9/ 22.8/ 22.6/" >> ./file echo ".E2 22.2/ 22.0/ 21.7/ 21.4/ 21.6/ 21.3/" >> ./file endif #Below FS if ($1 == 99) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 4.2/ 4.4/ 4.5/ 4.6/ 4.8/ 4.9/ 4.8/ 4.6/" >> ./file echo ".E2 4.2/ 4.0/ 4.7/ 4.4/ 4.6/ 4.3/" >> ./file endif #################### #Extended Forecasts# #################### #These mimic what one would due when a longer term forecast goes above flood. if ($1 == 21 || $1 == 22 || $1 == 23 || $1 == 24 || $1 == 41 || $1 == 42 || $1 == 43) then echo ".ER $2 $y2$mon2$d2 Z DH18/DC$mon$d$h$min/HGIRZ/DIH06 :6-Hr Obs Stage (ft)" > ./file echo ".E1 11.3/ 11.4/ 11.6/ 11.7/" >> ./file echo ".E2 11.8/ 12.0/ 12.3/ 12.7/" >> ./file endif if ($1 == 21) then #Minor echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file echo ".E2 20.0/ 21.0/ 23.5/ 23.9/ 22.9/ 22.0/ 21.0/ 20.5/" >> ./file echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file endif #Moderate if ($1 == 22) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file echo ".E2 20.0/ 21.0/ 24.5/ 25.2/ 24.9/ 23.0/ 22.0/ 20.5/" >> ./file echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file endif #Major if ($1 == 23) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file echo ".E2 20.0/ 21.0/ 24.5/ 25.8/ 26.9/ 28.0/ 27.7/ 26.5/" >> ./file echo ".E3 25.0/ 24.5/ 23.0/ 22.5/ 21.0/ 20.5/ 19.0/ 18.5/" >> ./file echo ".E4 16.0/ 15.5/ 14.0/ 13.5/" >> ./file endif #Below FS if ($1 == 24) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 17.3/" >> ./file echo ".E2 17.5/ 17.8/ 17.8/ 17.8/ 17.2/ 16.0/ 15.0/ 14.5/" >> ./file echo ".E3 14.4/ 14.3/ 14.2/ 14.1/ 14.0/ 13.8/ 13.6/ 13.5/" >> ./file echo ".E4 13.3/ 13.2/ 13.0/ 12.7/" >> ./file endif # if ($1 == 41) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.0/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file echo ".E2 19.5/ 20.0/ 20.5/ 21.3/ 21.5/ 20.8/ 20.0/ 20.0/" >> ./file echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file endif if ($1 == 42) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.0/ 14.0/ 14.5/ 15.0/ 15.5/ 16.0/ 16.5/ 17.0/" >> ./file echo ".E2 18.0/ 19.0/ 20.0/ 20.5/ 20.0/ 19.3/ 19.0/ 18.6/" >> ./file echo ".E3 18.2/ 17.3/ 17.0/ 16.4/ 16.0/ 15.2/ 15.0/ 14.6/" >> ./file echo ".E4 14.3/ 14.1/ 13.5/ 13.2/" >> ./file endif if ($1 == 43) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIFF/DIH6" >> ./file echo ".E1 13.0/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file echo ".E2 20.0/ 22.0/ 23.5/ 24.8/ 28.9/ 31.0/ 31.5/ 30.5/" >> ./file echo ".E3 29.0/ 28.5/ 28.0/ 26.5/ 24.0/ 22.5/ 19.0/ 18.5/" >> ./file echo ".E4 16.0/ 15.5/ 14.0/ 13.5/" >> ./file endif #################################################### #Send contingency forecasts for the specified site.# #################################################### if ($1 == 11 || $1 == 12 || $1 == 13 || $1 == 14) then echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC1/DIH6" > ./file_c1 echo ".E1 22.6/ 23.3/ 23.7/ 23.9/ 23.7/ 23.3/ 22.8/ 22.6/" >> ./file_c1 echo ".E2 22.2/ 22.0/ 21.7/ 21.4/ 21.6/ 21.3/" >> ./file_c1 echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC2/DIH6" > ./file_c2 echo ".E1 22.6/ 23.1/ 24.1/ 24.6/ 25.0/ 25.2/ 25.1/ 24.8/" >> ./file_c2 echo ".E2 24.4/ 23.8/ 23.3/ 22.7/ 21.6/ 21.3/" >> ./file_c2 echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC3/DIH6" > ./file_c3 echo ".E1 22.6/ 23.0/ 23.2/ 24.6/ 25.8/ 27.9/ 28.0/ 27.6/" >> ./file_c3 echo ".E2 26.2/ 24.0/ 22.7/ 21.4/ 21.6/ 21.3/" >> ./file_c3 else echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC1/DIH6" > ./file_c1 echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file_c1 echo ".E2 20.0/ 23.0/ 23.9/ 23.8/ 22.9/ 22.2/ 21.0/ 20.5/" >> ./file_c1 echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file_c1 echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file_c1 echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC2/DIH6" > ./file_c2 echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file_c2 echo ".E2 20.0/ 23.0/ 25.2/ 25.0/ 24.9/ 23.0/ 22.0/ 20.5/" >> ./file_c2 echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file_c2 echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file_c2 echo ".ER $2 $y$mon$d Z DC$y$mon$d$h$min/DH18/HGIC3/DIH6" > ./file_c3 echo ".E1 13.3/ 14.0/ 14.5/ 15.0/ 16.0/ 16.5/ 17.0/ 19.0/" >> ./file_c3 echo ".E2 19.5/ 20.8/ 21.5/ 21.2/ 21.3/ 20.8/ 20.1/ 20.0/" >> ./file_c3 echo ".E3 20.0/ 19.5/ 18.0/ 17.5/ 17.0/ 16.5/ 16.0/ 15.5/" >> ./file_c3 echo ".E4 15.0/ 14.5/ 14.0/ 13.5/" >> ./file_c3 endif #Send the file to the shef decoder. cp ./file $shef_dir cp ./file_c* $shef_dir echo "File has been sent to the shef decoder at: $shef_dir" #Do some cleanup. rm -f ./file_c* exit 0