Dennis,  Here is a message containing the new defplots.m,
fcast.html, and the necessary additional m-files that produce the
wind-stress and heatflux plots. defplots.m and fcast.html go in the
forecast MATLAB directory. stick3.m and read_o1d.m go in the
FCAST_1.2 OPNML matlab directory. Cut out each file below, enclosed
by the lines of ******'s, and save each as the filename indicated,
in the directory  as per above. Do not delete the older defplots.m
and fcast.html until you are sure you like these and that they
work.  I have tested them here, but you never  know. This version of
read_o1d.m is specific to files called "QFLUX.o1d"  and "TAUXY.o1d"
that reside in the OBS directory. It should not be  used on .o1d
files whose prefix is not QFLUX or TAUXY without some  coding; but
it is obvious what is going on if you need to; or just let me know
and I'll work on a more general version. One other thing: this
defplots.m code doesn't use the shiptrack from the UV-INTEG-Q4.m3d
file for the "mooring" panel plots (the last two on the fcast.html
page.)  Instead it gets the forecast ending time from the 
last ITER.icq4 file, and generates a timeseries called "buoytime"
that starts 3 days prior the ending time.  This wouldn't be important
except that UV-INTEG-Q4.m3d might be empty.  See toward the end of
the defplots.m file if you need to change this. Brian. Sorry this is so
long.
*******************************stick3.m**********************************
function hstick=stick3(t,u,v,ax)
% stick3(time,x,y,ax)
% vector plotter
% ax = [timemin timemax ymin ymax];
% orient ('portrait')   % or anything you want
% subplot(i,j,k)        % or anything you want
% stick2(time,x,y,ax)
% This one figures out the paper orientation, size
% for the horizontal to width ratio            
axis(ax);    
pos = get(gca,'Position');
pap = get(gcf,'PaperPosition');
hwratio = (pos(4)*pap(4))/(pos(3)*pap(3));
dt = ax(2)-ax(1);
dv = ax(4)-ax(3);
sf = hwratio*dt/dv;
s = [0; 1; 0];
n = length(t);
us = u*sf;   
vec = zeros( n*3, 2 );
id = (1:3'); 
for i=1:n    
   vec(id,:) = s*[us(i), v(i)];
   vec(id,1) = vec(id,1)+ones(3,1)*t(i);
   id = id+3;
end  
h=line(vec(:,1),vec(:,2));
if nargout==1,hstick=h;,end
axis(ax)     
**********************read_o1d.m******************************************
function O1D=read_o1d(filename)
[pfid,message]=fopen(filename);
if pfid==-1
   error([filename,' not found. ',message]);
end
[path,name,ext,ver] = fileparts(filename);
% read 'XXXX' delimiter
XXXX=fgetl(pfid);
comment1=fgetl(pfid);
comment2=fgetl(pfid);
year=fscanf(pfid,'%d',1);
II=fscanf(pfid,'%d',1);
if strcmp(name,'QFLUX')
   ncol=2;
else
   ncol=3;
end
O1D=fscanf(pfid,'%f',[ncol inf])';
**********************fcast.html*************************************
<HTML>
<TITLE>MAY CRUISE FORECAST PRODUCTS PAGE</TITLE>
<BODY>
<H1>STANDARD FORECAST PRODUCTS PAGE</H1>
<hr>
<ul>
   <li><a href="#stdplotloc">STANDARD PLOT LOCATIONS</a>
   <li><a href="#windstress">WIND STRESS OBSERVATIONS</a>
   <li><a href="#heatflux">HEAT FLUX OBSERVATIONS</a>
   <li><a href="#stdplotloc">STANDARD PLOT LOCATIONS</a>
   <li><a href="#horzslices"> HORIZONTAL SLICES </a>
   <ul>
      <li> <a href="#horzslicesd1">Forecast Day 1 Average</a>
      <li> <a href="#horzslicesd2">Forecast Day 2 Average</a>
      <li> <a href="#horzslicesd3">Forecast Day 3 Average</a>
      <li> <a href="#dailyavgcomphorz">Daily Average Comparisons</a>
   </ul>
   <li><a href="#stdtrans">STANDARD TRANSECTS</a>
   <ul>
      <li> <a href="#stdtransd1">Forecast Day 1 Average</a>
      <li> <a href="#stdtransd2">Forecast Day 2 Average</a>
      <li> <a href="#stdtransd3">Forecast Day 3 Average</a>
      <li> <a href="#dailyavgcompstd">Daily Average Comparisons</a>
      <ul>
	 <li> <a href="#dailyavgcompstd_vel">Velocity</a>
	 <li> <a href="#dailyavgcompstd_tmp">Temperature</a>
	 <li> <a href="#dailyavgcompstd_sal">Salinity</a>     
      </ul>
   
   </ul>
   <li><a href="#drifterpaths">DRIFTER PATHS</a>
   <li><a href="#lastshippos">LAST SHIP POSITION</a>
   <li><a href="#shiptracks">SHIP TRACKS</a>
   <li><a href="#timeseries">TIME SERIES</a>
</ul>
<hr>
<H2><a name=stdplotloc>STANDARD PLOT LOCATIONS</H2>
<ul>
<li><a href="std_plot_loc.jpg"><img align=top
src="std_plot_loc.jpg.small"></a>
</ul>
<H2><a name=windstress>WIND STRESS OBSERVATIONS</H2>
<ul>
<li><a href="wind_obs.jpg"><img align=top src="wind_obs.jpg.small"></a>
</ul>
<H2><a name=heatflux>HEAT FLUX OBSERVATIONS</H2>
<ul>
<li><a href="qflux_obs.jpg"><img align=top
src="qflux_obs.jpg.small"></a>
</ul>
<hr>
<H2><a name=horzslices>HORIZONTAL SLICES</H2>
<h4><a name=horzslicesd1>ForeCast Day 01 24-Hour Average</h4> 
<table cellspacing=10 cellpadding=2 border=5 rowspan=4 colspan=3>
<tr>
   <th><a href="surf_vec_Day_1.jpg"><img
src="surf_vec_Day_1.jpg.small"></a>
   <th><a href="m25_vec_Day_1.jpg"><img
src="m25_vec_Day_1.jpg.small"></a>
   <th><a href="bot_vec_Day_1.jpg"><img
src="bot_vec_Day_1.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_1_TMPMID.jpg"><img
src="horz_surf_Day_1_TMPMID.jpg.small"></a>
   <th><a href="horz_25m_Day_1_TMPMID.jpg"><img
src="horz_25m_Day_1_TMPMID.jpg.small"></a>
   <th><a href="horz_bot_Day_1_TMPMID.jpg"><img
src="horz_bot_Day_1_TMPMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_1_SALMID.jpg"><img
src="horz_surf_Day_1_SALMID.jpg.small"></a>
   <th><a href="horz_25m_Day_1_SALMID.jpg"><img
src="horz_25m_Day_1_SALMID.jpg.small"></a>
   <th><a href="horz_bot_Day_1_SALMID.jpg"><img
src="horz_bot_Day_1_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_1_Q2MID.jpg"><img
src="horz_surf_Day_1_Q2MID.jpg.small"></a>
   <th><a href="horz_25m_Day_1_Q2MID.jpg"><img
src="horz_25m_Day_1_Q2MID.jpg.small"></a>
   <th><a href="horz_bot_Day_1_Q2MID.jpg"><img
src="horz_bot_Day_1_Q2MID.jpg.small"></a>
</tr>
</table>
<h4><a name=horzslicesd2>ForeCast Day 02 24-Hour Average</h4> 
<table cellspacing=10 cellpadding=2 border=5 rowspan=4 colspan=3>
<tr>
   <th><a href="surf_vec_Day_2.jpg"><img
src="surf_vec_Day_2.jpg.small"></a>
   <th><a href="m25_vec_Day_2.jpg"><img
src="m25_vec_Day_2.jpg.small"></a>
   <th><a href="bot_vec_Day_2.jpg"><img
src="bot_vec_Day_2.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_2_TMPMID.jpg"><img
src="horz_surf_Day_2_TMPMID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_TMPMID.jpg"><img
src="horz_25m_Day_2_TMPMID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_TMPMID.jpg"><img
src="horz_bot_Day_2_TMPMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_2_SALMID.jpg"><img
src="horz_surf_Day_2_SALMID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_SALMID.jpg"><img
src="horz_25m_Day_2_SALMID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_SALMID.jpg"><img
src="horz_bot_Day_2_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_2_Q2MID.jpg"><img
src="horz_surf_Day_2_Q2MID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_Q2MID.jpg"><img
src="horz_25m_Day_2_Q2MID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_Q2MID.jpg"><img
src="horz_bot_Day_2_Q2MID.jpg.small"></a>
</tr>
</table>
<h4><a name=horzslicesd3>ForeCast Day 03 24-Hour Average</h4> 
<table cellspacing=10 cellpadding=2 border=5 rowspan=4 colspan=3>
<tr>
   <th><a href="surf_vec_Day_3.jpg"><img
src="surf_vec_Day_3.jpg.small"></a>
   <th><a href="m25_vec_Day_3.jpg"><img
src="m25_vec_Day_3.jpg.small"></a>
   <th><a href="bot_vec_Day_3.jpg"><img
src="bot_vec_Day_3.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_3_TMPMID.jpg"><img
src="horz_surf_Day_3_TMPMID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_TMPMID.jpg"><img
src="horz_25m_Day_3_TMPMID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_TMPMID.jpg"><img
src="horz_bot_Day_3_TMPMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_3_SALMID.jpg"><img
src="horz_surf_Day_3_SALMID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_SALMID.jpg"><img
src="horz_25m_Day_3_SALMID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_SALMID.jpg"><img
src="horz_bot_Day_3_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a href="horz_surf_Day_3_Q2MID.jpg"><img
src="horz_surf_Day_3_Q2MID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_Q2MID.jpg"><img
src="horz_25m_Day_3_Q2MID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_Q2MID.jpg"><img
src="horz_bot_Day_3_Q2MID.jpg.small"></a>
</tr>
</table>
<h4><a name=dailyavgcomphorz>Daily Average Comparisons</h4> 
<table cellspacing=10 cellpadding=2 border=5 colspan=4>
<tr>
   <th><a></a>
   <th><a>FCAST Day 01</a>
   <th><a>FCAST Day 02</a>
   <th><a>FCAST Day 03</a>
</tr>
<tr>
   <th><a>SURF VEL</a>
   <th><a href="surf_vec_Day_1.jpg"><img
src="surf_vec_Day_1.jpg.small"></a>
   <th><a href="surf_vec_Day_2.jpg"><img
src="surf_vec_Day_2.jpg.small"></a>
   <th><a href="surf_vec_Day_3.jpg"><img
src="surf_vec_Day_3.jpg.small"></a>

</tr>
<tr>
   <th><a>25 METER VEL</a>
   <th><a href="m25_vec_Day_1.jpg"><img
src="m25_vec_Day_1.jpg.small"></a>
   <th><a href="m25_vec_Day_2.jpg"><img
src="m25_vec_Day_2.jpg.small"></a>
   <th><a href="m25_vec_Day_3.jpg"><img
src="m25_vec_Day_3.jpg.small"></a>
</tr>
<tr>
   <th><a>BOT VEL</a>
   <th><a href="bot_vec_Day_1.jpg"><img
src="bot_vec_Day_1.jpg.small"></a>
   <th><a href="bot_vec_Day_2.jpg"><img
src="bot_vec_Day_2.jpg.small"></a>
   <th><a href="bot_vec_Day_3.jpg"><img
src="bot_vec_Day_3.jpg.small"></a>

</tr>
<tr>
   <th><a>SURF TEMP</a>
   <th><a href="horz_surf_Day_1_TMPMID.jpg"><img
src="horz_surf_Day_1_TMPMID.jpg.small"></a>
   <th><a href="horz_surf_Day_2_TMPMID.jpg"><img
src="horz_surf_Day_2_TMPMID.jpg.small"></a>
   <th><a href="horz_surf_Day_3_TMPMID.jpg"><img
src="horz_surf_Day_3_TMPMID.jpg.small"></a>
</tr>
<tr>
   <th><a>25-METER TEMP</a>
   <th><a href="horz_25m_Day_1_TMPMID.jpg"><img
src="horz_25m_Day_1_TMPMID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_TMPMID.jpg"><img
src="horz_25m_Day_2_TMPMID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_TMPMID.jpg"><img
src="horz_25m_Day_3_TMPMID.jpg.small"></a>
</tr>
<tr>
   <th><a>BOT TEMP</a>
   <th><a href="horz_bot_Day_1_TMPMID.jpg"><img
src="horz_bot_Day_1_TMPMID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_TMPMID.jpg"><img
src="horz_bot_Day_2_TMPMID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_TMPMID.jpg"><img
src="horz_bot_Day_3_TMPMID.jpg.small"></a>
</tr>

<tr>
   <th><a>SURF SAL</a>
   <th><a href="horz_surf_Day_1_SALMID.jpg"><img
src="horz_surf_Day_1_SALMID.jpg.small"></a>
   <th><a href="horz_surf_Day_2_SALMID.jpg"><img
src="horz_surf_Day_2_SALMID.jpg.small"></a>
   <th><a href="horz_surf_Day_3_SALMID.jpg"><img
src="horz_surf_Day_3_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a>25-METER SAL</a>
   <th><a href="horz_25m_Day_1_SALMID.jpg"><img
src="horz_25m_Day_1_SALMID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_SALMID.jpg"><img
src="horz_25m_Day_2_SALMID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_SALMID.jpg"><img
src="horz_25m_Day_3_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a>BOT SAL</a>
   <th><a href="horz_bot_Day_1_SALMID.jpg"><img
src="horz_bot_Day_1_SALMID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_SALMID.jpg"><img
src="horz_bot_Day_2_SALMID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_SALMID.jpg"><img
src="horz_bot_Day_3_SALMID.jpg.small"></a>
</tr>
<tr>
   <th><a>SURF Q2</a>
   <th><a href="horz_surf_Day_1_Q2MID.jpg"><img
src="horz_surf_Day_1_Q2MID.jpg.small"></a>
   <th><a href="horz_surf_Day_2_Q2MID.jpg"><img
src="horz_surf_Day_2_Q2MID.jpg.small"></a>
   <th><a href="horz_surf_Day_3_Q2MID.jpg"><img
src="horz_surf_Day_3_Q2MID.jpg.small"></a>
</tr>
<tr>
   <th><a>25-METER Q2</a>
   <th><a href="horz_25m_Day_1_Q2MID.jpg"><img
src="horz_25m_Day_1_Q2MID.jpg.small"></a>
   <th><a href="horz_25m_Day_2_Q2MID.jpg"><img
src="horz_25m_Day_2_Q2MID.jpg.small"></a>
   <th><a href="horz_25m_Day_3_Q2MID.jpg"><img
src="horz_25m_Day_3_Q2MID.jpg.small"></a>
</tr>
<tr>
   <th><a>BOT Q2</a>
   <th><a href="horz_bot_Day_1_Q2MID.jpg"><img
src="horz_bot_Day_1_Q2MID.jpg.small"></a>
   <th><a href="horz_bot_Day_2_Q2MID.jpg"><img
src="horz_bot_Day_2_Q2MID.jpg.small"></a>
   <th><a href="horz_bot_Day_3_Q2MID.jpg"><img
src="horz_bot_Day_3_Q2MID.jpg.small"></a>
</tr>
</table>


<hr>


<H1><a name=stdtrans>STANDARD TRANSECTS</H1>

<h3><a name=stdtransd1> Day 1, 24-hour Averages, <h3>
<h3>Velocity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_vel_1_Day_1.jpg"><img
src="trans_vel_1_Day_1.jpg.small">
   <th><a href="trans_vel_2_Day_1.jpg"><img
src="trans_vel_2_Day_1.jpg.small">
   <th><a href="trans_vel_3_Day_1.jpg"><img
src="trans_vel_3_Day_1.jpg.small">
</tr>
<tr>
   <th><a href="trans_vel_4_Day_1.jpg"><img
src="trans_vel_4_Day_1.jpg.small">
   <th><a href="trans_vel_5_Day_1.jpg"><img
src="trans_vel_5_Day_1.jpg.small">
   <th><a href="trans_vel_6_Day_1.jpg"><img
src="trans_vel_6_Day_1.jpg.small">
</tr>
</table>

<h3>Temperature</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_tmp_1_Day_1.jpg"><img
src="trans_tmp_1_Day_1.jpg.small">
   <th><a href="trans_tmp_2_Day_1.jpg"><img
src="trans_tmp_2_Day_1.jpg.small">
   <th><a href="trans_tmp_3_Day_1.jpg"><img
src="trans_tmp_3_Day_1.jpg.small">
</tr>
<tr>
   <th><a href="trans_tmp_4_Day_1.jpg"><img
src="trans_tmp_4_Day_1.jpg.small">
   <th><a href="trans_tmp_5_Day_1.jpg"><img
src="trans_tmp_5_Day_1.jpg.small">
   <th><a href="trans_tmp_6_Day_1.jpg"><img
src="trans_tmp_6_Day_1.jpg.small">
</tr>
</table>
<h3>Salinity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_sal_1_Day_1.jpg"><img
src="trans_sal_1_Day_1.jpg.small">
   <th><a href="trans_sal_2_Day_1.jpg"><img
src="trans_sal_2_Day_1.jpg.small">
   <th><a href="trans_sal_3_Day_1.jpg"><img
src="trans_sal_3_Day_1.jpg.small">
</tr>
<tr>
   <th><a href="trans_sal_4_Day_1.jpg"><img
src="trans_sal_4_Day_1.jpg.small">
   <th><a href="trans_sal_5_Day_1.jpg"><img
src="trans_sal_5_Day_1.jpg.small">
   <th><a href="trans_sal_6_Day_1.jpg"><img
src="trans_sal_6_Day_1.jpg.small">
</tr>
</table>

<h3> <a name=stdtransd2 > Day 2, 24-hour Averages</h3>
<h3>Velocity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_vel_1_Day_2.jpg"><img
src="trans_vel_1_Day_2.jpg.small">
   <th><a href="trans_vel_2_Day_2.jpg"><img
src="trans_vel_2_Day_2.jpg.small">
   <th><a href="trans_vel_3_Day_2.jpg"><img
src="trans_vel_3_Day_2.jpg.small">
</tr>
<tr>
   <th><a href="trans_vel_4_Day_2.jpg"><img
src="trans_vel_4_Day_2.jpg.small">
   <th><a href="trans_vel_5_Day_2.jpg"><img
src="trans_vel_5_Day_2.jpg.small">
   <th><a href="trans_vel_6_Day_2.jpg"><img
src="trans_vel_6_Day_2.jpg.small">
</tr>
</table>
<h3>Temperature</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_tmp_1_Day_2.jpg"><img
src="trans_tmp_1_Day_2.jpg.small">
   <th><a href="trans_tmp_2_Day_2.jpg"><img
src="trans_tmp_2_Day_2.jpg.small">
   <th><a href="trans_tmp_3_Day_2.jpg"><img
src="trans_tmp_3_Day_2.jpg.small">
</tr>
<tr>
   <th><a href="trans_tmp_4_Day_2.jpg"><img
src="trans_tmp_4_Day_2.jpg.small">
   <th><a href="trans_tmp_5_Day_2.jpg"><img
src="trans_tmp_5_Day_2.jpg.small">
   <th><a href="trans_tmp_6_Day_2.jpg"><img
src="trans_tmp_6_Day_2.jpg.small">
</tr>
</table>

<h3>Salinity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_sal_1_Day_2.jpg"><img
src="trans_sal_1_Day_2.jpg.small">
   <th><a href="trans_sal_2_Day_2.jpg"><img
src="trans_sal_2_Day_2.jpg.small">
   <th><a href="trans_sal_3_Day_2.jpg"><img
src="trans_sal_3_Day_2.jpg.small">
</tr>
<tr>
   <th><a href="trans_sal_4_Day_2.jpg"><img
src="trans_sal_4_Day_2.jpg.small">
   <th><a href="trans_sal_5_Day_2.jpg"><img
src="trans_sal_5_Day_2.jpg.small">
   <th><a href="trans_sal_6_Day_2.jpg"><img
src="trans_sal_6_Day_2.jpg.small">
</tr>
</table>


<h3> <a name=stdtransd2 > Day 3, 24-hour Averages</h3>
<h3>Velocity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_vel_1_Day_3.jpg"><img
src="trans_vel_1_Day_3.jpg.small">
   <th><a href="trans_vel_2_Day_3.jpg"><img
src="trans_vel_2_Day_3.jpg.small">
   <th><a href="trans_vel_3_Day_3.jpg"><img
src="trans_vel_3_Day_3.jpg.small">
</tr>
<tr>
   <th><a href="trans_vel_4_Day_3.jpg"><img
src="trans_vel_4_Day_3.jpg.small">
   <th><a href="trans_vel_5_Day_3.jpg"><img
src="trans_vel_5_Day_3.jpg.small">
   <th><a href="trans_vel_6_Day_3.jpg"><img
src="trans_vel_6_Day_3.jpg.small">
</tr>
</table>
<h3>Temperature</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_tmp_1_Day_3.jpg"><img
src="trans_tmp_1_Day_3.jpg.small">
   <th><a href="trans_tmp_2_Day_3.jpg"><img
src="trans_tmp_2_Day_3.jpg.small">
   <th><a href="trans_tmp_3_Day_3.jpg"><img
src="trans_tmp_3_Day_3.jpg.small">
</tr>
<tr>
   <th><a href="trans_tmp_4_Day_3.jpg"><img
src="trans_tmp_4_Day_3.jpg.small">
   <th><a href="trans_tmp_5_Day_3.jpg"><img
src="trans_tmp_5_Day_3.jpg.small">
   <th><a href="trans_tmp_6_Day_3.jpg"><img
src="trans_tmp_6_Day_3.jpg.small">
</tr>
</table>
<h3>Salinity</h3>
<table cellspacing=10 cellpadding=6 border=5 rowspan=3 colspan=2>
<tr>
   <th><a href="trans_sal_1_Day_3.jpg"><img
src="trans_sal_1_Day_3.jpg.small">
   <th><a href="trans_sal_2_Day_3.jpg"><img
src="trans_sal_2_Day_3.jpg.small">
   <th><a href="trans_sal_3_Day_3.jpg"><img
src="trans_sal_3_Day_3.jpg.small">
</tr>
<tr>
   <th><a href="trans_sal_4_Day_3.jpg"><img
src="trans_sal_4_Day_3.jpg.small">
   <th><a href="trans_sal_5_Day_3.jpg"><img
src="trans_sal_5_Day_3.jpg.small">
   <th><a href="trans_sal_6_Day_3.jpg"><img
src="trans_sal_6_Day_3.jpg.small">
</tr>
</table>


<h2><a name=dailyavgcompstd>Standard Transect - Daily Average
Comparisons</h2> 
<a name=dailyavgcompstd_vel>
<table cellspacing=10 cellpadding=2 border=5 colspan=4>
   <tr>
      <th><a></a>
      <th><a></a>
      <th><a>Velocity</a>
      <th><a></a>
   </tr>
   <tr>
      <th><a></a>
      <th><a>FCAST Day 01</a>
      <th><a>FCAST Day 02</a>
      <th><a>FCAST Day 03</a>
   </tr>
   <tr>
      <th><a>TRANSECT 1</a>
      <th><a href="trans_vel_1_Day_1.jpg"><img
src="trans_vel_1_Day_1.jpg.small">
      <th><a href="trans_vel_1_Day_2.jpg"><img
src="trans_vel_1_Day_2.jpg.small">
      <th><a href="trans_vel_1_Day_3.jpg"><img
src="trans_vel_1_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 2</a>
      <th><a href="trans_vel_2_Day_1.jpg"><img
src="trans_vel_2_Day_1.jpg.small">
      <th><a href="trans_vel_2_Day_2.jpg"><img
src="trans_vel_2_Day_2.jpg.small">
      <th><a href="trans_vel_2_Day_3.jpg"><img
src="trans_vel_2_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 3</a>
      <th><a href="trans_vel_3_Day_1.jpg"><img
src="trans_vel_3_Day_1.jpg.small">
      <th><a href="trans_vel_3_Day_2.jpg"><img
src="trans_vel_3_Day_2.jpg.small">
      <th><a href="trans_vel_3_Day_3.jpg"><img
src="trans_vel_3_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 4</a>
      <th><a href="trans_vel_4_Day_1.jpg"><img
src="trans_vel_4_Day_1.jpg.small">
      <th><a href="trans_vel_4_Day_2.jpg"><img
src="trans_vel_4_Day_2.jpg.small">
      <th><a href="trans_vel_4_Day_3.jpg"><img
src="trans_vel_4_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 5</a>
      <th><a href="trans_vel_5_Day_1.jpg"><img
src="trans_vel_5_Day_1.jpg.small">
      <th><a href="trans_vel_5_Day_2.jpg"><img
src="trans_vel_5_Day_2.jpg.small">
      <th><a href="trans_vel_5_Day_3.jpg"><img
src="trans_vel_5_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 6</a>
      <th><a href="trans_vel_6_Day_1.jpg"><img
src="trans_vel_6_Day_1.jpg.small">
      <th><a href="trans_vel_6_Day_2.jpg"><img
src="trans_vel_6_Day_2.jpg.small">
      <th><a href="trans_vel_6_Day_3.jpg"><img
src="trans_vel_6_Day_3.jpg.small">
   </tr>
</table>
<br>
<br>
<br>

<a name=dailyavgcompstd_tmp>
<table cellspacing=10 cellpadding=2 border=5 colspan=4>
   <tr>
      <th><a></a>
      <th><a></a>
      <th><a>Temperature</a>
      <th><a></a>
   </tr>
   <tr>
      <th><a></a>
      <th><a>FCAST Day 01</a>
      <th><a>FCAST Day 02</a>
      <th><a>FCAST Day 03</a>
   </tr>
   <tr>
      <th><a>TRANSECT 1</a>
      <th><a href="trans_tmp_1_Day_1.jpg"><img
src="trans_tmp_1_Day_1.jpg.small">
      <th><a href="trans_tmp_1_Day_2.jpg"><img
src="trans_tmp_1_Day_2.jpg.small">
      <th><a href="trans_tmp_1_Day_3.jpg"><img
src="trans_tmp_1_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 2</a>
      <th><a href="trans_tmp_2_Day_1.jpg"><img
src="trans_tmp_2_Day_1.jpg.small">
      <th><a href="trans_tmp_2_Day_2.jpg"><img
src="trans_tmp_2_Day_2.jpg.small">
      <th><a href="trans_tmp_2_Day_3.jpg"><img
src="trans_tmp_2_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 3</a>
      <th><a href="trans_tmp_3_Day_1.jpg"><img
src="trans_tmp_3_Day_1.jpg.small">
      <th><a href="trans_tmp_3_Day_2.jpg"><img
src="trans_tmp_3_Day_2.jpg.small">
      <th><a href="trans_tmp_3_Day_3.jpg"><img
src="trans_tmp_3_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 4</a>
      <th><a href="trans_tmp_4_Day_1.jpg"><img
src="trans_tmp_4_Day_1.jpg.small">
      <th><a href="trans_tmp_4_Day_2.jpg"><img
src="trans_tmp_4_Day_2.jpg.small">
      <th><a href="trans_tmp_4_Day_3.jpg"><img
src="trans_tmp_4_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 5</a>
      <th><a href="trans_tmp_5_Day_1.jpg"><img
src="trans_tmp_5_Day_1.jpg.small">
      <th><a href="trans_tmp_5_Day_2.jpg"><img
src="trans_tmp_5_Day_2.jpg.small">
      <th><a href="trans_tmp_5_Day_3.jpg"><img
src="trans_tmp_5_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 6</a>
      <th><a href="trans_tmp_6_Day_1.jpg"><img
src="trans_tmp_6_Day_1.jpg.small">
      <th><a href="trans_tmp_6_Day_2.jpg"><img
src="trans_tmp_6_Day_2.jpg.small">
      <th><a href="trans_tmp_6_Day_3.jpg"><img
src="trans_tmp_6_Day_3.jpg.small">
   </tr>
</table>

<br>
<br>
<br>


<a name=dailyavgcompstd_sal>
<table cellspacing=10 cellpadding=2 border=5 colspan=4>
   <tr>
      <th><a></a>
      <th><a></a>
      <th><a>Salinity</a>
      <th><a></a>
   </tr>
   <tr>
      <th><a></a>
      <th><a>FCAST Day 01</a>
      <th><a>FCAST Day 02</a>
      <th><a>FCAST Day 03</a>
   </tr>
   <tr>
      <th><a>TRANSECT 1</a>
      <th><a href="trans_sal_1_Day_1.jpg"><img
src="trans_sal_1_Day_1.jpg.small">
      <th><a href="trans_sal_1_Day_2.jpg"><img
src="trans_sal_1_Day_2.jpg.small">
      <th><a href="trans_sal_1_Day_3.jpg"><img
src="trans_sal_1_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 2</a>
      <th><a href="trans_sal_2_Day_1.jpg"><img
src="trans_sal_2_Day_1.jpg.small">
      <th><a href="trans_sal_2_Day_2.jpg"><img
src="trans_sal_2_Day_2.jpg.small">
      <th><a href="trans_sal_2_Day_3.jpg"><img
src="trans_sal_2_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 3</a>
      <th><a href="trans_sal_3_Day_1.jpg"><img
src="trans_sal_3_Day_1.jpg.small">
      <th><a href="trans_sal_3_Day_2.jpg"><img
src="trans_sal_3_Day_2.jpg.small">
      <th><a href="trans_sal_3_Day_3.jpg"><img
src="trans_sal_3_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 4</a>
      <th><a href="trans_sal_4_Day_1.jpg"><img
src="trans_sal_4_Day_1.jpg.small">
      <th><a href="trans_sal_4_Day_2.jpg"><img
src="trans_sal_4_Day_2.jpg.small">
      <th><a href="trans_sal_4_Day_3.jpg"><img
src="trans_sal_4_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 5</a>
      <th><a href="trans_sal_5_Day_1.jpg"><img
src="trans_sal_5_Day_1.jpg.small">
      <th><a href="trans_sal_5_Day_2.jpg"><img
src="trans_sal_5_Day_2.jpg.small">
      <th><a href="trans_sal_5_Day_3.jpg"><img
src="trans_sal_5_Day_3.jpg.small">
   </tr>
   <tr>
      <th><a>TRANSECT 6</a>
      <th><a href="trans_sal_6_Day_1.jpg"><img
src="trans_sal_6_Day_1.jpg.small">
      <th><a href="trans_sal_6_Day_2.jpg"><img
src="trans_sal_6_Day_2.jpg.small">
      <th><a href="trans_sal_6_Day_3.jpg"><img
src="trans_sal_6_Day_3.jpg.small">
   </tr>
</table>

<hr>

<h2><a name=lastshippos>LAST SHIP POS NORTH/SOUTH TRANSECT</H2>
<ul>
<li><a href="nsship_pos.jpg"><img align=top
src="nsship_pos.jpg.small"></a>
</ul>

<hr>
<H2><a name=shiptracks>SHIP TRACKS</H2>
<table cellspacing=10 cellpadding=6 border=5 rowspan=1 colspan=3>
<tr>
   <th><a href="ship_track_t_z_sal.jpg">  <img
src="ship_track_t_z_sal.jpg.small">
   <th><a href="ship_track_t_z_tmp.jpg">  <img
src="ship_track_t_z_tmp.jpg.small">
</tr>
<tr>
   <th><a href="ship_track_persp_sal.jpg"><img
src="ship_track_persp_sal.jpg.small">
   <th><a href="ship_track_persp_tmp.jpg"><img
src="ship_track_persp_tmp.jpg.small">
</tr>
</table>

<hr>
<H2><a name=drifterpaths>DRIFTER PATHS</H2>
<ul>
<li><a href="drifters.jpg"><img align=top src="drifters.jpg.small"></a>
</ul>

<hr>
<H2><a name=timeseries>TIME SERIES</H2>
Vertical Profiles at Specific Locations<br>
Schlitz North Mooring
<ul>
   <li><a href="ts1.jpg"><img align=top src="ts1.jpg.small"></a>
</ul>

Schlitz South Mooring
<ul>
   <li><a href="ts2.jpg"><img align=top src="ts2.jpg.small">
</ul>

</BODY>
</HTML>
******************************defplots.m****************************
function defplots
if isempty(dir('*.icq4'))|~exist('../MESH')|~exist('UV_INTEG-Q4.m3d')
     error(['one of *.icq4 ../MESH UV_INTEG-Q4.m3d not found in '...
	'current directory try a new directory'])
end

diary('defplots.log')
%echo on
clear

format compact
more off
clc
close all
fontsize=get(0,'DefaultAxesFontSize');
title_fontsize=fontsize+6;

% Get default locations/parameters
defplot_params;

% Determine list of available icq4 files
% Set the length of the .icq4 timeseries here!!
D=dirsort('ITER*.icq4');

% READ LAST ICQ4 FILE TO DETERMINE GRID NAME.
%
% GRID FILES ARE ASSUMED TO RESIDE IN ../MESH
First_icq4=read_icq4(D(1).name);
Last_icq4=read_icq4(D(length(D)).name);

% Get the list of daily average files; only the last 3 daily averages
% will be processed.
DDAY=dirsort('DAY*.icq4');
ldday=length(DDAY);
disp(['Reading ' DDAY(ldday-2).name '
file']);Day1_icq4=read_icq4(DDAY(ldday-2).name);
disp(['Reading ' DDAY(ldday-1).name '
file']);Day2_icq4=read_icq4(DDAY(ldday-1).name);
disp(['Reading ' DDAY(ldday).name   '
file']);Day3_icq4=read_icq4(DDAY(ldday).name);

nnv=Last_icq4.nnv;

% LOAD FEM_MESH_STRUCT INTO VARIABLE MESH

fem_grid_struct=loadgrid(fullfile('../MESH',Last_icq4.casename...
	(1:length(Last_icq4.casename)-1)));

% LOAD SHIP TRACK DATA FROM UV_INTEG-Q4.M3D

fid=fopen('UV_INTEG-Q4.m3d');	% OPEN FILE
fgetl(fid);			% STRIP HEADER
fgetl(fid);			% STRIP HEADER
fgetl(fid);			% STRIP HEADER
YEAR=fscanf(fid,'%i',1);	% RETRIEVE YEAR OF OBSERVATION
NC=fscanf(fid,'%i',1);		% DETERMINE NUMBER OF COLUMNS IN FILE
fgetl(fid);			% STRIP HEADER
UV=fscanf(fid,'%f');		% RETRIEVE T, U, & V DATA
fclose(fid);			% CLOSE FILE

% PARSE UV; RETRIEVING T, X, & Y FROM COLUMNS 1, 2, & 3
% (OTHER COLUMNS CONTAIN ADCP DATA) AND CONVERT T TO 
% JULIAN DAYS.

TShip=UV(1:NC:length(UV))+julian(YEAR,1,1,0);
XShip=UV(2:NC:length(UV));
YShip=UV(3:NC:length(UV));

% DEFINE SHIPTRACK PLOTTING OPTION
% This pretains to the ADCP-like ribbon plots
% That are expensive to compute if the 
% ship track is long;
SHIPTRACK=0;  % NO SHIPTRACK PLOTS
%SHIPTRACK=1;  % YES SHIPTRACK PLOTS

% DEFINE BUOY PLOTTING OPTION
%BUOYPLOTS=0;  % NO BUOYPLOTS
BUOYPLOTS=1;  % YES BUOYPLOTS

% ALTER SHIPTRACK HERE
%XShip=XShip(800:1000);
%YShip=YShip(800:1000);
%TShip=TShip(800:1000);

fld{1}='TMPMID';
fld{2}='SALMID';
fld{3}='Q2MID';

figure
set(gcf,'MenuBar','none','Position',[100 100 640 480])
orig_pos=get(gcf,'Position');
colormap(jet(16))

%%%%%%%%%%%%%%%%%  SHOW STANDARD PLOT LOCATIONS  %%%%%%%%%%%%%%

clf
set(gcf,'name','Transect_Positions')
hb=plotbnd(fem_grid_struct);
set(hb,'LineWidth',2)
hh=lcontour(fem_grid_struct,'z',[30 60 100 125]);
set(hh,'LineWidth',.5,'Color','b')
line(xtransloc',ytransloc','Color','r')
for in=1:length(xtransloc)
  
text(mean(xtransloc(in,:)),mean(ytransloc(in,:)),num2str(in),'FontSize',16)
end
if ~isempty(XShip)
   h=line(XShip,YShip,'Color','b');
   h=line(XShip,YShip,'Marker','.','Color','r','LineStyle','none');
end
h=line(BuoyLoc(:,1),BuoyLoc(:,2),'Marker','*','Color','g','LineStyle','none','MarkerSize',20);
title('Standard Plot Locations','FontSize',title_fontsize)
text(3e5,-2.2e5,'[30 60 100 125]-meter contours')
line(3e5,-2.3e5,'Marker','*','Color','g','LineStyle','none','MarkerSize',20);
text(3.05e5,-2.3e5,'Buoy Location(s)')
line([3e5 3.05e5],[-2.4e5 -2.4e5],'Color','b','LineStyle','-');
text(3.05e5,-2.4e5,'Ship Track')

output_image('html/std_plot_loc')

%%%%%%%%%%%%%%%%%% OBSERVATIONS OUTPUT, QFLUX, TAUXY  %%%%%%%%%%%%%%%%%%
QO1D=read_o1d('../OBS/QFLUX.o1d');
TO1D=read_o1d('../OBS/TAUXY.o1d');

heat_time=QO1D(:,1);
QFLUX=QO1D(:,2);

wind_time=TO1D(:,1);
taux=TO1D(:,2);
tauy=TO1D(:,3);
maxtau=max(abs(taux+sqrt(-1)*tauy));
% Make wind plots
% Only plot the last 6 days
maxtime= max(wind_time)  ;
idx=find(wind_time>=maxtime-6&wind_time<=maxtime);
wtime=wind_time(idx);
Tx=taux(idx);Ty=tauy(idx);
clf 
subplot(211)
title('Last 6 Days of Wind Observations','FontSize',fontsize+2)
htx=line(wtime,Tx,'Color','b','LineWidth',2);
hty=line(wtime,Ty,'Color','r','LineWidth',2);
set(gca,'XTickLabel',[])
set(gca,'Xlim',[maxtime-6 maxtime])
set(gca,'Ylim',[-maxtau maxtau])
ylabel('Pa')
legend('\tau_x','\tau_y',0)
subplot(212)
stick3(wtime,Tx,Ty,[maxtime-6 maxtime -maxtau maxtau])
xlabel('Year Day')
ylabel('Pa')
output_image('html/wind_obs')

% Make qflux plot
% Only plot the last 6 days
maxtime= max(heat_time)  ;
idx=find(heat_time>=maxtime-6&heat_time<=maxtime);
htime=heat_time(idx);
QF=QFLUX(idx);
clf 
title('Last 6 Days of Net Heat Flux Observations','FontSize',fontsize+2)
htx=line(htime,QF,'Color','b','LineWidth',2);
set(gca,'Xlim',[maxtime-6 maxtime])
ylabel('W/m^2')
xlabel('Year Day')
output_image('html/qflux_obs')


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HORIZONTAL SLICES WITH DRIFTERS, BASED ON THE 24-hour averaged icq4
files
% 
%set(gcf,'Position',[181    16   408   700])

%% LOOP OVER Day 1,2,3
for iday=1:3

   ICQ4=eval(['Day' int2str(iday) '_icq4']);
   uv25=horzslicefem(ICQ4.ZMID,ICQ4.UZMID+i*ICQ4.VZMID,-25);
   uvsu=ICQ4.UZMID(:,nnv)+i*ICQ4.VZMID(:,nnv);
   uvbo=ICQ4.UZMID(:,1)+i*ICQ4.VZMID(:,1);

  
yr=int2str(ICQ4.year);                                                 
   yr=yr(3:4);
   day_string=[int2str(ICQ4.day) '/' int2str(ICQ4.month) '/' yr];

   for in=1:length(fld)
      scale_origin_x=3.75e5;
      scale_origin_y=-2.25e5;
      vec_scale=1;
      Q=getfield(ICQ4,fld{in});
      maxQ=max(Q(:));
      minQ=min(Q(:));

      set(gcf,'name',['Day ' int2str(iday) ' hslice_' fld{in}])

      clf
      colormesh2d(fem_grid_struct,Q(:,nnv));
      plotbnd(fem_grid_struct);
      if in==1 | in==2
   	 set(gca,'CLim',[minQ maxQ])
      end
      colorbar
      set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	      'dataaspectratio',[1 1 1]);
      title(['Day ' day_string ' - Surface '  fld{in}])
      output_image(['html/horz_surf_Day_' int2str(iday) '_' fld{in}])

      clf
      hslicedicq4=horzslicefem(ICQ4.ZMID,Q,-25);
      colormesh2d(fem_grid_struct,hslicedicq4);
      plotbnd(fem_grid_struct);
      if in==1 | in==2
   	 set(gca,'CLim',[minQ maxQ])
      end
      colorbar
      hh=lcontour(fem_grid_struct,'z',25);
      set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	      'dataaspectratio',[1 1 1]);
      title(['Day ' day_string ' - 25 meters ' fld{in}])
      output_image(['html/horz_25m_Day_' int2str(iday) '_' fld{in}])

      clf
      colormesh2d(fem_grid_struct,Q(:,1));
      plotbnd(fem_grid_struct);
      if in==1 | in==2
   	 set(gca,'CLim',[minQ maxQ])
      end
      colorbar
      set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	      'dataaspectratio',[1 1 1]);
      title(['Day ' day_string ' - Bottom ' fld{in}])
      output_image(['html/horz_bot_Day_' int2str(iday) '_' fld{in}])
   end

   % VECTOR FIELD PLOTS
   clf
   set(gcf,'name','hslice_vel_surf')
   set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	   'dataaspectratio',[1 1 1]);
   plotbnd(fem_grid_struct);
   h=vecplot(fem_grid_struct,real(uvsu),imag(uvsu),vec_scale,'m/s',...
   		  scale_origin_x,scale_origin_y);
   set(h,'color','k')
   title(['Day ' day_string ' - Surface Velocity'])
   output_image(['html/surf_vec_Day_' int2str(iday)])

   clf
   set(gcf,'name','hslice_vel_25m')
   set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	   'dataaspectratio',[1 1 1]);
   plotbnd(fem_grid_struct);
   hh=lcontour(fem_grid_struct,'z',25);
   h=vecplot(fem_grid_struct,real(uv25),imag(uv25),vec_scale,'m/s',...
   		  scale_origin_x,scale_origin_y);
   set(h,'color','k')
   title(['Day ' day_string ' - 25 meter Velocity'])
   output_image(['html/m25_vec_Day_' int2str(iday)])

   clf
   set(gcf,'name','hslice_vel_bot')
   set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
   	   'dataaspectratio',[1 1 1]);
   plotbnd(fem_grid_struct);
   h=vecplot(fem_grid_struct,real(uvbo),imag(uvbo),vec_scale,'m/s',...
   		  scale_origin_x,scale_origin_y);
   set(h,'color','k')
   title(['Day ' day_string ' - Bottom Velocity'])
   output_image(['html/bot_vec_Day_' int2str(iday)])

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   % SLICE THROUGH SPECIFIED TRANSECTS

   % CYCLE THROUGH LENGTH OF XTRANSLOC
   vec_scale=.5; % for daily averages!!!
   for in=1:length(xtransloc)
      clf
      set(gcf,'name',['Transect_Vel_',num2str(in)'])

     
R=searibbon(ICQ4,fem_grid_struct,xtransloc(in,:),ytransloc(in,:),5e3);

      ind=find(~isnan(R.UZMID(:,1)));

      %%%%%%%%%%%%%%  ROTATE VELOCITY INTO TRANSECT PLANE
%%%%%%%%%%%%%%%%
      tgv=atan(diff(ytransloc(in,:))/diff(xtransloc(in,:)));
      u=R.UZMID(ind,:);
      v=R.VZMID(ind,:);
      [u,v]=rot(u,v,tgv);

      % U POSITIVE TO RIGHT OF TRANSECT DIRECTION (OUT OF SCREEN)
      % V POSITIVE ALONG TRANSECT

      pcolor(R.d(ind,:),R.ZMID(ind,:),reshape(u,size(R.ZMID(ind,:))))
      xlabel('Distance along transect (meters)')
      ylabel('Depth (meters)')
      shading interp
      hcb=colorbar;
      curax=gca;
      axes(hcb)
      ylabel('Through-Transect Velocity (m/sec)')
      axes(curax)
      ind1=find(~isnan(R.UZMID(:)));
     
hvec=vecplotstick(R.d(ind1),R.ZMID(ind1),v,R.WZMID(ind1),vec_scale,'k',...
	 10,'m/s',4e4,-37);
      title(['Velocity - Day ' day_string ' - Standard Transect '
int2str(in)],'FontSize',title_fontsize)
     
line(R.d(:,1),R.ZMID(:,1),'Color','k','LineStyle','-','linewidth',2)
      drawnow
      fname=['html/trans_vel_' int2str(in) '_Day_' int2str(iday)];
      output_image(fname)


      clf
      set(gcf,'name',['Transect_Sal_',num2str(in)'])
     
pcolor(R.d(ind,:),R.ZMID(ind,:),reshape(R.SALMID,size(R.ZMID(ind,:))))
     
line(R.d(:,1),R.ZMID(:,1),'Color','k','LineStyle','-','linewidth',2)
      xlabel('Distance along transect (meters)')
      ylabel('Depth (meters)')
      shading interp
      hcb=colorbar;
      curax=gca;
      axes(hcb)
      ylabel('Salinity (PSU)')
      axes(curax)
      title(['Salinity - Day ' day_string ' - Standard Transect '
int2str(in)],'FontSize',title_fontsize)
      drawnow
      fname=['html/trans_sal_' int2str(in) '_Day_' int2str(iday)];
      output_image(fname)

      clf
      set(gcf,'name',['Transect_Sal_',num2str(in)'])
     
pcolor(R.d(ind,:),R.ZMID(ind,:),reshape(R.TMPMID,size(R.ZMID(ind,:))))
     
line(R.d(:,1),R.ZMID(:,1),'Color','k','LineStyle','-','linewidth',2)
      xlabel('Distance along transect (meters)')
      ylabel('Depth (meters)')
      shading interp
      hcb=colorbar;
      curax=gca;
      axes(hcb)
      ylabel('Temperature (deg C)')
      axes(curax)
      title(['Temperature - Day ' day_string ' - Standard Transect '
int2str(in)],'FontSize',title_fontsize)
      drawnow
      fname=['html/trans_tmp_' int2str(in) '_Day_' int2str(iday)];
      output_image(fname)

   end  % std trans loop
end % iday loop

% DRIFTERS
   clf
   set(gcf,'name','Driftetrs')
   set(gcf,'Position',orig_pos)
   [P.gridname,P.ndrog,P.ndts,P.tsec,P.pth]=read_pth('DRIFTERS',4);
   if ~isempty(XShip)
      line(XShip,YShip,'Color','k','LineStyle','-','linewidth',2)
   end
   line(reshape(P.pth(:,1),P.ndrog,P.ndts)',...
	   reshape(P.pth(:,2),P.ndrog,P.ndts)','LineStyle','-')
   set(gca,'xlim',[1.5e5 4.3e5],'ylim',[-2.5e5 0e5],...
	   'dataaspectratio',[1 1 1]);
   plotbnd(fem_grid_struct)
   hh=lcontour(fem_grid_struct,'z',[30 60 100 125]);
   set(hh,'LineWidth',.5,'Color','b')
   title(['Drifters'])
   output_image('html/drifters')


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% N-S SLICE THROUGH LAST SHIP POSITION
disp('Computing timeribbon...')
if ~isempty(XShip)
   R=timeribbon(D,fem_grid_struct,...
	   XShip(length(XShip))*[1 1],...
	   [min(fem_grid_struct.y) max(fem_grid_struct.y)],...
	   TShip(length(TShip)),5e3);
   ind=find(~isnan(R.UZMID(:,1)));

clf
set(gcf,'name',['NSslice'])
pcolor(R.d(ind,:),R.ZMID(ind,:),R.UZMID(ind,:))
xlabel('Distance along transect (meters)')
ylabel('Depth (meters)')
hcb=colorbar;
mainax=gca;
axes(hcb)
ylabel('Through-Transect Velocity (m/sec)')
axes(mainax)
hold on
[c,h]=contour(R.d(ind,:),R.ZMID(ind,:),R.TMPMID(ind,:),[5:15],'y');
if ~isempty(h)
   ht=clabel(c,h);
end
set(ht,'FontSize',15)
set(h,'linewidth',2)

[c,h]=contour(R.d(ind,:),R.ZMID(ind,:),R.SALMID(ind,:),[20:40],'w');
if ~isempty(h)
   ht=clabel(c,h);
end
set(ht,'FontSize',15)
set(h,'linewidth',2)

line(R.d(:,1),R.ZMID(:,1),'Color','k','LineStyle','-','linewidth',2)
shading interp

ind=find(~isnan(R.UZMID(:)));
uu=R.VZMID(ind);
vv=R.WZMID(ind);
hvec=vecplotstick(R.d(ind),R.ZMID(ind),uu,vv,1,'k',...
   10,'m/s');

else
   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   axis([-1 1 -1 1])
end
   
title('NS SLice through Last Ship Pos.','FontSize',title_fontsize)
output_image('html/nsship_pos')
clear R
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% SHIPTRACK
if SHIPTRACK
   R1=timeribbon(D,fem_grid_struct,XShip,YShip,TShip,5e3);
   save ShipTrackRibbon.mat R1

   %%% ALONG-SHIPTRACK TMP
   mm=fem_grid_struct;
   mm.z=-fem_grid_struct.z;
   az=-4.5000;
   el=40;

   clf
   set(gcf,'name','shiptrack_T')
   if exist('R1')   % perhaps timeribbon bombed
      if ~isempty(R1) % perhaps timeribbon returned empty
   	 pcolor(R1.t-R1.t(1),R1.ZMID,R1.TMPMID)
   	 hcb=colorbar;
   	 mainax=gca;
   	 axes(hcb)
   	 ylabel('Temperature ({}^o C)')
   	 axes(mainax)

   	 shading interp
   	 hold on
   	 plot(R1.t(:,1)-R1.t(1),R1.ZMID(:,1),'k-','linewidth',2)
   	 ylabel('Depth (m)')
   	 xlabel('Forecast Time (days)')
   	 title('Along ShipTrack Temperature (^o
C)','FontSize',title_fontsize)
   	 hcb=colorbar;
   	 mainax=gca;
   	 axes(hcb)
   	 ylabel('Temperature ({}^o C)')
   	 axes(mainax)
      else
   	 clf
   	 text(0,0,'NO PLOT','HorizontalAlignment','center')
   	 title('Along ShipTrack Temperature (^o
C)','FontSize',title_fontsize)
   	 axis([-1 1 -1 1])
      end
   else
      clf
      text(0,0,'NO PLOT','HorizontalAlignment','center')
      title('Along ShipTrack Temperature (^o
C)','FontSize',title_fontsize)
      axis([-1 1 -1 1])
   end
   output_image('html/ship_track_t_z_tmp')


   clf
   if exist('R1')
      if ~isempty(R1) % perhaps timeribbon returned empty
   	 surf(R1.x,R1.y,R1.ZMID,R1.TMPMID)
   	 hcb=colorbar;
   	 mainax=gca;
   	 axes(hcb)
   	 ylabel('Temperature ({}^o C)')
   	 axes(mainax)
   	 hold on
   	 view(az,el)
   	 h=plotbnd(fem_grid_struct);
   	 set(h,'linewidth',2)
   	 drawelems3d(mm)
   	 plot3(R1.x(:,21),R1.y(:,21),R1.ZMID(:,21),'k-','linewidth',1)
   	 plot3(R1.x(:,1),R1.y(:,1),R1.ZMID(:,1),'k-','linewidth',1)
   	 axis([min(R1.x(:)) max(R1.x(:)) min(R1.y(:)) max(R1.y(:))...
   	       min(R1.ZMID(:)) max(R1.ZMID(:))])
   	 shading interp
   	 title('Along ShipTrack Temperature ({}^o
C)','FontSize',title_fontsize)
      else
   	 clf
   	 text(0,0,'NO PLOT','HorizontalAlignment','center')
   	 title('Along ShipTrack Temperature ({}^o
C)','FontSize',title_fontsize)
   	 axis([-1 1 -1 1])
      end
   else
      clf
      text(0,0,'NO PLOT','HorizontalAlignment','center')
      title('Along ShipTrack Temperature ({}^o
C)','FontSize',title_fontsize)
      axis([-1 1 -1 1])
   end
   output_image('html/ship_track_persp_tmp')

   %%% ALONG-SHIPTRACK SAL
   clf
   if exist('R1')
      if ~isempty(R1) % perhaps timeribbon returned empty
   	 set(gcf,'name','shiptrack_S')
   	 pcolor(R1.t-R1.t(1),R1.ZMID,R1.SALMID)
   	 hcb=colorbar;
   	 mainax=gca;
   	 axes(hcb)
   	 ylabel('Salinity (PSU)')
   	 axes(mainax)
   	 shading('interp')
   	 hold on
   	 plot(R1.t(:,1)-R1.t(1),R1.ZMID(:,1),'k-','linewidth',2)
   	 ylabel('Depth (m)')
   	 xlabel('Forecast Time (days)')
   	 title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
      else
   	 clf
   	 text(0,0,'NO PLOT','HorizontalAlignment','center')
   	 title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
   	 axis([-1 1 -1 1])
      end
   else
      clf
      text(0,0,'NO PLOT','HorizontalAlignment','center')
      title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
      axis([-1 1 -1 1])
   end
   output_image('html/ship_track_t_z_sal')

   clf
   if exist('R1')
      if ~isempty(R1) % perhaps timeribbon returned empty
   	 surf(R1.x,R1.y,R1.ZMID,R1.SALMID)
   	 hcb=colorbar;
   	 mainax=gca;
   	 axes(hcb)
   	 ylabel('Salinity (PSU)')
   	 axes(mainax)
   	 view(az,el)
   	 drawelems3d(mm)
   	 h=plotbnd(fem_grid_struct);
   	 set(h,'linewidth',2)
   	 hold on
   	 plot3(R1.x(:,21),R1.y(:,21),R1.ZMID(:,21),'k-','linewidth',1)
   	 plot3(R1.x(:,1),R1.y(:,1),R1.ZMID(:,1),'k-','linewidth',1)
   	 axis([min(R1.x(:)) max(R1.x(:)) min(R1.y(:)) max(R1.y(:))...
   	       min(R1.ZMID(:)) max(R1.ZMID(:))])
   	 shading interp
   	 title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
      else
   	 clf
   	 text(0,0,'NO PLOT','HorizontalAlignment','center')
   	 title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
   	 axis([-1 1 -1 1])
      end
   else
      clf
      text(0,0,'NO PLOT','HorizontalAlignment','center')
      title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
      axis([-1 1 -1 1])
   end
   output_image('html/ship_track_persp_sal')
 
   clear R1
else
   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   title('Along ShipTrack Temperature (^o C)','FontSize',title_fontsize)
   axis([-1 1 -1 1])
   output_image('html/ship_track_t_z_tmp')

   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   title('Along ShipTrack Temperature ({}^o
C)','FontSize',title_fontsize)
   axis([-1 1 -1 1])
   output_image('html/ship_track_persp_tmp')

   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
   axis([-1 1 -1 1])
   output_image('html/ship_track_t_z_sal')
      
   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   title('Along ShipTrack Salinity (PSU)','FontSize',title_fontsize)
   axis([-1 1 -1 1])
   output_image('html/ship_track_persp_sal')

end

% END SHIPTRACK BLOCK

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
timeshift=datenum('01-Jan-1999');
buoyend=datenum(Last_icq4.year,...
                Last_icq4.month,...
                Last_icq4.day,...
                0,0,...
                Last_icq4.curr_seconds)-timeshift+julian(YEAR,1,1,0);
buoystart=buoyend-3.;
bdt=3/24;
%note below that the very last time in buoytime cannot
%end on exactly the time of the last .icq4 file. so we
% subtract off some time to prevent reading past the last .icq4.
% this amount could be anything (like 1 hour), but here it is
% 3 (bdt)
buoytime=buoystart:bdt:buoyend-bdt;
clear Day?_icq4;
if BUOYPLOTS
   % TOP SCHLITZ BUOY AT (67.308W,41.170N)
   R2=timeribbon(D,fem_grid_struct,BuoyLoc(1,1),...
	   BuoyLoc(1,2),...
	   buoytime);
   if exist('R2')
      clf
      set(gcf,'name','Buoy - Schlitz Top')
      subplot(511)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.TMPMID)
      shading('interp')
      title('North Schlitz Mooring Position','FontSize',16)
      set(gca,'XTickLabel',[])
      h=colorbar;axes(h);ylabel('T')

      subplot(512)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.SALMID)
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('S')

      subplot(513)
      pcolor(R2.t-R2.t(1),R2.ZMID,log10(R2.Q2MID))
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('log_{10}(Q2)')

      subplot(514)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.UZMID)
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('U')

      subplot(515)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.VZMID)
      shading('interp')
      xlabel('Forecast Time (days)')
      h=colorbar;axes(h);ylabel('V')
   else
      clf
      title('North Schlitz Mooring Position','FontSize',16)
      axis([-1 1 -1 1])
      text(0,0,'NO PLOT','HorizontalAlignment','center')
   end
   output_image('html/ts1')
   clear R2


   % BOTTOM SCHLITZ BUOY AT (67.233W,41.047N)
   R2=timeribbon(D,fem_grid_struct,BuoyLoc(2,1),...
	   BuoyLoc(2,2),...
	   buoytime);

   if exist('R2')
      clf
      set(gcf,'name','Buoy - Schlitz Bottom')

      subplot(511)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.TMPMID)
      shading('interp')
      title('South Schlitz Mooring Position','FontSize',16)
      set(gca,'XTickLabel',[])
      h=colorbar;axes(h);ylabel('T')

      subplot(512)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.SALMID)
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('S')

      subplot(513)
      pcolor(R2.t-R2.t(1),R2.ZMID,log10(R2.Q2MID))
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('log_{10}(Q2)')

      subplot(514)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.UZMID)
      set(gca,'XTickLabel',[])
      shading('interp')
      h=colorbar;axes(h);ylabel('U')

      subplot(515)
      pcolor(R2.t-R2.t(1),R2.ZMID,R2.VZMID)
      shading('interp')
      xlabel('Forecast Time (days)')
      h=colorbar;axes(h);ylabel('V')

   else
      clf
      text(0,0,'NO PLOT','HorizontalAlignment','center')
      title('South Schlitz Mooring Position','FontSize',16)
      axis([-1 1 -1 1])
   end
   output_image('html/ts2')
else
   clf
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   title('South Schlitz Mooring Position','FontSize',16)
   axis([-1 1 -1 1])
   output_image('html/ts2')

   clf
   title('South Schlitz Mooring Position','FontSize',16)
   text(0,0,'NO PLOT','HorizontalAlignment','center')
   axis([-1 1 -1 1])
   output_image('html/ts1')

end

%echo off
diary off
****************************END ALL************************************
