function [url,loaddodsbool,infotext] = gbnfwsu ...
         (getarchive, getranges, getmode, getvariablelist, getserverlist, passtimes, passdepths, whichurl)
%
%    This function will build gbnfws file names and return infotext and time/lat/lon/url
%    to the browser
%

% The preceding empty line is important
% $Log: gbnfwsu.m,v $
% Revision 1.5  1999/07/20 15:11:45  dbyrne
%
%
% Fixed spaces in message.  dbyrne 99/07/20
%
% Revision 1.4  1999/07/13 14:46:04  kwoklin
% Use getnfws for gbnfws. Fix empty lat/lon return in gbnfwsc. Coded lat/lon
% display in getnfws.   klee
%
% Revision 1.2  1999/06/01 16:12:37  dbyrne
%
%
% quick bug fixes for AGU -- dbyrne 99/06/01
%
% Revision 1.1  1999/06/01 07:10:32  dbyrne
%
%
% Moved up from kleedata/
%
% Revision 1.3  1999/05/28 22:53:05  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: gbnfwsu.m,v 1.5 1999/07/20 15:11:45 dbyrne Exp $
% klee 04/01/99

if exist(getarchive) == 2   
  eval(getarchive)
else
  dodsmsg('Metadata not found!')
  return
end

url = []; infotext = []; text = []; Constraint = []; loaddodsbool = 1;

StartYear = passtimes(whichurl,1);
StartYrday = passtimes(whichurl,2);
EndYrday = passtimes(whichurl,3);
Constraint = [Constraint, '&',deblank(DodsName1(1,:)),'=',num2str(StartYear,9),'&',deblank(DodsName1(2,:)),'>=',...
                          num2str(StartYrday,9),'&',deblank(DodsName1(2,:)),'<=', num2str(EndYrday,9)];

returned_var = [];
for i = 1:size(getvariablelist,1)
  if ~strcmp(deblank(getvariablelist(i,:)), 'Latitude') & ~strcmp(deblank(getvariablelist(i,:)), 'Longitude')
    returned_var = [returned_var, dods_dbk(getvariablelist(i,:))];  
    if i < size(getvariablelist,1)
      returned_var = [returned_var, ','];
    end
  else
    returned_var = [returned_var, ''];
  end
end

url = [Server, '?', returned_var, Constraint];

tmpvar = ['?mooring,year,yrday0_gmt,'];
tmptext = ['loaddods ''', Server, tmpvar, Constraint, ''''];

infotext = sprintf('%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n',...
                  [ '"Mooring" station is stored as a character ',...
		    'variable. Searches on character variables ',...
                  'are not supported by this version of the DODS Matlab GUI.',...
                  '   ',...
                  '** To get Mooring Station information ** ',...
                  'please issue the ''loaddods'' command from the MATLAB prompt line, using a URL like this:',...
                  '   '], ...
                  ['URL = ',Server], ...
                  ['Proj = ',tmpvar] ,...
                  ['Sel = ',Constraint], ...
                  ['   '],...
                  ['Mooring station location corresponds to the following lat/lon coordinate:'],...
                  ['   '],...
                  ['Mooring          Latitude         Longitude'],...
                  ['Ntls                40.50            -69.40'],...
                  ['st1                 40.87            -67.56'],...
                  ['44003               40.80            -68.50'],...
                  ['44005               42.90            -68.90'],...
                  ['44008               40.50            -69.40'],...
                  ['440011              41.10            -66.60'],...
                  ['   '],...
                  ['They will return a set of date, depth and cruiseid vectors corresponding to each other.']);

return
  

  
