Index: issm/trunk-jpl/src/m/classes/SMBgemb.m
===================================================================
--- issm/trunk-jpl/src/m/classes/SMBgemb.m	(revision 19527)
+++ issm/trunk-jpl/src/m/classes/SMBgemb.m	(revision 19528)
@@ -123,11 +123,39 @@
 function md = checkconsistency(self,md,solution,analyses) % {{{
 
-		md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'>',0,'<',273+60); %60 celsius max value
-		md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1);
-		md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1);
-		md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1);
-		md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1);
+		md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'>',273-60,'<',273+60); %60 celsius max value
+		md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'>=',0,'<',45); %max 500 km/h
+		md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'>=',0,'<=',1400);
+		md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'>=',0);
+		md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'>=',0,'<=',100);
 		md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1);
-
+		
+		md = checkfield(md,'fieldname','smb.Tmean','NaN',1,'>',273-60,'<',273+60); %60 celsius max value
+		md = checkfield(md,'fieldname','smb.C','NaN',1,'>=',0); 
+		md = checkfield(md,'fieldname','smb.Tz','NaN',1,'>=',0,'<=',5000); 
+		md = checkfield(md,'fieldname','smb.Vz','NaN',1,'>=',0,'<=',5000); 
+		
+		md = checkfield(md,'fieldname','smb.spinUp','NaN',1,'>=',0);
+		md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'values',[1,2,3,4]);
+		md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'values',[0,1]);
+		md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'values',[1,2,3,4,5]);
+		
+		md = checkfield(md,'fieldname','smb.zTop','NaN',1,'>=',0);
+		md = checkfield(md,'fieldname','smb.dzTop','NaN',1,'>',0);
+		md = checkfield(md,'fieldname','smb.dzMin','NaN',1,'>',0);
+		md = checkfield(md,'fieldname','smb.zY','NaN',1,'>=',1);
+		md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'>',0,'<',10*365); %10 years max 
+		
+		switch self.aIdx,
+		case {1 2}
+			md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'>=',.64,'<=',.89);
+			md = checkfield(md,'fieldname','smb.aIce','NaN',1,'>=',.27,'<=',.58);
+		case 3
+			md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'>=',0,'<=',1);
+		case 4
+			md = checkfield(md,'fieldname','smb.t0wet','NaN',1,'>=',15,'<=',21.9);
+			md = checkfield(md,'fieldname','smb.t0dry','NaN',1,'>=',30,'<=',30);
+			md = checkfield(md,'fieldname','smb.K','NaN',1,'>=',7,'<=',7);
+		end
+		
 		%check zTop is < local thickness:
 		he=sum(md.geometry.thickness(md.mesh.elements),2)/size(md.mesh.elements,2);
@@ -195,7 +223,36 @@
 
 			WriteData(fid,'enum',SmbEnum(),'data',SMBgembEnum(),'format','Integer');
-			WriteData(fid,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
-			WriteData(fid,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
-			WriteData(fid,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
+			
+			WriteData(fid,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			WriteData(fid,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',1,'scale',1,'timeserieslength',md.mesh.numberofelements+1);
+			
+			WriteData(fid,'object',self,'class','smb','fieldname','Tmean','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','C','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','Tz','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','Vz','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','spinUp','format','Integer','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','aIdx','format','Integer','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','swIdx','format','Integer','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','denIdx','format','Integer','scale',1);
+
+			WriteData(fid,'object',self,'class','smb','fieldname','zTop','format','DoubleMat','mattype',1,'scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','dzTop','format','DoubleMat','mattype',1,'scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','dzMin','format','DoubleMat','mattype',1,'scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','zY','format','DoubleMat','mattype',1,'scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',1,'scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',1,'scale',1);
+
+			WriteData(fid,'object',self,'class','smb','fieldname','outputFreq','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','aSnow','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','aIce','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','cldFrac','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','t0wet','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','t0dry','format','Double','scale',1);
+			WriteData(fid,'object',self,'class','smb','fieldname','K','format','Double','scale',1);
 			
 			%process requested outputs
@@ -210,3 +267,3 @@
 		end % }}}
 	end
-end
+end		
