Index: /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 28092)
+++ /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 28093)
@@ -7,4 +7,33 @@
 /*Model processing*/
 void FreeSurfaceBaseAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+
+	/*Use spcthickness for now*/
+	IssmDouble* spcthickness = NULL;
+	int         M,N;
+	iomodel->FetchData(&spcthickness,&M,&N,"md.masstransport.spcthickness");
+	if(M!=iomodel->numberofvertices || N!=1) _error_("Size of constraints not supported yet");
+
+	/*Check if there is any NaN*/
+	bool isconstraints = false;
+	for(int i=0;i<M;i++) if(!xIsNan<IssmDouble>(spcthickness[i])) isconstraints = true;
+	if(!isconstraints){
+		iomodel->DeleteData(spcthickness,"md.masstransport.spcthickness");
+		return;
+	}
+
+	_printf0_("   WARNING: using md.geometry to constrain free base solver\n");
+
+	/*Use spcthickness for now*/
+	IssmDouble* base= NULL;
+	iomodel->FetchData(&base,&M,&N,"md.geometry.base");
+	if(M!=iomodel->numberofvertices || N!=1) _error_("Size of constraints not supported yet");
+	for(int i=0;i<M;i++) if(xIsNan<IssmDouble>(spcthickness[i])) base[i] = NAN;
+
+	/*Create Constraints based on this new vector*/
+	IoModelToConstraintsx(constraints,iomodel,base,M, N, FreeSurfaceBaseAnalysisEnum, P1Enum, 0);
+
+	/*Cleanup and return*/
+	iomodel->DeleteData(spcthickness,"md.masstransport.spcthickness");
+	iomodel->DeleteData(base,"md.geometry.base");
 }/*}}}*/
 void FreeSurfaceBaseAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
Index: /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 28092)
+++ /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 28093)
@@ -7,4 +7,33 @@
 /*Model processing*/
 void FreeSurfaceTopAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+
+	/*Use spcthickness for now*/
+	IssmDouble* spcthickness = NULL;
+	int         M,N;
+	iomodel->FetchData(&spcthickness,&M,&N,"md.masstransport.spcthickness");
+	if(M!=iomodel->numberofvertices || N!=1) _error_("Size of constraints not supported yet");
+
+	/*Check if there is any NaN*/
+	bool isconstraints = false;
+	for(int i=0;i<M;i++) if(!xIsNan<IssmDouble>(spcthickness[i])) isconstraints = true;
+	if(!isconstraints){
+		iomodel->DeleteData(spcthickness,"md.masstransport.spcthickness");
+		return;
+	}
+
+	_printf0_("   WARNING: using md.geometry to constrain free surface solver\n");
+
+	/*Use spcthickness for now*/
+	IssmDouble* surface= NULL;
+	iomodel->FetchData(&surface,&M,&N,"md.geometry.surface");
+	if(M!=iomodel->numberofvertices || N!=1) _error_("Size of constraints not supported yet");
+	for(int i=0;i<M;i++) if(xIsNan<IssmDouble>(spcthickness[i])) surface[i] = NAN;
+
+	/*Create Constraints based on this new vector*/
+	IoModelToConstraintsx(constraints,iomodel,surface,M, N, FreeSurfaceTopAnalysisEnum,P1Enum,0);
+
+	/*Cleanup and return*/
+	iomodel->DeleteData(spcthickness,"md.masstransport.spcthickness");
+	iomodel->DeleteData(surface,"md.geometry.surface");
 }/*}}}*/
 void FreeSurfaceTopAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
