#!/bin/sh #set -x ################################################################ # setup_hysplit - General hsyplit setup script - # RSMC, volcano, or Homeland Security ################################################################ # # created: 06 Mar 2002 - from individual setup scripts # may start new run or from previous run # revised: 06 Jan 2003 - per SDM comments # 21 Nov 2003 # 28 Mar 2003 # 19 May 2005 - conc grid #2 for Volcano (hourly output) # # 17 Oct 2005 - manual lat-lon-sitename for VA and RSMC # automatic NUMPAR per release specs # 23 Jan 2006 - automatic NUMPAR calculation bug # 26 Jun 2006 - hysplit_pollutant_specs file # 2nd grid for RSMC # 02 Nov 2006 - reset grid spacing span # set -x and run script as "setup_hysplit_script 2>dump" # 01 Dec 2006 - add zoom (all) and centering option (hls fine grid) # 31 Jan 2008 - source attribution (backward) # - use "%.*" for integer portion (for expr command) # 19 Mar 2008 - Commented out system priority menus. The priority var # is no longer used for HIRESW. # - Set the sitename var to default to "unknown_site." # Giving no answer would hang the script. # - Modified the menu language to remove warnings about # running the HIRESW. It is no longer significantly # system intensive. (F.Achorn/NCO) # 02 Apr 2008 - HIRESW priority slot in hysplit.ini is emission units # 23 Apr 2008 - Set 3-D particle model, number of particles, and # grid spacing for long-duration runs. # 22 Sep 2008 - Set default vs previous run to 'default' # (B.Stunder/ARL) # 14 Sep 2009 - multiple volcanoes with same name in hysplit_volcanoes # same for RSMC with rsmc-plants file # 18 Jun 2010 - bug in re-choosing prior run # multi-processor # PARINIT.001,etc.; PARSHIFT.001,etc. # zero emission (continue from PARDUMP) # multiple source lat-lon locations (same hgts, times) # run sequence number 3 digits # 12 Nov 2010 - allow unlimited volcano eruption duation; # it will be limited as necessary in hysplit_trajconc.sh # 16 Feb 2011 - input PARSHIFT from $GEShysplit # 31 Mar 2011 - restrict PARDUMP/PARSHIFT to volcanic ash # # User first chooses a default or a recent run. # For the default run, user is prompted to enter values. # User may edit values. # Values are written to file. # # Note that if change some menu items in the user-prompted section # need to change them in the review-inputs section as well ################################################################ FIRST=YES # flag for 1st time at review menu FIRST_RUNDESC=YES # run description FIRST_NAME=YES # source name FIRST_DUR=YES # emission duration FIRST_TOP=YES # emission top # NET envir and RUN are used to list today and yesterday's runs NET=hysplit envir=prod RUN=hysplit HOMEhysplit=/nw${envir} FIXhysplit=$HOMEhysplit/fix GEShysplit=${usrdir}/com/hysplit/$envir/input if [ ! -d ${GEShysplit} ] then mkdir $GEShysplit fi cd $GEShysplit rm -f ncepdate NMCDATE filelist filelist2 PDY ################################################################ # set constants ################################################################ # flag for blank values tflg=0 # minimum release duration (0.017 hours ~ 1 minute) mind=0.017 # isotropic turbulence for eruption column top at/above this height isoht=30000 # run duration above which should run 3-D particle model # --automatically set when set run duration, and checked at end of setup_hysplit_script # --longrun and neglongrun must be identical in setup_hysplit_script # -- and hysplit_conc.sh # --test is: if [ $nhrs -ge ${longrun} -o $nhrs -le ${neglongrun} ] longrun=84 neglongrun=`echo "${longrun}*-1" | bc` # suggested number of particles for long-duration run numparlong=50000 # suggested conc grid spacing for long-duration run dlatlong=0.75 dlonlong=0.75 # HIRES ARL-packed file (top 50 mb) mtopfh=62000 # top feet rounded mtopmh=19000 # top meters rounded lfhrh=18 # last forecast hour # also in exhypslit_fcst.sh.sms # NAM ARL-packed file (top 50 mb) mtopfe=62000 # top feet rounded mtopme=19000 # top meters rounded lfhre=48 # last forecast hour # GFS ARL-packed file (top 20 mb) mtopfg=85000 # top feet rounded (volcano) mtopmg=26000 # top meters rounded lfhrg=384 # last forecast hour (changed from 84 to 384 March 5 2008) initnumd=1 # for 'default' vs. starting with previous run fnum=0 # for initialization ################################################################ # Initial Setup ################################################################ clear echo "----------------------------------------" echo "| HYSPLIT MODEL INPUT SCRIPT |" echo "----------------------------------------" echo echo " You will be prompted to enter the HYSPLIT inputs or you may " echo " choose the inputs from a recent run, if any. For either case, " echo " you can verify/edit the inputs at the 'Review Menu'. " echo " Additional inputs for specialized runs may be specified in the " echo " 'advanced parameters menu', generally in consultation with ARL. " echo echo "-------------------------------------" echo " ORG DESCRIPTION " echo "-------------------------------------" echo "1 SDM - NCEP " echo "2 Not Available " # AWC - NCEP for volcano ???? echo "3 Alaska " echo "4 ARL " echo "-------------------------------------" echo "ENTER ORG DESCRIPTION NUMBER" read iorgdesc case $iorgdesc in 1) organ="sdm";; #2) organ="awc";; 3) organ="alaska";; 4) organ="arl";; *) echo echo "Not a valid entry... try again" echo "-------------------------------------" echo " ORG DESCRIPTION " echo "-------------------------------------" echo "1 SDM - NCEP " echo "2 Not Available " # AWC - NCEP for volcano ???? echo "3 Alaska " echo "4 ARL " echo "-------------------------------------" echo "ENTER ORG DESCRIPTION NUMBER" read iorgdesc case $iorgdesc in 1) organ="sdm";; #2) organ="awc";; 3) organ="alaska";; 4) organ="arl";; *) echo "Not a valid entry... start over" exit ;; esac ;; esac ################################################################ # Force Alaska to run volcano only. ################################################################ AKUSER="aawprd" if [ "$USER" = "$AKUSER" ] then organ="alaska" iorgdesc=3 fi case $iorgdesc in 3) typenum=2;; *) clear echo "-------------------------------------------" echo " RUN TYPE " echo "-------------------------------------------" echo "1 WMO/IAEA request for RSMC support " echo "2 volcano " echo "3 WFO, Homeland Security " echo "4 Back-tracking (Source attribution) " echo "-------------------------------------------" echo "ENTER RUN TYPE NUMBER: " read typenum if [ $typenum -lt 1 -o $typenum -gt 4 ] then echo echo "Not a valid entry... try again" echo "-------------------------------------------" echo " RUN TYPE " echo "-------------------------------------------" echo "1 WMO/IAEA request for RSMC support " echo "2 volcano " echo "3 WFO, Homeland Security " echo "4 Back-tracking (Source attribution) " echo "-------------------------------------------" echo "ENTER RUN TYPE NUMBER: " read typenum if [ $typenum -lt 1 -o $typenum -gt 4 ] then echo "Not a valid entry... start over" exit fi fi ;; esac ############################### #### set runtype constants ############################### case $typenum in 1) TYPl=rsmc kmax=23 # max number characters in sitename SOURCE="SITE" MNUM=5000 # max number particles; can override in Adv. Menu depth=500 # depth in meters used to calculate numpar duration=6 # time in hours used to calculate numpar #numpar_def=500 # default number of particles for typical run ;; 2) TYPl=volc kmax=15 SOURCE="VOLCANO" MNUM=50000 depth=40000 # depth in feet duration=3 #umpar_def=5000 ;; 3) TYPl=hls kmax=4 SOURCE="SITE" MNUM=10000 depth=1000 # # depth in meters duration=1 #numpar_def=10000 ;; 4) TYPl=back kmax=23 # max number characters in sitename SOURCE="SITE" MNUM=20000 # max number particles; can override in Adv. Menu depth=500 # depth in meters used to calculate numpar duration=24 # time in hours used to calculate numpar #numpar_def=500 # default number of particles for typical run ;; esac # read default number of particles from fix file, line 52 # (see setup_hysplit_script where write ini file for description of data) numpar_def=`head -n52 $FIXhysplit/hysplit_def${TYPl}.ini | tail -1` # Run setpdy and initialize PDY variables cyc=`date -u +%H` if test $cyc -lt 6 then cyc=00 else if test $cyc -lt 12 then cyc=06 else if test $cyc -lt 18 then cyc=12 else cyc=18 fi fi fi export cyc export cycle=t${cyc}z sh /nwprod/util/ush/setpdy.sh 1>/dev/null . ./PDY # chmod 777 ncepdate NMCDATE PDY PDYp1 chmod 777 ncepdate NMCDATE PDY # directories of previous runs' inputs COMOUTpdy=/com/${NET}/${envir}/${RUN}.${PDY} COMOUTpdym1=/com/${NET}/${envir}/${RUN}.${PDYm1} COMOUTpdym2=/com/${NET}/${envir}/${RUN}.${PDYm2} COMOUTpdym3=/com/${NET}/${envir}/${RUN}.${PDYm3} COMOUTpdym4=/com/${NET}/${envir}/${RUN}.${PDYm4} COMOUTpdym5=/com/${NET}/${envir}/${RUN}.${PDYm5} COMOUTpdym6=/com/${NET}/${envir}/${RUN}.${PDYm6} COMOUTpdym7=/com/${NET}/${envir}/${RUN}.${PDYm7} # may start with previous inputs rm -f filelist let N=1 echo echo "--------------------------------------------------------------------" echo " STARTING INPUTS " echo " Choose 1 for default values (to start from scratch)," echo " or another number, if available, if you want to start with a run" echo " from today or the past 7 days. " echo " " case $typenum in 2) echo " *** new 2011 *** hourly particle positions from past runs are saved" echo " The model can start from a time within the specified " echo " particle position file. Useful for:" echo " (a) successive 'puffs' [initialize with previous run, " echo " enter 2nd eruption specs (start time/duration/height) here" echo " (b) very long eruption (multi-day) [initialize with" echo " previous run, enter start/continuation eruption" echo " specs for the current time" echo " (c) eruption has stopped, but a current forecast of" echo " the downwind ash is needed [initialize with previous run," echo " enter 0 (zero) for eruption duration here]" echo " (d) current eruption height differs from that " echo " at the initial time [initialize with previous run, enter eruption" echo " start time/duration/height for the new height here]" #echo " Noting that " #echo " (aa) ideally want to initialize with particle position file" #echo " created with GDAS data not GFS" #echo " (bb) particle positions are dumped hourly on the hour" #echo " so the start time of the 'continuation'" #echo " will be rounded to the nearest hour" #echo " (cc) you can open another window and look at the text file listed" #echo " to verify specs from the listed runs" echo " " #echo " * not yet dropping the current case, that is start only at start of eruption" #echo " as long as within 7-day window, can start at beginning" echo " " ;; esac echo "--------------------------------------------------------------------" echo $N - default # force this only for testing change in rsmc ini file echo ${FIXhysplit}/hysplit_def${TYPl}.ini >> filelist chmod 777 filelist ls ${COMOUTpdy}/*.${TYPl}???.hysplit.ini \ ${COMOUTpdym1}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym2}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym3}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym4}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym5}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym6}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym7}/*.${TYPl}???.hysplit.ini 2>/dev/null | \ while read tmp; do let N=$N+1 echo $N - ${tmp} #echo $N - ${tmp##*/} echo $tmp >> filelist done echo "--------------------------------------------------------------------" echo "ENTER NUMBER FOR STARTING INPUTS (1-$N): " read initnum # if enter force initnum=1 'default' if [ "${initnum}" = "" ] then initnum=${initnumd} fi if [ $initnum -lt 1 -o $initnum -gt $N ] then let N=1 echo echo "Not a valid entry... try again" echo "--------------------------------------------------------------------" echo " STARTING INPUTS " echo "--------------------------------------------------------------------" echo $N - default ls ${COMOUTpdy}/*.${TYPl}???.hysplit.ini \ ${COMOUTpdym1}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym2}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym3}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym4}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym5}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym6}/*.${TYPl}???.hysplit.ini 2>/dev/null \ ${COMOUTpdym7}/*.${TYPl}???.hysplit.ini 2>/dev/null | \ while read tmp; do let N=$N+1 echo $N - ${tmp} #echo $N - ${tmp##*/} done echo "--------------------------------------------------------------------" echo "ENTER NUMBER FOR STARTING INPUTS (1-$N): " read initnum if [ $initnum -lt 1 -o $initnum -gt $N ] then echo "Not a valid entry... start over" exit fi fi # get default ini from fix directory or one from past run INI=`head -$initnum filelist | tail -1` cp $INI hysplit.ini # if choose past run skip initial messages if [ ${initnum} -ne 1 ] then FIRST_RUNDESC=NO FIRST_NAME=NO FIRST_DUR=NO FIRST_TOP=NO #FIRST=NO fi # read hysplit.ini - these are the starting values # (except for $pinpf which was just defined as pinpf_tmp and will be reassigned to pinpf next) if [ -s hysplit.ini ] then k=0 cat hysplit.ini | while read tmp do let k=$k+1 case $k in 1) title=$tmp;; 2) meteo=$tmp;; 3) site=$tmp;; 4) olat=$tmp;; 5) olon=$tmp;; 6) olvl1=$tmp;; 7) olvl2=$tmp;; 8) nhrs=$tmp;; 9) mtype=$tmp;; 10) dir1=$tmp;; 11) meteo1=$tmp;; 12) dir2=$tmp;; 13) meteo2=$tmp;; 14) dir3=$tmp;; 15) meteo3=$tmp;; 16) ident=$tmp;; 17) qrat=$tmp;; 18) qhrs=$tmp;; 19) dsyr=$tmp;; 20) dsmo=$tmp;; 21) dsda=$tmp;; 22) dshr=$tmp;; 23) dsmn=$tmp;; 24) cnlat=$tmp;; 25) cnlon=$tmp;; 26) dlat=$tmp;; 27) dlon=$tmp;; 28) splat=$tmp;; 29) splon=$tmp;; 30) height=$tmp;; 31) csyr=$tmp;; 32) csmo=$tmp;; 33) csda=$tmp;; 34) cshr=$tmp;; 35) dhr=$tmp;; 36) delhr=$tmp;; 37) cnlat2=$tmp;; 38) cnlon2=$tmp;; 39) dlat2=$tmp;; 40) dlon2=$tmp;; 41) splat2=$tmp;; 42) splon2=$tmp;; 43) height2=$tmp;; 44) dhr2=$tmp;; 45) dryvl=$tmp;; 46) wetin=$tmp;; 47) wetlo=$tmp;; 48) rhalf=$tmp;; 49) icmt=$tmp;; 50) initd=$tmp;; 51) khmax=$tmp;; 52) numpar=$tmp;; 53) isot=$tmp;; 54) ndump=$tmp;; 55) kmsl=$tmp;; 56) seq=$tmp;; 57) qunits=$tmp;; 58) org=$tmp # override $org with what user input ($organ) if [ "$org" != "$organ" ] then org="${organ}" fi ;; 59) zoom1=$tmp;; 60) zoom2=$tmp;; 61) relcen=$tmp;; 62) ncycl=$tmp;; 63) pinpf=$tmp;; 64) olat2=$tmp;; 65) olon2=$tmp;; 66) olat3=$tmp;; 67) olon3=$tmp;; 68) dum4=$tmp;; 69) dum3=$tmp;; 70) dum2=$tmp;; 71) dum1=$tmp;; esac done else echo "hysplit.ini file not found -- setup cannot start - job terminated" exit fi # assign flag eff_area (do for all runtypes) eff_area="NO" if [ ${olat2} -ne -99 -a ${olon2} -ne -99 -a ${olat3} -ne -99 -a ${olon3} -ne -99 ] then eff_area="YES" fi ##################################################################### # This section pertains to volcanic ash only since output PARDUMP # files were added April 2011, and also PARSHIFT capability ##################################################################### case $typenum in 2) # assign flag va_wet va_wet="YES" wetin_tmp=`echo ${wetin} | cut -c4-6` # force this to skip over irrelevant syntax error for typical case with wetin=3.5E+5 if [ "${wetin_tmp}" != "E+5" ] then if [ ${wetin} -eq 0 -a ${wetlo} -eq 0 ] then va_wet="NO" fi fi ## read pardump filename from past run, if past run chosen ### by default this will used for initialization if [ $initnum -gt 1 ] then # read portion of filename prior to "hysplit.ini" #hysplit.ini MUST be last in filename klen=`expr "${INI}" : ".*"` let klenwoini=${klen}-12 pinpf_pre=`echo ${INI} | cut -c1-${klenwoini}` pinpf=${pinpf_pre}.PARDUMP fi #################################################### # if choose prior run, choose which file to initialize with # this filename will be written to output file hysplit.ini #################################################### if [ ${initnum} -gt 1 ] then # see if any PARSHIFT files exist # (they will exist only if ran setup_hysplit_shift i.e. parshift) N_INIT=0 ls ${GEShysplit}/*.PARSHIFT.001 2>/dev/null |\ while read tmp; do let N_INIT=${N_INIT}+1 done if [ ${N_INIT} -eq 0 ] then echo echo "There are no particle files in which the particles have been shifted." echo echo "1 - Run with the particle position file from the chosen run (default)" echo "2 - Run starting at the beginning of the eruption with analysis meteorology" echo " (legacy option, 7 days worth of GDAS)" echo echo "Enter 1 or 2" read defdump case $defdump in 2) # do not want to use previously defined pinpf, the PARDUMP file pinpf= ;; *) # echo "Use previuosly defined PARDUMP $pinpf" pardump_time=`head -1 ${pinpf_pre}.PARINV` # read first time period of PARDUMP file and set default rlse start time to this iimo=`echo ${pardump_time} | cut -c3-4` iida=`echo ${pardump_time} | cut -c5-6` iihr=`echo ${pardump_time} | cut -c7-8` ;; esac else rm -f filelist2 let N=0 echo echo "--------------------------------------------------------------------" echo " PARTICLE FILES FOR INITIALIZATION " echo " Files named 'pardump' are from previous run (hourly particle positions)" echo " Files named 'parshift' are from setup_hysplit_shift" echo " in which the pardump files for one time period were deleted/shifted/rotated" echo " The 'shift' specs (time of delete/shift/rotate, increment deg lat lon, etc)" echo " are included in the filename." echo " " echo " NOTE if do several runs initializing with several 'shift' possibilities, " echo " i.e. trying to find the best match to the obs," echo " PARDUMP (no shift), PARSHIFT (one shift), and PARSHIFT (another shift)" echo " output to /com/hysplit will be overwritten unless the run-sequence number is" echo " manually changed in #15 Advanced Menu, then #13" echo "--------------------------------------------------------------------" ls ${pinpf_pre}.PARDUMP.001 \ ${GEShysplit}/*.PARSHIFT.001 2>/dev/null | \ while read tmp; do let N=$N+1 echo $N - ${tmp##*/} echo $tmp >> filelist2 chmod 777 filelist2 done if [ $N -eq 0 ] then echo "" echo "ERROR - PARDUMP.001 and PARSHIFT.001 should exist" echo " Enter 0 (zero)" echo "" fi echo "--------------------------------------------------------------------" echo "ENTER NUMBER FOR INITIALIZATION FILE (0,1-$N):" echo " 0 (zero) means to start from beginning of eruption using analysis meteorology" echo " instead of using any of these initialization files): " read fnum # if enter force retry if [ "${fnum}" = "" ] then let fnum=${N}+1 fi if [ $fnum -lt 0 -o $fnum -gt $N ] then let N=0 echo echo "Not a valid entry... try again" echo "--------------------------------------------------------------------" echo " PARTICLES FILES FOR INITIALIZATION " echo "--------------------------------------------------------------------" ls ${pinpf_pre}.PARDUMP.001 \ ${GEShysplit}/*.PARSHIFT.001 2>/dev/null | \ while read tmp; do let N=$N+1 #echo $N - ${tmp} echo $N - ${tmp##*/} done echo "--------------------------------------------------------------------" echo "ENTER NUMBER FOR INITIALIZATION FILE (0,1-$N): " read fnum # if enter force retry if [ "${fnum}" = "" ] then echo "Not a valid entry... start over" exit fi if [ $fnum -lt 0 -o $fnum -gt $N ] then echo "Not a valid entry... start over" exit fi fi # set pinpf to initialization filename, but without the .001 pinpf=`head -$fnum filelist2 | tail -1` klen=`expr "${pinpf}" : ".*"` let klenwo001=${klen}-4 pinpf=`echo ${pinpf} | cut -c1-${klenwo001}` # was PARDUMP or PARSHIFT chosen? let klenm7=${klenwo001}-7 let klenm6=${klenwo001}-6 read_dump=`echo $pinpf | cut -c${klenm6}-${klenwo001}` read_shft=`echo $pinpf | cut -c${klenm7}-${klenwo001}` #echo read_dump: $read_dump #echo read_shft: $read_shft # date of single time period in PARSHIFT file is in filename delimited by plus signs if [ "${read_shft}" = "PARSHIFT" ] then paramt=`echo ${pinpf} | cut -f2 -d+` iimo=`echo ${paramt} | cut -c3-4` iida=`echo ${paramt} | cut -c5-6` iihr=`echo ${paramt} | cut -c7-8` # need to verify this date is not before time period of run elif [ "${read_dump}" = "PARDUMP" ] then # same as above for PARDUMP pardump_time=`head -1 ${pinpf_pre}.PARINV` # read first time period of PARDUMP file and set default rlse start time to this iimo=`echo ${pardump_time} | cut -c3-4` iida=`echo ${pardump_time} | cut -c5-6` iihr=`echo ${pardump_time} | cut -c7-8` else echo "Not using PARDUMP nor PARSHIFT." fi fi fi ;; esac ##################################################################### # End of volcanic ash PARDUMP/PARSHIFT section ##################################################################### # ============================================================== # Save defaults (of default ini or previously run as chosen # ============================================================== #---- these are reset for setup.cfg ------------------------ identd=$ident # pollutant id dryvld=$dryvl # dry deposition velocity wetind=$wetin # in-cloud wet deposition wetlod=$wetlo # below-cloud wet deposition rhalfd=$rhalf # radioactive half-life #----------------------------------------------------------- qhrsd=$qhrs # hours of emission olvl2d=$olvl2 # source top height (m) # ============================================================== # Save defaults (default ini) # ============================================================== if [ -f ${FIXhysplit}/hysplit_def${TYPl}.ini ]; then cp ${FIXhysplit}/hysplit_def${TYPl}.ini default.ini chmod 775 default.ini else echo "${FIXhysplit}/hysplit_def${TYPl}.ini not found" echo " WARNING - will not be able to reset values if desired" echo "Continue (y/n)?" read defcont case $defcont in N|n) echo "Terminated" exit ;; esac fi # read default.ini - these are used for "reset" option # set all variable names to end in D(default) even though only adding # option to reset concentration grid specs now (Nov. 2006) k=0 cat default.ini | while read tmp do let k=$k+1 case $k in 1) titleD=$tmp;; 2) meteoD=$tmp;; 3) siteD=$tmp;; 4) olatD=$tmp;; 5) olonD=$tmp;; 6) olvl1D=$tmp;; 7) olvl2D=$tmp;; 8) nhrsD=$tmp;; 9) mtypeD=$tmp;; 10) dir1D=$tmp;; 11) meteo1D=$tmp;; 12) dir2D=$tmp;; 13) meteo2D=$tmp;; 14) dir3D=$tmp;; 15) meteo3D=$tmp;; 16) identD=$tmp;; 17) qratD=$tmp;; 18) qhrsD=$tmp;; 19) dsyrD=$tmp;; 20) dsmoD=$tmp;; 21) dsdaD=$tmp;; 22) dshrD=$tmp;; 23) dsmnD=$tmp;; 24) cnlatD=$tmp;; 25) cnlonD=$tmp;; 26) dlatD=$tmp;; 27) dlonD=$tmp;; 28) splatD=$tmp;; 29) splonD=$tmp;; 30) heightD=$tmp;; 31) csyrD=$tmp;; 32) csmoD=$tmp;; 33) csdaD=$tmp;; 34) cshrD=$tmp;; 35) dhrD=$tmp;; 36) delhrD=$tmp;; 37) cnlat2D=$tmp;; 38) cnlon2D=$tmp;; 39) dlat2D=$tmp;; 40) dlon2D=$tmp;; 41) splat2D=$tmp;; 42) splon2D=$tmp;; 43) height2D=$tmp;; 44) dhr2D=$tmp;; 45) dryvlD=$tmp;; 46) wetinD=$tmp;; 47) wetloD=$tmp;; 48) rhalfD=$tmp;; 49) icmtD=$tmp;; 50) initdD=$tmp;; 51) khmaxD=$tmp;; 52) numparD=$tmp;; 53) isotD=$tmp;; 54) ndumpD=$tmp;; 55) kmslD=$tmp;; 56) seqD=$tmp;; 57) qunitsD=$tmp;; 58) orgD=$tmp # override $org with what user input ($organ) if [ "$orgD" != "$organ" ] then orgD="${organ}" fi ;; 59) zoom1D=$tmp;; 60) zoom2D=$tmp;; 61) relcenD=$tmp;; 62) ncyclD=$tmp;; 63) pinpfD=$tmp;; 64) olat2D=$tmp;; 65) olon2D=$tmp;; 66) olat3D=$tmp;; 67) olon3D=$tmp;; 68) dum4D=$tmp;; 69) dum3D=$tmp;; 70) dum2D=$tmp;; 71) dum1D=$tmp;; esac done # ============================================================== # Convert olvl1 to feet for volcano # ============================================================== case $typenum in 2) if [ "${olvl1f}" == "" ]; then # 3.2808 ft = 1 m olvl1f=`echo "${olvl1}*32808/10000" | bc` # summit in feet fi esac # ============================================================== # Set max top of eruption/release to be top of meteo data # ============================================================== ### mtopf (max top of eruption column (top of met data)) in feet,and ### mtopm (max top of release (top of met data)) in meters case $meteo in HIRESW|HRW) mtopf=$mtopfh mtopm=$mtopmh;; NAM|NAM012) mtopf=$mtopfe mtopm=$mtopme;; GFS|GDAS) mtopf=$mtopfg mtopm=$mtopmg;; *) echo "NOTICE: meteo: $meteo not found; mtopf, mtopm not defined," echo " this is the max eruption/release height allowed" echo " per the top meteorology level and so will" echo " not be included in the prompt for the height" echo " You should only see this message if a meteorology file" echo " was added to the script, but not accounted for here." echo echo "Press any key to continue" read dummy;; esac #======================================================================== # databases listing nuclear power plant and volcano locations #======================================================================== case $typenum in 1) source=$FIXhysplit/hysplit_rsmc.plants region=$FIXhysplit/hysplit_country_codes.txt ;; 2) source=$FIXhysplit/hysplit_volcanoes ####----------------------------------------------------- #### Data from the Smithsonian Institution #### Global Volcanism Program file at #### http://www.nmnh.si.edu/gvp/volcano/vbd_alph.htm #### were reformatted to make the hysplit_volcanoes file ####----------------------------------------------------- region=$FIXhysplit/hysplit_volcano_regions.txt ####----------------------------------------------------- #### The regions are defined by the IAVCEI - CAVW #### (International Association of Volcanology and Chemistry #### of the Earth's Interior - #### Catalog of Active Volcanoes of the World ) #### as indicated in the Smithsonian's book "Volcanoes of the World" ####----------------------------------------------------- ;; 3|4) source= region= ;; esac # ============================================================== # Increment sequence number for filename/identification # ============================================================== let seq=$seq+1 klen=`expr "$seq" : ".*"` if [ $klen -eq 1 ]; then seq="00"${seq} elif [ $klen -eq 2 ]; then seq="0"${seq} fi # ============================================================== # Set release start time and sampling start time to the # 'current' time for the default run, not update. # Hour is prior 00/06/12/18. # ============================================================== if [ $initnum -eq 1 ] then dsyr=`date -u +%Y` # 4-digit dsmo=`date -u +%m` # 2-digit dsda=`date -u +%d` # 2-digit dshr=`date -u +%H` # 2-digit if test $dshr -ge 18 then dshr=18 else if test $dshr -ge 12 then dshr=12 else if test $dshr -ge 6 then dshr=06 # 2-digit else dshr=00 # 2-digit fi fi fi dsmn=00 # 2-digit # default sampling (c=concentration) start to the release start time csyr=$dsyr csmo=$dsmo csda=$dsda cshr=$dshr # minutes default to 00 (beginning of hour) else if [ ${fnum} -ne 0 ] then # default release start time to first time period of PARDUMP or time period of PARSHIFT dsyr=`date -u +%Y` # 4-digit dsmo=${iimo} dsda=${iida} dshr=${iihr} dsmn=00 fi # default sampling (c=concentration) start to the release start time csyr=$dsyr csmo=$dsmo csda=$dsda cshr=$dshr # minutes default to 00 (beginning of hour) fi #################################################################### # review inputs (both for default and previously-run case) #################################################################### main_menu_flag=1 while [ $main_menu_flag -ne 0 ] do clear echo echo "THIS IS THE REVIEW MENU... VERIFY/EDIT THE FOLLOWING INFORMATION" echo echo " 1) RUN DESCRIPTION : $title" echo " 2) METEOROLOGICAL DATA : $meteo1" echo " 3) ${SOURCE} NAME : $site" echo " 4) ${SOURCE} LATITUDE (SOUTH IS NEGATIVE) : $olat" echo " 5) ${SOURCE} LONGITUDE (WEST IS NEGATIVE) : $olon" case $typenum in 2) echo " SUMMIT HEIGHT (enter 15 for advanced parameters)" ;; esac echo " 6) (RELEASE TIME) YEAR : $dsyr" echo " 7) (RELEASE TIME) MONTH : $dsmo" echo " 8) (RELEASE TIME) DAY : $dsda" echo " 9) (RELEASE TIME) HOUR : $dshr" echo "10) (RELEASE TIME) MINUTE : $dsmn" case $typenum in 1) echo "11) RELEASE DURATION (hours) : ${qhrs}" echo "12) TOP OF RELEASE (meters, minimum 10): $olvl2" echo "13) RESULTS BASED ON DEFAULT INITIAL VALUES label (0=no 1=yes) : $icmt" echo " ***** RSMC protocol requires a 6 hour release and a release" echo " ***** top as 500 m for the first run. When changes are" echo " ***** made for subsequent runs, generally in consultation" echo " ***** with ARL, the label should be turned off." ;; 2) if [ $fnum -eq 0 ] then echo "11) ERUPTION DURATION (hours) : ${qhrs}" else echo "11) ERUPTION DURATION (hours) : ${qhrs} (zero means eruption has stopped)" fi echo "12) ASH COLUMN TOP (feet) : $olvl2" echo "13) ASH COLUMN TOP ESTIMATED label (0=no 1=yes 2=override with diagonal test labels) : $icmt" ;; 3|4) echo "11) RELEASE DURATION (hours) : ${qhrs}" echo "12) TOP OF RELEASE (meters, minimum 10): $olvl2" echo "13) N/A" ;; esac echo "14) N/A" echo "15) View/Edit Advanced Parameters" echo # backtracking option should not be invoked for starting time # ahead of current day case $typenum in 4) if [ ${dsyr}${dsmo}${dsda} -gt $PDY ] then echo "************" echo " ERROR - backtracking runs should usually begin before today." echo " Change date as needed" echo "************" echo #exit fi # for start date of today, need agppropriate gdas files if test ${dsyr}${dsmo}${dsda} -eq $PDY then PDYgdas1=$PDY PDYgdas2=$PDY if test $dshr -le 6 then gdascyc1=00 gdascyc2=06 else if test $dshr -le 12 then gdascyc1=06 gdascyc2=12 else if test $dshr -le 18 then gdascyc1=12 gdascyc2=18 else gdascyc1=18 gdascyc2=00 PDYgdas2=$PDYp1 fi fi fi export gdascyc1 gdascyc2 PDYgdas1 PDYgdas2 FILE1=${usrdir}/com/hysplit/${envir}/hysplit.$PDYgdas1/hysplit.t${gdascyc1}z.gdas1f FILE2=${usrdir}/com/hysplit/${envir}/hysplit.$PDYgdas2/hysplit.t${gdascyc2}z.gdas1f if [ -f $FILE1 -a ! -f $FILE2 ]; then echo "************" echo " ERROR - GDAS file not available - pick starting time at or just prior to ${gdascyc1}z" echo "************" echo #exit elif [ ! -f $FILE1 -a ! -f $FILE2 ]; then if [ $gdascyc1 -eq 00 ]; then cycm=18 else cycm=`expr $gdascyc1 - 6` fi echo "************" echo " ERROR - GDAS files not available - pick starting time prior to at least ${cycm}z" echo "************" echo #exit fi fi esac #------ add 9-14-09, edit 6-29-10 for FIRST if [ "${FIRST}" = "YES" ] then echo "********************" echo " NOTICE: The following are now entered via the Review Menu instead of having initial manual prompts" echo " Change them accordingly, as well as verify all other values" echo case $typenum in 1) echo " (1) Run description" echo " (3) ${SOURCE} name (setting $SOURCE name may automatically set lat, lon)" echo " (4,5) latitude, longitude" ;; 2|3|4) echo " (1) Run description" case $typenum in 2) echo " (3) ${SOURCE} name (setting $SOURCE NAME may automatically set lat, lon)";; *) echo " (3) ${SOURCE} name";; esac echo " (4,5) latitude, longitude" echo " (11) release duration" echo " (12) release top" case $typenum in 2) echo echo "For volcanic ash, wet deposition now occurs for the default run. To turn it off," echo " in the Advanced Menu, go to item #6," echo " then set the sub-menu item values #4 in-cloud and #5 below-cloud both to zero" echo ;; esac ;; esac echo "********************" echo else y_flg=NO if [ "${olat}" = "" -o "${olon}" = "" -o "${site}" = "" ] then y_flg=YES echo "********************" echo " WARNING: lat, lon, and/or $SOURCE NAME is null, please choose accordingly" case $typenum in 1|2) echo " setting $SOURCE NAME may automatically set lat, lon";; esac echo "********************" echo fi if [ "${olat}" = "0.0" -o "${olon}" = "0.0" ] then y_flg=YES echo "********************" echo " WARNING: lat and/or lon is 0.0, please choose accordingly" echo "********************" echo fi if [ ${olvl2} -eq 0 ] then y_flg=YES echo "********************" case ${typenum} in 2) echo " WARNING: ash column top is 0, please choose accordingly";; *) echo " WARNING: release top is 0, please choose accordingly";; esac echo "********************" echo fi if [ "${FIRST_RUNDESC}" = "YES" ] then y_flg=YES echo "***** NOTICE: Verify (1) Run Description" fi if [ "${FIRST_NAME}" = "YES" ] then y_flg=YES echo "***** NOTICE: Verify (3) ${SOURCE} name" fi echo if [ "${FIRST_DUR}" = "YES" ] then y_flg=YES case $typenum in 2) echo "***** NOTICE: Verify (11) Eruption Duration";; 3) echo "***** NOTICE: Verify (11) Release Duration";; 4) echo "***** NOTICE: Verify (11) Sampler Duration";; esac fi if [ "${FIRST_TOP}" = "YES" ] then y_flg=YES case $typenum in 2) echo "***** NOTICE: Verify (12) Ash Column Top";; 3|4) echo "***** NOTICE: Verify (12) Top of Release";; esac fi fi #------ if [ "${y_flg}" = "YES" -o "${FIRST}" = "YES" ] then echo echo "ENTER NUMBER TO EDIT OR (Y, after noting above messages) TO ACCEPT VALUES:" else echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" fi read ans # make sure release duration and height are not blank if [ "${ans}" = "Y" -o "${ans}" = "y" ]; then klen=`expr "${qhrs}" : ".*"` if [ $klen -eq 0 ]; then ans=11 tflg=1 fi klen=`expr "${olvl2}" : ".*"` if [ $klen -eq 0 ]; then ans=12 tflg=1 fi fi FIRST=NO # it should never go back to YES case $ans in 1) FIRST_RUNDESC=NO case $typenum in 1) clear echo "----------------------------------------------------------------------------------------" echo " RUN DESCRIPTION " echo "----------------------------------------------------------------------------------------" echo "1 Test of the RSMC Response System " echo "2 Requested Services " echo "3 IAEA Notified Emergency " echo "4 Internal NOAA Request " echo " " echo " " echo " When run jhyspt_post_web_rsmc, RSMC products are sent to ARL and placed on web pages" echo " per script on ARL server as summarized here:" echo " 1-Test 2-Requested 3-IAEA 4-Internal" echo " ARL common RSMC page Yes No Yes No" echo " ARL RSMC 'All Products' page Yes No Yes Yes" echo " " echo " ARL common RSMC page = https://ready.arl.noaa.gov/rsmc2-bin/jntrsmc.pl" echo " ARL RSMC 'All Products' page = https://ready.arl.noaa.gov/data/rsmc/restrict/US/arc/ " echo "----------------------------------------------------------------------------------------" echo "ENTER RUN DESCRIPTION NUMBER: " read titlenum case $titlenum in 1) title="Test of the RSMC Response System";; 2) title="Requested Services ";; 3) title="IAEA Notified Emergency ";; 4) title="Internal NOAA Request ";; *) echo "Not a valid entry..." echo "must choose option 1 again at the review menu and enter 1, 2, 3, or 4" echo echo "Press 'enter' to continue..." read dummy;; esac ;; 2) echo echo "----------------------------------------" echo " RUN DESCRIPTION " echo "----------------------------------------" echo "1 Test - No alert " echo "2 Alert " echo "3 Alert Watch " echo "4 Alert Update " echo "----------------------------------------" echo "ENTER RUN DESCRIPTION NUMBER" read titlenum case $titlenum in 1) title="volcanic ash - test ";; 2) title="volcanic ash - alert ";; 3) title="volcanic ash - alert watch ";; 4) title="volcanic ash - alert update ";; *) echo "Not a valid entry..." echo "must choose option 1 again at the review menu and enter 1, 2, 3, or 4" echo echo "Press 'enter' to continue..." read dummy;; esac ;; 3) echo echo "--------------------------------------------------" echo " RUN DESCRIPTION " echo "--------------------------------------------------" echo "1 TEST run of the on-demand HYSPLIT Model " echo "2 REAL EVENT run of the on-demand HYSPLIT Model " echo "--------------------------------------------------" echo "ENTER RUN DESCRIPTION NUMBER: " read titlenum case $titlenum in 1) title="Test run of the on-demand HYSPLIT Model";; 2) title="Real event run of the HYSPLIT Model ";; *) echo "Not a valid entry..." echo "must choose option 1 again at the review menu and enter 1 or 2" echo echo "Press 'enter' to continue..." read dummy;; esac ;; 4) echo echo "----------------------------------------" echo " RUN DESCRIPTION " echo "----------------------------------------" echo "1 Test of the Back-tracking System" echo "2 Requested Services " echo "----------------------------------------" echo "ENTER RUN DESCRIPTION NUMBER: " read titlenum case $titlenum in 1) title="Test of the Back-tracking System";; 2) title="Requested Services ";; *) echo "Not a valid entry... edit in review menu." echo "Press 'enter' to continue..." read dummy;; esac ;; esac ;; 2) clear case $typenum in 4) echo echo "----------------------------------------------------------------------" echo " METEOROLOGICAL DATA " echo "----------------------------------------------------------------------" echo " Cannot change meteorology for Back-tracking" echo " Press 'enter' to continiue..." read dummy ;; *) echo echo "----------------------------------------------------------------------" echo " METEOROLOGICAL DATA " echo "----------------------------------------------------------------------" if [ "$USER" = "$AKUSER" -o $typenum -eq 1 -o $typenum -eq 2 -o $typenum -eq 4 ] then echo "1 (Not Available) " else echo "1 High Resolution Window (4 km, ${lfhrh}-h, 1-hourly, pressure-level" echo " (hiresw currently unavailable, use NAM CONUS)" fi echo "2 NAM CONUS (12 km, ${lfhre}-h, 3-hourly, run this before Hi-Res) " case $typenum in 4) echo "3 (Not Available)" ;; *) echo "3 NAM Alaska (45 km, ${lfhre}-h, 3-hourly ) " esac echo "4 GFS (100 km, ${lfhrg}-h, 3-hourly, global) " echo "5 (Not Available) " echo echo "NOTE: Choose based on scale of incident and meteorological file domain." echo echo "NOTE: HYSPLIT permits multiple meteorological files. " echo " For instance, could start with NAM, then if the plume goes off " echo " the NAM grid or beyond the 48-hours of the NAM, GFS could be used. " echo " To do this, choose NAM here as the 1st file, then later in the " echo " 'Advanced Parameters Menu', choose GFS for the 2nd file. " echo "----------------------------------------------------------------------" echo "ENTER MODEL DESCRIPTION NUMBER: " read meteonum case $meteonum in 1) echo echo "Hiresw currently unavailable, use NAM CONUS" echo "At Review Menu, choose option 2, then 2 again for NAM CONUS" echo "Press 'enter' to continue..." read dummy # echo "***********************************************************" # echo " The Nam (12km) runs faster and should be run before the " # echo " High Res Window. " # echo # echo " After the HIRESW 4km is run, model output is converted " # echo " for a format for HYSPLIT. " # echo "***********************************************************" # echo # echo " If you want to continue with the High Res Window enter C, " # echo " else enter E for Nam. " # read CE # case $CE in # C|c) echo # #echo "----------------------------------------" # #echo " PRIORITY (SYSTEM RESOURCES) " # #echo "----------------------------------------" # #echo "1 LOWER IMPACT " # #echo "2 HIGHER IMPACT " # #echo "----------------------------------------" # #echo "ENTER PRIORITY NUMBER: " # #read prio # #case $prio in # # 1) system_prio="LOW";; # # 2) system_prio="HIGH";; # # *) system_prio="LOW";; # #esac # meteo="HIRESW" # mtopf=$mtopfh # mtopm=$mtopmh;; # *) meteo="NAM" # mtopf=$mtopfe # mtopm=$mtopme;; # esac ;; 2) meteo="NAM" mtopf=$mtopfe mtopm=$mtopme;; 3) meteo="NAMa" mtopf=$mtopfe mtopm=$mtopme;; 4) meteo="GFS" mtopf=$mtopfg mtopm=$mtopmg;; *) echo "Not a valid entry..." echo "go back to option 2 at the review menu" echo echo "Press 'enter' to continue..." read dummy;; esac meteo1=$meteo ;; esac ;; 3) clear FIRST_NAME=NO #======================================================================== # source latitude-longitude (and volcano summit) (6-30-10 moved here REVIEW MENU from above) #======================================================================== clear case $typenum in 1|2) # verify files exist if [ -f $source -a -f $region ] then echo echo "ENTER ${SOURCE} OR ENTER 0 (ZERO) FOR ${SOURCE} MENU:" echo " Sometimes a partial name will be sufficient " case $typenum in 1) echo " e.g. CALV for Calvert Cliffs" ;; 2) echo " e.g. E_HILLS for Soufriere Hills or HELENS for Mount St.Helens" ;; esac echo " For a new ${SOURCE} enter its name" echo " (will be truncated if necessary to $kmax characters and shown in the Review Menu)" read sitename # If nothing is entered, the program hangs.... # change $sitename to 'unknown_site' if nothing was written sitename=${sitename:-unknown_site} if test "$sitename" = "0" then # ================================================================== # use power plant/volcano listing file to create a list of choices # ================================================================== clear echo echo "-----------------------------------------------" case $typenum in 1) echo " COUNTRIES ";; 2) echo " VOLCANO REGIONS ";; esac echo "-----------------------------------------------" n=1 if [ -f ~/tmpcn ] ; then rm ~/tmpcn fi for cntry in `cat $source | awk '{print $1}' | sort -u` do cname=`grep "$cntry\_" $region | awk -F_ '{print $2}'` echo "$n -- $cntry ($cname)" echo $cntry >> ~/tmpcn n=`expr $n + 1` done chmod 777 ~/tmpcn N=`expr $n - 1` echo "-----------------------------------------------" case $typenum in 1) echo "ENTER COUNTRY NUMBER FOR SEARCH (1-$N):";; 2) echo "ENTER REGION NUMBER FOR SEARCH (1-$N):";; esac read num if [ $num -lt 1 -o $num -gt $N ] then echo "Not a valid entry... try again" echo "-----------------------------------------------" case $typenum in 1) echo "ENTER COUNTRY NUMBER FOR SEARCH (1-$N):";; 2) echo "ENTER REGION NUMBER FOR SEARCH (1-$N):";; esac read num if [ $num -lt 1 -o $num -gt $N ] then num=1 echo case $typenum in 1) echo "Not a valid entry... choose any power plant, then edit in review menu.";; 2) echo "Not a valid entry... choose any volcano, then edit in review menu.";; esac echo "Press 'enter' to continue..." read dummy fi fi echo echo "-------------------------------------------------------" case $typenum in 1) echo " COUNTRY LAT LONG POWER-PLANT ";; 2) echo " REGION LAT LONG VOLCANO CAVW # SUBREGION SUMMIT(m)";; esac echo "-------------------------------------------------------" n=1 cnt=`head -$num ~/tmpcn | tail -1` rm ~/tmpcn if [ -f ~/pltfil ] ; then rm ~/pltfil fi grep "$cnt " $source > ~/pltfil nx=`cat ~/pltfil | wc -l` chmod 777 ~/pltfil while test $n -le $nx do plant=`head -$n ~/pltfil | tail -1` echo "$n -- $plant" n=`expr $n + 1` done N=`expr $n - 1` echo "-------------------------------------------------------" case $typenum in 1) echo "ENTER POWER-PLANT NUMBER TO USE (1-$N):";; 2) echo "ENTER VOLCANO NUMBER (left-most column) TO USE (1-$N):";; esac read plt if [ $plt -lt 1 -o $plt -gt $N ] then echo "Not a valid entry... try again" echo "-------------------------------------------------------" case $typenum in 1) echo "ENTER POWER-PLANT NUMBER TO USE (1-$N):";; 2) echo "ENTER VOLCANO NUMBER (left-most column) TO USE (1-$N):";; esac read plt if [ $plt -lt 1 -o $plt -gt $N ] then echo plt=1 case $typenum in 1) echo "Not a valid entry... edit in review menu.";; 2) echo "Not a valid entry... edit in review menu.";; esac echo "Press 'enter' to continue..." read dummy fi fi head -$plt ~/pltfil | tail -1 | read var1 olat olon namefind volcnum volcloc bot if [ $typenum -eq 2 ]; then olvl1=$bot # 3.2808 ft = 1 m olvl1f=`echo "${olvl1}*32808/10000" | bc` # summit in feet fi rm ~/pltfil site=`echo $namefind | awk '{print $1}'` else # ================================================================= # manually entered power plant/volcano name $sitename - see if in list # ====================================================================== clear site=`echo $sitename | tr '[a-z]' '[A-Z]'| tr " " "_"` #---- 9-14-09 start # number of site name matches in file num_match=`grep -c $site $source` if [ ${num_match} -eq 0 ] then # set olat to null so with test $olat below, # will go to section DID NOT FIND $sitename IN DATABASE olat= echo "DID NOT FIND $site IN DATABASE... " echo "... if this is a site not in the database, enter latitude and longitude in Review Menu" case $typenum in 2) echo " and volcano summit in Advanced Menu" ;; esac echo "... or re-enter ${SOURCE} name again in Review Menu" echo "press 'enter' to continue" read dummy elif [ ${num_match} -eq 1 ] then grep $site $source | read var1 olat olon namefind volcnum volcloc bot else case $typenum in 1) echo "MORE THAN ONE MATCH FOUND FOR $site (nuclear power plant unit number may differentiate matches)";; 2) echo "MORE THAN ONE MATCH FOUND FOR $site";; esac grep -n $site $source # lists all matches with line numbers echo imatch=1 while [ ${imatch} -le ${num_match} ] do pos_match[$imatch]=`grep -n $site $source | head -${imatch} | tail -1 | cut -f1 -d:` let imatch=${imatch}+1 done echo "WHICH MATCH DO YOU WANT?" if [ ${num_match} -eq 2 ] then echo "Enter line number given at left such as ${pos_match[1]} or ${pos_match[2]}" elif [ ${num_match} -ge 3 ] then echo "Enter line number given at left such as ${pos_match[1]} or ${pos_match[2]} etc." fi read linenum # verify valid choice ich=0 imatch=1 while [ ${imatch} -le ${num_match} ] do if [ ${linenum} -eq ${pos_match[$imatch]} ] then ich=1 fi let imatch=${imatch}+1 done if [ ${ich} -eq 0 ] then echo echo "****************************************************************** " echo "******************* WARNING ****** " echo "****************************************************************** " echo echo "Line number ${linenum} is not one of the choices, try again" echo "****************************************************************** " echo case $typenum in 1) echo "MORE THAN ONE MATCH FOUND FOR $site(nuclear power plant unit number may differentiate matches)";; 2) echo "MORE THAN ONE MATCH FOUND FOR $site";; esac grep -n $site $source # lists all matches with line numbers echo echo "WHICH MATCH DO YOU WANT?" if [ ${num_match} -eq 2 ] then echo "Enter line number given at left such as ${pos_match[1]} or ${pos_match[2]}" elif [ ${num_match} -ge 3 ] then echo "Enter line number given at left such as ${pos_match[1]} or ${pos_match[2]} etc." fi read linenum # verify valid choice (again) ich=0 imatch=1 while [ ${imatch} -le ${num_match} ] do if [ ${linenum} -eq ${pos_match[$imatch]} ] then ich=1 fi let imatch=${imatch}+1 done if [ ${ich} -eq 0 ] then echo echo "****************************************************************** " echo "******************* WARNING ****** " echo "****************************************************************** " echo echo "Line number ${linenum} is still not one of the choices." echo "... GO TO OPTION #3 OF Review Menu AND CHOOSE $SOURCE AGAIN" # set olat to null so with test $olat below, # will go to section DID NOT FIND $sitename IN DATABASE olat= # force this so will skip over DID NOT FIND... num_match=0 echo "... press 'enter' to continue" read dummy echo "****************************************************************** " echo fi fi #---- 9-14-09 end # now that valid number is chosen, read volcano olat olon etc # note if failed above to get a valid number, num_match is set to 0 above if [ ${num_match} -ne 0 ] then head -${linenum} $source | tail -1 | read var1 olat olon namefind volcnum volcloc bot echo $var1 $olat $olon $namefind $volcnum $volcloc $bot fi fi if [ $typenum -eq 2 ]; then olvl1=$bot fi if test $olat then site=$namefind echo echo "FOUND $namefind $volcnum IN DATABASE" case $typenum in 1) echo "LAT: $olat LON: $olon COUNTRY: $var1 ";; 2) olvl1f=`echo "${olvl1}*32808/10000" | bc` # summit in feet echo "LAT: $olat LON: $olon SUMMIT: $olvl1 m ${olvl1f} ft LOCATION: $var1 $volcloc";; esac echo "ARE THESE VALUES CORRECT (Y/N): (Y)" case $typenum in 2) echo " (Degrees West Longitude is Negative)" ;; esac read ans if test "$ans" = 'n' || test "$ans" = 'N' then echo # reset to nulls and not the match that was found site= olat=0.0 olon=0.0 echo "Choose the ${SOURCE} again at the Review Menu" echo "... press 'enter' to continue" read dummy fi else if [ ${num_match} -ne 0 ] then # set olat to null so with test $olat below, # will go to section DID NOT FIND $sitename IN DATABASE olat= echo "DID NOT FIND $sitename IN DATABASE... " echo "... if this is a site not in the database, enter latitude and longitude in Review Menu" case $typenum in 2) echo " and volcano summit in Advanced Menu" ;; esac echo "... or re-enter ${SOURCE} name again in Review Menu" echo "press 'enter' to continue" read dummy fi fi fi else echo "NOTICE: file(s) not found:" echo " $source" echo " $region" echo "NOTICE: must enter lat-lon-ID (and volcano summit) in review menu" echo "Press any key to continue..." read dummy fi ;; 3|4) echo # ====================================================================== # no site listing database # ====================================================================== echo "ENTER NAME FOR THE ${SOURCE} LOCATION (MAXIMUM ${kmax} CHARACTERS):" echo " (enter latitude, longitude separately at Review Menu)" read sitename klen=`expr "$sitename" : ".*"` if [ klen -gt ${kmax} ]; then echo "NOTICE: Truncated to ${kmax} characters... can edit in review menu" fi sitename=`echo $sitename | cut -c1-${kmax}` site=`echo $sitename | tr '[a-z]' '[A-Z]'| tr " " "_"` ;; esac #======================================================================== # now that have source lat lon, set conc grid center #======================================================================== cnlat=$olat cnlon=$olon ;; 4) clear echo "ENTER ${SOURCE} LATITUDE (-90.000 TO 90.000, south is negative, any number of decimal digits):" read olat cnlat=$olat # (set grid center to site) ;; 5) clear echo " ****************" echo "ENTER ${SOURCE} LONGITUDE (-180.000 to 180.000, west is negative, any number of decimal digits)" echo " ****************" read olon if [ $olon -gt 0 ]; then echo "WARNING: This is in the EASTERN hemisphere." echo "Is this what you meant (y/n)?" read chk case $chk in n|N) olon=`echo "${olon}*-1" | bc` ;; esac fi cnlon=$olon # (set grid center to site) ;; 6) clear echo "ENTER YEAR (2003, 2004, 2005...):" read dsyr if [ $dsyr -le 999 ] then echo "ENTER YEAR (2003, 2004, 2005 ...) with 4-digits" read dsyr fi csyr="${dsyr}" # sample start ;; 7) clear echo "ENTER MONTH (01,02...):" read dsmo klen=`expr "$dsmo" : ".*"` if [ $klen -eq 1 ]; then dsmo="0"${dsmo} fi csmo="${dsmo}" # sample start ;; 8) clear echo "ENTER DAY (01,02...):" read dsda klen=`expr "$dsda" : ".*"` if [ $klen -eq 1 ]; then dsda="0"${dsda} fi csda="${dsda}" # sample start ;; 9) clear echo "ENTER HOUR (00,01,02...UTC, 2-digits):" read dshr klen=`expr "$dshr" : ".*"` if [ $klen -eq 1 ]; then dshr="0"${dshr} fi cshr="${dshr}" # sample start ;; 10) clear echo "ENTER MINUTE (2-digits):" read dsmn klen=`expr "$dsmn" : ".*"` if [ $klen -eq 1 ]; then dsmn="0"${dsmn} fi # csmn="${dsmn}" # sample start - leave out ;; 11) clear FIRST_DUR=NO dummy=`echo "${nhrs}*-1" | bc` # copied from prelim - how is this used? # for continuous eruption -99, subsequent upgrade in hysplit_conc.sh align rlse duration and run duration case $typenum in 1|3|4) echo "ENTER RELEASE DURATION in hours ($mind (1 min) or greater)" ;; 2) echo "ENTER ERUPTION DURATION in hours (0, $mind (1 min) or greater)" echo " 0 for model initialized with ash and no eruption after start time shown in Review Menu" ;; esac if [ ${tflg} -eq 1 ]; then echo " (it was not already set)" tflg=0 fi echo " ----------------------------------------------------------------" echo " If the duration is less than the HYSPLIT time step, " echo " but greater than zero, the duration" echo " will be set to the model time step. " echo " Output plots will indicate the duration used." echo " HYSPLIT time step is computed based on model gridsize and winds." #echo " In general, for Nam (12 km) minimum ~0.05 h (3 minutes)" #echo " for GFS (100 km) minimum ~0.25 h (15 minutes)." echo " ----------------------------------------------------------------" case $typenum in 1|3|4) echo "Note: Emission rate is recalculated based on release duration" echo " for a total emission of 1 unit. If needed override the" echo " emission rate in the advanced menu.";; esac echo "$qhrsd is default" read qhrs if [ "$qhrs" = "" ] ; then qhrs=$qhrsd fi tmpmind=`echo "$mind*1000" | bc` tmpnhrs=`echo "$nhrs*1000" | bc` tmpqhrs=`echo "$qhrs*1000" | bc` # set to upper or lower limit if necessary if [ $tmpqhrs -lt $tmpmind ] then if [ ${tmpqhrs} -ne 0 ] then echo "Setting to $mind h ... change in review menu if necessary" echo "Press 'enter' to continue" read dummy qhrs=$mind else qrat=0.0 fi else # skip this for back # add skip for volcanic ash so can have very-long duration runs 12 Nov 2010 B.Stunder/ARL # [change 1|2|3) to 1|3)] case $typenum in 1|3) if [ $tmpqhrs -gt $tmpnhrs ] then echo "Setting to $nhrs h ... change in review menu if necessary" echo "Press 'enter' to continue" read dummy qhrs=$nhrs fi ;; esac fi # set total emission Q to 1.0, calculate hourly emission rate case $typenum in 1|3|4) Q=1.0 qrat=`echo "scale=4\n $Q/$qhrs" |bc` echo "Note: Emission rate is recalculated based on release duration" echo " for a total emission of 1 unit. If needed override the" echo " emission rate in the advanced menu." ;; esac #=================================================================== # increase numpar for every depth unit(m) and rlse duration unit(h) # ### if edit here, edit 3 other places ### #=================================================================== # depth unit case $typenum in 2) DZ=`expr ${olvl2} - ${olvl1f}` ;; 1|3|4) DZ=`expr ${olvl2} - ${olvl1}` ;; esac dunit=`expr ${DZ} / $depth` # do not want fewer particles for heights less than 1 unit if [ ${dunit} -lt 1 ]; then let dunit=1 fi # do not want fewer particles for release durations less than 1 unit if [ ${qhrs} -le 1 ]; then runit=1 else runit=`expr ${qhrs%.*} / ${duration}` runit=${runit%.*} # this keeps the integer part of the number if [ ${runit} -le 0 ]; then runit=1 fi fi numpar=`expr ${runit} \* ${numpar_def} \* ${dunit}` # set to arbitrary max; run time issues; may increase in Adv Menu-SETUP.CFG if [ ${numpar} -gt ${MNUM} ]; then let numpar=${MNUM} fi let numparc=${numpar} #numpar calculated ;; 12) FIRST_TOP=NO case $typenum in 2) clear echo "ASH COLUMN TOP ESTIMATED label is chosen as #13 in the review menu" echo "ENTER ASH COLUMN TOP ($olvl1f (SUMMIT) to $mtopf FEET):" echo " (if eruption has stopped, eruption duration = 0, want to leave this as it was," echo " enter -1 to return to original value" if [ ${tflg} -eq 1 ]; then echo " (it was not already set)" tflg=0 fi read olvl2 if [ ${olvl2} -eq -1 ] then let olvl2=${olvl2d} fi if [ $olvl2 -lt $olvl1f ] then echo "Value entered $olvl2 is less than the summit $olvl1f" echo "If this is not what you wanted change (12) Ash Column Top" echo " and/or Advanced Menu (3) summit" echo "Press 'enter' to continue" read dummy fi if [ $olvl2 -gt $mtopf ] then echo "Setting TOP to $mtopf feet... edit in review menu if necessary" olvl2=$mtopf echo "Press 'enter' to continue" read dummy fi # force standard turbulence for 'small' volcano eruption if [ $olvl2 -lt $isoht ] then isot=0 else isot=1 fi ;; 1|3|4) clear echo "ENTER TOP OF RELEASE (10 - $mtopm meters):" if [ ${tflg} -eq 1 ]; then echo " (it was not already set)" tflg=0 fi echo "$olvl2d is default" read olvl2 if [ "$olvl2" = "" ] then olvl2=$olvl2d fi if [ $olvl2 -lt 10 ]; then let olvl2=10 echo "Top of relase is set to 10 m... press 'enter' to continue" read dummy if [ $olvl2 -gt $mtopm ] then echo "Setting top of release to $mtopm meters... edit in review menu if necessary" olvl2=$mtopm echo "Press 'enter' to continue" read dummy fi fi ;; esac #=================================================================== # increase numpar for every depth unit(m) and rlse duration unit(h) # ### if edit here, edit 3 other places ### #=================================================================== # depth unit case $typenum in 2) DZ=`expr ${olvl2} - ${olvl1f}` ;; 1|3|4) DZ=`expr ${olvl2} - ${olvl1}` ;; esac dunit=`expr ${DZ} / $depth` # do not want fewer particles for heights less than 1 unit if [ ${dunit} -lt 1 ]; then let dunit=1 fi # do not want fewer particles for release durations less than 1 unit if [ ${qhrs} -le 1 ]; then runit=1 else runit=`expr ${qhrs%.*} / ${duration}` runit=${runit%.*} # this keeps the integer part of the number if [ ${runit} -le 0 ]; then runit=1 fi fi numpar=`expr ${runit} \* ${numpar_def} \* ${dunit}` # set to arbitrary max; run time issues; may increase in Adv Menu-SETUP.CFG if [ ${numpar} -gt ${MNUM} ]; then let numpar=${MNUM} fi let numparc=${numpar} #numpar calculated ;; 13) case $typenum in 1) clear echo "USE COMMENT Results Based On Default Initial Values (Y/N):" read cmt case $cmt in Y|y) icmt=1;; N|n) icmt=0;; *) echo "Not a valid entry... edit in review menu" echo "Press 'enter' to continue" read dummy ;; esac ;; 2) clear echo "USE COMMENT Ash Column Top Estimated (Y/N) OR override with diagonal 'this is a test' labels (V):" read cmt case $cmt in V|v) icmt=2;; Y|y) icmt=1;; N|n) icmt=0;; *) echo "Not a valid entry... edit in review menu" echo "Press 'enter' to continue" read dummy ;; esac ;; esac ;; 15) advanced_menu_flag=1 forc=0 sitetmp=$site while [ $advanced_menu_flag -ne 0 ] do # ============================================================== # Advanced Parameter Menu # ============================================================== clear # re-set va_wet variable as needed ignore syntax errors # only for volcanic ash case $typenum in 2) wetin_tmp=`echo ${wetin} | cut -c4-6` # force this to skip over irrelevant syntax error for typical case with wetin=3.5E+5 if [ "${wetin_tmp}" != "E+5" ] then if [ ${wetin} -eq 0 -a ${wetlo} -eq 0 ] then va_wet="NO" fi fi esac # re-set eff_area as needed eff_area="NO" if [ ${olat2} -ne -99 -a ${olon2} -ne -99 -a ${olat3} -ne -99 -a ${olon3} -ne -99 ] then eff_area="YES" fi echo "THIS IS THE ADVANCED PARAMETERS MENU... VERIFY/EDIT THE FOLLOWING INFORMATION." echo case $typenum in 1|3) echo " 1) RUN DURATION (hours) : $nhrs";; 2) echo " 1) RUN DURATION (hours) : $nhrs" echo " (for volcanic ash run duration will be automatically calculated)";; 4) echo " 1) RUN DURATION (hours) : $nhrs (negative for source attribution)" ;; esac # for RSMC and volcano, this is calculated in hysplit_conc case $typenum in 1|3|4) echo " 2) EMISSION RATE (per hour) : $qrat" echo " Note: This emission rate is input to hysplit.";; 2) echo " 2) N/A";; esac case $typenum in 2) echo " 3) VOLCANO SUMMIT (meters) : $olvl1" klen=`expr "$olvl1f" : ".*"` if [ $klen -eq 0 ]; then olvl1f=`echo "${olvl1}*32808/10000" | bc` # summit in feet fi echo " VOLCANO SUMMIT (feet) : $olvl1f";; 1|3|4) echo " 3) BASE OF RELEASE (meters) : $olvl1";; esac echo " 4) CONCENTRATION GRID #1" cgrd2=0; if [ $dhr2 -ne 0 ]; then cgrd2=1; fi echo " 5) CONCENTRATION GRID #2 (0=no 1=yes): $cgrd2" case $typenum in 1|3|4) echo " 6) POLLUTANT : $ident";; 2) echo " 6) VOLCANIC ASH WET DEPOSITION: ${va_wet}";; esac echo " 7) SETUP.CFG parameters " echo " 8) EFFECTIVE AREA SOURCE (3 points): ${eff_area}" echo " 9) N/A " echo " 10) N/A " echo " 11) 2nd METEOROLOGY (use after $meteo1): $meteo2" #echo " 12) 3rd METEOROLOGY : $meteo3" echo " 12) N/A " echo " 13) RUN SEQUENCE NUMBER : $seq " case $titlenum in 1) echo " 14) Override label $sitetmp to TEST (0=no 1=yes) : $forc";; esac echo echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" read advanced_ans case $advanced_ans in 1) clear echo "ENTER RUN DURATION (HOURS):" read nhrs # force 3-d particle mode for long-duration run if [ $nhrs -ge ${longrun} -o $nhrs -le ${neglongrun} ]; then if [ ${initd} -ne 0 ]; then initd=0 echo "NOTICE: Because of long-duration run (cutoff ${longrun} hours)," echo " model is set to 3-D particle mode if it was not already." echo "Press to continue" read dummy fi if [ ${numpar} -lt ${numparlong} ]; then numpar=${numparlong} echo "NOTICE: Increased number of particles to $numpar." echo "Press to continue" read dummy fi dlattmp=`echo "${dlat}*1000" | bc` dlontmp=`echo "${dlon}*1000" | bc` dlatlongtmp=`echo "${dlatlong}*1000" | bc` dlonlongtmp=`echo "${dlonlong}*1000" | bc` if [ ${dlattmp} -lt ${dlatlongtmp} -o ${dlontmp} -lt ${dlonlongtmp} ] then dlat=`echo "scale=3\n ${dlatlongtmp}/1000" | bc` dlon=`echo "scale=3\n ${dlonlongtmp}/1000" | bc` echo "NOTICE: Increased concentration grid spacing to $dlat $dlon" echo "Press to continue" read dummy fi fi ;; 2) clear case $typenum in 1|3|4) echo "ENTER EMISSION RATE (MASS/HOUR):" read qrat ;; esac ;; 3) clear case $typenum in 2) echo "UNITS YOU WILL BE USING TO INPUT SUMMIT HEIGHT" echo "ENTER m FOR METERS or f FOR FEET" read unit echo "ENTER VOLCANO SUMMIT HEIGHT in $unit:" read olvl1 case $unit in m|M) olvl1f=`echo "${olvl1}*32808/10000" | bc` ;; f|F) olvl1f=$olvl1 olvl1=`echo "${olvl1f}*10000/32808" | bc` ;; *) echo "Incorrect entry" echo "UNITS YOU WILL BE USING TO INPUT SUMMIT HEIGHT" echo "ENTER m FOR METERS or f FOR FEET" read unit echo "ENTER VOLCANO SUMMIT HEIGHT in $unit:" read olvl1 case $unit in m|M) olvl1f=`echo "${olvl1}*32808/10000" | bc` ;; f|F) olvl1f=$olvl1 olvl1=`echo "${olvl1f}/32808*10000" | bc` ;; *) echo "UNITS m AND f ARE ONLY POSSIBILITIES." echo "Please correct later in list of inputs" ;; esac ;; esac ;; 1|3|4) echo "ENTER BASE OF RELEASE (minimum 10 METERS):" read olvl1 if [ $olvl1 -lt 10 ] then olvl1=10 fi ;; esac #======================================================================== # increase numpar for every depth unit(m) and rlse duration unit(h) # ### if edit here, edit 3 other places ### #======================================================================== # depth unit case $typenum in 2) DZ=`expr ${olvl2} - ${olvl1f}` ;; 1|3|4) DZ=`expr ${olvl2} - ${olvl1}` ;; esac dunit=`expr ${DZ} / $depth` # do not want fewer particles for heights less than 1 unit if [ ${dunit} -lt 1 ]; then let dunit=1 fi # do not want fewer particles for release durations less than 1 unit if [ ${qhrs} -le 1 ]; then runit=1 else runit=`expr ${qhrs%.*} / ${duration}` runit=${runit%.*} # this keeps the integer part of the number if [ ${runit} -le 0 ]; then runit=1 fi fi numpar=`expr ${runit} \* ${numpar_def} \* ${dunit}` # set to arbitrary max; run time issues; may increase in Adv Menu-SETUP.CFG if [ ${numpar} -gt ${MNUM} ]; then let numpar=${MNUM} fi let numparc=${numpar} #numpar calculated ;; 4) clear concgrid1_menu_flag=1 while [ $concgrid1_menu_flag -ne 0 ] do # ======================================================== # Concentration Grid #1 Menu # ======================================================== clear echo echo "VERIFY/EDIT CONC GRID #1 PARAMETER SETTINGS" echo " no checks are done to make sure these are reasonable" echo echo " 1) (SAMPLING START) YEAR : $csyr" echo " 2) (SAMPLING START) MONTH : $csmo" echo " 3) (SAMPLING START) DAY : $csda" # echo " ) (SAMPLING START) HOUR : $cshr" # sample start date/hour automatically set for volcano # sample start hour automatically set for RSMC case $typenum in 1|3|4) echo " 4) TOP OF CONCENTRATION OUTPUT LAYER (m) : $height";; 2) echo " 4) N/A";; esac echo " 5) CENTER OF CONCENTRATION GRID LATITUDE : $cnlat" echo " 6) CENTER OF CONCENTRATION GRID LONGITUDE : $cnlon" echo " 7) CONC GRID SPACING (decimal degrees) DLAT : $dlat" echo " 8) CONC GRID SPACING (decimal degrees) DLON : $dlon" echo " 9) CONC GRID SPAN (degrees) SPLAT : $splat" echo " 10) CONC GRID SPAN (degrees) SPLON : $splon" case $typenum in 1|3|4) echo " 11) OUTPUT AVERAGING TIME (hours) : $dhr";; 2) echo " 11) N/A";; esac case $typenum in 3) echo " 12) HOURS TO OUTPUT ON GRID #1 : $delhr" #echo " For a single grid, this can be set to a time well" #echo " into the future. " echo " For two grids, output to 2nd grid after given # of hours" ;; 1|2|4) echo " 12) N/A";; esac case $typenum in 1|2|4) echo " 13) OUTPUT MAP ZOOM LEVEL (least zoom 0-100 most) : $zoom1";; 3) echo " 13) OUTPUT MAP ZOOM LEVEL FOR FINE GRID (least zoom 0-100 most) : $zoom1";; esac case $typenum in 1|2|4) echo " 14) N/A";; 3) echo " 14) FORCE RELEASE LOCATION TO CENTER OF FINE GRID MAP (1=yes 0=no) : $relcen";; esac echo " 15) COMPARE GRID SPACING AND SPAN TO DEFAULTS" echo echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" read concgrid1_ans case $concgrid1_ans in 1) clear echo "ENTER YEAR (2003, 2004, 2005...):" read csyr if [ $csyr -le 999 ] then echo "ENTER YEAR (2003, 2004, 2005 ...) with 4-digits" read dsyr fi ;; 2) clear echo "ENTER MONTH (01,02...):" read csmo ;; 3) clear echo "ENTER DAY (01,02...):" read csda ;; 4) clear case $typenum in 1|3|4) echo "TOP OF CONCENTRATION OUTPUT LAYER (METERS):" read height ;; esac ;; 5) clear echo "CENTER OF CONCENTRATION GRID LATITUDE :" read cnlat ;; 6) clear echo "CENTER OF CONCENTRATION GRID LONGITUDE (west is negative):" read cnlon ;; 7) clear echo "CONC GRID SPACING (decimal degrees) DLAT: " read dlat ;; 8) clear echo "CONC GRID SPACING (decimal degrees) DLON: " read dlon ;; 9) clear echo "CONC GRID SPAN (degrees) SPLAT: " read splat ;; 10) clear echo "CONC GRID SPAN (degrees) SPLON: " read splon ;; 11) clear case $typenum in 1|3|4) echo "OUTPUT AVERAGING TIME (hours): " read dhr ;; esac ;; 12) clear case $typenum in 3) echo "HOURS TO OUTPUT ON THIS GRID : " read delhr ;; esac ;; 13) clear echo "OUTPUT MAP ZOOM LEVEL (least zoom 0-100 most)" case $typenum in 1|3|4) echo " usually set to 80, for larger area try 50" ;; 2) echo " usually set to 90, for larger area try 70" ;; esac read zoom1 ;; 14) clear case $typenum in 3|4) echo "Force release location to center of map (1=yes 0=no)" echo " may need to lower zoom factor" read relcen case $relcen in 1|y|yes|Yes|YES) relcen=1;; 0|n|no|No|NO) relcen=0;; esac esac ;; 15) clear echo "Grid spacing span (dlat,dlon,splat,splon):$dlat $dlon $splat $splon" echo "Default grid spacing span :$dlatD $dlonD $splatD $splonD" echo "Reset to defaults (y/n)?" read resetgrid case ${resetgrid} in Y|y) dlat=$dlatD dlon=$dlonD splat=$splatD splon=$splonD ;; esac ;; Y|y) concgrid1_menu_flag=0;; *) ;; esac done ;; 5) clear concgrid2_menu_flag=1 while [ $concgrid2_menu_flag -ne 0 ] do # ======================================================== # Concentration Grid #2 Menu # ======================================================== clear echo echo "VERIFY/EDIT CONC GRID #2 PARAMETER SETTINGS" echo " no checks are done to make sure these are reasonable;" echo case $typenum in 2|4) echo " 1) N/A";; 1|3) echo " 1) TOP OF CONCENTRATION OUTPUT LAYER (m) : $height2" ;; esac echo " 2) CENTER OF CONCENTRATION GRID LATITUDE : $cnlat2" echo " 3) CENTER OF CONCENTRATION GRID LONGITUDE : $cnlon2" echo " (center of 0.0 0.0 will default to source location)" echo " 4) CONC GRID SPACING (decimal degrees) DLAT : $dlat2" echo " 5) CONC GRID SPACING (decimal degrees) DLON : $dlon2" echo " 6) CONC GRID SPAN (degrees) SPLAT : $splat2" echo " 7) CONC GRID SPAN (degrees) SPLON : $splon2" echo " 8) OUTPUT AVERAGING TIME (hours, 0 for none): $dhr2" case $typenum in 1|2) echo " 9) OUTPUT MAP ZOOM LEVEL (least zoom 0-100 most) : $zoom2";; 3) echo " 9) OUTPUT MAP ZOOM LEVEL FOR COARSE GRID (least zoom 0-100 most) : $zoom2";; esac echo " 10) COMPARE GRID SPACING AND SPAN TO DEFAULTS" echo echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" read concgrid2_ans case $concgrid2_ans in 1) clear echo "TOP OF CONCENTRATION OUTPUT LAYER (METERS):" read height2 ;; 2) clear echo "CENTER OF CONCENTRATION GRID LATITUDE :" read cnlat2 ;; 3) clear echo "CENTER OF CONCENTRATION GRID LONGITUDE:" read cnlon2 ;; 4) clear echo "CONC GRID SPACING (decimal degrees) DLAT: " read dlat2 ;; 5) clear echo "CONC GRID SPACING (decimal degrees) DLON: " read dlon2 ;; 6) clear echo "CONC GRID SPAN (degrees) SPLAT: " read splat2 ;; 7) clear echo "CONC GRID SPAN (degrees) SPLON: " read splon2 ;; 8) clear echo "OUTPUT AVERAGING TIME (hours): " echo " (to turn off grid #2, set this to zero)" read dhr2 ;; 9) clear echo "OUTPUT MAP ZOOM LEVEL (least zoom 0-100 most)" case $typenum in 1|3) echo " usually set to 80, for larger area try 50" ;; 2) echo " usually set to 90, for larger area try 70" ;; esac read zoom2 ;; 10) clear echo "Grid spacing span are (dlat,dlon,splat,splon): $dlat2 $dlon2 $splat2 $splon2" echo "Default grid spacing span are : $dlat2D $dlon2D $splat2D $splon2D" echo "Reset to defaults (y/n)?" read resetgrid case ${resetgrid} in Y|y) dlat2=$dlat2D dlon2=$dlon2D splat2=$splat2D splon2=$splon2D ;; esac ;; Y|y) concgrid2_menu_flag=0;; *) ;; esac done ;; 6) # pollutant specs file (last item in list needs to be "Other" pspecs=$FIXhysplit/hysplit_pollutant_specs pollutant_menu_flag=1 while [ $pollutant_menu_flag -ne 0 ] do # ======================================================== # Pollutant Menu # ======================================================== clear echo echo "VERIFY/EDIT POLLUTANT PARAMETER SETTINGS" echo " no checks are done to make sure these are reasonable" echo echo " 1) POLLUTANT ID : $ident" echo " 2) SET TO $TYPl DEFAULTS " case $typenum in 2) echo " 3) N/A";; *) echo " 3) DRY DEPOSITION VELOCITY (m/s) : $dryvl" esac echo " 4) WET DEPOSITION IN-CLOUD (L/L) : $wetin" echo " 5) WET DEPOSITION BELOW-CLOUD (/s) : $wetlo" echo " for wet deposition both in- and below-cloud should be non-zero" case $typenum in 2) echo " to turn on wet deposition, choose volcanic ash for 'pollutant id'" ;; esac echo " for no wet deposition both in- and below-cloud should be zero (0)" case $typenum in 2) echo " 6) N/A";; *) echo " 6) RADIOACTIVE HALF-LIFE (days) : $rhalf";; esac echo " 7) RESET TO CHOSEN STARTING VALUES " echo " either default or previous run " echo echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" read pollutant_ans case $pollutant_ans in 1) clear plt=0 if [ -f $pspecs ] then # ======================================================== # Pollutant Choice Menu # ======================================================== echo echo "-----------------------------------------------------------------" echo " Name ID dry wet deposition radioactive" echo " deposition in-cloud below-cloud half-life" echo " (m/s) (L/L) (/s) (days) " echo "-----------------------------------------------------------------" n=1 if [ -f ~/pltfil ] ; then rm ~/pltfil fi grep "$cnt " ${pspecs} > ~/pltfil nx=`cat ~/pltfil | wc -l` chmod 777 ~/pltfil while test $n -le $nx do plant=`head -$n ~/pltfil | tail -1` echo "$n -- $plant" n=`expr $n + 1` done N=`expr $n - 1` echo "-----------------------------------------------------------------" echo "ENTER 'POLLUTANT' NUMBER (left-most column, 1-$N) or zero (0) for no change:" echo " Constants will be automatically set for 1-`expr $N - 1` " read plt if [ $plt -lt 0 -o $plt -gt $N ] then echo "Not a valid entry... try again" echo "-------------------------------------------------------" echo "ENTER 'POLLUTANT' NUMBER (left-most column) (1-$N) or zero (0):" read plt if [ $plt -lt 0 -o $plt -gt $N ] then echo plt=1 echo "Not a valid entry... choose 1 in POLLUTANT ID again" echo "Press 'enter' to continue..." read dummy fi fi if [ $plt -ge 1 -a $plt -lt $N ]; then head -$plt ~/pltfil | tail -1 | read tmp ident dryvl wetin wetlo rhalf misc if [ "${ident}" = "" ]; then ident= fi elif [ $plt -eq $N ]; then echo "Enter POLLUTANT ID (4-characters):" read ident klen=`expr "$ident" : ".*"` if [ klen -gt 4 ]; then echo "NOTICE: Will be truncated to 4 characters" fi ident=`echo $ident | cut -c1-4` echo echo "Enter DRY DEPOSITION VELOCITY (m/s): " read dryvl echo echo "Enter WET DEPOSITION IN-CLOUD (L/L):" read wetin echo echo "Enter WET DEPOSITION BELOW-CLOUD (/s): " read wetlo echo echo "Enter RADIOACTIVE HALF-LIFE (days): " read rhalf fi else # manually enter all echo echo "NOTICE: $pspecs not found; " echo " manually enter values in Pollutant Parameter Settings Menu after enter ID here" echo echo "Enter POLLUTANT ID (4-characters):" read ident klen=`expr "$ident" : ".*"` if [ klen -gt 4 ]; then echo "NOTICE: Will be truncated to 4 characters" fi ident=`echo $ident | cut -c1-4` fi ;; 2) if [ -f $pspecs ] then # number of records in pollutant specs file (n) n=0 cat $pspecs | while read dum;do let n=$n+1 done MATCH=0 REC=1 while [ $MATCH -eq 0 -a $REC -lt $n ]; do type=`head -n${REC} ${pspecs} | tail -1 | awk '{ print $7 }' ` if [ "${type}" = "${TYPl}" ]; then rec=$REC MATCH=1 ident_def=\ `head -n${rec} ${pspecs} | tail -1 | awk '{ print $2 }'` dryvl_def=\ `head -n${rec} ${pspecs} | tail -1 | awk '{ print $3 }'` wetin_def=\ `head -n${rec} ${pspecs} | tail -1 | awk '{ print $4 }'` wetlo_def=\ `head -n${rec} ${pspecs} | tail -1 | awk '{ print $5 }'` rhalf_def=\ `head -n${rec} ${pspecs} | tail -1 | awk '{ print $6 }'` fi let REC=$REC+1 done if [ $MATCH -eq 0 ]; then echo "Did not find $TYPl in ${pspecs}" ident=$identd dryvl=$dryvld wetin=$wetind wetlo=$wetlod rhalf=$rhalfd fi else ident=$identd dryvl=$dryvld wetin=$wetind wetlo=$wetlod rhalf=$rhalfd echo echo "NOTICE: $pspecs not found; starting values reset" echo " Press any key to continue" read dummy fi ;; 3) clear echo "DRY DEPOSITION VELOCITY (m/s) (zero (0) for volcanic ash): " read dryvl ;; 4) clear echo "WET DEPOSITION IN-CLOUD (L/L):" read wetin ;; 5) clear echo "WET DEPOSITION BELOW-CLOUD (/s): " read wetlo ;; 6) clear echo "RADIOACTIVE HALF-LIFE (days) (zero (0) for volcanic ash): " read rhalf ;; 7) clear ident=$identd dryvl=$dryvld wetin=$wetind wetlo=$wetlod rhalf=$rhalfd ;; Y|y) pollutant_menu_flag=0;; *) ;; esac done ;; 7) clear setup_menu_flag=1 while [ $setup_menu_flag -ne 0 ] do # ======================================================== # SETUP.CFG Menu # ======================================================== clear echo echo "VERIFY/EDIT SETUP.CFG PARAMETER SETTINGS" echo echo " 1) INITD (initial distribution) : $initd" echo " 2) KHMAX (maximum part duration, h) : $khmax" echo " 3) NUMPAR (number of part to release): $numpar" echo " 4) ISOT (turbulence) : $isot" echo " 5) NDUMP : $ndump" echo " (write particle position file starting this many hours after run start)" echo " 6) NCYCL : $ncycl" echo " (zero for none," echo " or otherwise, write to particle position file at this time interval in hours)" echo " 7) KMSL (starting height reference): $kmsl" echo " 8) reset defaults" echo echo "ENTER NUMBER TO EDIT OR (Y) TO ACCEPT VALUES:" read setup_ans case $setup_ans in 1) clear echo "INITD (0=3D-particle; 4=TopHat in horizontal, 3D particle in vertical):" read initd case $initd in 0|4|104) clear;; *) echo "Not a valid entry... " echo "Press 'enter' to continue and then choose option 1" read dummy initd=4 ;; esac ;; 2) clear echo "KHMAX (maximum duration in hours of particles/puffs):" read khmax ;; 3) clear echo "For large (high) releases and/or long releases, NUMPAR" echo "has been automatically adjusted, but if plume looks" echo "'splotchy', may need to increase this by a factor of 2" echo " or increase concentration grid spacing" echo "Model run time will increase with NUMPAR." echo "Note maximum number of particles is ${maxpar}." echo "NUMPAR (number of particles to release): " read numpar ;; 4) clear echo "ISOT (turbulence 0=std 1=isotropic):" read isot if [ $isot -lt 0 -o $isot -gt 1 ] then echo "Not a valid entry... " echo "Press 'enter' to continue and choose option 4 again" read dummy isot=0 fi ;; 5) clear echo "NDUMP (write first output to particle position file after this many hours, integer):" read ndump ndump=${ndump%.*} # truncate ;; 6) clear echo "NCYCL (write to particle position file at this time interval in hours, integer):" echo " (zero for none)" read ncycl ncycl=${ncycl%.*} # truncate ;; 7) clear echo "KMSL (starting height reference 0=AGL 1=MSL):" read kmsl if [ $kmsl -lt 0 -o $kmsl -gt 1 ] then echo "Not a valid entry... " echo "Press 'enter' to continue and choose option 6 again" read dummy kmsl=0 fi ;; 8) clear #initd=4 #khmax=9999 #numpar=${numparc} #isot=0 #ndump=0 #kmsl=0 ########################################################## ## need to give these default values in training reference ########################################################## initd=${initD} khmax=${khmaxD} numpar=${numparc} # only one not reset to D-default isot=${isotD} ndump=${ndumpD} ncycl=${ncyclD} kmsl=${kmslD} case $typenum in 2) if [ $olvl2 -lt $isoht ] then isot=0 else isot=1 fi initd=0 # numpar=${numparc} kmsl=1 ;; esac ;; Y|y) setup_menu_flag=0;; *) ;; esac done ;; 8) clear echo "*************************************************************" echo "Use three lat-lon point sources to approximate an area source" echo "*************************************************************" echo "$olat $olon was given in the Review Menu" echo "Enter 2 latitude-longitude pairs here (west is negative longitude)" echo " real or integer, with a space between each " echo echo "ENTER latitude1 longitude1 latitude2 longitude2, for example" echo "-99 -99 -99 -99 (for no area source)" echo "40.0 -90.0 42.0 -92.0 (for source bounded by 40,-90 42,-92 and point in Review Menu)" echo read olat2 olon2 olat3 olon3 olat2=${olat2:--99} olon2=${olon2:--99} olat3=${olat3:--99} olon3=${olon3:--99} echo "${olat2} ${olon2} ${olat3} ${olon3} : Correct (y/n)?" read ans_area case ${ans_area} in n|N) echo "Choose #8 and try again";; esac ;; 11) clear echo "---------------------------------------------------" echo " 2nd METEOROLOGY " echo "---------------------------------------------------" if [ "$USER" = "$AKUSER" -o $typenum -eq 1 -o $typenum -eq 2 -o $typenum -eq 4 ] then echo "1 (Not Available) " else echo "1 High Resolution Window (4 km - pressure) " echo " (hiresw currently unavailable, use NAM CONUS)" fi echo "2 NAM (12 km, CONUS) " echo "3 NAM (45 km, Alaska) " echo "4 GFS (100 km) " echo "5 (Not Available) " echo "6 remove meteorology (undefined) " echo echo "---------------------------------------------------" echo "ENTER MODEL DESCRIPTION NUMBER: " read met case $met in 1) echo echo "Hiresw currently unavailable, use NAM CONUS" echo "At the Advanced Menu, choose option 11, then 2 for NAM CONUS" echo "Press 'enter' to continue..." read dummy ;; #1) meteo2="HIRESW";; 2) meteo2="NAM";; 3) meteo2="NAMa";; 4) meteo2="GFS";; 6) meteo2="undefined";; *) echo "Not a valid entry..." echo "must choose option 11 again at the advanced menu" echo echo "Press 'enter' to continue..." read dummy;; esac ;; 12) clear echo "---------------------------------------------------" echo " 3rd METEOROLOGY " echo "---------------------------------------------------" if [ "$USER" = "$AKUSER" -o $typenum -eq 1 -o $typenum -eq 2 -o $typenum -eq 4 ] then echo "1 (Not Available) " else echo "1 High Resolution Window (4 km - pressure) " echo " (hiresw currently unavailable, use NAM CONUS)" fi echo "2 NAM (12 km, CONUS) " echo "3 NAM (45 km, Alaska) " echo "4 GFS (100 km) " echo "5 (Not Available) " echo "6 remove meteorology (undefined) " echo echo "---------------------------------------------------" echo "ENTER MODEL DESCRIPTION NUMBER: " read met case $met in #1) meteo3="HIRESW";; 2) meteo3="NAM";; 3) meteo3="NAMa";; 4) meteo3="GFS";; 6) meteo3="undefined";; *) echo "Not a valid entry..." echo "must choose option 12 again at the advanced menu" echo echo "Press 'enter' to continue..." read dummy;; esac ;; 13) clear echo "RUN SEQUENCE NUMBER: " echo " - was automatically incremented 1 from chosen run (hysplit.ini)" echo " - is used in filename to identify the run." echo " - in filename will be prefaced by $TYPl" echo "ENTER NEW RUN SEQUENCE NUMBER: " read seq klen=`expr "$seq" : ".*"` if [ $klen -eq 1 ]; then seq="00"${seq} elif [ $klen -eq 2 ]; then seq="0"${seq} fi ;; 14) clear ### This is useful for volcano test run so that ### on ARL web page, will see TEST rather than volcano name echo "Force $sitetmp to TEST (0=no 1=yes)" echo " This will affect label on plots and saved filenames." read forc if [ $forc -eq 1 ] then site=TEST fi ;; Y|y) advanced_menu_flag=0;; *) ;; esac done ;; Y|y) main_menu_flag=0;; *) ;; esac done ################################################################ # remove duplicate meteorology # example: first meteo1=Nam meteo2=GFS for RSMC # rerun with meteo1=GFS, but don't change meteo2 in advanced menu # hysplit can only have 1 GFS file input ################################################################ if [ "${meteo3}" = "${meteo2}" ] then meteo3="undefined" fi if [ "${meteo3}" = "${meteo1}" ] then meteo3="undefined" fi if [ "${meteo2}" = "${meteo1}" ] then meteo2="undefined" fi ################################################################ # count meteorology types ################################################################ mtype=0 for mn in $meteo1 $meteo2 $meteo3; do if [ ! "$mn" = "undefined" ] then let mtype=$mtype+1 fi done ################################################################ # increase number of particles for effective area source ################################################################ if [ "${eff_area}" = "YES" ] then let numpar=${numpar}+${numpar} fi ################################################################ # check for long-duration run ################################################################ if [ $nhrs -ge ${longrun} -o $nhrs -le ${neglongrun} ]; then if [ ${initd} -ne 0 ]; then initd=0 echo "WARNING: Because of long-duration run (cutoff ${longrun} hours)," echo " and puff splitting, the run may take a very long time." echo " 3-D particle mode (initd=0) is recommended." echo "Should this run be set to 3-D particle mode (y/n)" read threed case $threed in y|Y) initd=0 if [ ${numpar} -lt ${numparlong} ]; then numpar=${numparlong} echo "NOTICE: Increased number of particles to $numpar." fi dlattmp=`echo "${dlat}*1000" | bc` dlontmp=`echo "${dlon}*1000" | bc` dlatlongtmp=`echo "${dlatlong}*1000" | bc` dlonlongtmp=`echo "${dlonlong}*1000" | bc` if [ ${dlattmp} -lt ${dlatlongtmp} -o ${dlontmp} -lt ${dlonlongtmp} ] then dlat=`echo "scale=3\n ${dlatlongtmp}/1000" | bc` dlon=`echo "scale=3\n ${dlonlongtmp}/1000" | bc` echo "NOTICE: Increased concentration grid spacing to $dlat $dlon" fi echo "initd: $initd" echo "Press to continue" read dummy ;; esac fi fi ################################################################ # Reset Alaska meteorology to GFS if they chose HIRESW ################################################################ if [ "$USER" = "$AKUSER" ] then if [ "$meteo" = "HIRESW" ] then meteo="GFS" fi if [ "$meteo1" = "HIRESW" ] then meteo1="GFS" fi if [ "$meteo2" = "HIRESW" ] then meteo2="GFS" fi if [ "$meteo3" = "HIRESW" ] then meteo3="GFS" fi fi ################################################################ # replace period with underscore in sitename (SAB uses "." as delimiter) ################################################################ site=`echo $site | tr '[\.]' '[\_]'` ################################################################ # verify run duration is a negative for Back-tracking (Source Attribution) ################################################################ case $typenum in 4) if [ $nhrs -gt 0 ]; then clear echo "For the Back-tracking run, run duration must be negative." echo "Run duration is ${nhrs}" echo "Reset to a negative (y/n)?" read dum case $dum in Y|y) nhrs=`expr ${nhrs} \* -1`;; esac fi esac ################################################################ # Save Setup Information to the Base File # (variable names usually consistent with hysplit) # # When add a variable need to change fix file, # change read fix files above, and # change the following which read the ini file: # exhysplit_fcst_out.sh.sms # exhysplit_fcst_setup.sh.sms # exhysplit_post.sh.sms # exhysplit_wafs.sh.sms ################################################################ rm -f hysplit.ini echo $title >hysplit.ini # 1 title label echo $meteo >>hysplit.ini # 2 meteo label echo $site >>hysplit.ini # 3 site name echo $olat >>hysplit.ini # 4 site latitude echo $olon >>hysplit.ini # 5 site longitude echo $olvl1 >>hysplit.ini # 6 release bottom (m) echo $olvl2 >>hysplit.ini # 7 top (volcano - ft; others - m) echo $nhrs >>hysplit.ini # 8 hysplit run duration (hours) echo $mtype >>hysplit.ini # 9 number of meteorology file types # number of files calculated in hysplit_conc.sh echo $dir1 >>hysplit.ini # 10 meteo1 directory echo $meteo1 >>hysplit.ini # 11 meteorology type #1 echo $dir2 >>hysplit.ini # 12 meteo2 directory echo $meteo2 >>hysplit.ini # 13 meteorology type #2 echo $dir3 >>hysplit.ini # 14 meteo3 directory echo $meteo3 >>hysplit.ini # 15 meteorology type #3 echo $ident >>hysplit.ini # 16 pollutant/species ID (4-char) echo $qrat >>hysplit.ini # 17 emission rate (/hour) echo $qhrs >>hysplit.ini # 18 hours of emission (release duration) echo $dsyr >>hysplit.ini # 19 release (dirt) start year echo $dsmo >>hysplit.ini # 20 month echo $dsda >>hysplit.ini # 21 day echo $dshr >>hysplit.ini # 22 hour echo $dsmn >>hysplit.ini # 23 minute echo $cnlat >>hysplit.ini # 24 congrd #1 center lat echo $cnlon >>hysplit.ini # 25 lon echo $dlat >>hysplit.ini # 26 congrd #1 spacing lat echo $dlon >>hysplit.ini # 27 lon echo $splat >>hysplit.ini # 28 congrd #1 span lat echo $splon >>hysplit.ini # 29 lon echo $height >>hysplit.ini # 30 congrd #1 layer top (m) echo $csyr >>hysplit.ini # 31 sampling (concentration) start year echo $csmo >>hysplit.ini # 32 month echo $csda >>hysplit.ini # 33 day echo $cshr >>hysplit.ini # 34 hour echo $dhr >>hysplit.ini # 35 congrd #1 output averaging time (hours) echo $delhr >>hysplit.ini # 36 hours to output to grid #1 echo $cnlat2 >>hysplit.ini # 37 congrd #2 center lat echo $cnlon2 >>hysplit.ini # 38 lon echo $dlat2 >>hysplit.ini # 39 congrd #2 spacing lat echo $dlon2 >>hysplit.ini # 40 lon echo $splat2 >>hysplit.ini # 41 congrd #2 span lat echo $splon2 >>hysplit.ini # 42 lon echo $height2>>hysplit.ini # 43 congrd #2 layer top (m) echo $dhr2 >>hysplit.ini # 44 congrd #2 output averaging time (hours) echo $dryvl >>hysplit.ini # 45 deposition velocity (m/s) echo $wetin >>hysplit.ini # 46 wet deposition in-cloud echo $wetlo >>hysplit.ini # 47 wet deposition below-cloud echo $rhalf >>hysplit.ini # 48 radioactive half-life (days) echo $icmt >>hysplit.ini # 49 label comment flag for volcano echo $initd >>hysplit.ini # 50 initial distribution (0=3d part 4=TopHat/3D) echo $khmax >>hysplit.ini # 51 max particle age (hours) echo $numpar >>hysplit.ini # 52 number of particles echo $isot >>hysplit.ini # 53 isotropic turbulence (0=no 1=yes) echo $ndump >>hysplit.ini # 54 write to PARDUMP after ndump hours echo $kmsl >>hysplit.ini # 55 0=AGL 1=MSL echo $seq >>hysplit.ini # 56 run sequence number #echo $system_prio >>hysplit.ini # 57 system priority (HIRW) # no longer used 03/19/08 echo $qunits >>hysplit.ini # 57 emission units (04/02/08) input from fix/hysplit_defXXXX.ini echo $org >>hysplit.ini # 58 organiation request (sdm, aws, alaska, arl) echo $zoom1 >>hysplit.ini # 59 output map conc grid#1 echo $zoom2 >>hysplit.ini # 60 grid#2 echo $relcen >>hysplit.ini # 61 force release location to center of map (1=yes) echo $ncycl >>hysplit.ini # 62 time interval to write to particle dump file (hours) echo $pinpf >>hysplit.ini # 63 particle input filename (-99 for no particle input file) echo $olat2 >>hysplit.ini # 64 latitude of 2nd origin echo $olon2 >>hysplit.ini # 65 longitude of 2nd origin echo $olat3 >>hysplit.ini # 66 latitude of 3rd origin echo $olon3 >>hysplit.ini # 67 longitude of 3rd origin echo $dum4 >>hysplit.ini # 68 echo $dum3 >>hysplit.ini # 69 echo $dum2 >>hysplit.ini # 70 echo $dum1 >>hysplit.ini # 71 chmod 777 hysplit.ini cp hysplit.ini $GEShysplit/hysplit.ini.${TYPl}${seq}.$dsmo$dsda$dshr$dsyr.${org} chmod 777 $GEShysplit/hysplit.ini.${TYPl}${seq}.$dsmo$dsda$dshr$dsyr.${org} rm ncepdate NMCDATE filelist PDY ###### clear username=`whoami` if [ "$username" = "awcops" ] then echo "" echo "Enter the password to start the HYSPLIT Run on the IBM CCS:" read SMSPASS export SMSPASS export SMSBIN=/nwprod/sms/bin export SMSNAME=/prod12/arl12/hysplit/hls_ondemand_sdm/jhyspt_datachk $SMSBIN/smsrelease ret=$? if [ $ret -eq 0 ] then echo "HYSPLIT Run Started Successfully. Output should post to web page" echo "in approximately 5 minutes. (https://hysplit.ncep.noaa.gov)" else echo "Problems Restarting the HYSPLIT Run: Return Code $ret" fi else # copy section from above in case start date/time not changed # backtracking option should not be invoked for starting time # ahead of current day case $typenum in 4) if [ ${dsyr}${dsmo}${dsda} -gt $PDY ] then echo "************" echo " ERROR - backtracking runs should usually begin before today." echo " Change date as needed" echo "************" echo exit fi # for start time of today, need certain gdas files if test ${dsyr}${dsmo}${dsda} -eq $PDY then PDYgdas1=$PDY PDYgdas2=$PDY if test $dshr -le 6 then gdascyc1=00 gdascyc2=06 else if test $dshr -le 12 then gdascyc1=06 gdascyc2=12 else if test $dshr -le 18 then gdascyc1=12 gdascyc2=18 else gdascyc1=18 gdascyc2=00 PDYgdas2=$PDYp1 fi fi fi export gdascyc1 gdascyc2 PDYgdas1 PDYgdas2 FILE1=${usrdir}/com/hysplit/${envir}/hysplit.$PDYgdas1/hysplit.t${gdascyc1}z.gdas1f FILE2=${usrdir}/com/hysplit/${envir}/hysplit.$PDYgdas2/hysplit.t${gdascyc2}z.gdas1f if [ -f $FILE1 -a ! -f $FILE2 ]; then echo "************" echo " ERROR - GDAS file not available - pick starting time at or just prior to ${gdascyc1}z" echo "************" echo exit elif [ ! -f $FILE1 -a ! -f $FILE2 ]; then #echo in elsif statement if [ $gdascyc1 -eq 00 ]; then cycm=18 else cycm=`expr $gdascyc1 - 6` fi echo "************" echo " ERROR - GDAS files not available - pick starting time prior to at least ${cycm}z" echo "************" echo exit fi fi esac echo echo "############################" echo "Setup Complete - written to $GEShysplit/hysplit.ini" echo "Ask Operator to RERUN datachk" echo "############################" echo echo fi if [ ${numpar} -gt ${numpar_def} ]; then echo "NOTICE: The number of particles was increased automatically to account" echo " for the long eruption/release and/or high eruption/release or " echo " was manually set to a larger value. " echo " Default: ${numpar_def} Setting: ${numpar} " if [ ${numpar} -eq ${MNUM} ]; then echo " Further, the number of particles was set to the maximum. " fi echo " The run will take a longer time. " echo " To save computer time, you may decrease the number of " echo " particles, but then if the resulting plume depiction " echo " looks splotchy, you have reduced it too much. " echo " Number of particles can be forced in the " echo " Advanced Parameters Menu, SETUP.CFG " fi