Index: /issm/trunk-jpl/src/m/classes/friction.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/friction.m	(revision 25402)
+++ /issm/trunk-jpl/src/m/classes/friction.m	(revision 25403)
@@ -82,8 +82,8 @@
 
 			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
-			if(size(self.coefficient,1)==md.mesh.numberofelements | size(self.coefficient,1)==md.mesh.numberofelements+1),
+			if(size(self.coefficient,1)==md.mesh.numberofvertices | size(self.coefficient,1)==md.mesh.numberofvertices+1),
+				mattype=1; tsl = md.mesh.numberofvertices;
+			else
 				mattype=2; tsl = md.mesh.numberofelements;
-			else
-				mattype=1; tsl = md.mesh.numberofvertices;
 			end
 			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
Index: /issm/trunk-jpl/src/m/classes/matice.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/matice.m	(revision 25402)
+++ /issm/trunk-jpl/src/m/classes/matice.m	(revision 25403)
@@ -175,10 +175,10 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-			if(size(self.rheology_B,1)==md.mesh.numberofelements | size(self.rheology_B,1)==md.mesh.numberofelements+1),
+			if(size(self.rheology_B,1)==md.mesh.numberofvertices | size(self.rheology_B,1)==md.mesh.numberofvertices+1),
+				mattype=1; tsl = md.mesh.numberofvertices;
+			else
 				mattype=2; tsl = md.mesh.numberofelements;
-			else
-				mattype=1; tsl = md.mesh.numberofvertices;
-			end
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+mattype,'yts',md.constants.yts);
+			end
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
