Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22955)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22956)
@@ -4596,5 +4596,80 @@
 }
 /*}}}*/
-void FemModel::UpdateConstraintsL2ProjectionEPLx(IssmDouble* pL2count){ /*{{{*/
+void FemModvoid FemModel::HydrologyIDSupdateDomainx(IssmDouble* pIDScount){ /*{{{*/
+
+	bool                isthermal;
+	Vector<IssmDouble>* mask				= NULL;
+	Vector<IssmDouble>* active				= NULL;
+	IssmDouble*         serial_mask	= NULL;
+	IssmDouble*         serial_active	= NULL;
+
+	HydrologyDCInefficientAnalysis* inefanalysis =  new HydrologyDCInefficientAnalysis();
+	parameters->FindParam(&isthermal,TransientIsthermalEnum);
+
+	/*When solving a thermal model we update the thawed nodes*/
+	if(isthermal){
+		/*Step 1: update mask, the mask correspond to thawed nodes (that have a meltingrate)*/
+		mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
+
+		for (int i=0;i<elements->Size();i++){
+			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+			inefanalysis->HydrologyIDSGetMask(mask,element);
+		}
+		/*Assemble and serialize*/
+		mask->Assemble();
+		serial_mask=mask->ToMPISerial();
+		delete mask;
+	}
+	/*for other cases we just grab the mask from the initialisation value*/
+	else{
+		GetVectorFromInputsx(&serial_mask,this,HydrologydcMaskThawedNodeEnum,NodeSIdEnum);
+	}
+	/*Update Mask and elementize*/
+	InputUpdateFromVectorx(this,serial_mask,HydrologydcMaskThawedNodeEnum,NodeSIdEnum);
+	xDelete<IssmDouble>(serial_mask);
+	inefanalysis->ElementizeIdsMask(this);
+
+	/*get node mask coherent with element mask*/
+	active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
+	for (int i=0;i<elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+		inefanalysis->HydrologyIdsGetActive(active,element);
+	}
+
+	/*Assemble and serialize*/
+	active->Assemble();
+	serial_active=active->ToMPISerial();
+	delete active;
+
+	/*Update node activation accordingly*/
+	int counter =0;
+	for (int i=0;i<nodes->Size();i++){
+		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
+		if(node->InAnalysis(HydrologyDCInefficientAnalysisEnum)){
+			if(serial_active[node->Sid()]==1.){
+				node->Activate();
+				if(!node->IsClone()) counter++;
+			}
+			else{
+				node->Deactivate();
+			}
+		}
+	}
+
+	xDelete<IssmDouble>(serial_active);
+	delete inefanalysis;
+	int sum_counter;
+	ISSM_MPI_Reduce(&counter,&sum_counter,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&sum_counter,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+	counter=sum_counter;
+	*pIDScount = counter;
+	if(VerboseSolution()) _printf0_("   Number of active nodes in IDS layer: "<< counter <<"\n");
+
+	/*Update dof indexings*/
+	this->UpdateConstraintsx();
+
+}
+/*}}}*/
+el::UpdateConstraintsL2ProjectionEPLx(IssmDouble* pL2count){ /*{{{*/
 
 	Vector<IssmDouble>* active        = NULL;
