Index: ../trunk-jpl/src/m/classes/model.m
===================================================================
--- ../trunk-jpl/src/m/classes/model.m	(revision 18377)
+++ ../trunk-jpl/src/m/classes/model.m	(revision 18378)
@@ -220,8 +220,12 @@
 			end
 
 			%special for thermal modeling:
-			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
-			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
+			if ~isnan(md.basalforcings.groundedice_melting_rate),
+				md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
+			end
+			if ~isnan(md.basalforcings.floatingice_melting_rate),
+				md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
+			end
 			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); %bedrock only gets geothermal flux
 
 			%update of connectivity matrix
@@ -237,8 +241,12 @@
 			md.geometry.base=project2d(md,md.geometry.base,1);
 			md.geometry.bed=project2d(md,md.geometry.bed,1);
 
-			md.mask.groundedice_levelset=project2d(md,md.mask.groundedice_levelset,1);
-			md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+			if ~isnan(md.mask.groundedice_levelset),
+				md.mask.groundedice_levelset=project2d(md,md.mask.groundedice_levelset,1);
+			end
+			if ~isnan(md.mask.ice_levelset),
+				md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+			end
 
 			%lat long
 			if numel(md.mesh.lat) ==md.mesh.numberofvertices,  md.mesh.lat=project2d(md,md.mesh.lat,1); end
@@ -824,8 +832,9 @@
 			if isfield(structmd,'drag'), md.friction.coefficient=structmd.drag; end
 			if isfield(structmd,'p'), md.friction.p=structmd.p; end
 			if isfield(structmd,'q'), md.friction.q=structmd.p; end
-			if isfield(structmd,'melting'), md.basalforcings.melting_rate=structmd.melting; end
+			if isfield(structmd,'melting'), md.basalforcings.floatingice_melting_rate=structmd.melting; end
 			if isfield(structmd,'melting_rate'), md.basalforcings.floatingice_melting_rate=structmd.melting_rate; end
+			if isfield(structmd,'melting_rate'), md.basalforcings.groundedice_melting_rate=structmd.melting_rate; end
 			if isfield(structmd,'accumulation'), md.surfaceforcings.mass_balance=structmd.accumulation; end
 			if isfield(structmd,'numberofgrids'), md.mesh.numberofvertices=structmd.numberofgrids; end
 			if isfield(structmd,'numberofgrids2d'), md.mesh.numberofvertices2d=structmd.numberofgrids2d; end
