function [url,loaddodsbool,infotext] = gbdriftu ...
         (getarchive, getranges, getmode, getvariablelist, getserverlist, passtimes, passdepths, whichurl)
%
%    This function will build gbdrift file name and return infotext to the browser
%

% The preceding empty line is important
% $Log: gbdriftu.m,v $
% Revision 1.2  1999/06/24 19:05:00  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:29  dbyrne
%
%
% Moved up from kleedata/
%
% Revision 1.3  1999/05/28 22:53:04  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: gbdriftu.m,v 1.2 1999/06/24 19:05:00 kwoklin Exp $
% klee 04/01/99

if exist(getarchive) == 2   
  eval(getarchive)
else
  dodsmsg('Metadata not found!')
  return
end
 
url = []; infotext = []; text = []; Constraint = []; loaddodsbool = 1;
URLdepth = []; URLlat = []; URLlon = [];
dayname = deblank(DodsName1(1,:));
Yearstring = str2mat('1995','1996');

URLlat = ['&',LatitudeName,'>=',num2str(passtimes(whichurl,3),4),'&',LatitudeName,'<=',...
          num2str(passtimes(whichurl,4),4)];
% for [-180, 180]  
URLlon = ['&',LongitudeName,'>=',num2str(passtimes(whichurl,5),4),'&',LongitudeName,'<=',...
          num2str(passtimes(whichurl,6),4)];
Constraint = [Constraint, URLlat, URLlon]; 

StartYrday = passtimes(whichurl,1);
EndYrday = passtimes(whichurl,2);
year = passtimes(whichurl,7);
Constraint = [Constraint, '&',dayname,'>=', num2str(StartYrday,7), ...
                          '&',dayname,'<=', num2str(EndYrday,7)];

returned_var = [];
for i = 1:size(getvariablelist,1)
  returned_var = [returned_var, dods_dbk(getvariablelist(i,:))];  
  if i < size(getvariablelist,1)
    returned_var = [returned_var, ','];
  end
end

returned_var = [returned_var, ',', deblank(OptionalVariables(1,:)), ',', deblank(OptionalVariables(2,:)),...
                ',', deblank(OptionalVariables(3,:))];
%server = [Server, deblank(Yearstring(bool+1,:))];
server = [Server, num2str(year)];
url = [server, '?', returned_var, Constraint];            

return

  

  

  
