function [URL] = gmup1u(archive, pass_times, StartColumn, ...
    EndColumn, StartRow, EndRow, dset_stride, ranges, variablelist, server)
%
% This function will build the South American Precipitation url.
%

% The preceeding blank line is important for cvs.
% $Id: gmup1u.m,v 1.1 1999/05/21 16:54:40 paul Exp $
%

% $Log: gmup1u.m,v $
% Revision 1.1  1999/05/21 16:54:40  paul
% Initial version...phemenway
%

global urlmat
global dodsdates

% set up the variables to get the longitudes and latitudes from the
%   array locations
Nlat=75;
Nlon=55;
Constraint=[];


%find the indices of pass_times (yyyy ddd) that match DODS_Dates from
%      the Cat_m_File.
[indx1,indx2]=find(pass_times(1)==dodsdates(:,1)&pass_times(2)==dodsdates(:,2));

% we should have only one set of indices out of this.
%  pick the first indicated url:

url=urlmat(indx1(1),:);

for i = 1:size(variablelist,1)

  if i > 1
    Constraint = [Constraint ','];
  end


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

%
URL = [url '?' Constraint];


return;

