Index: /issm/trunk/test/Miscellaneous/Bump/DomainOutline.exp
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/DomainOutline.exp	(revision 1144)
+++ /issm/trunk/test/Miscellaneous/Bump/DomainOutline.exp	(revision 1144)
@@ -0,0 +1,10 @@
+## Name:domainoutline
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/test/Miscellaneous/Bump/Square.par
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/Square.par	(revision 1144)
+++ /issm/trunk/test/Miscellaneous/Bump/Square.par	(revision 1144)
@@ -0,0 +1,47 @@
+%Start defining model parameters here
+
+%dynamics
+md.dt=0.1*md.yts; %1 year
+md.ndt=md.dt*3; 
+md.artificial_diffusivity=1;
+
+hmin=500;
+hmax=500;
+ymin=min(md.y);
+ymax=max(md.y);
+md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
+pos=find(sqrt((md.x-500000).^2+(md.y-500000).^2)<4000);
+md.bed=-md.rho_ice/md.rho_water*md.thickness;
+md.surface=md.bed+md.thickness;
+md.bed(pos)=md.bed(pos)+20*cos(pi/(2*2000)*sqrt((md.x(pos)-500000).^2+(md.y(pos)-500000)));
+md.thickness=md.surface-md.bed;
+
+md.drag_type=2; %0 none 1 plastic 2 viscous
+md.drag=50*ones(md.numberofgrids,1); %q=1.
+%Take care of iceshelves: no basal drag
+pos=find(md.elementoniceshelf);
+md.drag(md.elements(pos,:))=0;
+md.p=ones(md.numberofelements,1);
+md.q=ones(md.numberofelements,1);
+
+md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
+
+md.B=paterson(md.observed_temperature);
+md.n=3*ones(md.numberofelements,1);
+
+%Deal with boundary conditions:
+md=SetIceSheetBC(md);
+md.dirichletvalues_diag=ones(md.numberofgrids,1)*[0 200];
+
+%Parallel options
+md.cluster='wilkes';
+md.np=8;
+md.time=50;
+md.waitonlock=1;
+md.connectivity=100;
+
+%Control method options
+md.nsteps=10;
+md.fit=[2*ones(5,1);0*ones(5,1)];
+md.optscal=100*ones(md.nsteps,1);
+md.maxiter=20*ones(md.nsteps,1);
Index: /issm/trunk/test/Miscellaneous/Bump/runme.m
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/runme.m	(revision 1144)
+++ /issm/trunk/test/Miscellaneous/Bump/runme.m	(revision 1144)
@@ -0,0 +1,60 @@
+%Test of a bump
+
+%initialize model with Stokes model
+md=model;
+md=mesh(md,'DomainOutline.exp',20000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md=extrude(md,8,4);
+md.pressure=zeros(md.numberofgrids,1);
+md.vx=zeros(md.numberofgrids,1);
+md.vy=zeros(md.numberofgrids,1);
+md.vz=zeros(md.numberofgrids,1);
+md=setelementstype(md,'pattyn','all','stokes','all');
+
+%compute solution
+md=solve(md,'analysis_type','diagnostic');
+
+%save model stokes
+mds=md;
+save modelstokes mds
+
+%now run a control method on macayeal
+md=model;
+md=mesh(md,'DomainOutline.exp',20000);
+md=geography(md,'','');
+md=parameterize(md,'Square.par');
+md.pressure=zeros(md.numberofgrids,1);
+md.vx=zeros(md.numberofgrids,1);
+md.vy=zeros(md.numberofgrids,1);
+md.vz=zeros(md.numberofgrids,1);
+md=setelementstype(md,'macayeal','all');
+
+%Initialize the CM with average value of vx and vy
+md.vx_obs=DepthAverage(mds,mds.results.diagnostic.vx);
+md.vy_obs=DepthAverage(mds,mds.results.diagnostic.vy);
+md.vel_obs=DepthAverage(mds,mds.results.diagnostic.vel);
+md.drag=30*ones(md.numberofgrids,1);
+
+%Compute the CM
+md=solve(md,'analysis_type','control')
+
+%%now run a control method on pattyn
+%md=model;
+%md=mesh(md,'DomainOutline.exp',20000);
+%md=geography(md,'','');
+%md=parameterize(md,'Square.par');
+%md=extrude(md,8,4);
+%md.pressure=zeros(md.numberofgrids,1);
+%md.vx=zeros(md.numberofgrids,1);
+%md.vy=zeros(md.numberofgrids,1);
+%md.vz=zeros(md.numberofgrids,1);
+%md=setelementstype(md,'pattyn','all');
+%
+%%Initialize the CM
+%md.vx_obs=mds.results.diagnostic.vx;
+%md.vy_obs=mds.results.diagnostic.vy;
+%md.vel_obs=mds.results.diagnostic.vel;
+%
+%%Compute the CM
+%md=solve(md,'analysis_type','control')
Index: /issm/trunk/test/Miscellaneous/Bump/updatearchive.m
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/updatearchive.m	(revision 1144)
+++ /issm/trunk/test/Miscellaneous/Bump/updatearchive.m	(revision 1144)
@@ -0,0 +1,84 @@
+function varargout=updatearchive(varargin)
+%updatearchive - test deck for ISSM nightly runs
+%
+%   Usage:
+%      varargout=updatearchive(varargin);
+%
+%   Examples:
+%      updatearchive;
+%      updatearchive({'ice'});
+%      updatearchive({'ice','cielo_serial'},{'diagnostic'});
+%      md=updatearchive({'cielo_parallel'});
+%
+%   See also: RUNME
+
+% This file can be run to update the velocity archives  of the test1.
+% This test deals with an icesheet with icefront for a 3d model. The geometry 
+% is square. Just run this file in Matlab, with a properly setup Ice code. 
+
+% The archive files will be saved in this directory but will not commited to ice1. 
+% Just commit the result if you want to.
+
+%check arguments
+if (nargin>2 | nargout>1)
+	help updatearchive
+	error('updatearchive error message: bad usage');
+end
+
+%packages and analysis_types to be tested
+if nargin==2,
+	solutions=varargin{2};
+else
+	solutions={'diagnostic','thermalsteady','thermaltransient','prognostic','transient'};
+end
+if nargin,
+	packages=varargin{1};
+else
+	packages={'macayeal','ice','cielo_serial','cielo_parallel'};
+end
+
+%go through the solutions requested
+testname='IceShelfIceFrontP3d_5';
+for i=1:length(packages),
+	package=packages{i};
+
+	for j=1:length(solutions),
+		solution=solutions{j};
+
+		%check solution requested
+		if strcmpi(package,'macayeal');
+			disp(sprintf(['\nsolution: ' solution  ', with package: ' package  ', in test: ' testname  ', not supported yet.\n']));
+			continue
+		end
+
+		%initialize model
+		md=model;
+		md=mesh(md,'DomainOutline.exp',100000);
+		md=geography(md,'all','');
+		md=parameterize(md,'Square.par');
+		md=extrude(md,8,4);
+		md=setelementstype(md,'pattyn','all');
+		if md.numberofgrids==832
+			load Velocities; md.vx=0.8*vx; md.vy=0.8*vy; md.vz=0.8*vz; md.temperature=temperature-1; md.pressure=pressure;
+		end
+
+		%compute solution
+		[analysis_type sub_analysis_type]=testsgetanalysis(solution);
+		[md packagefinal]=testsgetpackage(md,package);
+		if ~testschecksolution(md.type,solution), continue; end
+		md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal);
+
+		%compute fields to be checked
+		fields=testsgetfields(md.type,solution);
+
+		%save new archive
+		for k=1:length(fields),
+			field=fields{k};
+			eval(['Archive' package solution '_field' num2str(k) '=md.results. ' field  ';']);
+		end
+		eval(['save Archive' package solution ' Archive' package solution '_field*']);
+	end
+end
+if nargout==1, 
+	varargout{1}=md; 
+end
