Index: /issm/trunk-jpl/src/m/classes/basalforcings.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/basalforcings.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/basalforcings.m	(revision 15133)
@@ -47,7 +47,7 @@
 			yts=365.0*24.0*3600.0;
 
-			WriteData(fid,'object',obj,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
 			WriteData(fid,'object',obj,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 		end % }}}
 	end
Index: /issm/trunk-jpl/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/basalforcings.py	(revision 15133)
@@ -3,4 +3,5 @@
 from checkfield import *
 from WriteData import *
+import numpy
 
 class basalforcings(object):
@@ -50,6 +51,6 @@
 		yts=365.0*24.0*3600.0
 
-		WriteData(fid,'object',self,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 	# }}}
Index: /issm/trunk-jpl/src/m/classes/diagnostic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/diagnostic.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/diagnostic.m	(revision 15133)
@@ -151,7 +151,7 @@
 		end % }}}
 		function marshall(obj,md,fid) % {{{
-			WriteData(fid,'object',obj,'fieldname','spcvx','format','DoubleMat','mattype',1,'forcing',1);
-			WriteData(fid,'object',obj,'fieldname','spcvy','format','DoubleMat','mattype',1,'forcing',1);
-			WriteData(fid,'object',obj,'fieldname','spcvz','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','spcvx','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+			WriteData(fid,'object',obj,'fieldname','spcvy','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+			WriteData(fid,'object',obj,'fieldname','spcvz','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','restol','format','Double');
 			WriteData(fid,'object',obj,'fieldname','reltol','format','Double');
Index: /issm/trunk-jpl/src/m/classes/diagnostic.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/diagnostic.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/diagnostic.py	(revision 15133)
@@ -161,7 +161,7 @@
 	# }}}
 	def marshall(self,md,fid):    # {{{
-		WriteData(fid,'object',self,'fieldname','spcvx','format','DoubleMat','mattype',1,'forcing',1)
-		WriteData(fid,'object',self,'fieldname','spcvy','format','DoubleMat','mattype',1,'forcing',1)
-		WriteData(fid,'object',self,'fieldname','spcvz','format','DoubleMat','mattype',1,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','spcvx','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+		WriteData(fid,'object',self,'fieldname','spcvy','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+		WriteData(fid,'object',self,'fieldname','spcvz','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','restol','format','Double')
 		WriteData(fid,'object',self,'fieldname','reltol','format','Double')
Index: /issm/trunk-jpl/src/m/classes/geometry.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/geometry.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/geometry.m	(revision 15133)
@@ -52,5 +52,5 @@
 		function marshall(obj,md,fid) % {{{
 			WriteData(fid,'data',obj.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum());
-			WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'forcing',1);
+			WriteData(fid,'data',obj.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'data',obj.bed,'format','DoubleMat','mattype',1,'enum',BedEnum());
 			WriteData(fid,'data',obj.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum());
Index: /issm/trunk-jpl/src/m/classes/geometry.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/geometry.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/geometry.py	(revision 15133)
@@ -50,5 +50,5 @@
 	def marshall(self,md,fid):    # {{{
 		WriteData(fid,'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum())
-		WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'forcing',1)
+		WriteData(fid,'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum())
 		WriteData(fid,'data',self.bathymetry,'format','DoubleMat','mattype',1,'enum',BathymetryEnum())
Index: /issm/trunk-jpl/src/m/classes/hydrologydc.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologydc.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/hydrologydc.m	(revision 15133)
@@ -147,5 +147,5 @@
 	    end
 
-			WriteData(fid,'object',obj,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','sediment_compressibility','format','Double');			
 			WriteData(fid,'object',obj,'fieldname','sediment_porosity','format','Double');			
@@ -154,5 +154,5 @@
 
 			if obj.isefficientlayer==1,	
-				WriteData(fid,'object',obj,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'forcing',1);
+				WriteData(fid,'object',obj,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 				WriteData(fid,'object',obj,'fieldname','epl_compressibility','format','Double');			
 				WriteData(fid,'object',obj,'fieldname','epl_porosity','format','Double');			
Index: /issm/trunk-jpl/src/m/classes/hydrologyshreve.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 15133)
@@ -61,5 +61,5 @@
 		function marshall(obj,md,fid) % {{{
 			WriteData(fid,'enum',HydrologyModelEnum(),'data',HydrologyshreveEnum(),'format','Integer');
-			WriteData(fid,'object',obj,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','n','format','Double');
 			WriteData(fid,'object',obj,'fieldname','CR','format','Double');
Index: /issm/trunk-jpl/src/m/classes/hydrologyshreve.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 15133)
@@ -64,5 +64,5 @@
 	def marshall(self,md,fid):    # {{{
 		WriteData(fid,'enum',HydrologyModelEnum(),'data',HydrologyshreveEnum(),'format','Integer');
-		WriteData(fid,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','n','format','Double')
 		WriteData(fid,'object',self,'fieldname','CR','format','Double')
Index: /issm/trunk-jpl/src/m/classes/prognostic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/prognostic.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/prognostic.m	(revision 15133)
@@ -65,5 +65,5 @@
 		end % }}}
 		function marshall(obj,md,fid) % {{{
-			WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double');
 			WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum());
Index: /issm/trunk-jpl/src/m/classes/prognostic.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/prognostic.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/prognostic.py	(revision 15133)
@@ -68,5 +68,5 @@
 	# }}}
 	def marshall(self,md,fid):    # {{{
-		WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','min_thickness','format','Double')
 		WriteData(fid,'data',StringToEnum(self.hydrostatic_adjustment)[0],'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum())
Index: /issm/trunk-jpl/src/m/classes/surfaceforcings.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/surfaceforcings.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/surfaceforcings.m	(revision 15133)
@@ -104,6 +104,6 @@
 			yts=365.0*24.0*3600.0;
 
-			WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
-			WriteData(fid,'object',obj,'fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
+			WriteData(fid,'object',obj,'fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','ispdd','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','isdelta18o','format','Boolean');
@@ -118,14 +118,13 @@
 					WriteData(fid,'object',obj,'fieldname','delta18o','format','DoubleMat','mattype',1);
 				else
-					WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcing',1);
-					WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1,'forcing',1);
+					WriteData(fid,'object',obj,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 				end
 			end
 			WriteData(fid,'object',obj,'fieldname','issmbgradients','format','Boolean');
 			if obj.issmbgradients,
-				WriteData(fid,'object',obj,'fieldname','href','format','DoubleMat','mattype',1,'forcing',1);
-				WriteData(fid,'object',obj,'fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
-				WriteData(fid,'object',obj,'fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
-				WriteData(fid,'object',obj,'fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1);
+				WriteData(fid,'object',obj,'fieldname','href','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+				WriteData(fid,'object',obj,'fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
+				WriteData(fid,'object',obj,'fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
+				WriteData(fid,'object',obj,'fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
 			end
 
Index: /issm/trunk-jpl/src/m/classes/surfaceforcings.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/surfaceforcings.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/surfaceforcings.py	(revision 15133)
@@ -104,6 +104,6 @@
 		yts=365.0*24.0*3600.0
 
-		WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
-		WriteData(fid,'object',self,'fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+		WriteData(fid,'object',self,'fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','ispdd','format','Boolean')
 		WriteData(fid,'object',self,'fieldname','isdelta18o','format','Boolean')
@@ -119,13 +119,12 @@
 				WriteData(fid,'object',self,'fieldname','delta18o','format','DoubleMat','mattype',1)
 			else:
-				WriteData(fid,'object',self,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcing',1)
-				WriteData(fid,'object',self,'fieldname','precipitation','format','DoubleMat','mattype',1,'forcing',1)
+				WriteData(fid,'object',self,'fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 
 		WriteData(fid,'object',self,'fieldname','issmbgradients','format','Boolean')
 
 		if self.issmbgradients:
-			WriteData(fid,'object',self,'fieldname','href','format','DoubleMat','mattype',1,'forcing',1)
-			WriteData(fid,'object',self,'fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
-			WriteData(fid,'object',self,'fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
-			WriteData(fid,'object',self,'fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'forcing',1)
+			WriteData(fid,'object',self,'fieldname','href','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+			WriteData(fid,'object',self,'fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+			WriteData(fid,'object',self,'fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+			WriteData(fid,'object',self,'fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
 	# }}}
Index: /issm/trunk-jpl/src/m/classes/thermal.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/thermal.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/thermal.m	(revision 15133)
@@ -66,5 +66,5 @@
 		end % }}}
 		function marshall(obj,md,fid) % {{{
-			WriteData(fid,'object',obj,'fieldname','spctemperature','format','DoubleMat','mattype',1,'forcing',1);
+			WriteData(fid,'object',obj,'fieldname','spctemperature','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 			WriteData(fid,'object',obj,'fieldname','penalty_threshold','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
Index: /issm/trunk-jpl/src/m/classes/thermal.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/thermal.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/classes/thermal.py	(revision 15133)
@@ -72,5 +72,5 @@
 	# }}}
 	def marshall(self,md,fid):    # {{{
-		WriteData(fid,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'forcing',1)
+		WriteData(fid,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
 		WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer')
 		WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
Index: /issm/trunk-jpl/src/m/solve/WriteData.m
===================================================================
--- /issm/trunk-jpl/src/m/solve/WriteData.m	(revision 15132)
+++ /issm/trunk-jpl/src/m/solve/WriteData.m	(revision 15133)
@@ -24,5 +24,5 @@
 format  = getfieldvalue(options,'format');
 mattype = getfieldvalue(options,'mattype',0);    %only required for matrices
-forcing = getfieldvalue(options,'forcing',1);
+forcinglength = getfieldvalue(options,'forcinglength',-1);
 
 %Process sparse matrices
@@ -34,6 +34,6 @@
 if exist(options,'scale'),
 	scale = getfieldvalue(options,'scale');
-	if forcing,
-		data(1:end-1,:) = scale.*data;
+	if size(data,1)==forcinglength,
+		data(1:end-1,:) = scale.*data(1:end-1,:);
 	else
 		data  = scale.*data;
Index: /issm/trunk-jpl/src/m/solve/WriteData.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 15132)
+++ /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 15133)
@@ -35,5 +35,5 @@
 	format  = options.getfieldvalue('format')
 	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
-	forcing = options.getfieldvalue('forcing',0)
+	forcinglength = options.getfieldvalue('forcinglength',-1)
 
 	#Process sparse matrices
@@ -45,8 +45,10 @@
 	if options.exist('scale'):
 		scale = options.getfieldvalue('scale')
-		if forcing:
-			data[0:-1] = scale*data[0:-1]
-		else:
-			data  = scale*data
+		if numpy.size(data) > 1 :
+			if numpy.size(data,0)==forcinglength:
+				data=numpy.array(data)
+				data[0:-1,:] = scale*data[0:-1,:]
+			else:
+				data  = scale*data
 
 	#Step 1: write the enum to identify this record uniquely
