Index: issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26047)
+++ issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26320)
@@ -307,5 +307,5 @@
 
 /*Finite Element Analysis*/
-void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* serial_spc,Element* element){/*{{{*/
+void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* local_spc,Element* element){/*{{{*/
 
 	/* Do not check if ice in element, this may lead to inconsistencies between cpu partitions */
@@ -317,5 +317,4 @@
 	int         numindices;
 	int        *indices = NULL;
-	Node*       node = NULL;
 	IssmDouble	pressure;
 
@@ -325,5 +324,5 @@
 
 	/*Get parameters and inputs: */
-	Input* pressure_input		 = element->GetInput(PressureEnum);							 _assert_(pressure_input);
+	Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
 
 	/*Fetch indices of basal & surface nodes for this finite element*/
@@ -338,7 +337,7 @@
 
 		/*apply or release spc*/
-		node=element->GetNode(indices[i]);
+		Node* node=element->GetNode(indices[i]);
 		if(!node->IsActive()) continue;
-		if(serial_spc[node->Sid()]==1.){
+		if(local_spc[node->Lid()]==1.){
 			pressure_input->GetInputValue(&pressure, gauss);
 			node->ApplyConstraint(0,PureIceEnthalpy(element,pressure));
@@ -1344,21 +1343,21 @@
 			case 0:
 				// cold, dry base: apply basal surface forcing
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 1:
 				// cold, wet base: keep at pressure melting point
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 2:
 				// temperate, thin refreezing base:
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 3:
 				// temperate, thin melting base: set spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 4:
 				// temperate, thick melting base:
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			default:
@@ -1417,21 +1416,21 @@
 			case 0:
 				// cold, dry base: apply basal surface forcing
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 1:
 				// cold, wet base: keep at pressure melting point
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 2:
 				// temperate, thin refreezing base: release spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 3:
 				// temperate, thin melting base: set spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 4:
 				// temperate, thick melting base: set grad H*n=0
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			default:
@@ -1668,8 +1667,8 @@
 
 	/*Update basal dirichlet BCs for enthalpy: */
-	Vector<IssmDouble>* spc           = NULL;
-	IssmDouble*         serial_spc    = NULL;
-
-	spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
+	int numnodes            = femmodel->nodes->NumberOfNodes();
+   int localmasters        = femmodel->nodes->NumberOfNodesLocal();
+	Vector<IssmDouble>* spc = new Vector<IssmDouble>(localmasters,numnodes);
+
 	/*First create a vector to figure out what elements should be constrained*/
 	for(Object* & object : femmodel->elements->objects){
@@ -1678,7 +1677,10 @@
 	}
 
-	/*Assemble and serialize*/
+	/*Assemble*/
 	spc->Assemble();
-	serial_spc=spc->ToMPISerial();
+
+	/*Get local vector with both masters and slaves:*/
+	IssmDouble *local_spc = NULL;
+	femmodel->GetLocalVectorWithClonesNodes(&local_spc,spc);
 	delete spc;
 
@@ -1686,5 +1688,5 @@
 	for(Object* & object : femmodel->elements->objects){
 		Element* element=xDynamicCast<Element*>(object);
-		ApplyBasalConstraints(serial_spc,element);
+		ApplyBasalConstraints(local_spc,element);
 	}
 
@@ -1692,5 +1694,5 @@
 
 	/*Delete*/
-	xDelete<IssmDouble>(serial_spc);
+	xDelete<IssmDouble>(local_spc);
 }/*}}}*/
 void           EnthalpyAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
