Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 3450)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 3451)
@@ -67,14 +67,10 @@
 	/*indexing:*/
 	DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node
-	if(iomodel->my_bordervertices[i])partitionborder=1; else partitionborder=0;//is this node on a partition border?
+	if(iomodel->my_bordervertices[i]) partitionborder=1; else partitionborder=0;//is this node on a partition border?
 
 	this->indexing.Init(numdofs,partitionborder);
 
 	/*properties: */
-	this->properties.Init(
-			(int)iomodel->gridonbed[i],
-			(int)iomodel->gridonsurface[i],
-			(int)iomodel->gridoniceshelf[i],
-			(int)iomodel->gridonicesheet[i]);
+	this->properties.Init(i,iomodel);
 
 	/*hooks: */
@@ -97,9 +93,20 @@
 	this->hupper_node.Init(&upper_node_id,1);
 
-	/*set single point constraints.: */
-	/*FROM DIAGNOSTICHORIZ*/
-	if (strcmp(iomodel->meshtype,"3d")==0){
-		/*We have a  3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
-		if (iomodel->deadgrids[i]){
+	/*set single point constraints: */
+
+	/*Diagnostic Horiz*/
+	if (iomodel->analysis_type==DiagnosticAnalysisEnum() && iomodel->sub_analysis_type==HorizAnalysisEnum()){
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			/*We have a  3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
+			if (!iomodel->deadgrids) ISSMERROR("iomodel->deadgrids is NULL");
+			if (iomodel->deadgrids[i]){
+				for(k=1;k<=numdofs;k++){
+					this->FreezeDof(k);
+				}
+			}
+		}
+		/*spc all nodes on hutter*/
+		if (!iomodel->gridonhutter) ISSMERROR("iomodel->gridonhutter is NULL");
+		if (iomodel->gridonhutter[i]){
 			for(k=1;k<=numdofs;k++){
 				this->FreezeDof(k);
@@ -107,34 +114,42 @@
 		}
 	}
-	if (iomodel->gridonhutter[i]){
-		for(k=1;k<=numdofs;k++){
-			this->FreezeDof(k);
-		}
-	}
-	/*FROM DIAGNOSTICSTOKES*/
-	/*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */
-	if (iomodel->borderstokes[i]){
-		//freeze everything except pressure
-		this->FreezeDof(1);
-		this->FreezeDof(2);
-		this->FreezeDof(3);
-	}
-	else if (iomodel->gridonstokes[i]==0){
-		for(k=1;k<=numdofs;k++){
-			this->FreezeDof(k);
-		}
-	}
-	/*FROM DIAGNOSTICHUTTER*/
-	if (!iomodel->gridonhutter[i]){
-		for(k=1;k<=numdofs;k++){
-			this->FreezeDof(k);
-		}
-	}
-	/*FROM PROGNOSTIC/BALANCESVEL/BALANCEDTHICK*/
-	if (strcmp(iomodel->meshtype,"3d")==0){
-		/*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
-		if (!iomodel->gridonbed[i]){
+
+	/*Diagnostic Stokes*/
+	if (iomodel->analysis_type==DiagnosticAnalysisEnum() && iomodel->sub_analysis_type==StokesAnalysisEnum()){
+		/*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */
+		if (!iomodel->borderstokes) ISSMERROR("iomodel->borderstokes is NULL");
+		if (iomodel->borderstokes[i]){
+			//freeze everything except pressure
+			this->FreezeDof(1);
+			this->FreezeDof(2);
+			this->FreezeDof(3);
+		}
+		else if (iomodel->gridonstokes[i]==0){
 			for(k=1;k<=numdofs;k++){
 				this->FreezeDof(k);
+			}
+		}
+	}
+
+	/*Diagnostic Hutter*/
+	if (iomodel->analysis_type==DiagnosticAnalysisEnum() && iomodel->sub_analysis_type==HutterAnalysisEnum()){
+		/*Spc all nodes that are not Hutter*/
+		if (!iomodel->gridonhutter) ISSMERROR("iomodel->gridonhutter is NULL");
+		if (!iomodel->gridonhutter[i]){
+			for(k=1;k<=numdofs;k++){
+				this->FreezeDof(k);
+			}
+		}
+	}
+
+	/*Prognostic/ Balancedvelocities/ Balancedthickness*/
+	if (iomodel->analysis_type==PrognosticAnalysisEnum() || iomodel->analysis_type==BalancedvelocitiesAnalysisEnum() || iomodel->analysis_type==BalancedthicknessAnalysisEnum()){
+		if (strcmp(iomodel->meshtype,"3d")==0){
+			/*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
+			if (!iomodel->gridonbed) ISSMERROR("iomodel->gridonbed is NULL");
+			if (!iomodel->gridonbed[i]){
+				for(k=1;k<=numdofs;k++){
+					this->FreezeDof(k);
+				}
 			}
 		}
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 3450)
+++ /issm/trunk/src/c/objects/Node.h	(revision 3451)
@@ -5,5 +5,4 @@
 #ifndef _NODE_H_
 #define _NODE_H_
-
 
 /*indefinitions: */
Index: /issm/trunk/src/c/objects/NodeProperties.cpp
===================================================================
--- /issm/trunk/src/c/objects/NodeProperties.cpp	(revision 3450)
+++ /issm/trunk/src/c/objects/NodeProperties.cpp	(revision 3451)
@@ -35,5 +35,5 @@
 }
 /*}}}*/
-/*FUNCTION NodeProperties init: used by constructor {{{1*/
+/*FUNCTION NodeProperties Init: used by constructor {{{1*/
 void NodeProperties::Init(int nodeproperties_onbed, int nodeproperties_onsurface, int nodeproperties_onshelf, int nodeproperties_onsheet){
 
@@ -42,4 +42,14 @@
 	this->onshelf=nodeproperties_onshelf;
 	this->onsheet=nodeproperties_onsheet;
+
+}
+/*}}}*/
+/*FUNCTION NodeProperties Init from iomodel: used by constructor {{{1*/
+void NodeProperties::Init(int i, IoModel* iomodel){ //i is the node index
+
+	if (iomodel->gridonbed)      this->onbed=(int)iomodel->gridonbed[i];
+	if (iomodel->gridonsurface)  this->onsurface=(int)iomodel->gridonsurface[i];
+	if (iomodel->gridoniceshelf) this->onshelf=(int)iomodel->gridoniceshelf[i];
+	if (iomodel->gridonicesheet) this->onsheet=(int)iomodel->gridonicesheet[i];
 
 }
Index: /issm/trunk/src/c/objects/NodeProperties.h
===================================================================
--- /issm/trunk/src/c/objects/NodeProperties.h	(revision 3450)
+++ /issm/trunk/src/c/objects/NodeProperties.h	(revision 3451)
@@ -5,4 +5,7 @@
 #ifndef _NODEPROPERTIES_H_
 #define  _NODEPROPERTIES_H_
+
+/*indefinitions: */
+struct IoModel;
 
 class NodeProperties{
@@ -18,4 +21,5 @@
 		NodeProperties(int onbed, int onsurface, int onshelf, int onsheet);
 		void Init(int onbed, int onsurface, int onshelf, int onsheet);
+		void Init(int i, IoModel* iomodel);
 		NodeProperties(NodeProperties* properties);
 		~NodeProperties();
