Index: /issm/trunk/test/NightlyRun/Id2Name.m
===================================================================
--- /issm/trunk/test/NightlyRun/Id2Name.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/Id2Name.m	(revision 5047)
@@ -145,4 +145,8 @@
 elseif (id==427), name='SquareSheetShelfDiadM3dDakotaMassFluxSerial';
 elseif (id==428), name='SquareSheetShelfDiadM3dDakotaMassFluxParallel';
+elseif (id==429), name='SquareSheetShelfCMDragSteaM3dSerial';
+elseif (id==430), name='SquareSheetShelfCMDragSteaM3dParallel';
+elseif (id==431), name='SquareSheetShelfCMDragSteaP3dSerial';
+elseif (id==432), name='SquareSheetShelfCMDragSteaP3dParallel';
 elseif (id==501), name='PigDiagM2dSerial';
 elseif (id==502), name='PigDiagM2dParallel';
@@ -165,4 +169,5 @@
 elseif (id==519), name='PigSteaS3dSerial';
 elseif (id==520), name='PigSteaS3dParallel';
+elseif (id==521), name='PigSteaS3dParallel';
 elseif (id==601), name='79NorthProg2dSerial';
 elseif (id==602), name='79NorthProg2dParallel';
Index: /issm/trunk/test/NightlyRun/test429.m
===================================================================
--- /issm/trunk/test/NightlyRun/test429.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test429.m	(revision 5047)
@@ -1,37 +1,23 @@
-md=mesh(model,'../Exp/Square.exp',150000);
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'../Exp/SquareShelf.exp','');
 md=parameterize(md,'../Par/SquareSheetShelf.par');
+md=extrude(md,3,1);
 md=setelementstype(md,'macayeal','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='drag_coefficient';
+md.cm_min=1;
+md.cm_max=200;
+md.nsteps=2;
+md.fit=2*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=3*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.cm_noisedmp=2*10^-7;
+md.dt=0;
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster='none';
-
-%Dakota options
-md.variables.nuv=normal_uncertain.empty();
-md.variables.nuv(end+1)=normal_uncertain('RhoIce',md.rho_ice,0.01);
-md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01);
-
-md.responses=struct();
-md.responses.rf =response_function.empty();
-md.responses.rf (end+1)=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-
-md.qmu_method     =dakota_method('nond_l');
-
-md.qmu_params.direct=true;
-md.qmu_params.analysis_driver='diagnostic';
-md.qmu_params.evaluation_concurrency=1;
-md.qmu_params.interval_type='forward';
-md.qmu_params.tabular_graphics_data=true;
-
-%partitioning
-md.npart=20;
-md=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
-md.part=md.part-1;
-md.qmu_analysis=1;
-
-md.eps_rel=10^-10; %tighten for qmu analyses
-
-%rm existing results
-if exist('./qmu')
-	system('rm -rf qmu/');
-end
-
-md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+md=solve(md,'analysis_type',SteadystateSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test429_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test429_nightly.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test429_nightly.m	(revision 5047)
@@ -1,7 +1,14 @@
-md=tres(md,'dakota');
-md.results.dakota.importancefactors=importancefactors(md,'DragCoefficient','MaxVel')';
-field_names     ={'importancefactors'};
-field_tolerances={1e-11};
+field_names     ={'Gradient' 'Misfits' 'DragCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'MeltingRate'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
-         md.results.dakota.importancefactors,...
-	};
+	PatchToVec(md.results.SteadystateSolution.Gradient),...
+	md.results.SteadystateSolution.J,...
+	PatchToVec(md.results.SteadystateSolution.DragCoefficient),...
+	PatchToVec(md.results.SteadystateSolution.Pressure),...
+	PatchToVec(md.results.SteadystateSolution.Vel),...
+	PatchToVec(md.results.SteadystateSolution.Vx),...
+	PatchToVec(md.results.SteadystateSolution.Vy),...
+	PatchToVec(md.results.SteadystateSolution.Vz),...
+	PatchToVec(md.results.SteadystateSolution.Temperature),...
+	PatchToVec(md.results.SteadystateSolution.MeltingRate)
+};
Index: /issm/trunk/test/NightlyRun/test430.m
===================================================================
--- /issm/trunk/test/NightlyRun/test430.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test430.m	(revision 5047)
@@ -1,37 +1,23 @@
-md=mesh(model,'../Exp/Square.exp',150000);
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'../Exp/SquareShelf.exp','');
 md=parameterize(md,'../Par/SquareSheetShelf.par');
+md=extrude(md,3,1);
 md=setelementstype(md,'macayeal','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='drag_coefficient';
+md.cm_min=1;
+md.cm_max=200;
+md.nsteps=2;
+md.fit=2*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=3*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.cm_noisedmp=2*10^-7;
+md.dt=0;
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster=oshostname();
-
-%Dakota options
-md.variables.nuv=normal_uncertain.empty();
-md.variables.nuv(end+1)=normal_uncertain('RhoIce',md.rho_ice,0.01);
-md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01);
-
-md.responses=struct();
-md.responses.rf =response_function.empty();
-md.responses.rf (end+1)=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-
-md.qmu_method     =dakota_method('nond_l');
-
-md.qmu_params.direct=true;
-md.qmu_params.analysis_driver='diagnostic';
-md.qmu_params.evaluation_concurrency=1;
-md.qmu_params.interval_type='forward';
-md.qmu_params.tabular_graphics_data=true;
-
-%partitioning
-md.npart=20;
-md=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
-md.part=md.part-1;
-md.qmu_analysis=1;
-
-md.eps_rel=10^-10; %tighten for qmu analyses
-
-%rm existing results
-if exist('./qmu')
-	system('rm -rf qmu/');
-end
-
-md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+md=solve(md,'analysis_type',SteadystateSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test430_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test430_nightly.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test430_nightly.m	(revision 5047)
@@ -1,7 +1,14 @@
-md=tres(md,'dakota');
-md.results.dakota.importancefactors=importancefactors(md,'DragCoefficient','MaxVel')';
-field_names     ={'importancefactors'};
-field_tolerances={1e-10};
+field_names     ={'Gradient' 'Misfits' 'DragCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'MeltingRate'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
-         md.results.dakota.importancefactors,...
-	};
+	PatchToVec(md.results.SteadystateSolution.Gradient),...
+	md.results.SteadystateSolution.J,...
+	PatchToVec(md.results.SteadystateSolution.DragCoefficient),...
+	PatchToVec(md.results.SteadystateSolution.Pressure),...
+	PatchToVec(md.results.SteadystateSolution.Vel),...
+	PatchToVec(md.results.SteadystateSolution.Vx),...
+	PatchToVec(md.results.SteadystateSolution.Vy),...
+	PatchToVec(md.results.SteadystateSolution.Vz),...
+	PatchToVec(md.results.SteadystateSolution.Temperature),...
+	PatchToVec(md.results.SteadystateSolution.MeltingRate)
+};
Index: /issm/trunk/test/NightlyRun/test431.m
===================================================================
--- /issm/trunk/test/NightlyRun/test431.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test431.m	(revision 5047)
@@ -1,52 +1,23 @@
-md=mesh(model,'../Exp/Square.exp',150000);
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'../Exp/SquareShelf.exp','');
 md=parameterize(md,'../Par/SquareSheetShelf.par');
-md=setelementstype(md,'macayeal','all');
+md=extrude(md,3,1);
+md=setelementstype(md,'pattyn','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='drag_coefficient';
+md.cm_min=1;
+md.cm_max=200;
+md.nsteps=2;
+md.fit=1*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=3*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.cm_noisedmp=2*10^-7;
+md.dt=0;
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster='none';
-
-%constrain all velocities to 1 m/yr, in the y-direction
-md.spcvelocity(:,1:3)=1;
-md.spcvelocity(:,4)=0;
-md.spcvelocity(:,5)=1*md.yts;
-md.spcvelocity(:,6)=0;
-
-%Dakota options
-md.variables.nuv=normal_uncertain.empty();
-md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01);
-
-md.responses=struct();
-md.responses.rf =response_function.empty();
-md.responses.rf (end+1)=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-
-%mass flux profiles
-md.qmu_mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
-md.qmu_mass_flux_profile_directory=pwd;
-
-md.qmu_method     =dakota_method('nond_l');
-
-md.qmu_params.direct=true;
-md.qmu_params.analysis_driver='diagnostic';
-md.qmu_params.evaluation_concurrency=1;
-md.qmu_params.interval_type='forward';
-md.qmu_params.tabular_graphics_data=true;
-
-%partitioning
-md.npart=20;
-md=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
-md.part=md.part-1;
-md.qmu_analysis=1;
-
-md.eps_rel=10^-10; %tighten for qmu analyses
-
-%rm existing results
-if exist('./qmu')
-	system('rm -rf qmu/');
-end
-
-md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+md=solve(md,'analysis_type',SteadystateSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test431_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test431_nightly.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test431_nightly.m	(revision 5047)
@@ -1,18 +1,14 @@
-md=tres(md,'dakota');
-%ok, mass flux of 3 profiles should be -.3, -.3 and the sum, which is -.6
-%we recover those mass fluxes through the mean of the response.
-%also, we recover the max velo, which should be 1m/s. 
-%we put all that data in the importancefactors, which we will use to test for success.
-%also, check that the stddev are 0.
-md.results.dakota.importancefactors=[];
-for i=1:7,
-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
-end
-for i=1:7,
-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
-end
-field_names     ={'importancefactors'};
-field_tolerances={1e-11};
+field_names     ={'Gradient' 'Misfits' 'DragCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'MeltingRate'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
-         md.results.dakota.importancefactors,...
-	};
+	PatchToVec(md.results.SteadystateSolution.Gradient),...
+	md.results.SteadystateSolution.J,...
+	PatchToVec(md.results.SteadystateSolution.DragCoefficient),...
+	PatchToVec(md.results.SteadystateSolution.Pressure),...
+	PatchToVec(md.results.SteadystateSolution.Vel),...
+	PatchToVec(md.results.SteadystateSolution.Vx),...
+	PatchToVec(md.results.SteadystateSolution.Vy),...
+	PatchToVec(md.results.SteadystateSolution.Vz),...
+	PatchToVec(md.results.SteadystateSolution.Temperature),...
+	PatchToVec(md.results.SteadystateSolution.MeltingRate)
+};
Index: /issm/trunk/test/NightlyRun/test432.m
===================================================================
--- /issm/trunk/test/NightlyRun/test432.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test432.m	(revision 5047)
@@ -1,52 +1,23 @@
-md=mesh(model,'../Exp/Square.exp',150000);
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'../Exp/SquareShelf.exp','');
 md=parameterize(md,'../Par/SquareSheetShelf.par');
-md=setelementstype(md,'macayeal','all');
+md=extrude(md,3,1);
+md=setelementstype(md,'pattyn','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='drag_coefficient';
+md.cm_min=1;
+md.cm_max=200;
+md.nsteps=2;
+md.fit=1*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=3*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.cm_noisedmp=2*10^-7;
+md.dt=0;
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster=oshostname();
-
-%constrain all velocities to 1 m/yr, in the y-direction
-md.spcvelocity(:,1:3)=1;
-md.spcvelocity(:,4)=0;
-md.spcvelocity(:,5)=1*md.yts;
-md.spcvelocity(:,6)=0;
-
-%Dakota options
-md.variables.nuv=normal_uncertain.empty();
-md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01);
-
-md.responses=struct();
-md.responses.rf =response_function.empty();
-md.responses.rf (end+1)=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.responses.rf (end+1)=response_function('MassFlux6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-
-%mass flux profiles
-md.qmu_mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
-md.qmu_mass_flux_profile_directory=pwd;
-
-md.qmu_method     =dakota_method('nond_l');
-
-md.qmu_params.direct=true;
-md.qmu_params.analysis_driver='diagnostic';
-md.qmu_params.evaluation_concurrency=1;
-md.qmu_params.interval_type='forward';
-md.qmu_params.tabular_graphics_data=true;
-
-%partitioning
-md.npart=20;
-md=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
-md.part=md.part-1;
-md.qmu_analysis=1;
-
-md.eps_rel=10^-10; %tighten for qmu analyses
-
-%rm existing results
-if exist('./qmu')
-	system('rm -rf qmu/');
-end
-
-md=solve(md,'analysis_type',DiagnosticSolutionEnum);
+md=solve(md,'analysis_type',SteadystateSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test432_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test432_nightly.m	(revision 5046)
+++ /issm/trunk/test/NightlyRun/test432_nightly.m	(revision 5047)
@@ -1,19 +1,14 @@
-md=tres(md,'dakota');
-%ok, mass flux of 3 profiles should be -.3, -.3 and the sum, which is -.6
-%we recover those mass fluxes through the mean of the response.
-%also, we recover the max velo, which should be 1m/s. 
-%we put all that data in the importancefactors, which we will use to test for success.
-%also, check that the stddev are 0.
-md.results.dakota.importancefactors=[];
-for i=1:7,
-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
-end
-for i=1:7,
-	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
-end
-field_names     ={'importancefactors'};
-field_tolerances={1e-11};
+field_names     ={'Gradient' 'Misfits' 'DragCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'MeltingRate'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
-         md.results.dakota.importancefactors,...
-	};
-md.results.dakota.importancefactors
+	PatchToVec(md.results.SteadystateSolution.Gradient),...
+	md.results.SteadystateSolution.J,...
+	PatchToVec(md.results.SteadystateSolution.DragCoefficient),...
+	PatchToVec(md.results.SteadystateSolution.Pressure),...
+	PatchToVec(md.results.SteadystateSolution.Vel),...
+	PatchToVec(md.results.SteadystateSolution.Vx),...
+	PatchToVec(md.results.SteadystateSolution.Vy),...
+	PatchToVec(md.results.SteadystateSolution.Vz),...
+	PatchToVec(md.results.SteadystateSolution.Temperature),...
+	PatchToVec(md.results.SteadystateSolution.MeltingRate)
+};
