Index: /issm/trunk/test/NightlyRun/Id2Name.m
===================================================================
--- /issm/trunk/test/NightlyRun/Id2Name.m	(revision 5025)
+++ /issm/trunk/test/NightlyRun/Id2Name.m	(revision 5026)
@@ -63,8 +63,12 @@
 elseif (id==221), name='SquareShelfTranS3dSerial';
 elseif (id==222), name='SquareShelfTranS3dParallel';
-elseif (id==223), name='SquareShelfCMB2dSerial';
-elseif (id==224), name='SquareShelfCMB2dParallel';
-elseif (id==225), name='SquareShelfCMB3dSerial';
-elseif (id==226), name='SquareShelfCMB3dParallel';
+elseif (id==223), name='SquareShelfCMBM2dSerial';
+elseif (id==224), name='SquareShelfCMBM2dParallel';
+elseif (id==225), name='SquareShelfCMBM3dSerial';
+elseif (id==226), name='SquareShelfCMBM3dParallel';
+elseif (id==227), name='SquareShelfCMBP3dSerial';
+elseif (id==228), name='SquareShelfCMBP3dParallel';
+elseif (id==229), name='SquareShelfCMBS3dSerial';
+elseif (id==230), name='SquareShelfCMBS3dParallel';
 elseif (id==231), name='SquareShelfDiagM2dRiftSerial';
 elseif (id==232), name='SquareShelfDiagM2dRiftParallel';
Index: /issm/trunk/test/NightlyRun/test224.m
===================================================================
--- /issm/trunk/test/NightlyRun/test224.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test224.m	(revision 5026)
@@ -0,0 +1,20 @@
+md=mesh(model,'../Exp/Square.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setelementstype(md,'macayeal','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
+md.cluster=oshostname();
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test224_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test224_nightly.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test224_nightly.m	(revision 5026)
@@ -0,0 +1,11 @@
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB2d),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
+	PatchToVec(md.results.DiagnosticSolution.Vx),...
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test225.m
===================================================================
--- /issm/trunk/test/NightlyRun/test225.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test225.m	(revision 5026)
@@ -0,0 +1,21 @@
+md=mesh(model,'../Exp/Square.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=extrude(md,3,1);
+md=setelementstype(md,'macayeal','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
+md.cluster='none';
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test225_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test225_nightly.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test225_nightly.m	(revision 5026)
@@ -0,0 +1,11 @@
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
+	PatchToVec(md.results.DiagnosticSolution.Vx),...
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test226.m
===================================================================
--- /issm/trunk/test/NightlyRun/test226.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test226.m	(revision 5026)
@@ -0,0 +1,21 @@
+md=mesh(model,'../Exp/Square.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=extrude(md,3,1);
+md=setelementstype(md,'macayeal','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
+md.cluster=oshostname();
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test226_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test226_nightly.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test226_nightly.m	(revision 5026)
@@ -0,0 +1,11 @@
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
+	PatchToVec(md.results.DiagnosticSolution.Vx),...
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test227.m
===================================================================
--- /issm/trunk/test/NightlyRun/test227.m	(revision 5025)
+++ /issm/trunk/test/NightlyRun/test227.m	(revision 5026)
@@ -1,10 +1,21 @@
-md=mesh(model,'../Exp/Square.exp','../Exp/Rifts.exp',50000);
-md=meshprocessrifts(md,'../Exp/Square.exp');
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.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='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster='none';
-md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 80 ';
-md=solversettoasm(md);
-error('rifts not working for now')
 md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test227_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test227_nightly.m	(revision 5025)
+++ /issm/trunk/test/NightlyRun/test227_nightly.m	(revision 5026)
@@ -1,8 +1,11 @@
-field_names     ={'Vx','Vy','Vel','Pressure'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
 	PatchToVec(md.results.DiagnosticSolution.Vx),...
-	PatchToVec(md.results.DiagnosticSolution.Vy),...
-	PatchToVec(md.results.DiagnosticSolution.Vel),...
-	PatchToVec(md.results.DiagnosticSolution.Pressure),...
-	};
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test228.m
===================================================================
--- /issm/trunk/test/NightlyRun/test228.m	(revision 5025)
+++ /issm/trunk/test/NightlyRun/test228.m	(revision 5026)
@@ -1,10 +1,21 @@
-md=mesh(model,'../Exp/Square.exp','../Exp/Rifts.exp',50000);
-md=meshprocessrifts(md,'../Exp/Square.exp');
+md=mesh(model,'../Exp/Square.exp',200000);
 md=geography(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.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='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
 md.cluster=oshostname();
-md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 80 ';
-md=solversettomumps(md);
-error('rifts not working for now')
 md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test228_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test228_nightly.m	(revision 5025)
+++ /issm/trunk/test/NightlyRun/test228_nightly.m	(revision 5026)
@@ -1,8 +1,11 @@
-field_names     ={'Vx','Vy','Vel','Pressure'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
 	PatchToVec(md.results.DiagnosticSolution.Vx),...
-	PatchToVec(md.results.DiagnosticSolution.Vy),...
-	PatchToVec(md.results.DiagnosticSolution.Vel),...
-	PatchToVec(md.results.DiagnosticSolution.Pressure),...
-	};
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test229.m
===================================================================
--- /issm/trunk/test/NightlyRun/test229.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test229.m	(revision 5026)
@@ -0,0 +1,21 @@
+md=mesh(model,'../Exp/Square.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=extrude(md,3,1);
+md=setelementstype(md,'macayeal','all','stokes','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
+md.cluster='none';
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test229_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test229_nightly.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test229_nightly.m	(revision 5026)
@@ -0,0 +1,11 @@
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
+	PatchToVec(md.results.DiagnosticSolution.Vx),...
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test230.m
===================================================================
--- /issm/trunk/test/NightlyRun/test230.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test230.m	(revision 5026)
@@ -0,0 +1,21 @@
+md=mesh(model,'../Exp/Square.exp',200000);
+md=geography(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=extrude(md,3,1);
+md=setelementstype(md,'macayeal','all','stokes','all');
+
+%control parameters
+md.control_analysis=1;
+md.control_type='rheology_B';
+md.cm_min=10^6;
+md.cm_max=2*10^9;
+md.nsteps=2;
+md.fit=0*ones(md.nsteps,1);
+md.weights=ones(md.numberofgrids,1);
+md.optscal=10^7*ones(md.nsteps,1);
+md.maxiter=2*ones(md.nsteps,1);
+md.cm_jump=0.3*ones(md.nsteps,1);
+md.vx_obs=md.vx; md.vy_obs=md.vy;
+
+md.cluster=oshostname();
+md=solve(md,'analysis_type',DiagnosticSolutionEnum);
Index: /issm/trunk/test/NightlyRun/test230_nightly.m
===================================================================
--- /issm/trunk/test/NightlyRun/test230_nightly.m	(revision 5026)
+++ /issm/trunk/test/NightlyRun/test230_nightly.m	(revision 5026)
@@ -0,0 +1,11 @@
+field_names     ={'Gradient' 'Misfits' 'RheologyB2d' 'Pressure' 'Vel' 'Vx' 'Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	PatchToVec(md.results.DiagnosticSolution.Gradient),...
+	md.results.DiagnosticSolution.J,...
+	PatchToVec(md.results.DiagnosticSolution.RheologyB),...
+	PatchToVec(md.results.DiagnosticSolution.Pressure),...
+	PatchToVec(md.results.DiagnosticSolution.Vel),...
+	PatchToVec(md.results.DiagnosticSolution.Vx),...
+	PatchToVec(md.results.DiagnosticSolution.Vy)
+};
