function [URL] = uriclurl(archive, pass_times, StartColumn, ...
    EndColumn, StartRow, EndRow, dset_stride, ranges, variable, server)
%
%   This function will build the Pathfinder Eroded climatology sst file name.
%

% The preceding empty line is important.
%
% $Id: uriclurl.m,v 1.7 1998/11/09 20:26:57 dbyrne Exp $

% $Log: uriclurl.m,v $
% Revision 1.7  1998/11/09 20:26:57  dbyrne
% *** empty log message ***
%
% Revision 1.4  1998/11/05 16:01:56  root
% Changed LonVector and LatVector to be used if no Lon returned and tried the update function.
% DataScale and DataNull should now be optional!
%
% Revision 1.5  1998/09/13 21:31:19  dbyrne
% Updated to elminate global variables and add multivariables.
%
% Revision 1.3  1998/09/09 15:04:31  dbyrne
% Eliminating all global variables.
%
% Revision 1.2  1998/09/09 10:02:51  dbyrne
% changed internal function name to match filename.
%
% Revision 1.1  1998/05/17 14:18:13  dbyrne
% *** empty log message ***
%
% Revision 1.4  1997/10/09 22:05:59  jimg
% Merged changes from 2.14c
%
% Revision 1.3  1997/10/04 00:33:32  jimg
% Release 2.14c fixes
%
% Revision 1.2  1997/10/02 14:21:32  tom
% added omitted file extension
%
% Revision 1.1.1.1  1997/09/22 14:13:55  tom
% Imported Matlab GUI sources to CVS
%

variable = deblank(variable);
server = deblank(server);
year = pass_times(1);
yearday = pass_times(2);

if rem(year,4) ~= 0 | year == 1900
   MonthFirstDay = [1 32 60 91 121 152 182 213 244 274 305 335 400];
else
   MonthFirstDay = [1 32 61 92 122 153 183 214 245 275 306 336 400];
end

iMonth = 0;
while MonthFirstDay(iMonth+1) <= yearday
   iMonth = iMonth + 1;
end

% Got the month now the constraint.

ImgName = sprintf('%s%2.2i.avg', server, iMonth);

Constraint = sprintf('%s', variable,'[', ...
      num2str(StartRow), ':', num2str(dset_stride), ':', num2str(EndRow),'][', ...
      num2str(StartColumn), ':', num2str(dset_stride), ':',...
      num2str(EndColumn), ']');

URL = sprintf('%s', ImgName, '?', Constraint);

%TemporaryTime = iMonth;

return
