Index: /issm/trunk/test/Miscellaneous/Bump/Bump.par
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/Bump.par	(revision 2897)
+++ /issm/trunk/test/Miscellaneous/Bump/Bump.par	(revision 2898)
@@ -5,4 +5,5 @@
 
 %dynamics
+md.debug=2;
 md.dt=0.1*md.yts; %1 year
 md.ndt=md.dt*3; 
@@ -14,10 +15,11 @@
 ymax=max(md.y);
 md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
-md.bed=-md.rho_ice/md.rho_water*md.thickness+height*exp(-((md.x-50000).^2+(md.y-50000).^2)/(2000)^2);
+md.bed=-md.rho_ice/md.rho_water*md.thickness+10;
 md.surface=md.bed+md.thickness;
+md.bed=-md.rho_ice/md.rho_water*md.thickness+height*exp(-((md.x-50000).^2+(md.y-50000).^2)/(2000)^2)+10;
 md.thickness=md.surface-md.bed;
 
 md.drag_type=2; %0 none 1 plastic 2 viscous
-md.drag=20*ones(md.numberofgrids,1); %q=1.
+md.drag=30*ones(md.numberofgrids,1); %q=1.
 %Take care of iceshelves: no basal drag
 pos=find(md.elementoniceshelf);
@@ -33,8 +35,9 @@
 %Deal with boundary conditions:
 md=SetIceSheetBC(md);
-md.dirichletvalues_diag=ones(md.numberofgrids,1)*[0 200];
+md.spcvelocity(:,4)=zeros(md.numberofgrids,1);
+md.spcvelocity(:,5)=200*ones(md.numberofgrids,1);
 
 %Parallel options
-md.cluster='wilkes';
+md.cluster='larsen';
 md.np=8;
 md.time=50;
Index: /issm/trunk/test/Miscellaneous/Bump/runme.m
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/runme.m	(revision 2897)
+++ /issm/trunk/test/Miscellaneous/Bump/runme.m	(revision 2898)
@@ -1,3 +1,6 @@
 %Test of a bump
+
+loadmodel diagstokes
+mdc=mds;
 
 %initialize model with Stokes model
@@ -7,5 +10,4 @@
 md=geography(md,'','');
 md=parameterize(md,'Bump.par');
-md.drag=50*ones(md.numberofgrids,1);
 md=extrude(md,8,4);
 md.pressure=zeros(md.numberofgrids,1);
@@ -15,10 +17,30 @@
 md=setelementstype(md,'pattyn','all','stokes','all');
 
+%Initialize the CM with average value of vx and vy
+md.vx_obs=mdc.results.diagnostic.vx;
+md.vy_obs=mdc.results.diagnostic.vy;
+md.vel_obs=mdc.results.diagnostic.vel;
+
+md.nsteps=5;
+md.fit=2*ones(5,1);
+md.optscal=1000*ones(5,1);
+md.maxiter=20*ones(5,1);
 %compute solution
-md=solve(md,'analysis_type','diagnostic');
+md=solve(md,'analysis_type','control');
+
+save step1 md
+md.drag=md.results.control.parameter;
+
+md=solve(md,'analysis_type','control');
+save step2 md
+
+md.drag=md.results.control.parameter;
+md.fit=0*md.fit;
+save step3 md
 
 %save model stokes
 mds=md;
 save modelstokes mds
+error
 
 %now run a control method on macayeal
@@ -35,8 +57,7 @@
 
 %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);
+md.vx_obs=DepthAverage(mdc,mdc.results.diagnostic.vx);
+md.vy_obs=DepthAverage(mdc,mdc.results.diagnostic.vy);
+md.vel_obs=DepthAverage(mdc,mdc.results.diagnostic.vel);
 
 %Compute the CM
@@ -61,7 +82,7 @@
 
 %Initialize the CM
-md.vx_obs=mds.results.diagnostic.vx;
-md.vy_obs=mds.results.diagnostic.vy;
-md.vel_obs=mds.results.diagnostic.vel;
+md.vx_obs=mdc.results.diagnostic.vx;
+md.vy_obs=mdc.results.diagnostic.vy;
+md.vel_obs=mdc.results.diagnostic.vel;
 
 %Compute the CM
