%
%  GLOBEC  Broadscale Cruises CTD Data

% The preceding empty line is important
% $Log: gbbdctd.m,v $
% Revision 1.4  2000/02/24 19:53:52  kwoklin
% Recommit for previous changes.     klee
%
% Revision 1.3  1999/10/27 22:18:21  dbyrne
% *** empty log message ***
%
% Revision 1.2  1999/10/27 22:10:39  root
% Fixed many spelling and grammatical errors in comment fields.
%
% Revision 1.1  1999/09/02 18:33:05  root
% *** empty log message ***
%
% Revision 1.2  1999/06/24 19:04:59  kwoklin
% Change file name of nbnerr.m. Fix some display bugs, define precision level
% of lat/lon/depth/time, and fix some more bugs in globec files.        klee
%
% Revision 1.1  1999/06/01 07:10:28  dbyrne
%
%
% Moved up from kleedata/
%
% Revision 1.3  1999/05/28 22:53:03  kwoklin
% Point to new server for all jgofs datasets. Update getjgsta on loaddods.
% Fix infotext for all gb geturl files. Fix transmissivity for some gb
% files. Modify some variable names on gb files.       klee
%

% $Id: gbbdctd.m,v 1.4 2000/02/24 19:53:52 kwoklin Exp $
%  klee 04/99

GetFunctionName = 'getjgsta';

Server = 'http://maewest.gso.uri.edu/cgi-bin/nph-jg/broad'; %add year afterwards
CatalogServer = nan;
Cat_m_File = 'gbbdctdc';
URL_m_File = 'gbbdctdu';

LonRange = [-69.5 -65]; 
LatRange = [40.0 42.5];   
TimeRange = [1995.11598164 2000];
DepthRange = [0.0 310];  
Resolution = nan;

DodsName1 = str2mat('year','yrday_gmt','press','lat','lon');
DodsName = str2mat('temp_ctd','sal_ctd','flvolt','cast','station','station_std');
DataName = 'Water Column - Broadscale Cruises CTD - NMFS/GLOBEC ';    
LongitudeName = 'lon';
LatitudeName = 'lat';
TimeName = str2mat('year','yrday_gmt');         
DepthName = 'press';
DepthUnits = 'Meters';
SelectableVariables = str2mat('Sea_Temp','Salinity','Fluorescence');
%TextField = str2mat('EN261','EN263','EN265','EN276','EN278','EN282','EN320','AL9505','AL9506','AL9508',...
%                    'AL9605','AL9607','AL9701','AL9705','AL9707','AL9801','AL9806','AL9808','AL9901',...
%                    'OC275','OC298','OC300','OC302','OC317','OC319','OC322','OC336');
OptionalVariables = str2mat('depth_w');
SelectableOptional = str2mat('Depth_Water');

DataNull = [nan nan nan nan 99.9999 99.9999 nan nan nan nan nan];

Acknowledge = [];
Data_Use_Policy = sprintf('%s' ,...
      'Any person making substantial use of a data set must communicate with the investigators who acquired the data prior to publication and anticipate that the data collectors will be co-authors of published results. This extends to model results and to data organized for retrospective studies. (Please refer to U.S. GLOBEC''s data policy Report #10 (http://cbl.umces.edu/fogarty/usglobec/reports/datapol/ datapol.contents.html).) The data available here are intended for scholarly use by the academic and scientific community, with the express understanding that any such use will properly acknowledge the originating investigator. Use or reproduction of any material herein for any commercial purpose is prohibited without prior written permission from the U.S. GLOBEC Georges Bank Data Management Office. (http://globec.whoi.edu/globec-dir/contact_dmo.html)');

%COMMENTS
Comments1 = sprintf('%s\n', ...
'                                GLOBEC Broadscale Cruises CTD Data      ',...
'   *** Newly acquired data should always be considered preliminary. If you encounter any ***',...
'   *** questionable values please contact M. Taylor, at 508/548-5123 (NMFS/Woods Hole).  ***',...
'   ',...
'                   Parameter         Description                               Units',...
'                 --------------------------------------------------------------------',...
'   ',...
'                   year              2-digit year (92,93,94,or 95)             year',...
'                   ship              1st letter in ship name                   character',...
'                   inst              "mkvctd"(nbrown) or "BongoSB" (seabird)   code',...
'                   si                1st initial & last name (dmountain)       character',...
'                   eventno           event number  (en263.001)                 nd',...
'                   gyd_range         gmt yearday range for particular event    decimayd:decyd',...
'                   lyd_range         local yearday range for particular event  decimayd:decyd',...
'                   lon_range         longtitude range for particular event     decdeg:decdeg',...
'                   lat_range         lattitude range for particular event      decdeg:decdeg',...
'                   CTD_range         range of CTD cast #''s in event            cast#:cast#',...
'                   sd_range          max sample depth range for  event         meters:meters',...
'                   site              designated site (Broadscale)              text descript.',...
'                   comments          comments                                  text descript.',...
'                   yrday_gmt         gmt yearday                               decimal yd',...
'                   yrday_local       local yearday                             local yd',...
'                   cast              cast #                                    integer',...
'                   station           consecutive station occupied              integer',...
'                   station_std       standard station occupied                 integer ',...
'                   lon               longitude                                 decimal degrees',...
'                   lat               latitude                                  decimal degrees',...
'                   press             pressure  (ctd)                           meters',...
'                   temp_ctd          temperature (ctd)                         degC',...
'                   sal_ctd           salinity  (ctd)                           PSU',...
'                   flvolt            fluorescence (mkvctd only)                volts',...
'                   depth_w           water depth                               meters',...
'                   nobs              # observations per bin                    integer',...
'                   light_tran        light transmission (mkvctd)               volts',...
'  ',...
' Note: Seabird ctd casts do not contain fluorescence data or Transmissometer data',...
'       casts numbered > 100 are seabird casts',...
'       the primary data for Endeavor cruise contains both MK5 and seabird data',...
'       the primary data for oc275 is from the seabird ctd due to damage to the MK5',...
'       * "Primary" data refer to ALL of the CTD data collected during a cruise (MK5/SB911 at standard ',...
'         stations, seabird at the intermediate bongo stations) * ',...
'  ',...
'  ');

Comments2 = sprintf('%s\n', ...
'Procedure for processing primary CTD data ',...
'  ',...
'The following is an outline of the methods used to process the "primary" CTD data from the 1995 Broad',...
'scale surveys. ',...
' ',...
'  1.Upon completion of each broad scale cruise, preliminary processing of the MK5 data was carried out: ',...
'       1."first differencing" (called from within CTDPOST) of the Raw cast files was completed. This',...
'         program flags any data where the difference between sequential scans exceed some preset limit. ',...
'  ',...
'       2."smart editor" used to interpolate over any flagged values from "first differencing"',...
'  ',...
'       3.ENDCAST XXX (a dos batch routine where xxx=cast#) runs MK5PROC.EXE which creates',...
'         pressure averaged, pressure centered 1 db files (.PRE files). These routines (pressure',... 
'         averaging and pressure centering) were developed by Bob Millard at WHOI and were modified ',...
'         for the Mk5. "ENDCAST" also updates a cruise header file, and backs up the data to floppy) ',...
'  ',...
'       4.CTDPLOT (visual basic program by David Mountain) was run at each station to plot out the',...
'         cast profile and to visually inspect the data.',...
'  ',...
'       5.MK5BOT.EXE This routine (again, developed by Bob Millard) extracts and averages 30 data',...
'         scans around the data scan number (as identified in the cast .BTL file) at which bottles were',...
'         fired during a cast and appends to a cruise bottle file. These files were reviewed after each ',...
'         cruise to ensure that each btl fired had a corresponding observation record in the btl file. ',...
'         If we forgot to record a btl fired (forgot to press [CTRL] F3), we used an observation from ',...
'         the .PRE files.',...
'  ',...
'  2.Salinity samples (btm) collected on each cruise were analyzed on a guildline autosal ',...
'         tstslt.bas was used to compare the cruise btl file with the autosal output file ',...
'         mk5xxxx.m (where xxxx=4 digit cruise id) was used to calculate the mean conductivity offset ',...
'       1.any single comparison that was greater than -0.1 or +0.1 was ignored. ',...
'       2.the mean offset and standard deviation (std) were calculated ',...
'       3.any single comparison that was greater than +/- 2 std''s was discarded as an outlier ',...
'       4.the mean and std were re-calculated ',...
'       5.The offset series for each cruise were inspected to insure that a time dependant trend was not',...
'         evident and that using a mean offset was appropriate.',...
'  ',...
'  3.The mean conductivity offsets were applied to each cruise data set using MK5final.bas. MK5cru.fin');

Comments3 = sprintf('%s\n', ...
'     was read in as input containing the necessary information for cruise id, directory, and most',...
'     importantly conductivity offset. The output was pressure averaged, pressure centerred .PRS files.',... 
'  ',...
'         During EN261 and ALB9506, seabird data was used to supplement for primary hydro data when',...
'         there were problems with the MK5 (or winch). Seabird CTD data were processed to pressure',...
'         averaged, 1 db files using the manufacturer''s software DATCNV, ALIGNCTD, BINAVG,',...
'         DERIVE, and ASCIIOUT. When Seabird data were used as "primary" data, the casts were',...
'         numbered >100. The same steps outlined in 2a)--2e) were followed in the quality controlling of',...
'         the seabird salinity data except that the comparison was done with salinity (rather than',...
'         conductivity). The seabird cast data have also been processed to NODC formatted files and are',...
'         available in this format in a NEFSC anonymous ftp account ftp: ftp/pub/hydro. ',...
'  ',...
'  4.Final data checking was accomplished with a matlab program called dchkXX.m (where xx is the',...
'     cruise code) that did the following: ',...
'  ',...
'       1.read in the cruise .h3 file (output of ENDCRUIS.FOR) and calculated the distance and time',...
'         between consecutive casts and wrote the results to headchk.xx (where xx is the cruise code). ',...
'         Any speed that was >= 10 knots was verified with the original cruise logs and if found in ',...
'         error, was corrected.',...
'  ',...
'       2.read in the cast files and went through a series of allowable "range checking" of T, S, ',...
'         Sigma-t, and fluorescence. Profiles of these 4 parameters are plotted to the screen for visual',... 
'         inspection.',...
'  ',...                                 
'                                 RANGES',...
'                            0 <--- T ---> 25',...
'                           30 <--- S ---> 37',...
'                            0 <--- Fl ---> 5',...
'                        -0.05 <--- ST---> 0.1 ',...
'  ',...
'         The above flagged values were written out to datachk.xx ',...
'  ',...
'** note: in most instances, the positive sigma-t differences were O.K. and occurred when stratifi-',...
'         cation had developed or when the MK5 sampled through strong gradients like the shelf / slope ',...
'         front. However, there were cases of "hysteresis" (sp?) when the MK5 or seabird sampled ',...
'         through sharp t/s gradients. In these instances, I had to delete the records.',...
'  ',...
'** On a number of occasions, there were negative fluorescence values for the sfc observation.',... 
'   (These were also observed in the raw data...A consultant with Sea-tech said that this is probably',... 
'   "noise" associated with its equilibrating when just powered up). For these casts, I looked in the ',...
'   raw data files, and chose a substitute fluorescence value.',...
'  ',...
'The output listing of the flagged observations from "datachk.m" are kept on file (and can be made',...
'available). Any record deletions are noted. ',...
'  ',...
'Prepared by: Maureen Taylor, NMFS/Woods Hole, 2/7/1996 ');

Comments4 = sprintf('%s\n', ...
'   ', ...
'    Time_Period_of_Content = ', ...
'         Beginning_Date: Feb. 11, 1995 (1995.11598164) ', ...
'         Ending_Date:    Jun. 24, 1999 (1999.47955479)', ...
'    Spatial_Domain = ', ...
'         Bounding Coordinates: ', ...
'              West Bounding Coordinate: 69.142 W ', ...
'              East Bounding Coordinate: 65.647 W ', ...
'              South Bounding Coordinate: 40.298 N ', ...
'              North Bounding Coordinate: 42.343 N ', ...
'   ', ...
'    Point_of_Contact = ', ...
'         Address - si: ', ...
'               Maureen Talyor',...
'               NOAA/NMFS',...
'               166 Water Street',...
'               Woods Hole, MA 02543',...
'               Electronic Mail Address:INTERNET > mtaylor@whsun1.wh.whoi.edu',...
'               FAX: 508-495-2258',...
'               --------------------------------',...
'               David Mountain', ...
'               NMFS ',...
'               Woods Hole, MA 02543-1541 ',...
'               USA ', ...
'               Electronic Mail Address:INTERNET > David.Mountain@noaa.gov ',...
'               Fax: 508-495-2258',...
'         Address - globec: ',...
'               Robert Groman',...
'               Swift House MS# 38',...
'               Woods Hole, MA 02543-1127',...
'               USA ',...
'               Electronic Mail Address:INTERNET > rgroman@whoi.edu',...
'               FAX: (508) 457-2169',...
'         Address - dods: ',...
'               Electronic Mail Address:INTERNET > support@unidata.ucar.edu ');

Comments = [Comments1 Comments2 Comments3 Comments4];