Index: /issm/branches/trunk-larour-SLPS2022/src/c/analyses/SealevelchangeAnalysis.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 27070)
+++ /issm/branches/trunk-larour-SLPS2022/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 27071)
@@ -44,22 +44,9 @@
 
 	if(isexternal){
+
 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementeast",SolidearthExternalDisplacementEastRateEnum);
 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementnorth",SolidearthExternalDisplacementNorthRateEnum);
 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
-
-		/*Resolve Mmes using the modelid, if necessary:*/
-		if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
-			int modelid;
-
-			/*retrieve model id: */
-			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
-
-			/*replace dataset of forcings with only one, the modelid'th:*/
-			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
-			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
-			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
-			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
-		}
 	}
 
@@ -220,5 +207,5 @@
 		iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
 		if(externalnature>=3){
-			IssmDouble modelid; 
+			int modelid; 
 			int nummodels;
 
@@ -640,4 +627,23 @@
 void           SealevelchangeAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 
+	int isuq=0;
+	int modelid=0;
+
+	/*Resolve Mmes using the modelid, if necessary: meaning if we are running a transient model and that UQ computations have not been triggered:*/
+	femmodel->parameters->FindParam(&isuq,QmuIsdakotaEnum);
+	_printf_("hello0\n");
+	if (!isuq && femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
+		_printf_("hello1\n");
+		
+		femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum);
+
+		/*replace dataset of forcings with only one, the modelid'th:*/
+		MmeToInputFromIdx(femmodel->inputs,femmodel->elements,modelid-1,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+		MmeToInputFromIdx(femmodel->inputs,femmodel->elements,modelid-1,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+		MmeToInputFromIdx(femmodel->inputs,femmodel->elements,modelid-1,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+		MmeToInputFromIdx(femmodel->inputs,femmodel->elements,modelid-1,SolidearthExternalGeoidRateEnum, P1Enum);
+
+	}		
+
 	/*run sea level change core geometry only once, after the Model Processor is done:*/
 	sealevelchange_initialgeometry(femmodel);
