Index: /issm/trunk/src/m/classes/mesh.m
===================================================================
--- /issm/trunk/src/m/classes/mesh.m	(revision 9713)
+++ /issm/trunk/src/m/classes/mesh.m	(revision 9714)
@@ -9,4 +9,10 @@
 		extractedvertices           = modelfield('default',NaN,'marshall',false);
 		extractedelements           = modelfield('default',NaN,'marshall',false);
+		vertexonboundary            = modelfield('default',NaN,'marshall',false);
+		lat        = modelfield('default',NaN,'marshall',false);
+		long       = modelfield('default',NaN,'marshall',false);
+		hemisphere = modelfield('default',NaN,'marshall',false);
+		segments             = modelfield('default',NaN,'marshall',false);
+		segmentmarkers       = modelfield('default',NaN,'marshall',false);
 	end
 	methods
Index: /issm/trunk/src/m/classes/model/model.m
===================================================================
--- /issm/trunk/src/m/classes/model/model.m	(revision 9713)
+++ /issm/trunk/src/m/classes/model/model.m	(revision 9714)
@@ -43,5 +43,4 @@
 		 %FIXME: all other fields should belong to other classes
 
-		 %Mesh
 		 dim                 = modelfield('default',0,'marshall',true,'format','Integer');
 		 numberofelements    = modelfield('default',0,'marshall',true,'format','Integer');
@@ -55,5 +54,4 @@
 		 edges               = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 
-		 %Initial 2d mesh 
 		 numberofelements2d = modelfield('default',0,'marshall',true,'format','Integer');
 		 numberofnodes2d    = modelfield('default',0,'marshall',true,'format','Integer');
@@ -62,14 +60,4 @@
 		 y2d                = modelfield('default',NaN,'marshall',false);
 
-		 %latlon of the coorinates
-		 lat        = modelfield('default',NaN,'marshall',false);
-		 long       = modelfield('default',NaN,'marshall',false);
-		 hemisphere = modelfield('default',NaN,'marshall',false);
-
-		 %Penalties
-		 segments             = modelfield('default',NaN,'marshall',false);
-		 segmentmarkers       = modelfield('default',NaN,'marshall',false);
-
-		 %Projections
 		 uppernodes           = modelfield('default',NaN,'marshall',false);
 		 upperelements        = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',2);
@@ -77,5 +65,4 @@
 		 lowernodes           = modelfield('default',NaN,'marshall',false);
 
-		 %Extrusion
 		 numlayers         = modelfield('default',0,'marshall',true,'format','Integer');
 		 elementonbed      = modelfield('default',NaN,'marshall',true,'format','BooleanMat','mattype',2);
@@ -83,7 +70,4 @@
 		 nodeonbed         = modelfield('default',NaN,'marshall',true,'format','BooleanMat','mattype',1);
 		 nodeonsurface     = modelfield('default',NaN,'marshall',true,'format','BooleanMat','mattype',1);
-
-		 %Boundary conditions
-		 nodeonboundary = modelfield('default',NaN,'marshall',false);
 		 %}}}
 	 end
@@ -234,5 +218,5 @@
 			 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,'gridonboundary'), md.mesh.vertexonboundary=structmd.gridonboundary; end
 			 if isfield(structmd,'petscoptions'), md.solver=structmd.petscoptions; end
 			 if isfield(structmd,'g'), md.constants.g=structmd.g; end
@@ -328,4 +312,10 @@
 			 if isfield(structmd,'extractednodes'), md.mesh.extractedvertices=structmd.extractednodes; end
 			 if isfield(structmd,'extractedelements'), md.mesh.extractedelements=structmd.extractedelements; end
+			 if isfield(structmd,'nodeonboundary'), md.mesh.vertexonboundary=structmd.nodeonboundary; end
+			 if isfield(structmd,'hemisphere'), md.mesh.hemisphere=structmd.hemisphere; end
+			 if isfield(structmd,'lat'), md.mesh.lat=structmd.lat; end
+			 if isfield(structmd,'lon'), md.mesh.lon=structmd.lon; end
+			 if isfield(structmd,'segments'), md.mesh.segments=structmd.segments; end
+			 if isfield(structmd,'segmentmarkers'), md.mesh.segmentmarkers=structmd.segmentmarkers; end
 
 			 %Field changes
Index: /issm/trunk/src/m/kml/kml_mesh_elem.m
===================================================================
--- /issm/trunk/src/m/kml/kml_mesh_elem.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_mesh_elem.m	(revision 9714)
@@ -61,6 +61,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -69,5 +69,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -160,5 +160,5 @@
 
     for j=1:size(md.elements,2)
-        kring.coords(j,:)=[md.long(md.elements(i,j)) md.lat(md.elements(i,j)) alt];
+        kring.coords(j,:)=[md.mesh.long(md.elements(i,j)) md.mesh.lat(md.elements(i,j)) alt];
     end
     kring.coords(end,:)=kring.coords(1,:);
Index: /issm/trunk/src/m/kml/kml_mesh_write.m
===================================================================
--- /issm/trunk/src/m/kml/kml_mesh_write.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_mesh_write.m	(revision 9714)
@@ -67,6 +67,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -75,5 +75,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
Index: /issm/trunk/src/m/kml/kml_part_edges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_edges.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_part_edges.m	(revision 9714)
@@ -62,6 +62,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -70,5 +70,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -234,7 +234,7 @@
 %  if first edge, write out first node
                     if ~elast
-                        kline.coords(end+1,:)=[md.long(edgeper(j,1)) md.lat(edgeper(j,1)) alt];
+                        kline.coords(end+1,:)=[md.mesh.long(edgeper(j,1)) md.mesh.lat(edgeper(j,1)) alt];
                     end
-                    kline.coords(end+1,:)=[md.long(edgeper(j,2)) md.lat(edgeper(j,2)) alt];
+                    kline.coords(end+1,:)=[md.mesh.long(edgeper(j,2)) md.mesh.lat(edgeper(j,2)) alt];
                     elast=elemper(j);
                     nlast=edgeper(j,2);
@@ -323,14 +323,14 @@
 %  write out first node of first side for half-edge to midpoint
 %                                disp(['segment j=' int2str(j) ' unshared half edge from node ' int2str(elemp(ielem,nlast)) ' (node ' int2str(nlast) ') on side ' int2str(slast) ' from element ' int2str(ielem) ' written.'])
-                                kline.coords(end+1,:)=[md.long(elemp(ielem,nlast)) ...
-                                                       md.lat(elemp(ielem,nlast)) alt];
+                                kline.coords(end+1,:)=[md.mesh.long(elemp(ielem,nlast)) ...
+                                                       md.mesh.lat(elemp(ielem,nlast)) alt];
                             end
                             nlast=0;
                             
 %  write out midpoint of first side
-                            kline.coords(end+1,:)=[(md.long(elemp(ielem,slast))...
-                                                   +md.long(elemp(ielem,mod(slast,3)+1)))/2. ...
-                                                   (md.lat(elemp(ielem,slast))...
-                                                   +md.lat(elemp(ielem,mod(slast,3)+1)))/2. alt];
+                            kline.coords(end+1,:)=[(md.mesh.long(elemp(ielem,slast))...
+                                                   +md.mesh.long(elemp(ielem,mod(slast,3)+1)))/2. ...
+                                                   (md.mesh.lat(elemp(ielem,slast))...
+                                                   +md.mesh.lat(elemp(ielem,mod(slast,3)+1)))/2. alt];
                         end
 
@@ -371,8 +371,8 @@
 %  write out half-edge from current node to midpoint of unshared side
 %                            disp(['segment j=' int2str(j) ' unshared half edge from node ' int2str(elemp(ielem,nlast)) ' (node ' int2str(nlast) ') on side ' int2str(slast) ' from element ' int2str(ielem) ' written.'])
-                            kline.coords(end+1,:)=[(md.long(elemp(ielem,nlast))...
-                                                   +md.long(elemp(ielem,nnext)))/2. ...
-                                                   (md.lat(elemp(ielem,nlast))...
-                                                   +md.lat(elemp(ielem,nnext)))/2. alt];
+                            kline.coords(end+1,:)=[(md.mesh.long(elemp(ielem,nlast))...
+                                                   +md.mesh.long(elemp(ielem,nnext)))/2. ...
+                                                   (md.mesh.lat(elemp(ielem,nlast))...
+                                                   +md.mesh.lat(elemp(ielem,nnext)))/2. alt];
                             nlast=0;
 
@@ -404,6 +404,6 @@
 %  all different, so cut through centroid
 %                                disp(['element ielem=' int2str(ielem) ' centroid written.'])
-                                kline.coords(end+1,:)=[sum(md.long(elemp(ielem,:)))/3. ...
-                                                       sum(md.lat(elemp(ielem,:)))/3. alt];
+                                kline.coords(end+1,:)=[sum(md.mesh.long(elemp(ielem,:)))/3. ...
+                                                       sum(md.mesh.lat(elemp(ielem,:)))/3. alt];
                             end
 %  one node is in current partition, so cut off other two nodes
@@ -419,8 +419,8 @@
 %  write out midpoint of opposite side
 %                        disp(['segment j=' int2str(j) ' internal edge from side ' int2str(slast) ' to side ' int2str(snext) ' from element ' int2str(ielem) ' written.'])
-                        kline.coords(end+1,:)=[(md.long(elemp(ielem,snext))...
-                                               +md.long(elemp(ielem,mod(snext,3)+1)))/2. ...
-                                               (md.lat(elemp(ielem,snext))...
-                                               +md.lat(elemp(ielem,mod(snext,3)+1)))/2. alt];
+                        kline.coords(end+1,:)=[(md.mesh.long(elemp(ielem,snext))...
+                                               +md.mesh.long(elemp(ielem,mod(snext,3)+1)))/2. ...
+                                               (md.mesh.lat(elemp(ielem,snext))...
+                                               +md.mesh.lat(elemp(ielem,mod(snext,3)+1)))/2. alt];
                         elast=ielem;
                         nlast=0;
@@ -451,6 +451,6 @@
                             end
 %                            disp(['segment j=' int2str(j) ' unshared half edge on side ' int2str(slast) ' to node ' int2str(elemp(elast,nnext)) ' (node ' int2str(nnext) ') from element ' int2str(elast) ' written.'])
-                            kline.coords(end+1,:)=[md.long(elemp(elast,nnext)) ...
-                                                   md.lat(elemp(elast,nnext)) alt];
+                            kline.coords(end+1,:)=[md.mesh.long(elemp(elast,nnext)) ...
+                                                   md.mesh.lat(elemp(elast,nnext)) alt];
                             break
 %  if not unshared, advance perimeter list and watch for end
Index: /issm/trunk/src/m/kml/kml_part_elems.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_elems.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_part_elems.m	(revision 9714)
@@ -62,6 +62,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -70,5 +70,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -199,5 +199,5 @@
 
             for j=1:size(elem,2)
-                kring.coords(j,:)=[md.long(elem(i,j)) md.lat(elem(i,j)) alt];
+                kring.coords(j,:)=[md.mesh.long(elem(i,j)) md.mesh.lat(elem(i,j)) alt];
             end
             kring.coords(end,:)=kring.coords(1,:);
Index: /issm/trunk/src/m/kml/kml_part_flagedges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_flagedges.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_part_flagedges.m	(revision 9714)
@@ -54,6 +54,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -62,5 +62,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -74,5 +74,5 @@
 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ...
     md.qmu.numberofpartitions
-    [latseg,lonseg]=flagedges(md.elements,md.lat,md.long,md.qmu.partition);
+    [latseg,lonseg]=flagedges(md.elements,md.mesh.lat,md.mesh.long,md.qmu.partition);
     kfold=kml_folder();
     kfold.name      ='Partition Segments';
Index: /issm/trunk/src/m/kml/kml_partitions.m
===================================================================
--- /issm/trunk/src/m/kml/kml_partitions.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_partitions.m	(revision 9714)
@@ -63,6 +63,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -71,5 +71,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -236,7 +236,7 @@
 %  if first edge, write out first node
                     if ~elast
-                        kring.coords(end+1,:)=[md.long(edgeper(j,1)) md.lat(edgeper(j,1)) alt];
+                        kring.coords(end+1,:)=[md.mesh.long(edgeper(j,1)) md.mesh.lat(edgeper(j,1)) alt];
                     end
-                    kring.coords(end+1,:)=[md.long(edgeper(j,2)) md.lat(edgeper(j,2)) alt];
+                    kring.coords(end+1,:)=[md.mesh.long(edgeper(j,2)) md.mesh.lat(edgeper(j,2)) alt];
                     elast=elemper(j);
                     nlast=edgeper(j,2);
@@ -325,14 +325,14 @@
 %  write out first node of first side for half-edge to midpoint
 %                                disp(['segment j=' int2str(j) ' unshared half edge from node ' int2str(elemp(ielem,nlast)) ' (node ' int2str(nlast) ') on side ' int2str(slast) ' from element ' int2str(ielem) ' written.'])
-                                kring.coords(end+1,:)=[md.long(elemp(ielem,nlast)) ...
-                                                       md.lat(elemp(ielem,nlast)) alt];
+                                kring.coords(end+1,:)=[md.mesh.long(elemp(ielem,nlast)) ...
+                                                       md.mesh.lat(elemp(ielem,nlast)) alt];
                             end
                             nlast=0;
                             
 %  write out midpoint of first side
-                            kring.coords(end+1,:)=[(md.long(elemp(ielem,slast))...
-                                                   +md.long(elemp(ielem,mod(slast,3)+1)))/2. ...
-                                                   (md.lat(elemp(ielem,slast))...
-                                                   +md.lat(elemp(ielem,mod(slast,3)+1)))/2. alt];
+                            kring.coords(end+1,:)=[(md.mesh.long(elemp(ielem,slast))...
+                                                   +md.mesh.long(elemp(ielem,mod(slast,3)+1)))/2. ...
+                                                   (md.mesh.lat(elemp(ielem,slast))...
+                                                   +md.mesh.lat(elemp(ielem,mod(slast,3)+1)))/2. alt];
                         end
 
@@ -373,8 +373,8 @@
 %  write out half-edge from current node to midpoint of unshared side
 %                            disp(['segment j=' int2str(j) ' unshared half edge from node ' int2str(elemp(ielem,nlast)) ' (node ' int2str(nlast) ') on side ' int2str(slast) ' from element ' int2str(ielem) ' written.'])
-                            kring.coords(end+1,:)=[(md.long(elemp(ielem,nlast))...
-                                                   +md.long(elemp(ielem,nnext)))/2. ...
-                                                   (md.lat(elemp(ielem,nlast))...
-                                                   +md.lat(elemp(ielem,nnext)))/2. alt];
+                            kring.coords(end+1,:)=[(md.mesh.long(elemp(ielem,nlast))...
+                                                   +md.mesh.long(elemp(ielem,nnext)))/2. ...
+                                                   (md.mesh.lat(elemp(ielem,nlast))...
+                                                   +md.mesh.lat(elemp(ielem,nnext)))/2. alt];
                             nlast=0;
 
@@ -406,6 +406,6 @@
 %  all different, so cut through centroid
 %                                disp(['element ielem=' int2str(ielem) ' centroid written.'])
-                                kring.coords(end+1,:)=[sum(md.long(elemp(ielem,:)))/3. ...
-                                                       sum(md.lat(elemp(ielem,:)))/3. alt];
+                                kring.coords(end+1,:)=[sum(md.mesh.long(elemp(ielem,:)))/3. ...
+                                                       sum(md.mesh.lat(elemp(ielem,:)))/3. alt];
                             end
 %  one node is in current partition, so cut off other two nodes
@@ -421,8 +421,8 @@
 %  write out midpoint of opposite side
 %                        disp(['segment j=' int2str(j) ' internal edge from side ' int2str(slast) ' to side ' int2str(snext) ' from element ' int2str(ielem) ' written.'])
-                        kring.coords(end+1,:)=[(md.long(elemp(ielem,snext))...
-                                               +md.long(elemp(ielem,mod(snext,3)+1)))/2. ...
-                                               (md.lat(elemp(ielem,snext))...
-                                               +md.lat(elemp(ielem,mod(snext,3)+1)))/2. alt];
+                        kring.coords(end+1,:)=[(md.mesh.long(elemp(ielem,snext))...
+                                               +md.mesh.long(elemp(ielem,mod(snext,3)+1)))/2. ...
+                                               (md.mesh.lat(elemp(ielem,snext))...
+                                               +md.mesh.lat(elemp(ielem,mod(snext,3)+1)))/2. alt];
                         elast=ielem;
                         nlast=0;
@@ -453,6 +453,6 @@
                             end
 %                            disp(['segment j=' int2str(j) ' unshared half edge on side ' int2str(slast) ' to node ' int2str(elemp(elast,nnext)) ' (node ' int2str(nnext) ') from element ' int2str(elast) ' written.'])
-                            kring.coords(end+1,:)=[md.long(elemp(elast,nnext)) ...
-                                                   md.lat(elemp(elast,nnext)) alt];
+                            kring.coords(end+1,:)=[md.mesh.long(elemp(elast,nnext)) ...
+                                                   md.mesh.lat(elemp(elast,nnext)) alt];
                             break
 %  if not unshared, advance perimeter list and watch for end
Index: /issm/trunk/src/m/kml/kml_unsh_edges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_unsh_edges.m	(revision 9713)
+++ /issm/trunk/src/m/kml/kml_unsh_edges.m	(revision 9714)
@@ -54,6 +54,6 @@
 end
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
     if     ~exist('latsgn','var')
         error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
@@ -62,5 +62,5 @@
     else
         display('Converting x/y data to lat/long data.');
-        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
+        [md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,latsgn);
     end
 end
@@ -104,5 +104,5 @@
 
         for j=1:2
-            kline.coords(j,:)=[md.long(edgeuns(i,j)) md.lat(edgeuns(i,j)) alt];
+            kline.coords(j,:)=[md.mesh.long(edgeuns(i,j)) md.mesh.lat(edgeuns(i,j)) alt];
         end
 
Index: /issm/trunk/src/m/model/bamg.m
===================================================================
--- /issm/trunk/src/m/model/bamg.m	(revision 9713)
+++ /issm/trunk/src/m/model/bamg.m	(revision 9714)
@@ -321,6 +321,6 @@
 md.elements=bamgmesh_out.Triangles(:,1:3);
 md.edges=bamgmesh_out.IssmEdges;
-md.segments=bamgmesh_out.IssmSegments(:,1:3);
-md.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
+md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
+md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
 
 %Fill in rest of fields:
@@ -334,5 +334,5 @@
 md.elementonbed=ones(md.numberofelements,1);
 md.elementonsurface=ones(md.numberofelements,1);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.elementconnectivity=md.private.bamg.mesh.ElementConnectivity;
 md.elementconnectivity(find(isnan(md.elementconnectivity)))=0;
Index: /issm/trunk/src/m/model/collapse.m
===================================================================
--- /issm/trunk/src/m/model/collapse.m	(revision 9713)
+++ /issm/trunk/src/m/model/collapse.m	(revision 9714)
@@ -83,5 +83,5 @@
 md.geometry.thickness=project2d(md,md.geometry.thickness,1);
 md.geometry.bed=project2d(md,md.geometry.bed,1);
-md.nodeonboundary=project2d(md,md.nodeonboundary,1);
+md.mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
 md.mask.elementonfloatingice=project2d(md,md.mask.elementonfloatingice,1);
 md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1);
Index: /issm/trunk/src/m/model/extrude.m
===================================================================
--- /issm/trunk/src/m/model/extrude.m	(revision 9713)
+++ /issm/trunk/src/m/model/extrude.m	(revision 9714)
@@ -202,5 +202,5 @@
 md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node');
 md.geometry.bathymetry=project3d(md,'vector',md.geometry.bathymetry,'type','node');
-md.nodeonboundary=project3d(md,'vector',md.nodeonboundary,'type','node');
+md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
 md.mask.elementonfloatingice=project3d(md,'vector',md.mask.elementonfloatingice,'type','element');
 md.mask.vertexonfloatingice=project3d(md,'vector',md.mask.vertexonfloatingice,'type','node');
Index: /issm/trunk/src/m/model/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/model/ismodelselfconsistent.m	(revision 9713)
+++ /issm/trunk/src/m/model/ismodelselfconsistent.m	(revision 9714)
@@ -151,5 +151,5 @@
 		message(['model not consistent: md.rifts should be a structure!']);
 	end
-	if ~isempty(find(md.segmentmarkers>=2)),
+	if ~isempty(find(md.mesh.segmentmarkers>=2)),
 		%We have segments with rift markers, but no rift structure!
 		message(['model not consistent: model ' md.miscellaneous.name ' should be processed for rifts (run meshprocessrifts)!']);
Index: /issm/trunk/src/m/model/kmlimagesc.m
===================================================================
--- /issm/trunk/src/m/model/kmlimagesc.m	(revision 9713)
+++ /issm/trunk/src/m/model/kmlimagesc.m	(revision 9714)
@@ -20,26 +20,26 @@
 fontsize=getfieldvalue(options,'fontsize',12);
 posting=getfieldvalue(options,'posting',.1);
-minlong=getfieldvalue(options,'minlong',min(md.long));
-maxlong=getfieldvalue(options,'maxlong',max(md.long));
-minlat=getfieldvalue(options,'minlat',min(md.lat));
-maxlat=getfieldvalue(options,'maxlat',max(md.lat));
+minlong=getfieldvalue(options,'minlong',min(md.mesh.long));
+maxlong=getfieldvalue(options,'maxlong',max(md.mesh.long));
+minlat=getfieldvalue(options,'minlat',min(md.mesh.lat));
+maxlat=getfieldvalue(options,'maxlat',max(md.mesh.lat));
 minfield=getfieldvalue(options,'minfield',min(field));
 maxfield=getfieldvalue(options,'maxfield',max(field));
 
 %do we have hemisphere setup?:
-if ~isstr(md.hemisphere),
-	error('md.hemisphere should be ''s'' or ''n''');
+if ~isstr(md.mesh.hemisphere),
+	error('md.mesh.hemisphere should be ''s'' or ''n''');
 end
 
-if strcmpi(md.hemisphere,'s'),
+if strcmpi(md.mesh.hemisphere,'s'),
 	hemisphere=1;
 	central_meridian=getfieldvalue(options,'central_meridian',45);
 	standard_parallel=getfieldvalue(options,'standard_parallel',70);
-elseif strcmpi(md.hemisphere,'n'),
+elseif strcmpi(md.mesh.hemisphere,'n'),
 	hemisphere=-1;
 	central_meridian=getfieldvalue(options,'central_meridian',0);
 	standard_parallel=getfieldvalue(options,'standard_parallel',71);
 else
-	error('md.hemisphere should be ''s'' or ''n''');
+	error('md.mesh.hemisphere should be ''s'' or ''n''');
 end
 
@@ -49,5 +49,5 @@
 
 %regrid to lat,long grid
-[x_m,y_m,field]=InterpFromMeshToGrid(md.elements,md.long,md.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
+[x_m,y_m,field]=InterpFromMeshToGrid(md.elements,md.mesh.long,md.mesh.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
 field=flipud(field);
 
Index: /issm/trunk/src/m/model/mesh/meshconvert.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshconvert.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/meshconvert.m	(revision 9714)
@@ -32,6 +32,6 @@
 md.elements=bamgmesh_out.Triangles(:,1:3);
 md.edges=bamgmesh_out.IssmEdges;
-md.segments=bamgmesh_out.IssmSegments(:,1:3);
-md.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
+md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
+md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
 
 %Fill in rest of fields:
@@ -45,3 +45,3 @@
 md.elementonbed=ones(md.numberofelements,1);
 md.elementonsurface=ones(md.numberofelements,1);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
Index: /issm/trunk/src/m/model/mesh/meshnodensity.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshnodensity.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/meshnodensity.m	(revision 9714)
@@ -25,5 +25,5 @@
 %Mesh using TriMeshNoDensity
 if strcmp(riftname,''),
-	[md.elements,md.x,md.y,md.segments,md.segmentmarkers]=TriMeshNoDensity(domainname);
+	[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshNoDensity(domainname);
 else
 	[elements,x,y,segments,segmentmarkers]=TriMeshNoDensity(domainname,riftname);
@@ -50,6 +50,6 @@
 	md.y=y;
 	md.elements=elements;
-	md.segments=segments;
-	md.segmentmarkers=segmentmarkers;
+	md.mesh.segments=segments;
+	md.mesh.segmentmarkers=segmentmarkers;
 end
 
@@ -58,5 +58,5 @@
 md.numberofnodes=length(md.x);
 md.z=zeros(md.numberofnodes,1);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.nodeonbed=ones(md.numberofnodes,1);
 md.nodeonsurface=ones(md.numberofnodes,1);
Index: /issm/trunk/src/m/model/mesh/meshrefine.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshrefine.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/meshrefine.m	(revision 9714)
@@ -16,5 +16,5 @@
 
 %Refine using TriMeshRefine
-[md.elements,md.x,md.y,md.segments,md.segmentmarkers]=TriMeshRefine(md.elements,md.x,md.y,md.segments,md.segmentmarkers,areas,'yes');
+[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshRefine(md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,areas,'yes');
 
 %Fill in rest of fields:
@@ -22,5 +22,5 @@
 md.numberofnodes=length(md.x);
 md.z=zeros(md.numberofnodes,1);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.nodeonbed=ones(md.numberofnodes,1);
 md.nodeonsurface=ones(md.numberofnodes,1);
Index: /issm/trunk/src/m/model/mesh/meshyams.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshyams.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/meshyams.m	(revision 9714)
@@ -97,5 +97,5 @@
 		md.nodeconnectivity=NodeConnectivity(md.elements,md.numberofnodes);
 		md.elementconnectivity=ElementConnectivity(md.elements,md.nodeconnectivity);
-		md.segments=findsegments(md);
+		md.mesh.segments=findsegments(md);
 		md=meshyamsrecreateriftsegments(md);
 	end
@@ -110,6 +110,6 @@
 
 %recreate segments
-md.segments=findsegments(md);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.segments=findsegments(md);
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 
 %Fill in rest of fields:
Index: /issm/trunk/src/m/model/mesh/reorder.m
===================================================================
--- /issm/trunk/src/m/model/mesh/reorder.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/reorder.m	(revision 9714)
@@ -21,7 +21,7 @@
 %update all fields
 md.elements=tnewnodes(md.elements(newelements,:));
-md.segments=[tnewnodes(md.segments(:,1)) tnewnodes(md.segments(:,2)) tnewelements(md.segments(:,3))];
+md.mesh.segments=[tnewnodes(md.mesh.segments(:,1)) tnewnodes(md.mesh.segments(:,2)) tnewelements(md.mesh.segments(:,3))];
 md.x=md.x(newnodes);
 md.y=md.y(newnodes);
 md.z=md.z(newnodes);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
Index: /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m	(revision 9714)
@@ -74,11 +74,11 @@
 	end
 	
-	md.segments(:,1:2)=nodeconv(md.segments(:,1:2));
-	md.segments(:,3)=elconv(md.segments(:,3));
+	md.mesh.segments(:,1:2)=nodeconv(md.mesh.segments(:,1:2));
+	md.mesh.segments(:,3)=elconv(md.mesh.segments(:,3));
 
 end
 
 %finish up "a la" mesh.h
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.nodeonbed=ones(md.numberofnodes,1);
 md.nodeonsurface=ones(md.numberofnodes,1);
Index: /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 9714)
@@ -68,12 +68,12 @@
 
 		%deal with segments
-		tipsegments=find((md.segments(:,1)==tip) | (md.segments(:,2)==tip));
+		tipsegments=find((md.mesh.segments(:,1)==tip) | (md.mesh.segments(:,2)==tip));
 		for  k=1:length(tipsegments),
 			segment_index=tipsegments(k);
-			pos=find(md.segments(segment_index,1:2)~=tip);
-			other_node=md.segments(segment_index,pos);
+			pos=find(md.mesh.segments(segment_index,1:2)~=tip);
+			other_node=md.mesh.segments(segment_index,pos);
 			if ~isconnected(md.elements,other_node,tip),
-				pos=find(md.segments(segment_index,1:2)==tip);
-				md.segments(segment_index,pos)=num;
+				pos=find(md.mesh.segments(segment_index,1:2)==tip);
+				md.mesh.segments(segment_index,pos)=num;
 			end
 		end
@@ -86,5 +86,5 @@
 md.numberofnodes=length(md.x);
 md.z=zeros(md.numberofnodes,1);
-md.nodeonboundary=zeros(length(md.x),1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(length(md.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.rifts.numrifts=length(md.rifts.riftstruct);
 md.flowequation.element_equation=3*ones(md.numberofelements,1);
Index: /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 9714)
@@ -25,5 +25,5 @@
 
 %Call MEX file
-[md.elements,md.x,md.y,md.segments,md.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.elements,md.x,md.y,md.segments,md.segmentmarkers);
+[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers);
 if ~isstruct(md.rifts.riftstruct),
 	error('TriMeshProcessRifts did not find any rift');
@@ -34,5 +34,5 @@
 md.numberofnodes=length(md.x);
 md.z=zeros(md.numberofnodes,1);
-md.nodeonboundary=zeros(length(md.x),1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(length(md.x),1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.rifts.numrifts=length(md.rifts.riftstruct);
 md.flowequation.element_equation=3*ones(md.numberofelements,1);
Index: /issm/trunk/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/rifts/meshyamsrecreateriftsegments.m	(revision 9714)
@@ -11,19 +11,19 @@
 
 				%find tip1 and tip2 for this rift, in the new mesh created by yams.
-				pos=find_point(md.x(md.segments(:,1)),md.y(md.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
-				tip1=md.segments(pos,1);
-				pos=find_point(md.x(md.segments(:,1)),md.y(md.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
-				tip2=md.segments(pos,1);
+				pos=find_point(md.x(md.mesh.segments(:,1)),md.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+				tip1=md.mesh.segments(pos,1);
+				pos=find_point(md.x(md.mesh.segments(:,1)),md.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
+				tip2=md.mesh.segments(pos,1);
 
 				%start from tip1, and build segments of this rift. 
-				pos=find_point(md.x(md.segments(:,1)),md.y(md.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+				pos=find_point(md.x(md.mesh.segments(:,1)),md.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
 				pos_record=[pos_record; pos];
-				riftsegs=md.segments(pos,:);
+				riftsegs=md.mesh.segments(pos,:);
 				while 1,
 					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
 					%find other segment that holds B.
-					pos=find(md.segments(:,1)==B);
+					pos=find(md.mesh.segments(:,1)==B);
 					pos_record=[pos_record; pos];
-					riftsegs=[riftsegs; md.segments(pos,:)];
+					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
 					if riftsegs(end,2)==tip1, 
 						break;
@@ -39,8 +39,8 @@
 
 				%find tip1 and tip2 for this rift, in the new mesh created by yams.
-				pos1=find_point(md.x(md.segments(:,1)),md.y(md.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
-				tip1=md.segments(pos1,1);
-				pos2=find_point(md.x(md.segments(:,1)),md.y(md.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
-				tip2=md.segments(pos2,1);
+				pos1=find_point(md.x(md.mesh.segments(:,1)),md.y(md.mesh.segments(:,1)),rift.tip1coordinates(1),rift.tip1coordinates(2));
+				tip1=md.mesh.segments(pos1,1);
+				pos2=find_point(md.x(md.mesh.segments(:,1)),md.y(md.mesh.segments(:,1)),rift.tip2coordinates(1),rift.tip2coordinates(2));
+				tip2=md.mesh.segments(pos2,1);
 				if length(tip1)==2,
 					%swap.
@@ -53,11 +53,11 @@
 
 				pos_record=[pos_record; pos];
-				riftsegs=md.segments(pos,:);
+				riftsegs=md.mesh.segments(pos,:);
 				while 1,
 					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
 					%find other segment that holds B.
-					pos=find(md.segments(:,1)==B);
+					pos=find(md.mesh.segments(:,1)==B);
 					pos_record=[pos_record; pos];
-					riftsegs=[riftsegs; md.segments(pos,:)];
+					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
 					if ((riftsegs(end,2)==tip2(1)) | (riftsegs(end,2)==tip2(2))), 
 						%figure out which tip we reached
@@ -70,11 +70,11 @@
 				pos=pos2(index);
 				pos_record=[pos_record; pos];
-				riftsegs=[riftsegs; md.segments(pos,:)];
+				riftsegs=[riftsegs; md.mesh.segments(pos,:)];
 				while 1,
 					A=riftsegs(end,1); B=riftsegs(end,2); el=riftsegs(end,3);
 					%find other segment that holds B.
-					pos=find(md.segments(:,1)==B);
+					pos=find(md.mesh.segments(:,1)==B);
 					pos_record=[pos_record; pos];
-					riftsegs=[riftsegs; md.segments(pos,:)];
+					riftsegs=[riftsegs; md.mesh.segments(pos,:)];
 					if riftsegs(end,2)==tip1, 
 						break;
@@ -88,3 +88,3 @@
 	end
 	%take out rift segments from segments
-	md.segments(pos_record,:)=[];
+	md.mesh.segments(pos_record,:)=[];
Index: /issm/trunk/src/m/model/mesh/setmesh.m
===================================================================
--- /issm/trunk/src/m/model/mesh/setmesh.m	(revision 9713)
+++ /issm/trunk/src/m/model/mesh/setmesh.m	(revision 9714)
@@ -39,5 +39,5 @@
 %Mesh using TriMesh
 if strcmp(riftname,''),
-	[md.elements,md.x,md.y,md.segments,md.segmentmarkers]=TriMesh(domainname,area,'yes');
+	[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMesh(domainname,area,'yes');
 else
 	[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area,'yes');
@@ -64,6 +64,6 @@
 	md.y=y;
 	md.elements=elements;
-	md.segments=segments;
-	md.segmentmarkers=segmentmarkers;
+	md.mesh.segments=segments;
+	md.mesh.segmentmarkers=segmentmarkers;
 end
 
@@ -72,5 +72,5 @@
 md.numberofnodes=length(md.x);
 md.z=zeros(md.numberofnodes,1);
-md.nodeonboundary=zeros(md.numberofnodes,1); md.nodeonboundary(md.segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1); md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
 md.nodeonbed=ones(md.numberofnodes,1);
 md.nodeonsurface=ones(md.numberofnodes,1);
Index: /issm/trunk/src/m/model/modelextract.m
===================================================================
--- /issm/trunk/src/m/model/modelextract.m	(revision 9713)
+++ /issm/trunk/src/m/model/modelextract.m	(revision 9714)
@@ -206,5 +206,5 @@
 		md2.elementconnectivity=ElementConnectivity(md2.elements,md2.nodeconnectivity);
 		md2.segments=contourenvelope(md2);
-		md2.nodeonboundary=zeros(numberofnodes2,1); md2.nodeonboundary(md2.segments(:,1:2))=1;
+		md2.mesh.vertexonboundary=zeros(numberofnodes2,1); md2.nodeonboundary(md2.segments(:,1:2))=1;
 	end
 
Index: /issm/trunk/src/m/model/outflow.m
===================================================================
--- /issm/trunk/src/m/model/outflow.m	(revision 9713)
+++ /issm/trunk/src/m/model/outflow.m	(revision 9714)
@@ -5,6 +5,6 @@
 %      flag=outflow(md);
 
-A=md.segments(:,1);
-B=md.segments(:,2);
+A=md.mesh.segments(:,1);
+B=md.mesh.segments(:,2);
 Nx=-(md.y(A)-md.y(B));
 Ny=  md.x(A)-md.x(B);
Index: /issm/trunk/src/m/model/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/model/plot/applyoptions.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/applyoptions.m	(revision 9714)
@@ -9,6 +9,6 @@
 
 %some defaults
-if strcmpi(md.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
-elseif strcmpi(md.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
+if strcmpi(md.mesh.hemisphere,'n'), options=addfielddefault(options,'hemisphere','n'); 
+elseif strcmpi(md.mesh.hemisphere,'s'), options=addfielddefault(options,'hemisphere','s'); 
 end
 
@@ -410,8 +410,8 @@
 	axis equal off
 	%box off
-	if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
+	if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
 		A=expread([ issmdir() '/projects/Exp/GreenlandBoxFront.exp']);
 		[A.x A.y]=ll2xy(A.x,A.y,+1,45,70);
-	elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
+	elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
 		A=expread([ issmdir() '/projects/Exp/Antarctica.exp']);
 	else
Index: /issm/trunk/src/m/model/plot/kmlgroundoverlay.m
===================================================================
--- /issm/trunk/src/m/model/plot/kmlgroundoverlay.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/kmlgroundoverlay.m	(revision 9714)
@@ -12,5 +12,5 @@
 
 %first figure out if lat and long were computed!
-if (isempty(md.lat) | isempty(md.long)),
+if (isempty(md.mesh.lat) | isempty(md.mesh.long)),
 	error('kmlgroundoverlay error message: project x,y onto lat,long fields of model!');
 end
@@ -28,8 +28,8 @@
 
 %figure out  min and max for lat and long of this image:
-west=min(md.long);
-east=max(md.long);
-south=min(md.lat);
-north=max(md.lat);
+west=min(md.mesh.long);
+east=max(md.mesh.long);
+south=min(md.mesh.lat);
+north=max(md.mesh.lat);
 
 %print image at high resolution
Index: /issm/trunk/src/m/model/plot/latlonoverlay.m
===================================================================
--- /issm/trunk/src/m/model/plot/latlonoverlay.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/latlonoverlay.m	(revision 9714)
@@ -66,8 +66,8 @@
 	latitudes =lat*ones(size(longitudes));
 
-	if strcmpi(md.hemisphere,'n'),
+	if strcmpi(md.mesh.hemisphere,'n'),
 		if lat<0, continue; end
 		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
-	elseif strcmpi(md.hemisphere,'s'),
+	elseif strcmpi(md.mesh.hemisphere,'s'),
 		if lat>0, continue; end
 		[x,y]=ll2xy(latitudes,longitudes,-1, 0,71);
@@ -105,9 +105,9 @@
 for lon=-180:lonstep:180
 
-	if strcmpi(md.hemisphere,'n'),
+	if strcmpi(md.mesh.hemisphere,'n'),
 		latitudes =0:resolution:90;
 		longitudes=lon*ones(size(latitudes));
 		[x,y]=ll2xy(latitudes,longitudes,+1,45,70);
-	elseif strcmpi(md.hemisphere,'s'),
+	elseif strcmpi(md.mesh.hemisphere,'s'),
 		latitudes =-90:resolution:0;
 		longitudes=lon*ones(size(latitudes));
Index: /issm/trunk/src/m/model/plot/plot_boundaries.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_boundaries.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_boundaries.m	(revision 9714)
@@ -15,6 +15,6 @@
 [x y z elements is2d isplanet]=processmesh(md,[],options);
 
-for i=1:size(md.segments,1),
-	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');hold on;
+for i=1:size(md.mesh.segments,1),
+	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');hold on;
 end
 
Index: /issm/trunk/src/m/model/plot/plot_riftfraction.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_riftfraction.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_riftfraction.m	(revision 9714)
@@ -19,6 +19,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
+for i=1:size(md.mesh.segments,1),
+	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
 end
 
Index: /issm/trunk/src/m/model/plot/plot_riftnumbering.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_riftnumbering.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_riftnumbering.m	(revision 9714)
@@ -15,6 +15,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
+for i=1:size(md.mesh.segments,1),
+	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
 end
 
@@ -24,6 +24,6 @@
 if isstruct(md.rifts.riftstruct),
 	%plot mesh boundaries
-	for i=1:size(md.segments,1),
-		h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
+	for i=1:size(md.mesh.segments,1),
+		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
 	end
 	for i=1:size(md.rifts.riftstruct,1),
Index: /issm/trunk/src/m/model/plot/plot_riftpenetration.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_riftpenetration.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_riftpenetration.m	(revision 9714)
@@ -14,6 +14,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k-');
+for i=1:size(md.mesh.segments,1),
+	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
 end
 
@@ -23,6 +23,6 @@
 if isstruct(md.rifts.riftstruct),
 	%plot mesh boundaries
-	for i=1:size(md.segments,1),
-		h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
+	for i=1:size(md.mesh.segments,1),
+		h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
 	end
 	for i=1:size(md.rifts.riftstruct,1),
Index: /issm/trunk/src/m/model/plot/plot_riftrelvel.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_riftrelvel.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_riftrelvel.m	(revision 9714)
@@ -39,6 +39,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k-');
+for i=1:size(md.mesh.segments,1),
+	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
 end
 
@@ -59,6 +59,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
+for i=1:size(md.mesh.segments,1),
+	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
 end
 for i=1:md.rifts.numrifts,
Index: /issm/trunk/src/m/model/plot/plot_riftvel.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_riftvel.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_riftvel.m	(revision 9714)
@@ -35,6 +35,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
+for i=1:size(md.mesh.segments,1),
+	plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k.-');
 end
 
@@ -53,6 +53,6 @@
 
 %plot mesh boundaries
-for i=1:size(md.segments,1),
-	h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
+for i=1:size(md.mesh.segments,1),
+	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
 end
 
Index: /issm/trunk/src/m/model/plot/plot_segments.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_segments.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/plot_segments.m	(revision 9714)
@@ -12,5 +12,5 @@
 %process mesh and data
 [x y z elements is2d isplanet]=processmesh(md,[],options);
-segments=md.segments;
+segments=md.mesh.segments;
 
 if (md.dim==2),
@@ -27,5 +27,5 @@
 	if strcmpi(getfieldvalue(options,'segmentnumbering','off'),'on'),
 		text(sum(x(segments(:,1:2)),2)/2,sum(y(segments(:,1:2)),2)/2,sum(z(segments(:,1:2)),2)/2+1,...
-			num2str(md.segmentmarkers),...
+			num2str(md.mesh.segmentmarkers),...
 			'backgroundcolor',[0.8 0.9 0.8],'HorizontalAlignment','center','VerticalAlignment','middle');
 	end
Index: /issm/trunk/src/m/model/plot/processmesh.m
===================================================================
--- /issm/trunk/src/m/model/plot/processmesh.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/processmesh.m	(revision 9714)
@@ -21,7 +21,7 @@
 		y2d=md.y2d;
 	else
-		x=md.long;
+		x=md.mesh.long;
 		x2d=md.x2d;
-		y=md.lat;
+		y=md.mesh.lat;
 		y2d=md.y2d;
 	end
Index: /issm/trunk/src/m/model/plot/showregion.m
===================================================================
--- /issm/trunk/src/m/model/plot/showregion.m	(revision 9713)
+++ /issm/trunk/src/m/model/plot/showregion.m	(revision 9714)
@@ -15,7 +15,7 @@
 axis equal off
 %box off
-if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
+if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
 	A=expread([issmdir() 'projects/Exp/Greenland.exp']);
-elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
+elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
 	A=expread([issmdir() '/projects/Exp/Antarctica.exp']);
 else
Index: /issm/trunk/src/m/model/radarpower.m
===================================================================
--- /issm/trunk/src/m/model/radarpower.m	(revision 9713)
+++ /issm/trunk/src/m/model/radarpower.m	(revision 9714)
@@ -29,5 +29,5 @@
 %figure out if we should go look for Greenland or Antarctica geotiff, or if user provided one.
 if ~exist(options,'overlay_image'),
-	if strcmpi(md.hemisphere,'n'),
+	if strcmpi(md.mesh.hemisphere,'n'),
 		if ~exist([issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg']),
 			error(['radarpower error message: file ' issmdir() '/projects/ModelData/MOG/mog150_greenland_map.jpg not found.']);
@@ -56,5 +56,5 @@
 		md.radaroverlay.y=(ymin:(ymax-ymin)/(size(md.radaroverlay.pwr,1)-1):ymax);
 
-	elseif strcmpi(md.hemisphere,'s'),
+	elseif strcmpi(md.mesh.hemisphere,'s'),
 		if highres,
 			if ~exist([issmdir() '/projects/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif']),
Index: /issm/trunk/src/m/model/setmask2.m
===================================================================
--- /issm/trunk/src/m/model/setmask2.m	(revision 9713)
+++ /issm/trunk/src/m/model/setmask2.m	(revision 9714)
@@ -120,5 +120,5 @@
 
 %call findsegments to build segment using THIS conectivity
-md.segments=findsegments(md,'elementconnectivity',elementconnectivity);
+md.mesh.segments=findsegments(md,'elementconnectivity',elementconnectivity);
 
 %some final checks: 
@@ -146,3 +146,3 @@
 md.mask.elementongroundedice=elementongroundedice;
 
-md.segmentmarkers(:)=1;
+md.mesh.segmentmarkers(:)=1;
Index: /issm/trunk/src/m/solutions/flaim.m
===================================================================
--- /issm/trunk/src/m/solutions/flaim.m	(revision 9713)
+++ /issm/trunk/src/m/solutions/flaim.m	(revision 9714)
@@ -50,6 +50,6 @@
 %  calculate latitude and longitude, if necessary 
 
-if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
-   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
+if isempty(md.mesh.lat)  || ((numel(md.mesh.lat) == 1)  && isnan(md.mesh.lat)) || ...
+   isempty(md.mesh.long) || ((numel(md.mesh.long) == 1) && isnan(md.mesh.long))
 	if     ~isfield(options,'latsgn')
 		error(['Missing ''latsgn'' parameter to calculate missing lat/long values.']);
@@ -58,5 +58,5 @@
 	else
 		display('Converting x/y values to lat/long values.');
-		[md.lat,md.long]=xy2ll(md.x,md.y,options.latsgn);
+		[md.mesh.lat,md.mesh.long]=xy2ll(md.x,md.y,options.latsgn);
 	end
 end
@@ -80,5 +80,5 @@
 
 display('Calling KMLMeshWrite.');
-KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.elements,md.nodeconnectivity,md.lat,md.long,md.qmu.partition,md.flaim.criterion,options.cmap,filekml);
+KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.elements,md.nodeconnectivity,md.mesh.lat,md.mesh.long,md.qmu.partition,md.flaim.criterion,options.cmap,filekml);
 %  for testing
 %filekml='issm-split-geikie1-targets.kml';
Index: /issm/trunk/src/m/utils/BC/SetIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceSheetBC.m	(revision 9713)
+++ /issm/trunk/src/m/utils/BC/SetIceSheetBC.m	(revision 9714)
@@ -8,5 +8,5 @@
 
 %node on Dirichlet
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.diagnostic.spcvx=NaN*ones(md.numberofnodes,1);
 md.diagnostic.spcvy=NaN*ones(md.numberofnodes,1);
Index: /issm/trunk/src/m/utils/BC/SetIceShelfBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 9713)
+++ /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 9714)
@@ -20,5 +20,5 @@
 	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
 	nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
-	nodeonicefront=double(md.nodeonboundary & nodeinsideicefront);
+	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
 elseif nargin==1,
 	nodeonicefront=zeros(md.numberofnodes,1);
@@ -27,5 +27,5 @@
 	error('bad usage');
 end
-pos=find(md.nodeonboundary & ~nodeonicefront);
+pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
 md.diagnostic.spcvx=NaN*ones(md.numberofnodes,1);
 md.diagnostic.spcvy=NaN*ones(md.numberofnodes,1);
@@ -47,9 +47,9 @@
 %segment on Ice Front
 %segment on Neumann (Ice Front)
-pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2)));
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2)));
 if (md.dim==2)
-	pressureload=md.segments(pos,:);
+	pressureload=md.mesh.segments(pos,:);
 elseif md.dim==3
-	pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofnodes2d  md.segments(pos,1)+md.numberofnodes2d  md.segments(pos,3)];
+	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.numberofnodes2d  md.mesh.segments(pos,1)+md.numberofnodes2d  md.mesh.segments(pos,3)];
 	pressureload=[];
 	for i=1:md.numlayers-1,
Index: /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 9713)
+++ /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 9714)
@@ -24,12 +24,12 @@
 	end
 	nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
-	vertexonicefront=double(md.nodeonboundary & nodeinsideicefront);
+	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
 else
 	%Guess where the ice front is
 	vertexonfloatingice=zeros(md.numberofnodes,1);
 	vertexonfloatingice(md.elements(find(md.mask.elementonfloatingice),:))=1;
-	vertexonicefront=double(md.nodeonboundary & vertexonfloatingice);
+	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
 end
-pos=find(md.nodeonboundary & ~vertexonicefront);
+pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
 if isempty(pos),
 	warning('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually')
@@ -53,13 +53,13 @@
 
 md.hydrology.spcwatercolumn=zeros(md.numberofnodes,2);
-pos=find(md.nodeonboundary); 
+pos=find(md.mesh.vertexonboundary); 
 md.hydrology.spcwatercolumn(pos,1)=1;
 
 %segment on Neumann (Ice Front)
-pos=find(vertexonicefront(md.segments(:,1)) | vertexonicefront(md.segments(:,2)));
+pos=find(vertexonicefront(md.mesh.segments(:,1)) | vertexonicefront(md.mesh.segments(:,2)));
 if (md.dim==2)
-	pressureload=md.segments(pos,:);
+	pressureload=md.mesh.segments(pos,:);
 elseif md.dim==3
-	pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofnodes2d  md.segments(pos,1)+md.numberofnodes2d  md.segments(pos,3)];
+	pressureload_layer1=[md.mesh.segments(pos,1:2)  md.mesh.segments(pos,2)+md.numberofnodes2d  md.mesh.segments(pos,1)+md.numberofnodes2d  md.mesh.segments(pos,3)];
 	pressureload=[];
 	for i=1:md.numlayers-1,
Index: /issm/trunk/src/m/utils/Mesh/argusmesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 9713)
+++ /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 9714)
@@ -91,6 +91,6 @@
 
 %Add segments and nodes on boundary
-md.segments=findsegments(md);
-md.nodeonboundary=zeros(md.numberofnodes,1);
-md.nodeonboundary(md.segments(:,1))=1;
-md.nodeonboundary(md.segments(:,2))=1;
+md.mesh.segments=findsegments(md);
+md.mesh.vertexonboundary=zeros(md.numberofnodes,1);
+md.mesh.vertexonboundary(md.mesh.segments(:,1))=1;
+md.mesh.vertexonboundary(md.mesh.segments(:,2))=1;
Index: /issm/trunk/src/m/utils/Mesh/squaremesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 9713)
+++ /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 9714)
@@ -60,5 +60,5 @@
 md.z=zeros(nods,1);
 md.numberofnodes=nods;
-md.nodeonboundary=zeros(nods,1);md.nodeonboundary(segments(:,1:2))=1;
+md.mesh.vertexonboundary=zeros(nods,1);md.mesh.vertexonboundary(segments(:,1:2))=1;
 md.nodeonbed=ones(nods,1);
 md.nodeonsurface=ones(nods,1);
@@ -66,5 +66,5 @@
 %plug elements
 md.elements=index;
-md.segments=segments;
+md.mesh.segments=segments;
 md.numberofelements=nel;
 md.elementonbed=ones(nel,1);
Index: /issm/trunk/template
===================================================================
--- /issm/trunk/template	(revision 9713)
+++ /issm/trunk/template	(revision 9714)
@@ -2,8 +2,4 @@
 
 	projection
-		lat
-		long
-		hemisphere
-
 	  x
 	  y
@@ -34,12 +30,4 @@
 	  nodeconnectivity
 	  elementconnectivity
-	  connectivity -> rename average_vertex_connectivity
-
-	  segments
-	  segmentmarkers
-	  nodeonboundary
-
-	  extractednodes
-	  extractedelements
 }}}
 
Index: /issm/trunk/test/NightlyRun/test131.m
===================================================================
--- /issm/trunk/test/NightlyRun/test131.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test131.m	(revision 9714)
@@ -3,5 +3,5 @@
 md=parameterize(md,'../Par/SquareShelfConstrained.par');
 %Add boundary conditions on thickness on the border
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 md=setflowequation(md,'macayeal','all');
Index: /issm/trunk/test/NightlyRun/test132.m
===================================================================
--- /issm/trunk/test/NightlyRun/test132.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test132.m	(revision 9714)
@@ -3,5 +3,5 @@
 md=parameterize(md,'../Par/SquareShelfConstrained.par');
 %Add boundary conditions on thickness on the border
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 md=setflowequation(md,'macayeal','all');
Index: /issm/trunk/test/NightlyRun/test133.m
===================================================================
--- /issm/trunk/test/NightlyRun/test133.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test133.m	(revision 9714)
@@ -4,5 +4,5 @@
 md=extrude(md,5,1);
 %Add boundary conditions on thickness on the border
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 md=setflowequation(md,'macayeal','all');
Index: /issm/trunk/test/NightlyRun/test134.m
===================================================================
--- /issm/trunk/test/NightlyRun/test134.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test134.m	(revision 9714)
@@ -4,5 +4,5 @@
 md=extrude(md,5,1);
 %Add boundary conditions on thickness on the border
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 md=setflowequation(md,'macayeal','all');
Index: /issm/trunk/test/NightlyRun/test233.m
===================================================================
--- /issm/trunk/test/NightlyRun/test233.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test233.m	(revision 9714)
@@ -54,5 +54,5 @@
 nodeonicefront=zeros(md.numberofnodes,1);
 pos=find(md.y==ymax); nodeonicefront(pos)=1;
-pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2))); diagnostic.icefront=md.segments(pos,:);
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
 diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
 md.diagnostic.icefront=diagnostic.icefront;
Index: /issm/trunk/test/NightlyRun/test234.m
===================================================================
--- /issm/trunk/test/NightlyRun/test234.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test234.m	(revision 9714)
@@ -54,5 +54,5 @@
 nodeonicefront=zeros(md.numberofnodes,1);
 pos=find(md.y==ymax); nodeonicefront(pos)=1;
-pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2))); diagnostic.icefront=md.segments(pos,:);
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
 diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
 md.diagnostic.icefront=diagnostic.icefront;
Index: /issm/trunk/test/NightlyRun/test235.m
===================================================================
--- /issm/trunk/test/NightlyRun/test235.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test235.m	(revision 9714)
@@ -51,5 +51,5 @@
 nodeonicefront=zeros(md.numberofnodes,1);
 pos=find(md.y==ymax); nodeonicefront(pos)=1;
-pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2))); diagnostic.icefront=md.segments(pos,:);
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
 diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
 md.diagnostic.icefront=diagnostic.icefront;
Index: /issm/trunk/test/NightlyRun/test236.m
===================================================================
--- /issm/trunk/test/NightlyRun/test236.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test236.m	(revision 9714)
@@ -51,5 +51,5 @@
 nodeonicefront=zeros(md.numberofnodes,1);
 pos=find(md.y==ymax); nodeonicefront(pos)=1;
-pos=find(nodeonicefront(md.segments(:,1)) | nodeonicefront(md.segments(:,2))); diagnostic.icefront=md.segments(pos,:);
+pos=find(nodeonicefront(md.mesh.segments(:,1)) | nodeonicefront(md.mesh.segments(:,2))); diagnostic.icefront=md.mesh.segments(pos,:);
 diagnostic.icefront=[diagnostic.icefront 1*md.mask.elementonfloatingice(diagnostic.icefront(:,end))];
 md.diagnostic.icefront=diagnostic.icefront;
Index: /issm/trunk/test/NightlyRun/test527.m
===================================================================
--- /issm/trunk/test/NightlyRun/test527.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test527.m	(revision 9714)
@@ -28,5 +28,5 @@
 %refine existing mesh 3
 hVertices=NaN*ones(md.numberofnodes,1);
-hVertices(find(md.nodeonboundary))=500;
+hVertices(find(md.mesh.vertexonboundary))=500;
 md2=bamg(md,'metric',md.miscellaneous.dummy,'hmin',1000,'hmax',20000,'gradation',3,'geometricalmetric',1,'anisomax',1,'hVertices',hVertices);
 x5=md2.x;
Index: /issm/trunk/test/NightlyRun/test625.m
===================================================================
--- /issm/trunk/test/NightlyRun/test625.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test625.m	(revision 9714)
@@ -7,5 +7,5 @@
 %Ice sheet only
 md=modelextract(md,md.mask.elementongroundedice);
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 
Index: /issm/trunk/test/NightlyRun/test626.m
===================================================================
--- /issm/trunk/test/NightlyRun/test626.m	(revision 9713)
+++ /issm/trunk/test/NightlyRun/test626.m	(revision 9714)
@@ -7,5 +7,5 @@
 %Ice sheet only
 md=modelextract(md,md.mask.elementongroundedice);
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 
Index: /issm/trunk/test/Par/79North.par
===================================================================
--- /issm/trunk/test/Par/79North.par	(revision 9713)
+++ /issm/trunk/test/Par/79North.par	(revision 9714)
@@ -44,5 +44,5 @@
 %Boundary conditions:
 md=SetMarineIceSheetBC(md);
-pos=find(md.nodeonboundary);
+pos=find(md.mesh.vertexonboundary);
 md.balancethickness.spcthickness(pos)=md.geometry.thickness(pos);
 md.prognostic.spcthickness(pos)=md.geometry.thickness(pos);
Index: /issm/trunk/test/Par/RoundSheetShelf.par
===================================================================
--- /issm/trunk/test/Par/RoundSheetShelf.par	(revision 9713)
+++ /issm/trunk/test/Par/RoundSheetShelf.par	(revision 9714)
@@ -83,5 +83,5 @@
 md.diagnostic.spcvy(pos)=0;
 
-pressureload=md.segments;
+pressureload=md.mesh.segments;
 pressureload=[pressureload 1*md.mask.elementonfloatingice(pressureload(:,end)) + 0*md.mask.elementongroundedice(pressureload(:,end))];
 md.diagnostic.icefront=pressureload;
