Index: /issm/trunk/src/c/modules/OutputResultsx/MatlabWriteResults.cpp
===================================================================
--- /issm/trunk/src/c/modules/OutputResultsx/MatlabWriteResults.cpp	(revision 4320)
+++ /issm/trunk/src/c/modules/OutputResultsx/MatlabWriteResults.cpp	(revision 4321)
@@ -28,9 +28,9 @@
 	mwSize nsteps;
 	mwSize step;
-	const	char**	fnames=NULL;
-	int*    enums=NULL;
-	int     baseenum;
-	mwSize		onebyone[2] = {1,1};
-	mwSize		ndim=2;
+	const char **fnames      = NULL;
+	int         *enums       = NULL;
+	int          baseenum;
+	mwSize       onebyone[2] = {1,1};
+	mwSize       ndim        = 2;
 
 	/*How many time steps do we have? : */
@@ -66,6 +66,6 @@
 	for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++;
 
-	/*Add 1 field for time: */
-	nfields++;
+	/*Add 2 fields for time and step: */
+	nfields=nfields+2;
 	
 	/*Fill the names of the structure field: */
@@ -78,6 +78,7 @@
 		}
 	}
-	/*don't forget the extra field "time":*/
-	fnames[nfields-1]=EnumAsString(TimeEnum);
+	/*don't forget the extra fields "time" and "step":*/
+	fnames[nfields-2]="time";
+	fnames[nfields-1]="step";
 
 	/*Initialize structure: */
@@ -85,5 +86,5 @@
 
 	/*Fill each field: */
-	for(i=0;i<nfields-1;i++){ //do not include the last one used for time
+	for(i=0;i<nfields-2;i++){ //do not include the last one used for time
 		ExternalResult* result=(ExternalResult*)results->GetObjectByOffset(i);
 		result->SetMatlabField(dataref);
Index: /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 4320)
+++ /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 4321)
@@ -22,5 +22,5 @@
 #endif
 
-	int         solutiontype;
+	int  solutiontype;
 	
 	/*First, configure elements*/
Index: /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4321)
@@ -190,5 +190,6 @@
 	
 	mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar((double)value));
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 }
 #endif
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4321)
@@ -185,5 +185,6 @@
 	name=this->GetResultName();
 	mxSetField( dataref,this->step-1, name,mxCreateDoubleScalar(value));
-	mxSetField( dataref,this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 
 }
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 4321)
@@ -244,7 +244,6 @@
 	/*set tranpose matrix inside the dataref structure: */
 	mxSetField( dataref, this->step-1, name,pfield2);
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
-
-
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
 
 }
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4321)
@@ -226,6 +226,6 @@
 
 	mxSetField( dataref, this->step-1, name,pfield);
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
-
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 
 }
Index: /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4321)
@@ -190,5 +190,6 @@
 
 	mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar(value));
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 
 }
Index: /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4321)
@@ -259,5 +259,6 @@
 	
 	mxSetField( dataref, this->step-1, name, pfield);
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 
 }
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4320)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4321)
@@ -202,5 +202,6 @@
 
 	mxSetField( dataref, this->step-1, name, mxCreateString(value));
-	mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
+	mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time)); 
+	mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step)); 
 
 }
Index: /issm/trunk/src/m/classes/@model/model.m
===================================================================
--- /issm/trunk/src/m/classes/@model/model.m	(revision 4320)
+++ /issm/trunk/src/m/classes/@model/model.m	(revision 4321)
@@ -232,5 +232,5 @@
 	md.inputfilename='';
 	md.outputfilename='';
-	md.results=NaN;
+	md.results=struct();
 	md.vx=NaN;
 	md.vy=NaN;
Index: /issm/trunk/src/m/classes/@model/setdefaultparameters.m
===================================================================
--- /issm/trunk/src/m/classes/@model/setdefaultparameters.m	(revision 4320)
+++ /issm/trunk/src/m/classes/@model/setdefaultparameters.m	(revision 4321)
@@ -262,7 +262,2 @@
 %Ice solver: 'general' for Matlab's default solver (or 'lu' or 'sholesky')
 md.solver_type='general';
-
-%results
-md.results.diagnostic=[];
-md.results.steadystate=[];
-md.results.prognostic=[];
Index: /issm/trunk/src/m/classes/public/solve.m
===================================================================
--- /issm/trunk/src/m/classes/public/solve.m	(revision 4320)
+++ /issm/trunk/src/m/classes/public/solve.m	(revision 4321)
@@ -104,7 +104,7 @@
 %Check result is consistent
 displaystring(md.verbose,'%s\n','checking result consistency');
-if ~isresultconsistent(md,options.analysis_type),
-	disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
-end
+%if ~isresultconsistent(md,options.analysis_type),
+%	disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
+%end
 
 %convert analysis type to string finally
Index: /issm/trunk/src/m/solutions/diagnostic.m
===================================================================
--- /issm/trunk/src/m/solutions/diagnostic.m	(revision 4320)
+++ /issm/trunk/src/m/solutions/diagnostic.m	(revision 4321)
@@ -35,5 +35,6 @@
 		
 		displaystring(verbose,'%s',['write results']);
-		md.results.diagnostic=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results);
+		results=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results);
+		md.results.(EnumAsString(solution_type))=ProcessPatch(results);
 	else
 		%launch dakota driver for diagnostic core solution
