function [bathy]=bumpcos(meshnod,dep,hh,hl,hs,hw)
% TWO COSINE BUMPS
% [bathy]=bumpcos(meshnod,dep,hh,hl,hs,hw);
% Test it with:
%  plot3(meshnod(:,2),meshnod(:,3),-bathy(:,2),'o'); axis('equal')   
%
% For bathymetry 
%      dep is depth of outer plane, 
%      hh is depth of bump 
%     dep = 10, hh = 9 will give a bump which is 9 deep on its top.
% [bathy]=bumpcos(meshnod,depth,humpheight,humplength,humpspace,humpwidth);
% For drag coefficient 
%     cdd is drag coefficient on outer plane
%     cddbump is drag coefficient of mid point of bump
% [meshcd]=bumpcos(meshnod,cdd,cddbump,humplength,humpspace,humpwidth);

humplength = 12000;
humpheight = 10;
depth = 20;
humpspace =6000;
humpwidth = 3000;


depth = dep;
humpheight = hh;
humplength = hl;
humpspace = hs;
humpwidth = hw;

humpheight = depth - hh;
% TWO COSINE BUMPS

x = meshnod(:,2)-mean(meshnod(:,2));
y = meshnod(:,3)-mean(meshnod(:,3)); 
bathy = meshnod(:,1:2);

bathy(:,2) = depth*ones(length(bathy(:,2)),1);
r = sqrt((x-humpspace/2).^2+(y-humplength/2).^2);
l = find(r<humpwidth & y>humplength/2);
bathy(l,2) = bathy(l,2) - humpheight*(.5*(cos(pi*r(l)/humpwidth)+1));
r = sqrt((x-humpspace/2).^2+(y+humplength/2).^2);
l = find(r<humpwidth & y<-humplength/2);
bathy(l,2) = bathy(l,2) - humpheight*(.5*(cos(pi*r(l)/humpwidth)+1));

l = find( (x-humpspace/2)/humpwidth>-1 & (x-humpspace/2)/humpwidth<1 ...
  & y>-humplength/2 & y<humplength/2);
bathy(l,2)=bathy(l,2)- humpheight*(.5*(cos(pi*(x(l)-humpspace/2)/humpwidth)+1));

r = sqrt((x+humpspace/2).^2+(y-humplength/2).^2);
l = find(r<humpwidth & y>humplength/2);
bathy(l,2) =  bathy(l,2) - humpheight*(.5*(cos(pi*r(l)/humpwidth)+1));
r = sqrt((x+humpspace/2).^2+(y+humplength/2).^2);
l = find(r<humpwidth & y<-humplength/2);
bathy(l,2) =  bathy(l,2) - humpheight*(.5*(cos(pi*r(l)/humpwidth)+1));

l = find( (x+humpspace/2)/humpwidth>-1 & (x+humpspace/2)/humpwidth<1 ...
  & y>-humplength/2 & y<humplength/2);
bathy(l,2)=bathy(l,2)- humpheight*(.5*(cos(pi*(x(l)+humpspace/2)/humpwidth)+1));

% COSINE BUMPS
%end
