HECWFS = Huron to Erie Waterway Forecasting System
+++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11/19/2008

GET DAILY DISCHARGE USING LBRM METHOD
Use discharge from 1 day ago
/Users/lang/hecwfs/fvcom_nowcast_3d/rivers-lbrm/2008/2008323.StcDetRivRun.txt           1
Flows using LBRM method (m^3/s) =    52.53    29.18    15.57   207.29    46.69   319.67    21.64
Percentages LBRM method (%)     =      7.6      4.2      2.2     29.9      6.7     46.2      3.1
Total flow using LBRM method (m^3/s) =      692.574

GET DAILY DISCHARGE USING CLINTON METHOD
Use discharge from 1 day ago
Use discharge from 2 days ago
/Users/lang/hecwfs/fvcom_nowcast_3d/rivers/2008/2008322.04165500.txt           1
      52.3193      17.5100      2.98797
Flows using Clinton method (m^3/s) =    36.21    20.11    10.73   102.52    52.32   202.88    40.58
Percentages Clinton method (%)     =      7.8      4.3      2.3     22.0     11.2     43.6      8.7
Total flow using Clinton method (m^3/s) =      465.346

./inputdr/200832412.riv.dat
Use LBRM Method
    52.53    29.18    15.57   207.29    46.69   319.67    21.64
      692.574

;eliminate zero flows, set equal to 1/2 of the minimum non-zero flow.
if flow1 lt 127 then flow1=127.24/2.  ; ft^3/sec
if flow2 lt 17 then flow2=17.74/2.
if flow3 lt 78 then flow3=78.52/2.
if flow4 lt 18 then flow4=18.23/2.
if flow5 lt 29 then flow5=29.02/2.
if flow6 lt 235 then flow6=235.19/2.
if flow7 lt 146 then flow7=146.41/2.
if flow8 lt 69 then flow8=69.48/2.

LBRM, lumped-parameter 1-d model (Tim Hunter)
ftp://ftp.glerl.noaa.gov/ahps/curfcst/StcDetRivRun.txt

Subbasin runoff estimates from the LBRM for StClair and Detroit River tributaries
The following rivers are associated with each subbasin.  Other rivers and
streams may also be associated with each subbasin.
STC01 = Black River, Mill Creek, Belle River
STC02 = ??
STC03 = Clinton River
STC04 = ??
STC05 = Ruscom River, Little River
STC06 = Thames River
STC07 = Sydenham River
ERI01 = Rouge River

StartDate =  1/ 1/1948
EndDate   = 11/18/2008
Runoff values are in cubic feet per second.  Missing data = -999.99
DD-MM-YYYY    STC01    STC02    STC03    STC04    STC05    STC06    STC07    ERI01
18-11-2008  3435.46   585.39  1648.88   309.90  1015.71 11288.92  7320.44   764.33

Using drainage area estimates from Great lakes Trib Loading Report (1978), Tim's STC01 flow
is divided into Black (54%), Pine (30%), and Belle (16%).

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11/13/2008
Yesterday, Fermi stopped reporting.  I modified hecbc.pro to use Gibraltar minus 0.12m instead of Fermi.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11/12/2008
Modified the long-term mean flows for the seven tributaries, based on LBRM (Tim Hunter), and verified by
IJC report.

New flows:
rivflow=[12.12,6.73,3.59,34.31,17.51,67.90,13.58]       ;cms
corresponding to:
Black R, Pine R, Belle R, Sydenham R, Clinton R, Thames R, and Rouge R.
Note, the Black R is set to 54% of the LBRM Black, the Pine to 30%, and the Belle to 16%.  These estimates
are based on drainage areas.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11/12/2008
Reduced lower water level boundary condition by 10 cm.
;;;   lowvals=fltarr(2)-1.81395*(lower(i)-lower2(i))+lower(i)-176.784+0.178         ;fvcom-3d
; adjust lower water level down 10cm, 11/12/08
   lowvals=fltarr(2)-1.81395*(lower(i)-lower2(i))+lower(i)-176.784+0.178-.10         ;fvcom-3d

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10/15/2008

Also today, Eric modified the fvcom-3d code to read in the anemometer height, AHEIGHT, from hec_run.dat.
AHEIGHT is used to adjust the winds and air temp to 10m.  For the LSCM4 staiton, AHEIGHT=14.4m

I've added a print statement to data_run.F to print the new variable AHEIGHT:
   WRITE(IPT,*)'!  # DELTT               :',DELTT
   WRITE(IPT,*)'!  # AHEIGHT             :',AHEIGHT
   WRITE(IPT,*)'!  # CASETITLE           :',TRIM(CASETITLE)
/net/rip/Users/lang/hecwfs/sou/FVCOM_3D_mpi/data_run.F

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10/15/2008
On DOY 288 hr 18-21, the FVCOM-3d model went unstable due to a fast moving squall line that went across Lake Huron. 
Observed water levels at Dunn Paper rose 0.6 m and currents near the Blue Water Bridge were measured at about 2.7 m/s. 
The FVCOM-3d model made it through the early part of this period but became unstable during the hr 18-21 period. Eric
determined that reducing the timestep from 4 sec to 2 sec would allow the model to get through this period.  I ran the
model using a 2-sec timestep for hr 18-21 and hr 21-24, DOY 288, then returned it to 4 sec.  The results look good.

I've saved these results here:
http://www.glerl.noaa.gov/res/hecwfs/events/2008288-squall/

I've
also added provisions to check the output file looking for signs of instability ("NaN", "Infinity"), and prevent further
runs until the situation is resolved.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10/8/2008
The URLs for HECWFS have been changed.

http://www.glerl.noaa.gov/res/hecwfs/ now displays the FVCOM-3D products.

http://www.glerl.noaa.gov/res/hecwfs2d/ now displays the FVCOM-2D products.

http://www.glerl.noaa.gov/res/hecwfs3d/ is no longer active.

In addition, I modified the cron on Rip and the necessary scripts/IDL programs so that the FVCOM-3D Nowcast will run
every 3 hours.  The 3-hr simulation takes about 2 minutes 7 seconds to complete, and finishes at about 30 minutes past
0,3,6,9,12,15,18,21 GMT.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10/6/2008

Changed simulation time from 6 hours to 3 hours.

hec_run.dat...
NSTEPS = 2700      ! 3 hrs x 900 per hr = 2700

modified these to end at 3 hours:
inputdr/hec_air.dat
inputdr/hec_ccdp.dat

Many changes to idl pro files to accommodate new 3 hr simulaiton time.

New cron...
# HECWFS River Discharge, GMT
22 0,3,6,9,12,15,18,21 * * * /Users/lang/hecwfs/fvcom_nowcast_3d/rivers/get_discharge.sh > /Users/lang/hecwfs/fvcom_nowcast_3d/rivers/get_discharge.log 2>&1

# HECWFS COOPS Current Meter data, GMT
23 0,3,6,9,12,15,18,21 * * * /Users/lang/hecwfs/fvcom_nowcast_3d/currents/get_currents.sh > /Users/lang/hecwfs/fvcom_nowcast_3d/currents/get_currents.log 2>&1

# HECWFS water levels, GMT
24 0,3,6,9,12,15,18,21 * * * /Users/lang/hecwfs/fvcom_nowcast_3d/wl/get_wl.sh > /Users/lang/hecwfs/fvcom_nowcast_3d/wl/get_wl.log 2>&1

# HECWFS FVCOM, GMT
26 0,3,6,9,12,15,18,21 * * * /Users/lang/hecwfs/fvcom_nowcast_3d/hecwfs.sh >> /Users/lang/hecwfs/fvcom_nowcast_3d/hecwfs.log 2>> /Users/lang/hecwfs/fvcom_nowcast_3d/hecwfs.err

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/25/2008
Put /Users/lang/hecwfs/fvcom_nowcast_3d/hecwfs.sh on rip's cron
Changed Rip's timezone to GMT.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/18/2008

later...
Re-thinking the flows... We checked into the long-term mean flows from Dave Holtstag (USGS).  These are flows
at the mouth (estimated from gauge flows).  The Clinton flows we are using are at the gauge, not the mouth.  To
estimate the Clinton flow at the mouth, multiply the recorded daily flow by the 1.4 (this is the ratio of 
USGS mean annual flow at the mouth to the 40 year mean of Clinton flow at the gauge, from Eric).  Then for each of
the other 6 tribs, multiply their long-term mean flow at their mouth by the ratio of the daily Clinton flow to the 
long-term mean Clinton flow (both at the mouth).

earlier...
The water levels in Lake St. Clair have been low since the large rain event starting about DOY 258.
It seems that even though we use daily Clinton flows, and use scale factors to estimate the Thames and
Sydenham, we don't have a provision to estimate large, event-driven flows from other rivers.  And the scale 
factors for the Thames and Sydenhammay underestimate their flows.  So...I re-ran the FVCOM-3D for 4 cycles 
with the Clinton flows multiplied by 10.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/17/2008

ts=2008 260 00

Can use mpirun in /usr/bin (installed by mac) to run fvcom.  But need to use /usr/local/bin/mpirun when 
compiling fvcom with fortran.  See Eric for details.

hecbc.pro...
added lower2=fermi
lowvals=fltarr(2)-1.81395*(lower(i)-lower2(i))+lower(i)-176.784+0.178

rivnode=[14264,13403,12363,12554,9913,8971,3607]	;node locations of rivers
rivflow=[13.85,3.37,13.54,52.7,26.28,137.54,8.83]	;standard river flow data (append with clinton and thames data/calculations)
scale1=[3.46,3.44,4.26,3.80,2.4,1.94,1.87,1.95,2.11,2.37,3.05,3.76]		;scale for Thames flow
scale2=[0.69,0.80,0.83,0.72,0.50,0.36,0.32,0.27,0.33,0.44,0.71,0.93]	;scale for Sydenham River flow
	rivflow(4)=clinton
	rivflow(5)=clinton*scale1(mo-1)		;thames river approximation
	rivflow(3)=clinton*scale2(mo-1)		;sydenham river approximation

hec_run.dat...
> DTE    = 4.        ! 4 sec = 15 per min = 900 per hr       
> NSTEPS = 5400      ! 6 hrs x 900 per hr = 5400
> INFOFILE = ./info.dat
> IREPORT  = 900       ! hourly 
> IDMPSMS  = 0 
> IRESTART = 900       ! hourly  
> HORCON  = 1.000E-1
> UMOL    = 1.000E-6
> CTRL_DEN  = pdensity
> KSL    =   7 
> DPTHSL =   0.  -1.   -3.   -5.   -10.   -15.  -21.1025
> KB      = 7 
> CDF_INT = 900 !20 frames / m2 cycle 
> CDF_VDP = ua va u v ww el
> INFO1   = HECWFS
> INFO2   = 3D model with elevation and wind forcing

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/10/2008
Started working on converting/modifying FVCOM scripts and programs to run/use FVCOM-3D instead
of FVCOM-2D.

modified makefile to use MPI (7 processors)
also modify makefile so that /usr/local/bin/mpif90 (Eric installed) is used instead of /usr/bin/mpif90 (system).

#  Intel Compiler Definitions
#--------------------------------------------------------------------------
         CPP      = /usr/bin/cpp
         CPPFLAGS = $(DEF_FLAGS) -DINTEL 
         FC       = /usr/local/bin/mpif90 #-Vaxlib 
         DEBFLGS  = #-check all 
         OPT      = -O3 #-xN -axN -tpp7
         CLIB     = #-static-libcxa 

to comile:
make clean
make
/usr/local/bin/mpif90 -o fvcom *.o ../METIS_source/*.o -Wl,-stack_size,100000000 -L/usr/local/lib -lnetcdf
-->creates executable: fvcom

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/8/2008
I adjusted the 9014098 offset to -0.12 - better fit.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9/4/2008
Starting on DOY 247.5 I set hecbc.pro to use Fort Gratiot (9014098) water levels minus 0.1 because 
the Dunn Paper levels have been unreliable since DOY 237.  There was a big blow on DOY 237 and after 
that, the water levels at 9014096 (Dunn) appeared to be smoothed/damped, i.e. none of the peaks and 
detail shown at the other nearby gauges are showing up at Dunn Paper.  I emailed Andrea Hardy at NOS.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
May 1, 2008
The FVCOM model is running on the GLFS cron.

Since this is the model we will be using, I've modified the HECWFS website to display the FVCOM output:
http://www.glerl.noaa.gov/res/hecwfs

Therefore, the RMA2 output has been relegated to:
http://www.glerl.noaa.gov/res/hecwfs/rma2

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4/23/2008

created hecwfs.sh...
create input symlinks
lrwxrwxrwx  1 lang users       21 Apr 23 08:30 hec_elj_obc.dat -> 200811218.elj_obc.dat
lrwxrwxrwx  1 lang users       21 Apr 23 08:30 hec_restart.dat -> 200811218.restart.dat
lrwxrwxrwx  1 lang users       24 Apr 23 08:30 hec_restart_wd.dat -> 200811218.restart_wd.dat
lrwxrwxrwx  1 lang users       17 Apr 23 08:30 hec_riv.dat -> 200811218.riv.dat
lrwxrwxrwx  1 lang users       17 Apr 23 08:30 hec_wnd.dat -> 200811218.wnd.dat

outfile=${outdr}out/${yyyy}${ddd}${hh}.out
${soudr}fvcom hec > ${outdr}
after run:
mv restart ${indr}${yyyy}${ddd}${hh}.restart.dat
mv restart_wd ${indr}${yyyy}${ddd}${hh}.restart_wd.dat
mv ${outdr}timeseries/hec_algonac.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.algonac.dat
mv ${outdr}timeseries/hec_dry_dock.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.dry_dock.dat
mv ${outdr}timeseries/hec_dunn_paper.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.dunn_paper.dat
mv ${outdr}timeseries/hec_ft_wayne.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.ft_wayne.dat
mv ${outdr}timeseries/hec_gibraltar.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.gibraltar.dat
mv ${outdr}timeseries/hec_mbr.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.mbr.dat
mv ${outdr}timeseries/hec_police.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.police.dat
mv ${outdr}timeseries/hec_st_clair.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.st_clair.dat
mv ${outdr}timeseries/hec_windmill.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.windmill.dat
mv ${outdr}timeseries/hec_wyandotte.dat ${outdr}timeseries/${yyyy}${ddd}${hh}.wyandotte.dat

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4/22/2008

hecbc.pro creates 3 inputfiles:
hec_elj_obc.dat
hec_riv.dat
hec_wnd.dat

hotstart files:
hec_restart.dat
hec_restart_wd.dat

hec_elj_obc.dat includes wl from DUNN PAPER = UPPER = 9014096 and GIBRALTAR = LOWER = 9044020
;write elevation for inlet (relative to datum 176.784m and adjusted for inlet 'extension')
;write elevation for outlet (relative to datum 176.784m and adjusted to bar point)
; 2 nodes ar Dunn Paper location
; 38 nodes at Gibralter location
40 values x 60+1 (6 minute data for 6 hour period plus next)
DELTT in hec_run.dat controls this time interval
DELTT=360 sec = 6 minute
 !  TIDAL DATA BEGIN      :  0000:00:00:00
 !  TIDAL DATA END        :  0000:06:00:00

hec_wnd.dat includes u- and v-components (m/s) of the hourly wind data at each of 14230 nodes
time is in hours: 0,1,2,3,4,5,6

hec_riv.dat includes daily averaged discharge (m3/sec) at the 7 river inputs.
time is in hours: 0, 9999999. 
discharge #5 = Clinton R.
discharge #6 = Thames R. = function of Clinton R. (monthly scale factor)
Uses current day's Clinton R. discharge if available, otherwise use previous day's, otherwise
use 2 days ago, otherwise abort.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4/21/2008

fvcom_source_2D/ copied from /home/anderson/fvcom/fvcom_source_2D/

modified makefile to not use --fast (use -O3 instead):
         CPPFLAGS = $(DEF_FLAGS)
         CPP      = /usr/bin/cpp
#         FC       = lfc --fast
         FC       = lfc -O3
         DEBFLGS  = 
         OPT      = 

to comile:
make clean
make
-->creates executable: fvcom

modified the following input files:
stclair2d/hec_air.dat
stclair2d/hec_ccdp.dat
 to have 9 records 0,1,...,7,8.  These files are read but not used.  Need at least one record per hour +1.

to run:
fvcom hec
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++