Index: /issm/trunk/src/m/classes/model/model.m
===================================================================
--- /issm/trunk/src/m/classes/model/model.m	(revision 9673)
+++ /issm/trunk/src/m/classes/model/model.m	(revision 9674)
@@ -308,8 +308,4 @@
 			 if isfield(structmd,'numberofgrids'), md.numberofnodes=structmd.numberofgrids; end
 			 if isfield(structmd,'numberofgrids2d'), md.numberofnodes2d=structmd.numberofgrids2d; end
-			 if isfield(structmd,'gridonhutter'), md.nodeonhutter=structmd.gridonhutter; end
-			 if isfield(structmd,'gridonmacayeal'), md.nodeonmacayeal=structmd.gridonmacayeal; end
-			 if isfield(structmd,'gridonpattyn'), md.nodeonpattyn=structmd.gridonpattyn; end
-			 if isfield(structmd,'gridonstokes'), md.nodeonstokes=structmd.gridonstokes; end
 			 if isfield(structmd,'uppergrids'), md.uppernodes=structmd.uppergrids; end
 			 if isfield(structmd,'lowergrids'), md.lowernodes=structmd.lowergrids; end
@@ -317,8 +313,7 @@
 			 if isfield(structmd,'gridonsurface'), md.nodeonsurface=structmd.gridonsurface; end
 			 if isfield(structmd,'extractedgrids'), md.extractednodes=structmd.extractedgrids; end
-			 if isfield(structmd,'gridoniceshelf'), md.nodeoniceshelf=structmd.gridoniceshelf; end
-			 if isfield(structmd,'gridonicesheet'), md.nodeonicesheet=structmd.gridonicesheet; end
-			 if isfield(structmd,'gridonwater'), md.nodeonwater=structmd.gridonwater; end
-			 if isfield(structmd,'gridonnuna'), md.nodeonnuna=structmd.gridonnuna; end
+			 if isfield(structmd,'gridoniceshelf'), md.mask.vertexonfloatingice=structmd.gridoniceshelf; end
+			 if isfield(structmd,'gridonicesheet'), md.mask.vertexongroundedice=structmd.gridonicesheet; end
+			 if isfield(structmd,'gridonwater'), md.mask.vertexonwater=structmd.gridonwater; end
 			 if isfield(structmd,'gridonboundary'), md.nodeonboundary=structmd.gridonboundary; end
 			 if isfield(structmd,'petscoptions'), md.solver=structmd.petscoptions; end
@@ -332,5 +327,8 @@
 			 if isfield(structmd,'drag_p'), md.friction.p=structmd.drag_p; end
 			 if isfield(structmd,'drag_q'), md.friction.q=structmd.drag_q; end
-			 if isfield(structmd,'numrifts'), md.rifts.numrifts=structmd.numrifts; end
+			 if isfield(structmd,'numrifts'),
+				 md.rifts=rifts; %Rifts already existed as a struct in a previous version
+				 md.rifts.numrifts=structmd.numrifts; 
+			 end
 			 if isfield(structmd,'rifts'), md.rifts.riftstruct=structmd.rifts; end
 			 if isfield(structmd,'riftproperties'), md.rifts.riftproperties=structmd.riftproperties; end
@@ -362,7 +360,10 @@
 			 if isfield(structmd,'penalties'), md.prognostic.vertex_pairing=structmd.penalties; end
 			 if isfield(structmd,'penalty_offset'), md.prognostic.penalty_factor=structmd.penalty_offset; end
-			 if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.B; end
-			 if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.n; end
-			 if isfield(structmd,'elementoniceshelf'), md.mask.elementonfloatingice=structmd.elementoniceshelf; end
+			 if isfield(structmd,'rheology_B'), md.materials.rheology_B=structmd.rheology_B; end
+			 if isfield(structmd,'rheology_n'), md.materials.rheology_n=structmd.rheology_n; end
+			 if isfield(structmd,'elementoniceshelf'),
+				 md.mask=mask(); %maks already existed in a previous version
+				 md.mask.elementonfloatingice=structmd.elementoniceshelf; 
+			 end
 			 if isfield(structmd,'elementonicesheet'), md.mask.elementongroundedice=structmd.elementonicesheet; end
 			 if isfield(structmd,'elementonwater'), md.mask.elementonwater=structmd.elementonwater; end
@@ -418,10 +419,10 @@
 				 pos=find(structmd.elements_type==61); md.elements_type(pos,end)=7;
 			 end
-			 if isnumeric(structmd.rheology_law),
+			 if isfield(structmd,'rheology_law') & isnumeric(structmd.rheology_law),
 				 if (structmd.rheology_law==272), md.materials.rheology_law='None';      end
 				 if (structmd.rheology_law==368), md.materials.rheology_law='Paterson';  end
 				 if (structmd.rheology_law==369), md.materials.rheology_law='Arrhenius'; end
 			 end
-			 if isnumeric(structmd.groundingline_migration),
+			 if isfield(structmd,'groundingline_migration') & isnumeric(structmd.groundingline_migration),
 				 if (structmd.groundingline_migration==272), md.groundingline.migration='None';      end
 				 if (structmd.groundingline_migration==273), md.groundingline.migration='AgressiveMigration';  end
@@ -434,13 +435,13 @@
 			 end
 			 if ismember(structmd.cm_responses(end,end),[165:170 383 388 389]),
-				 pos=find(structmd.cm_responses==166), md.control_type(pos)=101;
-				 pos=find(structmd.cm_responses==167), md.control_type(pos)=102;
-				 pos=find(structmd.cm_responses==168), md.control_type(pos)=103;
-				 pos=find(structmd.cm_responses==169), md.control_type(pos)=104;
-				 pos=find(structmd.cm_responses==170), md.control_type(pos)=105;
-				 pos=find(structmd.cm_responses==165), md.control_type(pos)=201;
-				 pos=find(structmd.cm_responses==389), md.control_type(pos)=501;
-				 pos=find(structmd.cm_responses==388), md.control_type(pos)=502;
-				 pos=find(structmd.cm_responses==382), md.control_type(pos)=503;
+				 pos=find(structmd.cm_responses==166); md.control_type(pos)=101;
+				 pos=find(structmd.cm_responses==167); md.control_type(pos)=102;
+				 pos=find(structmd.cm_responses==168); md.control_type(pos)=103;
+				 pos=find(structmd.cm_responses==169); md.control_type(pos)=104;
+				 pos=find(structmd.cm_responses==170); md.control_type(pos)=105;
+				 pos=find(structmd.cm_responses==165); md.control_type(pos)=201;
+				 pos=find(structmd.cm_responses==389); md.control_type(pos)=501;
+				 pos=find(structmd.cm_responses==388); md.control_type(pos)=502;
+				 pos=find(structmd.cm_responses==382); md.control_type(pos)=503;
 			 end
 
