%get all the cdf group names for each moored location
%
do_names2

%the whole thing
start=[1989 12 5 19 0 0];
stop=[1991 9 14 23 0 0];
%
%  each one of the cdf_groups is a text matrix containing the 
%  names of the cdf files that make up this group
%
cdf_groups=[
'broad_5   '
'broad_18  '
'lnb_5     '
'lnb_23    '
'lnb_33    '
'race_5    '
'race_23   '
'race_55   '
'race_60   '
'stell_75  '
'stell_84  '
'mano_5    '
'mano_29   '
'scit_5    '
'scit_23   '
'u6_8      '
'u6_28     '
'u6_72     '
'u3_4      '
'u3_25     '
'u2_4      '
'u2_25     '
'u2_60     '
'u7_4      '
'u7_25     '
];
[m,n]=size(cdf_groups);
%
% merge the files of each group together
%
for i=1:m
  cdf_groups(i,:)
  group=eval(cdf_groups(i,:)) 
  [w(:,i),jd]=merge(group,start,stop);
  cdf_names(i,:)=group(1,:);
end
%get lat, lon, inst_depth, water_depth
getaux
ll=lon';
ll(:,2)=lat';
lonlat=ll;
%
% wind
cdfwind='logantau-a.cdf';
logan_str=getwind(cdfwind,start,stop);
%wind_ll=getll(cdfwind);  %get lon lat
%
% runoff
cdfrun='runoff.cdf';
getrunoff(cdfrun,start,stop);
%run_ll=getll(cdfrun);
run_ll=[-70.8359 42.7993];   % make Merrimack river lon lat closer to mouth 
%
% get rid of bad data
% U2 25 m  8-27-90  1-17-91
w(6342:9774,22)=w(6342:9774,22)*NaN;
%
% u2 60 m  11-15-91 1-27-91
w(8262:10014,23)=w(8262:10014,23)*NaN;
% u3  4 m  10-31-91 2-9-91
w(7902:10326 ,19)=w(7902:10326,19)*NaN;
%
% removes all speed values above 200 cm/s
vthumb

