Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 17235)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 17236)
@@ -1559,9 +1559,8 @@
 	AC_MSG_CHECKING(for kml capability compilation)
 
+	HAVE_KML=no
 	if test "x$KML" = "xyes"; then
 		HAVE_KML=yes
 		AC_DEFINE([_HAVE_KML_],[1],[with kml capability])
-	else
-		HAVE_KML=no
 	fi
 	AM_CONDITIONAL([KML], [test x$HAVE_KML = xyes])
@@ -1574,120 +1573,127 @@
 	AC_MSG_CHECKING(for kriging capability compilation)
 
+	HAVE_KRIGING=no
 	if test "x$KRIGING" = "xyes"; then
 		HAVE_KRIGING=yes
 		AC_DEFINE([_HAVE_KRIGING_],[1],[with kriging capability])
-	else
-		HAVE_KRIGING=no
 	fi
 	AM_CONDITIONAL([KRIGING], [test x$HAVE_KRIGING = xyes])
 	AC_MSG_RESULT($HAVE_KRIGING)
 	dnl }}}
-	dnl with-steadystate{{{
-	AC_ARG_WITH([steadystate],
-		AS_HELP_STRING([--with-steadystate = YES],[compile with steadystate capabilities (default is yes)]),
-		[STEADYSTATE=$withval],[STEADYSTATE=yes]) 
-	AC_MSG_CHECKING(for steadystate capability compilation)
-
-	if test "x$STEADYSTATE" = "xyes"; then
-
-		dnl defaults
-		HAVE_STEADYSTATE=yes
-
-		AC_DEFINE([_HAVE_STEADYSTATE_],[1],[with steadystate capability])
-	else
-		HAVE_STEADYSTATE=no
-	fi
-	AM_CONDITIONAL([STEADYSTATE], [test x$HAVE_STEADYSTATE = xyes])
-	AC_MSG_RESULT($HAVE_STEADYSTATE)
-	dnl }}}
-	dnl with-transient{{{
-	AC_ARG_WITH([transient],
-		AS_HELP_STRING([--with-transient = YES], [compile with transient capabilities (default is yes)]),
-		[TRANSIENT=$withval],[TRANSIENT=yes]) 
-	AC_MSG_CHECKING(for transient capability compilation)
-
-	if test "x$TRANSIENT" = "xyes"; then
-
-		dnl defaults
-		HAVE_TRANSIENT=yes
-
-		AC_DEFINE([_HAVE_TRANSIENT_],[1],[with transient capability])
-	else
-		HAVE_TRANSIENT=no
-	fi
-	AM_CONDITIONAL([TRANSIENT], [test x$HAVE_TRANSIENT = xyes])
-	AC_MSG_RESULT($HAVE_TRANSIENT)
-	dnl }}}
-	dnl with-thermal{{{
-	AC_ARG_WITH([thermal],
-		AS_HELP_STRING([--with-thermal = YES], [compile with thermal capabilities (default is yes)]),
-		[THERMAL=$withval],[THERMAL=yes]) 
-	AC_MSG_CHECKING(for thermal capability compilation)
-
-	if test "x$THERMAL" = "xyes"; then
-
-		dnl defaults
-		HAVE_THERMAL=yes
-
-		AC_DEFINE([_HAVE_THERMAL_],[1],[with thermal capability])
-	else
-		HAVE_THERMAL=no
-	fi
-	AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
-	AC_MSG_RESULT($HAVE_THERMAL)
-	dnl }}}
-	dnl with-masstransport{{{
-	AC_ARG_WITH([masstransport],
-		AS_HELP_STRING([--with-masstransport = YES], [compile with masstransport capabilities (default is yes)]),
-		[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes]) 
-	AC_MSG_CHECKING(for masstransport capability compilation)
-
-	if test "x$MASSTRANSPORT" = "xyes"; then
-
-		dnl defaults
-		HAVE_MASSTRANSPORT=yes
-
-		AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with masstransport capability])
-	else
-		HAVE_MASSTRANSPORT=no
-	fi
-	AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
-	AC_MSG_RESULT($HAVE_MASSTRANSPORT)
-	dnl }}}
-	dnl with-control{{{
-	AC_ARG_WITH([control],
-		AS_HELP_STRING([--with-control = YES], [compile with control capabilities (default is yes)]),
-		[CONTROL=$withval],[CONTROL=yes]) 
-	AC_MSG_CHECKING(for control capability compilation)
-
-	if test "x$CONTROL" = "xyes"; then
-
-		dnl defaults
-		HAVE_CONTROL=yes
-
-		AC_DEFINE([_HAVE_CONTROL_],[1],[with control capability])
-	else
-		HAVE_CONTROL=no
-	fi
-	AM_CONDITIONAL([CONTROL], [test x$HAVE_CONTROL = xyes])
-	AC_MSG_RESULT($HAVE_CONTROL)
-	dnl }}}
-	dnl with-hydrology{{{
-	AC_ARG_WITH([hydrology],
-		AS_HELP_STRING([--with-hydrology = YES], [compile with hydrology capabilities (default is yes)]),
-		[HYDROLOGY=$withval],[HYDROLOGY=yes]) 
-	AC_MSG_CHECKING(for hydrology capability compilation)
-
-	if test "x$HYDROLOGY" = "xyes"; then
-
-		dnl defaults
-		HAVE_HYDROLOGY=yes
-
-		AC_DEFINE([_HAVE_HYDROLOGY_],[1],[with hydrology capability])
-	else
-		HAVE_HYDROLOGY=no
-	fi
-	AM_CONDITIONAL([HYDROLOGY], [test x$HAVE_HYDROLOGY = xyes])
-	AC_MSG_RESULT($HAVE_HYDROLOGY)
+	dnl with-gia{{{
+		AC_ARG_WITH([gia],
+		AS_HELP_STRING([--with-gia = YES], [compile with gia capabilities (default is no)]),
+		[GIA=$withval],[GIA=no]) 
+	   AC_MSG_CHECKING(for gia capability compilation)
+
+		HAVE_GIA=no
+		if test "x$GIA" = "xyes"; then
+			if test "x$HAVE_MATH77" = "xno"; then
+				 AC_MSG_ERROR([gia requires compilation of math77 library! Reconfigure with --with-math77 option on]);
+			else
+				HAVE_GIA=yes
+				AC_DEFINE([_HAVE_GIA_],[1],[with gia capability])
+		   fi
+		fi
+		AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
+		AC_MSG_RESULT($HAVE_GIA)
+		dnl }}}
+	dnl with-AdjointBalancethickness{{{
+	AC_ARG_WITH([AdjointBalancethickness],
+		AS_HELP_STRING([--with-AdjointBalancethickness = YES], [compile with AdjointBalancethickness capabilities (default is yes)]),
+		[ADJOINTBALANCETHICKNESS=$withval],[ADJOINTBALANCETHICKNESS=yes]) 
+	AC_MSG_CHECKING(for AdjointBalancethickness capability compilation)
+
+	HAVE_ADJOINTBALANCETHICKNESS=no
+	if test "x$ADJOINTBALANCETHICKNESS" = "xyes"; then
+		HAVE_ADJOINTBALANCETHICKNESS=yes
+		AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS_],[1],[with AdjointBalancethickness capability])
+	fi
+	AM_CONDITIONAL([ADJOINTBALANCETHICKNESS], [test x$HAVE_ADJOINTBALANCETHICKNESS = xyes])
+	AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS)
+	dnl }}}
+	dnl with-AdjointHoriz{{{
+	AC_ARG_WITH([AdjointHoriz],
+		AS_HELP_STRING([--with-AdjointHoriz = YES], [compile with AdjointHoriz capabilities (default is yes)]),
+		[ADJOINTHORIZ=$withval],[ADJOINTHORIZ=yes]) 
+	AC_MSG_CHECKING(for AdjointHoriz capability compilation)
+
+	HAVE_ADJOINTHORIZ=no
+	if test "x$ADJOINTHORIZ" = "xyes"; then
+		HAVE_ADJOINTHORIZ=yes
+		AC_DEFINE([_HAVE_ADJOINTHORIZ_],[1],[with AdjointHoriz capability])
+	fi
+	AM_CONDITIONAL([ADJOINTHORIZ], [test x$HAVE_ADJOINTHORIZ = xyes])
+	AC_MSG_RESULT($HAVE_ADJOINTHORIZ)
+	dnl }}}
+	dnl with-Balancethickness{{{
+	AC_ARG_WITH([Balancethickness],
+		AS_HELP_STRING([--with-Balancethickness = YES], [compile with Balancethickness capabilities (default is yes)]),
+		[BALANCETHICKNESS=$withval],[BALANCETHICKNESS=yes]) 
+	AC_MSG_CHECKING(for Balancethickness capability compilation)
+
+	HAVE_BALANCETHICKNESS=no
+	if test "x$BALANCETHICKNESS" = "xyes"; then
+		HAVE_BALANCETHICKNESS=yes
+		AC_DEFINE([_HAVE_BALANCETHICKNESS_],[1],[with Balancethickness capability])
+	fi
+	AM_CONDITIONAL([BALANCETHICKNESS], [test x$HAVE_BALANCETHICKNESS = xyes])
+	AC_MSG_RESULT($HAVE_BALANCETHICKNESS)
+	dnl }}}
+	dnl with-BalancethicknessSoft{{{
+	AC_ARG_WITH([BalancethicknessSoft],
+		AS_HELP_STRING([--with-BalancethicknessSoft = YES], [compile with BalancethicknessSoft capabilities (default is yes)]),
+		[BALANCETHICKNESSSOFT=$withval],[BALANCETHICKNESSSOFT=yes]) 
+	AC_MSG_CHECKING(for BalancethicknessSoft capability compilation)
+
+	HAVE_BALANCETHICKNESSSOFT=no
+	if test "x$BALANCETHICKNESSSOFT" = "xyes"; then
+		HAVE_BALANCETHICKNESSSOFT=yes
+		AC_DEFINE([_HAVE_BALANCETHICKNESSSOFT_],[1],[with BalancethicknessSoft capability])
+	fi
+	AM_CONDITIONAL([BALANCETHICKNESSSOFT], [test x$HAVE_BALANCETHICKNESSSOFT = xyes])
+	AC_MSG_RESULT($HAVE_BALANCETHICKNESSSOFT)
+	dnl }}}
+	dnl with-Balancevelocity{{{
+	AC_ARG_WITH([Balancevelocity],
+		AS_HELP_STRING([--with-Balancevelocity = YES], [compile with Balancevelocity capabilities (default is yes)]),
+		[BALANCEVELOCITY=$withval],[BALANCEVELOCITY=yes]) 
+	AC_MSG_CHECKING(for Balancevelocity capability compilation)
+
+	HAVE_BALANCEVELOCITY=no
+	if test "x$BALANCEVELOCITY" = "xyes"; then
+		HAVE_BALANCEVELOCITY=yes
+		AC_DEFINE([_HAVE_BALANCEVELOCITY_],[1],[with Balancevelocity capability])
+	fi
+	AM_CONDITIONAL([BALANCEVELOCITY], [test x$HAVE_BALANCEVELOCITY = xyes])
+	AC_MSG_RESULT($HAVE_BALANCEVELOCITY)
+	dnl }}}
+	dnl with-L2ProjectionBase{{{
+	AC_ARG_WITH([L2ProjectionBase],
+		AS_HELP_STRING([--with-L2ProjectionBase = YES], [compile with L2ProjectionBase capabilities (default is yes)]),
+		[L2PROJECTIONBASE=$withval],[L2PROJECTIONBASE=yes]) 
+	AC_MSG_CHECKING(for L2ProjectionBase capability compilation)
+
+	HAVE_L2PROJECTIONBASE=no
+	if test "x$L2PROJECTIONBASE" = "xyes"; then
+		HAVE_L2PROJECTIONBASE=yes
+		AC_DEFINE([_HAVE_L2PROJECTIONBASE_],[1],[with L2ProjectionBase capability])
+	fi
+	AM_CONDITIONAL([L2PROJECTIONBASE], [test x$HAVE_L2PROJECTIONBASE = xyes])
+	AC_MSG_RESULT($HAVE_L2PROJECTIONBASE)
+	dnl }}}
+	dnl with-DamageEvolution{{{
+	AC_ARG_WITH([DamageEvolution],
+		AS_HELP_STRING([--with-DamageEvolution = YES], [compile with DamageEvolution capabilities (default is yes)]),
+		[DAMAGEEVOLUTION=$withval],[DAMAGEEVOLUTION=yes]) 
+	AC_MSG_CHECKING(for DamageEvolution capability compilation)
+
+	HAVE_DAMAGEEVOLUTION=no
+	if test "x$DAMAGEEVOLUTION" = "xyes"; then
+		HAVE_DAMAGEEVOLUTION=yes
+		AC_DEFINE([_HAVE_DAMAGEEVOLUTION_],[1],[with DamageEvolution capability])
+	fi
+	AM_CONDITIONAL([DAMAGEEVOLUTION], [test x$HAVE_DAMAGEEVOLUTION = xyes])
+	AC_MSG_RESULT($HAVE_DAMAGEEVOLUTION)
 	dnl }}}
 	dnl with-stressbalance{{{
@@ -1697,165 +1703,238 @@
 	AC_MSG_CHECKING(for stressbalance capability compilation)
 
+	HAVE_STRESSBALANCE=no
 	if test "x$STRESSBALANCE" = "xyes"; then
-
-		dnl defaults
 		HAVE_STRESSBALANCE=yes
-
 		AC_DEFINE([_HAVE_STRESSBALANCE_],[1],[with stressbalance capability])
-	else
-		HAVE_STRESSBALANCE=no
 	fi
 	AM_CONDITIONAL([STRESSBALANCE], [test x$HAVE_STRESSBALANCE = xyes])
 	AC_MSG_RESULT($HAVE_STRESSBALANCE)
 	dnl }}}
-	dnl with-balanced{{{
-	AC_ARG_WITH([balanced],
-		AS_HELP_STRING([--with-balanced = YES], [compile with balanced capabilities (default is yes)]),
-		[BALANCED=$withval],[BALANCED=yes]) 
-	AC_MSG_CHECKING(for balanced capability compilation)
-
-	if test "x$BALANCED" = "xyes"; then
-
-		dnl defaults
-		HAVE_BALANCED=yes
-
-		AC_DEFINE([_HAVE_BALANCED_],[1],[with balanced capability])
-	else
-		HAVE_BALANCED=no
-	fi
-	AM_CONDITIONAL([BALANCED], [test x$HAVE_BALANCED = xyes])
-	AC_MSG_RESULT($HAVE_BALANCED)
-	dnl }}}
-	dnl with-damage{{{
-	AC_ARG_WITH([damage],
-		AS_HELP_STRING([--with-damage = YES], [compile with damage capabilities (default is yes)]),
-		[DAMAGE=$withval],[DAMAGE=yes]) 
-	AC_MSG_CHECKING(for damage capability compilation)
-
-	if test "x$DAMAGE" = "xyes"; then
-
-		dnl defaults
-		HAVE_DAMAGE=yes
-
-		AC_DEFINE([_HAVE_DAMAGE_],[1],[with damage capability])
-	else
-		HAVE_DAMAGE=no
-	fi
-	AM_CONDITIONAL([DAMAGE], [test x$HAVE_DAMAGE = xyes])
-	AC_MSG_RESULT($HAVE_DAMAGE)
-	dnl }}}
-	dnl with-responses{{{
-	AC_ARG_WITH([responses],
-		AS_HELP_STRING([--with-responses = YES], [compile with responses capabilities (default is yes)]),
-		[RESPONSES=$withval],[RESPONSES=yes]) 
-	AC_MSG_CHECKING(for responses capability compilation)
-
-	if test "x$RESPONSES" = "xyes"; then
-
-		dnl defaults
-		HAVE_RESPONSES=yes
-
-		AC_DEFINE([_HAVE_RESPONSES_],[1],[with responses capability])
-	else
-		HAVE_RESPONSES=no
-	fi
-	AM_CONDITIONAL([RESPONSES], [test x$HAVE_RESPONSES = xyes])
-	AC_MSG_RESULT($HAVE_RESPONSES)
-	dnl }}}
-	dnl with-slope{{{
-	AC_ARG_WITH([slope],
-		AS_HELP_STRING([--with-slope = YES], [compile with slope capabilities (default is yes)]),
-		[SLOPE=$withval],[SLOPE=yes]) 
-	AC_MSG_CHECKING(for slope capability compilation)
-
-	if test "x$SLOPE" = "xyes"; then
-
-		dnl defaults
-		HAVE_SLOPE=yes
-
-		AC_DEFINE([_HAVE_SLOPE_],[1],[with slope capability])
-	else
-		HAVE_SLOPE=no
-	fi
-	AM_CONDITIONAL([SLOPE], [test x$HAVE_SLOPE = xyes])
-	AC_MSG_RESULT($HAVE_SLOPE)
-	dnl }}}
-	dnl with-meshdeformation{{{
-		AC_ARG_WITH([meshdeformation],
-					AS_HELP_STRING([--with-meshdeformation = YES], [compile with meshdeformation capabilities (default is yes)]),
-					[MESHDEFORMATION=$withval],[MESHDEFORMATION=yes]) 
-		  AC_MSG_CHECKING(for meshdeformation capability compilation)
-
-		  if test "x$MESHDEFORMATION" = "xyes"; then
-
-			dnl defaults
-			  HAVE_MESHDEFORMATION=yes
-
-			  AC_DEFINE([_HAVE_MESHDEFORMATION_],[1],[with meshdeformation capability])
-		  else
-				HAVE_MESHDEFORMATION=no
-		  fi
-	  AM_CONDITIONAL([MESHDEFORMATION], [test x$HAVE_MESHDEFORMATION = xyes])
-	  AC_MSG_RESULT($HAVE_MESHDEFORMATION)
-	  dnl }}}
-	dnl with-groundingline{{{
-	AC_ARG_WITH([groundingline],
-		AS_HELP_STRING([--with-groundingline = YES], [compile with groundingline capabilities (default is yes)]),
-		[GROUNDINGLINE=$withval],[GROUNDINGLINE=yes]) 
-	AC_MSG_CHECKING(for groundingline capability compilation)
-
-	if test "x$GROUNDINGLINE" = "xyes"; then
-
-		dnl defaults
-		HAVE_GROUNDINGLINE=yes
-
-		AC_DEFINE([_HAVE_GROUNDINGLINE_],[1],[with groundingline capability])
-	else
-		HAVE_GROUNDINGLINE=no
-	fi
-	AM_CONDITIONAL([GROUNDINGLINE], [test x$HAVE_GROUNDINGLINE = xyes])
-	AC_MSG_RESULT($HAVE_GROUNDINGLINE)
-	dnl }}}
-	dnl with-rifts{{{
-	AC_ARG_WITH([rifts],
-		AS_HELP_STRING([--with-rifts = YES], [compile with rifts capabilities (default is yes)]),
-		[RIFTS=$withval],[RIFTS=yes]) 
-	AC_MSG_CHECKING(for rifts capability compilation)
-
-	if test "x$RIFTS" = "xyes"; then
-
-		dnl defaults
-		HAVE_RIFTS=yes
-
-		AC_DEFINE([_HAVE_RIFTS_],[1],[with rifts capability])
-	else
-		HAVE_RIFTS=no
-	fi
-	AM_CONDITIONAL([RIFTS], [test x$HAVE_RIFTS = xyes])
-	AC_MSG_RESULT($HAVE_RIFTS)
-	dnl }}}
-	dnl with-gia{{{
-	AC_ARG_WITH([gia],
-		AS_HELP_STRING([--with-gia = YES], [compile with gia capabilities (default is yes)]),
-		[GIA=$withval],[GIA=no]) 
-	AC_MSG_CHECKING(for gia capability compilation)
-
-	if test "x$GIA" = "xyes"; then
-	  
-	  if test "x$HAVE_MATH77" = "xno"; then
-		  HAVE_GIA=no
-		  AC_MSG_ERROR([gia requires compilation of math77 library! Reconfigure with --with-math77 option on]);
-	  else
-		dnl defaults
-		HAVE_GIA=yes
-		AC_DEFINE([_HAVE_GIA_],[1],[with gia capability])
-	  fi
-
-	else
-		HAVE_GIA=no
-	fi
-	AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
-	AC_MSG_RESULT($HAVE_GIA)
-	dnl }}}
+	dnl with-stressbalanceSIA{{{
+		AC_ARG_WITH([stressbalanceSIA],
+					AS_HELP_STRING([--with-stressbalanceSIA = YES], [compile with stressbalanceSIA capabilities (default is yes)]),
+					[STRESSBALANCESIA=$withval],[STRESSBALANCESIA=yes]) 
+		  AC_MSG_CHECKING(for stressbalanceSIA capability compilation)
+
+		  HAVE_STRESSBALANCESIA=no
+		  if test "x$STRESSBALANCESIA" = "xyes"; then
+			HAVE_STRESSBALANCESIA=yes
+			  AC_DEFINE([_HAVE_STRESSBALANCESIA_],[1],[with stressbalanceSIA capability])
+			  fi
+			  AM_CONDITIONAL([STRESSBALANCESIA], [test x$HAVE_STRESSBALANCESIA = xyes])
+			  AC_MSG_RESULT($HAVE_STRESSBALANCESIA)
+			  dnl }}}
+	dnl with-StressbalanceVertical{{{
+	AC_ARG_WITH([StressbalanceVertical],
+		AS_HELP_STRING([--with-StressbalanceVertical = YES], [compile with StressbalanceVertical capabilities (default is yes)]),
+		[STRESSBALANCEVERTICAL=$withval],[STRESSBALANCEVERTICAL=yes]) 
+	AC_MSG_CHECKING(for StressbalanceVertical capability compilation)
+
+	HAVE_STRESSBALANCEVERTICAL=no
+	if test "x$STRESSBALANCEVERTICAL" = "xyes"; then
+		HAVE_STRESSBALANCEVERTICAL=yes
+		AC_DEFINE([_HAVE_STRESSBALANCEVERTICAL_],[1],[with StressbalanceVertical capability])
+	fi
+	AM_CONDITIONAL([STRESSBALANCEVERTICAL], [test x$HAVE_STRESSBALANCEVERTICAL = xyes])
+	AC_MSG_RESULT($HAVE_STRESSBALANCEVERTICAL)
+	dnl }}}
+	dnl with-Enthalpy{{{
+	AC_ARG_WITH([Enthalpy],
+		AS_HELP_STRING([--with-Enthalpy = YES], [compile with Enthalpy capabilities (default is yes)]),
+		[ENTHALPY=$withval],[ENTHALPY=yes]) 
+	AC_MSG_CHECKING(for Enthalpy capability compilation)
+
+	HAVE_ENTHALPY=no
+	if test "x$ENTHALPY" = "xyes"; then
+		HAVE_ENTHALPY=yes
+		AC_DEFINE([_HAVE_ENTHALPY_],[1],[with Enthalpy capability])
+	fi
+	AM_CONDITIONAL([ENTHALPY], [test x$HAVE_ENTHALPY = xyes])
+	AC_MSG_RESULT($HAVE_ENTHALPY)
+	dnl }}}
+	dnl with-HydrologyShreve{{{
+	AC_ARG_WITH([HydrologyShreve],
+		AS_HELP_STRING([--with-HydrologyShreve = YES], [compile with HydrologyShreve capabilities (default is yes)]),
+		[HYDROLOGYSHREVE=$withval],[HYDROLOGYSHREVE=yes]) 
+	AC_MSG_CHECKING(for HydrologyShreve capability compilation)
+
+	HAVE_HYDROLOGYSHREVE=no
+	if test "x$HYDROLOGYSHREVE" = "xyes"; then
+		HAVE_HYDROLOGYSHREVE=yes
+		AC_DEFINE([_HAVE_HYDROLOGYSHREVE_],[1],[with HydrologyShreve capability])
+	fi
+	AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
+	AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
+	dnl }}}
+	dnl with-HydrologyDCInefficient{{{
+	AC_ARG_WITH([HydrologyDCInefficient],
+		AS_HELP_STRING([--with-HydrologyDCInefficient = YES], [compile with HydrologyDCInefficient capabilities (default is yes)]),
+		[HYDROLOGYDCINEFFICIENT=$withval],[HYDROLOGYDCINEFFICIENT=yes]) 
+	AC_MSG_CHECKING(for HydrologyDCInefficient capability compilation)
+
+	HAVE_HYDROLOGYDCINEFFICIENT=no
+	if test "x$HYDROLOGYDCINEFFICIENT" = "xyes"; then
+		HAVE_HYDROLOGYDCINEFFICIENT=yes
+		AC_DEFINE([_HAVE_HYDROLOGYDCINEFFICIENT_],[1],[with HydrologyDCInefficient capability])
+	fi
+	AM_CONDITIONAL([HYDROLOGYDCINEFFICIENT], [test x$HAVE_HYDROLOGYDCINEFFICIENT = xyes])
+	AC_MSG_RESULT($HAVE_HYDROLOGYDCINEFFICIENT)
+	dnl }}}
+	dnl with-HydrologyDCEfficient{{{
+	AC_ARG_WITH([HydrologyDCEfficient],
+		AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
+		[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes]) 
+	AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
+
+	HAVE_HYDROLOGYDCEFFICIENT=no
+	if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
+		HAVE_HYDROLOGYDCEFFICIENT=yes
+		AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
+	fi
+	AM_CONDITIONAL([HYDROLOGYDCEFFICIENT], [test x$HAVE_HYDROLOGYDCEFFICIENT = xyes])
+	AC_MSG_RESULT($HAVE_HYDROLOGYDCEFFICIENT)
+	dnl }}}
+	dnl with-Melting{{{
+	AC_ARG_WITH([Melting],
+		AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
+		[MELTING=$withval],[MELTING=yes]) 
+	AC_MSG_CHECKING(for Melting capability compilation)
+
+	HAVE_MELTING=no
+	if test "x$MELTING" = "xyes"; then
+		HAVE_MELTING=yes
+		AC_DEFINE([_HAVE_MELTING_],[1],[with Melting capability])
+	fi
+	AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
+	AC_MSG_RESULT($HAVE_MELTING)
+	dnl }}}
+	dnl with-Masstransport{{{
+	AC_ARG_WITH([Masstransport],
+		AS_HELP_STRING([--with-Masstransport = YES], [compile with Masstransport capabilities (default is yes)]),
+		[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes]) 
+	AC_MSG_CHECKING(for Masstransport capability compilation)
+
+	HAVE_MASSTRANSPORT=no
+	if test "x$MASSTRANSPORT" = "xyes"; then
+		HAVE_MASSTRANSPORT=yes
+		AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with Masstransport capability])
+	fi
+	AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
+	AC_MSG_RESULT($HAVE_MASSTRANSPORT)
+	dnl }}}
+	dnl with-FreeSurfaceBase{{{
+	AC_ARG_WITH([FreeSurfaceBase],
+		AS_HELP_STRING([--with-FreeSurfaceBase = YES], [compile with FreeSurfaceBase capabilities (default is yes)]),
+		[FREESURFACEBASE=$withval],[FREESURFACEBASE=yes]) 
+	AC_MSG_CHECKING(for FreeSurfaceBase capability compilation)
+
+	HAVE_FREESURFACEBASE=no
+	if test "x$FREESURFACEBASE" = "xyes"; then
+		HAVE_FREESURFACEBASE=yes
+		AC_DEFINE([_HAVE_FREESURFACEBASE_],[1],[with FreeSurfaceBase capability])
+	fi
+	AM_CONDITIONAL([FREESURFACEBASE], [test x$HAVE_FREESURFACEBASE = xyes])
+	AC_MSG_RESULT($HAVE_FREESURFACEBASE)
+	dnl }}}
+	dnl with-FreeSurfaceTop{{{
+		AC_ARG_WITH([FreeSurfaceTop],
+					AS_HELP_STRING([--with-FreeSurfaceTop = YES], [compile with FreeSurfaceTop capabilities (default is yes)]),
+					[FREESURFACETOP=$withval],[FREESURFACETOP=yes]) 
+		  AC_MSG_CHECKING(for FreeSurfaceTop capability compilation)
+
+		  HAVE_FREESURFACETOP=no
+		  if test "x$FREESURFACETOP" = "xyes"; then
+			HAVE_FREESURFACETOP=yes
+			  AC_DEFINE([_HAVE_FREESURFACETOP_],[1],[with FreeSurfaceTop capability])
+			  fi
+			  AM_CONDITIONAL([FREESURFACETOP], [test x$HAVE_FREESURFACETOP = xyes])
+			  AC_MSG_RESULT($HAVE_FREESURFACETOP)
+			  dnl }}}
+	dnl with-ExtrudeFromBase{{{
+	AC_ARG_WITH([ExtrudeFromBase],
+		AS_HELP_STRING([--with-ExtrudeFromBase = YES], [compile with ExtrudeFromBase capabilities (default is yes)]),
+		[EXTRUDEFROMBASE=$withval],[EXTRUDEFROMBASE=yes]) 
+	AC_MSG_CHECKING(for ExtrudeFromBase capability compilation)
+
+	HAVE_EXTRUDEFROMBASE=no
+	if test "x$EXTRUDEFROMBASE" = "xyes"; then
+		HAVE_EXTRUDEFROMBASE=yes
+		AC_DEFINE([_HAVE_EXTRUDEFROMBASE_],[1],[with ExtrudeFromBase capability])
+	fi
+	AM_CONDITIONAL([EXTRUDEFROMBASE], [test x$HAVE_EXTRUDEFROMBASE = xyes])
+	AC_MSG_RESULT($HAVE_EXTRUDEFROMBASE)
+	dnl }}}
+	dnl with-ExtrudeFromTop{{{
+		AC_ARG_WITH([ExtrudeFromTop],
+					AS_HELP_STRING([--with-ExtrudeFromTop = YES], [compile with ExtrudeFromTop capabilities (default is yes)]),
+					[EXTRUDEFROMTOP=$withval],[EXTRUDEFROMTOP=yes]) 
+		  AC_MSG_CHECKING(for ExtrudeFromTop capability compilation)
+
+		  HAVE_EXTRUDEFROMTOP=no
+		  if test "x$EXTRUDEFROMTOP" = "xyes"; then
+			HAVE_EXTRUDEFROMTOP=yes
+			  AC_DEFINE([_HAVE_EXTRUDEFROMTOP_],[1],[with ExtrudeFromTop capability])
+			  fi
+			  AM_CONDITIONAL([EXTRUDEFROMTOP], [test x$HAVE_EXTRUDEFROMTOP = xyes])
+			  AC_MSG_RESULT($HAVE_EXTRUDEFROMTOP)
+			  dnl }}}
+	dnl with-Thermal{{{
+	AC_ARG_WITH([Thermal],
+		AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
+		[THERMAL=$withval],[THERMAL=yes]) 
+	AC_MSG_CHECKING(for Thermal capability compilation)
+
+	HAVE_THERMAL=no
+	if test "x$THERMAL" = "xyes"; then
+		HAVE_THERMAL=yes
+		AC_DEFINE([_HAVE_THERMAL_],[1],[with Thermal capability])
+	fi
+	AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
+	AC_MSG_RESULT($HAVE_THERMAL)
+	dnl }}}
+	dnl with-Meshdeformation{{{
+	AC_ARG_WITH([Meshdeformation],
+		AS_HELP_STRING([--with-Meshdeformation = YES], [compile with Meshdeformation capabilities (default is yes)]),
+		[MESHDEFORMATION=$withval],[MESHDEFORMATION=yes]) 
+	AC_MSG_CHECKING(for Meshdeformation capability compilation)
+
+	HAVE_MESHDEFORMATION=no
+	if test "x$MESHDEFORMATION" = "xyes"; then
+		HAVE_MESHDEFORMATION=yes
+		AC_DEFINE([_HAVE_MESHDEFORMATION_],[1],[with Meshdeformation capability])
+	fi
+	AM_CONDITIONAL([MESHDEFORMATION], [test x$HAVE_MESHDEFORMATION = xyes])
+	AC_MSG_RESULT($HAVE_MESHDEFORMATION)
+	dnl }}}
+	dnl with-Levelset{{{
+	AC_ARG_WITH([Levelset],
+		AS_HELP_STRING([--with-Levelset = YES], [compile with Levelset capabilities (default is yes)]),
+		[LEVELSET=$withval],[LEVELSET=yes]) 
+	AC_MSG_CHECKING(for Levelset capability compilation)
+
+	HAVE_LEVELSET=no
+	if test "x$LEVELSET" = "xyes"; then
+		HAVE_LEVELSET=yes
+		AC_DEFINE([_HAVE_LEVELSET_],[1],[with Levelset capability])
+	fi
+	AM_CONDITIONAL([LEVELSET], [test x$HAVE_LEVELSET = xyes])
+	AC_MSG_RESULT($HAVE_LEVELSET)
+	dnl }}}
+	dnl with-Extrapolation{{{
+	AC_ARG_WITH([Extrapolation],
+		AS_HELP_STRING([--with-Extrapolation = YES], [compile with Extrapolation capabilities (default is yes)]),
+		[EXTRAPOLATION=$withval],[EXTRAPOLATION=yes]) 
+	AC_MSG_CHECKING(for Extrapolation capability compilation)
+
+	HAVE_EXTRAPOLATION=no
+	if test "x$EXTRAPOLATION" = "xyes"; then
+		HAVE_EXTRAPOLATION=yes
+		AC_DEFINE([_HAVE_EXTRAPOLATION_],[1],[with Extrapolation capability])
+	fi
+	AM_CONDITIONAL([EXTRAPOLATION], [test x$HAVE_EXTRAPOLATION = xyes])
+	AC_MSG_RESULT($HAVE_EXTRAPOLATION)
+	dnl }}}
+
+	dnl Platform specifics
 	dnl with-ios{{{
 	AC_ARG_WITH([ios],
@@ -1921,22 +2000,4 @@
 	fi
 	AC_MSG_RESULT($HAVE_ANDROID_NDK)
-	dnl }}}
-	dnl with-3d{{{
-	AC_ARG_WITH([3d],
-		AS_HELP_STRING([--with-3d = YES], [compile with 3d capabilities (default is yes)]),
-		[THREED=$withval],[THREED=yes]) 
-	AC_MSG_CHECKING(for 3d capability compilation)
-
-	if test "x$THREED" = "xyes"; then
-
-		dnl defaults
-		HAVE_3D=yes
-
-		AC_DEFINE([_HAVE_3D_],[1],[with 3d capability])
-	else
-		HAVE_3D=no
-	fi
-	AM_CONDITIONAL([THREED], [test x$HAVE_3D = xyes])
-	AC_MSG_RESULT($HAVE_3D)
 	dnl }}}
 
@@ -2000,38 +2061,33 @@
 		  dnl check that if petsc is requested , mpi should be specified
 		  if test "$HAVE_PETSC" = "yes" ; then
-			if test "$HAVE_MPI" = "NO";  then
-			 AC_MSG_ERROR([petsc requires mpi!]);
-		fi
+				if test "$HAVE_MPI" = "NO";  then
+					 AC_MSG_ERROR([petsc requires mpi!]);
+				fi
 		  fi
 
 		  dnl check that we have either python or matlab support if we compile the modules
 		  if test "$MODULES_VALUE" = "yes"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
-			AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
-		fi
+				AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
+		  fi
 
 		  dnl check that if we have MPI, we have metis
 		  if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
-			AC_MSG_ERROR([need mpi if using the metis partitioner!]);
-		fi
+				AC_MSG_ERROR([need mpi if using the metis partitioner!]);
+		  fi
 		
 		dnl check that if we run adolc, we don't compile krigging.exe
-		  if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_KRIGING" = "yes" ; then
+		if test "$HAVE_ADOLC" = "yes"  && test "$HAVE_KRIGING" = "yes" ; then
 			AC_MSG_ERROR([cannot compile kriging.exe under adolc conditions!]);
 		fi
 		dnl check that if we run meteoio, we have snowpack also
-		  if test "$HAVE_METEOIO" = "yes"  && test "$HAVE_SNOWPACK" = "no" ; then
+		if test "$HAVE_METEOIO" = "yes"  && test "$HAVE_SNOWPACK" = "no" ; then
 			AC_MSG_ERROR([cannot compile MeteoIO package without Snowpack!]);
 		fi
 		dnl check that if we run snowpack, we have meteoio also
-		  if test "$HAVE_METEOIO" = "no"  && test "$HAVE_SNOWPACK" = "yes" ; then
+		if test "$HAVE_METEOIO" = "no"  && test "$HAVE_SNOWPACK" = "yes" ; then
 			AC_MSG_ERROR([cannot compile Snowpack package without MeteoIO!]);
 		fi
 
-
-
-
-
-
-		  AC_MSG_RESULT(done)
-		  dnl }}}
+		AC_MSG_RESULT(done)
+		dnl }}}
 ])
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 17235)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 17236)
@@ -18,7 +18,7 @@
 #}}}
 
-#sources
+#Core sources
 #Core sources{{{
-core_sources = ./datastructures/DataSet.h\
+issm_sources = ./datastructures/DataSet.h\
 					./datastructures/DataSet.cpp\
 					./datastructures/Object.h\
@@ -349,8 +349,96 @@
 					./classes/Options/OptionUtilities.h\
 					./classes/RiftStruct.cpp\
-					./classes/RiftStruct.h
-#}}}
+					./classes/RiftStruct.h\
+					./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
+					./cores/transient_core.cpp\
+					./cores/steadystate_core.cpp\
+					./cores/masstransport_core.cpp\
+					./cores/extrudefrombase_core.cpp\
+					./cores/extrudefromtop_core.cpp\
+					./cores/thermal_core.cpp\
+					./solutionsequences/solutionsequence_thermal_nonlinear.cpp\
+					./modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp\
+					./modules/ControlInputGetGradientx/ControlInputGetGradientx.h\
+					./modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp\
+					./modules/ControlInputSetGradientx/ControlInputSetGradientx.h\
+					./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp\
+					./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h\
+					./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp\
+					./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\
+					./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\
+					./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
+					./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
+					./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
+					./modules/InputControlUpdatex/InputControlUpdatex.h\
+					./modules/InputControlUpdatex/InputControlUpdatex.cpp\
+					./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
+					./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp\
+					./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h\
+					./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp\
+					./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h\
+					./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp\
+					./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h\
+					./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp\
+					./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h\
+					./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp\
+					./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h\
+					./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp\
+					./modules/Orthx/Orthx.h\
+					./modules/Orthx/Orthx.cpp\
+					./modules/Gradjx/Gradjx.h\
+					./modules/Gradjx/Gradjx.cpp\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
+					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
+					./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp\
+					./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h\
+					./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp\
+					./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
+					./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
+					./classes/Inputs/ControlInput.h\
+					./classes/Inputs/ControlInput.cpp\
+					./shared/Numerics/BrentSearch.cpp\
+					./shared/Numerics/OptimalSearch.cpp \
+					./cores/control_core.cpp\
+					./cores/controltao_core.cpp\
+					./cores/objectivefunction.cpp\
+					./cores/gradient_core.cpp\
+					./cores/adjointstressbalance_core.cpp\
+					./cores/adjointbalancethickness_core.cpp\
+					./cores/AdjointCorePointerFromSolutionEnum.cpp\
+					./solutionsequences/solutionsequence_adjoint_linear.cpp\
+					./cores/hydrology_core.cpp\
+					./solutionsequences/solutionsequence_hydro_nonlinear.cpp\
+					./cores/stressbalance_core.cpp\
+					./solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp\
+					./cores/balancethickness_core.cpp \
+					./cores/balancevelocity_core.cpp \
+					./cores/dummy_core.cpp\
+					./cores/surfaceslope_core.cpp\
+					./cores/bedslope_core.cpp\
+					./cores/meshdeformation_core.cpp\
+					./cores/damage_core.cpp\
+					./analyses/DamageEvolutionAnalysis.cpp\
+					./solutionsequences/solutionsequence_damage_nonlinear.cpp\
+					./modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp\
+					./classes/Loads/Riftfront.cpp\
+					./modules/ConstraintsStatex/RiftConstraintsState.cpp\
+					./classes/Massfluxatgate.h \
+					./classes/Misfit.h \
+					./modules/ModelProcessorx/CreateOutputDefinitions.cpp\
+					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h\
+					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\
+					./classes/gauss/GaussPenta.h\
+					./classes/gauss/GaussPenta.cpp\
+					./classes/Inputs/PentaInput.h\
+					./classes/Inputs/PentaInput.cpp\
+					./classes/Elements/Penta.h\
+					./classes/Elements/Penta.cpp\
+					./classes/Elements/PentaRef.h\
+					./classes/Elements/PentaRef.cpp\
+					#}}}
 #DAKOTA sources  {{{
-dakota_sources = ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h\
+if DAKOTA
+issm_sources +=  ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h\
 					  ./modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp\
 					  ./modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h\
@@ -365,376 +453,9 @@
 					  ./cores/DakotaSpawnCore.h\
 					  ./cores/DakotaSpawnCore.cpp
-#}}}
-#Transient sources  {{{
-transient_sources  = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
-							./cores/transient_core.cpp\
-              ./analyses/LevelsetAnalysis.h\
-              ./analyses/LevelsetAnalysis.cpp\
-			  ./analyses/ExtrapolationAnalysis.h\
-			  ./analyses/ExtrapolationAnalysis.cpp
-#}}}
-#Steadystate sources  {{{
-steadystate_sources = ./cores/steadystate_core.cpp
-#}}}
-#Masstransport sources  {{{
-masstransport_sources = ./analyses/ExtrudeFromBaseAnalysis.h\
-								./analyses/ExtrudeFromBaseAnalysis.cpp\
-								./analyses/ExtrudeFromTopAnalysis.h\
-								./analyses/ExtrudeFromTopAnalysis.cpp\
-								./analyses/MasstransportAnalysis.h\
-								./analyses/MasstransportAnalysis.cpp\
-								./analyses/FreeSurfaceBaseAnalysis.h\
-								./analyses/FreeSurfaceBaseAnalysis.cpp\
-								./analyses/FreeSurfaceTopAnalysis.h\
-								./analyses/FreeSurfaceTopAnalysis.cpp\
-								./cores/masstransport_core.cpp\
-								./cores/extrudefrombase_core.cpp\
-								./cores/extrudefromtop_core.cpp
-
-#}}}
-#Thermal sources  {{{
-thermal_sources = ./analyses/ThermalAnalysis.h\
-						./analyses/ThermalAnalysis.cpp\
-						./analyses/EnthalpyAnalysis.h\
-						./analyses/EnthalpyAnalysis.cpp\
-						./analyses/MeltingAnalysis.h\
-						./analyses/MeltingAnalysis.cpp\
-					   ./cores/thermal_core.cpp\
-					   ./solutionsequences/solutionsequence_thermal_nonlinear.cpp
-#}}}
-#Control sources  {{{
-control_sources= ./modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp\
-					  ./modules/ControlInputGetGradientx/ControlInputGetGradientx.h\
-					  ./modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp\
-					  ./modules/ControlInputSetGradientx/ControlInputSetGradientx.h\
-					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp\
-					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h\
-					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp\
-					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\
-					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\
-					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
-					  ./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
-					  ./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
-					  ./modules/InputControlUpdatex/InputControlUpdatex.h\
-					  ./modules/InputControlUpdatex/InputControlUpdatex.cpp\
-					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.h\
-					  ./modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp\
-					  ./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.h\
-					  ./modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp\
-					  ./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.h\
-					  ./modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp\
-					  ./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h\
-					  ./modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp\
-					  ./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h\
-					  ./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp\
-					  ./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h\
-					  ./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp\
-					  ./modules/Orthx/Orthx.h\
-					  ./modules/Orthx/Orthx.cpp\
-					  ./modules/Gradjx/Gradjx.h\
-					  ./modules/Gradjx/Gradjx.cpp\
-					  ./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
-					  ./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h\
-					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp\
-					  ./modules/ThicknessAlongGradientx/ThicknessAlongGradientx.h\
-					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp\
-					  ./modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.h\
-					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp\
-					  ./modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h\
-					  ./classes/Inputs/ControlInput.h\
-					  ./classes/Inputs/ControlInput.cpp\
-					  ./shared/Numerics/BrentSearch.cpp\
-					  ./shared/Numerics/OptimalSearch.cpp \
-					  ./cores/control_core.cpp\
-					  ./cores/controltao_core.cpp\
-					  ./cores/objectivefunction.cpp\
-					  ./cores/gradient_core.cpp\
-					  ./cores/adjointstressbalance_core.cpp\
-					  ./cores/adjointbalancethickness_core.cpp\
-					  ./cores/AdjointCorePointerFromSolutionEnum.cpp\
-					  ./analyses/AdjointBalancethicknessAnalysis.h\
-					  ./analyses/AdjointBalancethicknessAnalysis.cpp\
-					  ./analyses/AdjointHorizAnalysis.h\
-					  ./analyses/AdjointHorizAnalysis.cpp\
-					  ./solutionsequences/solutionsequence_adjoint_linear.cpp
-
-#}}}
-#Hydrology sources  {{{
-hydrology_sources  = ./analyses/HydrologyDCEfficientAnalysis.h\
-							./analyses/HydrologyDCEfficientAnalysis.cpp\
-							./analyses/HydrologyDCInefficientAnalysis.h\
-							./analyses/HydrologyDCInefficientAnalysis.cpp\
-							./analyses/HydrologyShreveAnalysis.h\
-							./analyses/HydrologyShreveAnalysis.cpp\
-							./analyses/L2ProjectionEPLAnalysis.h\
-					  	./analyses/L2ProjectionEPLAnalysis.cpp\
-							./cores/hydrology_core.cpp\
-							./solutionsequences/solutionsequence_hydro_nonlinear.cpp
-#}}}
-#Stressbalance sources  {{{
-stressbalance_sources = ./analyses/StressbalanceAnalysis.h\
-							./analyses/StressbalanceAnalysis.cpp\
-							./analyses/StressbalanceSIAAnalysis.h\
-							./analyses/StressbalanceSIAAnalysis.cpp\
-							./analyses/StressbalanceVerticalAnalysis.h\
-							./analyses/StressbalanceVerticalAnalysis.cpp\
-							./cores/stressbalance_core.cpp\
-							./solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp
-#}}}
-#Balanced sources  {{{
-balanced_sources = ./analyses/BalancevelocityAnalysis.h\
-						 ./analyses/BalancevelocityAnalysis.cpp\
-						 ./analyses/SmoothedSurfaceSlopeXAnalysis.h\
-						 ./analyses/SmoothedSurfaceSlopeXAnalysis.cpp\
-						 ./analyses/SmoothedSurfaceSlopeYAnalysis.h\
-						 ./analyses/SmoothedSurfaceSlopeYAnalysis.cpp\
-						 ./analyses/BalancethicknessAnalysis.h\
-						 ./analyses/BalancethicknessAnalysis.cpp\
-						 ./analyses/BalancethicknessSoftAnalysis.h\
-						 ./analyses/BalancethicknessSoftAnalysis.cpp\
-						 ./cores/balancethickness_core.cpp \
-						 ./cores/balancevelocity_core.cpp \
-						 ./cores/dummy_core.cpp
-#}}}
-#Slope sources  {{{
-slope_sources =  ./analyses/L2ProjectionBaseAnalysis.h\
-					  ./analyses/L2ProjectionBaseAnalysis.cpp\
-					  ./cores/surfaceslope_core.cpp\
-					  ./cores/bedslope_core.cpp
-#}}}
-#MeshDeformation sources  {{{
-meshdeformation_sources = ./analyses/MeshdeformationAnalysis.h\
-					  ./analyses/MeshdeformationAnalysis.cpp\
-					  ./cores/meshdeformation_core.cpp
-#}}}
-#Gia sources  {{{
-gia_sources =  ./cores/gia_core.cpp\
-					./analyses/GiaAnalysis.h\
-					./analyses/GiaAnalysis.cpp\
-					./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp\
-					./modules/GiaDeflectionCorex/GiaDeflectionCorex.h\
-					./modules/GiaDeflectionCorex/distme.f\
-					./modules/GiaDeflectionCorex/freed.f\
-					./modules/GiaDeflectionCorex/ojrule.f\
-					./modules/GiaDeflectionCorex/pwise.f\
-					./modules/GiaDeflectionCorex/qwise.f\
-					./modules/GiaDeflectionCorex/stot.f\
-					./modules/GiaDeflectionCorex/what0.f\
-					./classes/GiaDeflectionCoreArgs.h
-
-#}}}
-#Damage sources  {{{
-damage_sources =  ./cores/damage_core.cpp\
-						./analyses/DamageEvolutionAnalysis.h\
-						./analyses/DamageEvolutionAnalysis.cpp\
-						./solutionsequences/solutionsequence_damage_nonlinear.cpp
-
-#}}}
-#Groundingline sources  {{{
-groundingline_sources= ./modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp\
-					        ./modules/GroundinglineMigrationx/GroundinglineMigrationx.h
-#}}}
-#Rifts sources  {{{
-rifts_sources = ./classes/Loads/Riftfront.cpp\
-				    ./classes/Loads/Riftfront.h\
-				    ./modules/ConstraintsStatex/RiftConstraintsState.cpp
-#}}}
-#Responses sources  {{{
-responses_sources= ./classes/Massfluxatgate.h \
-				   ./classes/Misfit.h \
-				   ./modules/ModelProcessorx/CreateOutputDefinitions.cpp\
-				   ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h\
-				   ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp
-#}}}
-#Android sources  {{{
-android_sources = 
-#}}}
-#3D sources  {{{
-threed_sources = ./classes/gauss/GaussPenta.h\
-				     ./classes/gauss/GaussPenta.cpp\
-				     ./classes/Inputs/PentaInput.h\
-				     ./classes/Inputs/PentaInput.cpp\
-				     ./classes/Elements/Penta.h\
-				     ./classes/Elements/Penta.cpp\
-				     ./classes/Elements/PentaRef.h\
-				     ./classes/Elements/PentaRef.cpp
-#}}}
-#Bamg sources  {{{
-bamg_sources =  ./bamg/bamgobjects.h\
-				./bamg/BamgGeom.h\
-				./bamg/BamgGeom.cpp\
-				./bamg/BamgMesh.h\
-				./bamg/BamgMesh.cpp\
-				./bamg/BamgOpts.h\
-				./bamg/BamgOpts.cpp\
-				./bamg/CrackedEdge.h\
-				./bamg/CrackedEdge.cpp\
-				./bamg/Curve.h\
-				./bamg/Curve.cpp\
-				./bamg/Direction.h\
-				./bamg/Direction.cpp\
-				./bamg/DoubleAndInt.h\
-				./bamg/Edge.h\
-				./bamg/Edge.cpp\
-				./bamg/GeomEdge.h\
-				./bamg/GeomEdge.cpp\
-				./bamg/GeomSubDomain.h\
-				./bamg/GeomSubDomain.cpp\
-				./bamg/GeomVertex.h\
-				./bamg/GeomVertex.cpp\
-				./bamg/Geometry.cpp\
-				./bamg/Geometry.h\
-				./bamg/ListofIntersectionTriangles.cpp\
-				./bamg/ListofIntersectionTriangles.h\
-				./bamg/EigenMetric.cpp\
-				./bamg/Metric.cpp\
-				./bamg/Metric.h\
-				./bamg/BamgQuadtree.cpp\
-				./bamg/BamgQuadtree.h\
-				./bamg/R2.h\
-				./bamg/SetOfE4.cpp\
-				./bamg/SetOfE4.h\
-				./bamg/SubDomain.h\
-				./bamg/SubDomain.cpp\
-				./bamg/AdjacentTriangle.h\
-				./bamg/AdjacentTriangle.cpp\
-				./bamg/Triangle.cpp\
-				./bamg/det.h \
-				./bamg/Triangle.h\
-				./bamg/BamgVertex.cpp\
-				./bamg/BamgVertex.h\
-				./bamg/VertexOnEdge.h\
-				./bamg/VertexOnEdge.cpp\
-				./bamg/VertexOnGeom.h\
-				./bamg/VertexOnGeom.cpp\
-				./bamg/VertexOnVertex.h\
-				./bamg/VertexOnVertex.cpp\
-				./bamg/Mesh.cpp\
-				./bamg/Mesh.h\
-				./shared/Bamg/Abs.h \
-				./shared/Bamg/BigPrimeNumber.h\
-				./shared/Bamg/BigPrimeNumber.cpp\
-				./shared/Bamg/BinaryRand.h \
-				./shared/Bamg/Exchange.h \
-				./shared/Bamg/extrema.h \
-				./shared/Bamg/HeapSort.h \
-				./shared/Bamg/OppositeAngle.h \
-				./modules/Bamgx/Bamgx.cpp\
-				./modules/Bamgx/Bamgx.h\
-				./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
-				./modules/BamgConvertMeshx/BamgConvertMeshx.h\
-				./modules/BamgTriangulatex/BamgTriangulatex.cpp\
-				./modules/BamgTriangulatex/BamgTriangulatex.h
-#}}}
-#Kriging sources  {{{
-kriging_sources = ./classes/kriging/Observations.h\
-						./classes/kriging/Observations.cpp\
-						./classes/kriging/Variogram.h \
-						./classes/kriging/GaussianVariogram.h\
-						./classes/kriging/GaussianVariogram.cpp\
-						./classes/kriging/ExponentialVariogram.h\
-						./classes/kriging/ExponentialVariogram.cpp\
-						./classes/kriging/SphericalVariogram.h\
-						./classes/kriging/SphericalVariogram.cpp\
-						./classes/kriging/PowerVariogram.h\
-						./classes/kriging/PowerVariogram.cpp\
-						./classes/kriging/Quadtree.h\
-						./classes/kriging/Quadtree.cpp\
-						./classes/kriging/Observation.h\
-						./classes/kriging/Observation.cpp\
-						./modules/Krigingx/Krigingx.cpp\
-						./modules/Krigingx/Krigingx.h
-
-#For parallel kriging, only difference is ./modules/Krigingx/pKrigingx.cpp with no multithreading
-pkriging_sources = ./classes/kriging/Observations.h\
-						./classes/kriging/Observations.cpp\
-						./classes/kriging/Variogram.h \
-						./classes/kriging/GaussianVariogram.h\
-						./classes/kriging/GaussianVariogram.cpp\
-						./classes/kriging/ExponentialVariogram.h\
-						./classes/kriging/ExponentialVariogram.cpp\
-						./classes/kriging/SphericalVariogram.h\
-						./classes/kriging/SphericalVariogram.cpp\
-						./classes/kriging/PowerVariogram.h\
-						./classes/kriging/PowerVariogram.cpp\
-						./classes/kriging/Quadtree.h\
-						./classes/kriging/Quadtree.cpp\
-						./classes/kriging/Observation.h\
-						./classes/kriging/Observation.cpp\
-						./modules/Krigingx/pKrigingx.cpp\
-						./modules/Krigingx/Krigingx.h
-
-#}}}
-#Kml sources  {{{
-kml_sources = ./modules/Exp2Kmlx/Exp2Kmlx.h\
-			     ./modules/Exp2Kmlx/Exp2Kmlx.cpp\
-			     ./modules/Kml2Expx/Kml2Expx.h\
-			     ./modules/Kml2Expx/Kml2Expx.cpp\
-			     ./modules/Shp2Kmlx/Shp2Kmlx.h\
-			     ./modules/Shp2Kmlx/Shp2Kmlx.cpp\
-			     ./modules/KMLFileReadx/KMLFileReadx.h\
-			     ./modules/KMLFileReadx/KMLFileReadx.cpp\
-			     ./modules/KMLMeshWritex/KMLMeshWritex.h\
-			     ./modules/KMLMeshWritex/KMLMeshWritex.cpp\
-			     ./modules/KMLOverlayx/KMLOverlayx.h\
-			     ./modules/KMLOverlayx/KMLOverlayx.cpp\
-			     ./kml/kmlobjects.h\
-			     ./kml/KML_Attribute.cpp\
-			     ./kml/KML_Attribute.h\
-			     ./kml/KML_Comment.cpp\
-			     ./kml/KML_Comment.h\
-			     ./kml/KML_ColorStyle.cpp\
-			     ./kml/KML_ColorStyle.h\
-			     ./kml/KML_Container.cpp\
-			     ./kml/KML_Container.h\
-			     ./kml/KML_Document.cpp\
-			     ./kml/KML_Document.h\
-			     ./kml/KML_Feature.cpp\
-			     ./kml/KML_Feature.h\
-			     ./kml/KML_File.cpp\
-			     ./kml/KML_File.h\
-			     ./kml/KML_Folder.cpp\
-			     ./kml/KML_Folder.h\
-			     ./kml/KML_Geometry.cpp\
-			     ./kml/KML_Geometry.h\
-			     ./kml/KML_GroundOverlay.cpp\
-			     ./kml/KML_GroundOverlay.h\
-			     ./kml/KML_Icon.cpp\
-			     ./kml/KML_Icon.h\
-			     ./kml/KML_LatLonBox.cpp\
-		  	     ./kml/KML_LatLonBox.h\
-			     ./kml/KML_LinearRing.cpp\
-			     ./kml/KML_LinearRing.h\
-			     ./kml/KML_LineString.cpp\
-			     ./kml/KML_LineString.h\
-			     ./kml/KML_LineStyle.cpp\
-			     ./kml/KML_LineStyle.h\
-			     ./kml/KML_MultiGeometry.cpp\
-			     ./kml/KML_MultiGeometry.h\
-			     ./kml/KML_Object.cpp\
-			     ./kml/KML_Object.h\
-			     ./kml/KML_Overlay.cpp\
-			     ./kml/KML_Overlay.h\
-			     ./kml/KML_Point.cpp\
-			     ./kml/KML_Point.h\
-			     ./kml/KML_Placemark.cpp\
-			     ./kml/KML_Placemark.h\
-			     ./kml/KML_Polygon.cpp\
-			     ./kml/KML_Polygon.h\
-			     ./kml/KML_PolyStyle.cpp\
-			     ./kml/KML_PolyStyle.h\
-			     ./kml/KML_Style.cpp\
-			     ./kml/KML_Style.h\
-			     ./kml/KML_StyleSelector.cpp\
-			     ./kml/KML_StyleSelector.h\
-			     ./kml/KML_SubStyle.cpp\
-			     ./kml/KML_SubStyle.h\
-			     ./kml/KML_Unknown.cpp\
-			     ./kml/KML_Unknown.h\
-			     ./kml/KMLFileReadUtils.cpp\
-			     ./kml/KMLFileReadUtils.h
+endif
 #}}}
 #Petsc sources  {{{
-petsc_sources= ./toolkits/petsc\
+if PETSC
+issm_sources += ./toolkits/petsc\
 					./toolkits/petsc/patches\
 					./toolkits/petsc/patches/SolverEnum.h\
@@ -762,23 +483,280 @@
 					./toolkits/petsc/objects/PetscSolver.h\
 					./toolkits/petsc/petscincludes.h
-
+endif
 #}}}
 #Mumps sources  {{{
-mumps_sources=      ./toolkits/mumps\
+if MUMPS
+issm_sources += ./toolkits/mumps\
 					./toolkits/mumps/mumpsincludes.h\
 					./toolkits/mumps/MumpsSolve.cpp
+endif
 #}}}
 #Gsl sources  {{{
-gsl_sources=      ./toolkits/gsl\
+if GSL
+issm_sources += ./toolkits/gsl\
 					./toolkits/gsl/gslincludes.h\
 					./toolkits/gsl/DenseGslSolve.cpp
+endif
+#}}}
+#Analyses{{{
+if ADJOINTBALANCETHICKNESS
+issm_sources += ./analyses/AdjointBalancethicknessAnalysis.cpp
+endif
+if ADJOINTHORIZ
+issm_sources += ./analyses/AdjointHorizAnalysis.cpp
+endif
+if BALANCETHICKNESS
+issm_sources += ./analyses/BalancethicknessAnalysis.cpp
+endif
+if BALANCETHICKNESSSOFT
+issm_sources += ./analyses/BalancethicknessSoftAnalysis.cpp
+endif
+if BALANCEVELOCITY
+issm_sources += ./analyses/BalancevelocityAnalysis.cpp
+endif
+if L2PROJECTIONBASE
+issm_sources += ./analyses/L2ProjectionBaseAnalysis.cpp
+endif
+if DAMAGEEVOLUTION
+issm_sources += ./analyses/DamageEvolutionAnalysis.cpp
+endif
+if STRESSBALANCE
+issm_sources += ./analyses/StressbalanceAnalysis.cpp
+endif
+if STRESSBALANCESIA
+issm_sources += ./analyses/StressbalanceSIAAnalysis.cpp
+endif
+if STRESSBALANCEVERTICAL
+issm_sources += ./analyses/StressbalanceVerticalAnalysis.cpp
+endif
+if ENTHALPY
+issm_sources += ./analyses/EnthalpyAnalysis.cpp
+endif
+if HYDROLOGYSHREVE
+issm_sources += ./analyses/HydrologyShreveAnalysis.cpp
+endif
+if HYDROLOGYDCINEFFICIENT
+issm_sources += ./analyses/HydrologyDCInefficientAnalysis.cpp
+endif
+if HYDROLOGYDCEFFICIENT
+issm_sources += ./analyses/HydrologyDCEfficientAnalysis.cpp
+endif
+if MELTING
+issm_sources += ./analyses/MeltingAnalysis.cpp
+endif
+if MASSTRANSPORT
+issm_sources += ./analyses/MasstransportAnalysis.cpp
+endif
+if FREESURFACEBASE
+issm_sources += ./analyses/FreeSurfaceBaseAnalysis.cpp
+endif
+if FREESURFACETOP
+issm_sources += ./analyses/FreeSurfaceTopAnalysis.cpp
+endif
+if EXTRUDEFROMBASE
+issm_sources += ./analyses/ExtrudeFromBaseAnalysis.cpp
+endif
+if EXTRUDEFROMTOP
+issm_sources += ./analyses/ExtrudeFromTopAnalysis.cpp
+endif
+if THERMAL
+issm_sources += ./analyses/ThermalAnalysis.cpp
+endif
+if MESHDEFORMATION
+issm_sources += ./analyses/MeshdeformationAnalysis.cpp
+endif
+if LEVELSET
+issm_sources += ./analyses/LevelsetAnalysis.cpp
+endif
+if EXTRAPOLATION
+issm_sources += ./analyses/ExtrapolationAnalysis.cpp
+endif
+#}}}
+#Gia sources  {{{
+if GIA
+issm_sources +=  ./cores/gia_core.cpp\
+					./analyses/GiaAnalysis.cpp\
+					./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp\
+					./modules/GiaDeflectionCorex/distme.f\
+					./modules/GiaDeflectionCorex/freed.f\
+					./modules/GiaDeflectionCorex/ojrule.f\
+					./modules/GiaDeflectionCorex/pwise.f\
+					./modules/GiaDeflectionCorex/qwise.f\
+					./modules/GiaDeflectionCorex/stot.f\
+					./modules/GiaDeflectionCorex/what0.f
+endif
 #}}}
 #Mpi sources  {{{
-mpi_sources= ./toolkits/issm/IssmMpiDenseMat.h\
-				./toolkits/issm/IssmMpiVec.h
+if MPI
+issm_sources += ./toolkits/issm/IssmMpiDenseMat.h\
+					 ./toolkits/issm/IssmMpiVec.h
+endif
 #}}}
 #Metis sources  {{{
-metis_sources= ./toolkits/metis/patches/metispatches.h\
+if METIS
+issm_sources += ./toolkits/metis/patches/metispatches.h\
 					./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+endif
+#}}}
+
+#Wrapper sources
+#Bamg sources  {{{
+bamg_sources =  ./bamg/bamgobjects.h\
+					 ./bamg/BamgGeom.h\
+					 ./bamg/BamgGeom.cpp\
+					 ./bamg/BamgMesh.h\
+					 ./bamg/BamgMesh.cpp\
+					 ./bamg/BamgOpts.h\
+					 ./bamg/BamgOpts.cpp\
+					 ./bamg/CrackedEdge.h\
+					 ./bamg/CrackedEdge.cpp\
+					 ./bamg/Curve.h\
+					 ./bamg/Curve.cpp\
+					 ./bamg/Direction.h\
+					 ./bamg/Direction.cpp\
+					 ./bamg/DoubleAndInt.h\
+					 ./bamg/Edge.h\
+					 ./bamg/Edge.cpp\
+					 ./bamg/GeomEdge.h\
+					 ./bamg/GeomEdge.cpp\
+					 ./bamg/GeomSubDomain.h\
+					 ./bamg/GeomSubDomain.cpp\
+					 ./bamg/GeomVertex.h\
+					 ./bamg/GeomVertex.cpp\
+					 ./bamg/Geometry.cpp\
+					 ./bamg/Geometry.h\
+					 ./bamg/ListofIntersectionTriangles.cpp\
+					 ./bamg/ListofIntersectionTriangles.h\
+					 ./bamg/EigenMetric.cpp\
+					 ./bamg/Metric.cpp\
+					 ./bamg/Metric.h\
+					 ./bamg/BamgQuadtree.cpp\
+					 ./bamg/BamgQuadtree.h\
+					 ./bamg/R2.h\
+					 ./bamg/SetOfE4.cpp\
+					 ./bamg/SetOfE4.h\
+					 ./bamg/SubDomain.h\
+					 ./bamg/SubDomain.cpp\
+					 ./bamg/AdjacentTriangle.h\
+					 ./bamg/AdjacentTriangle.cpp\
+					 ./bamg/Triangle.cpp\
+					 ./bamg/det.h \
+					 ./bamg/Triangle.h\
+					 ./bamg/BamgVertex.cpp\
+					 ./bamg/BamgVertex.h\
+					 ./bamg/VertexOnEdge.h\
+					 ./bamg/VertexOnEdge.cpp\
+					 ./bamg/VertexOnGeom.h\
+					 ./bamg/VertexOnGeom.cpp\
+					 ./bamg/VertexOnVertex.h\
+					 ./bamg/VertexOnVertex.cpp\
+					 ./bamg/Mesh.cpp\
+					 ./bamg/Mesh.h\
+					 ./shared/Bamg/Abs.h \
+					 ./shared/Bamg/BigPrimeNumber.h\
+					 ./shared/Bamg/BigPrimeNumber.cpp\
+					 ./shared/Bamg/BinaryRand.h \
+					 ./shared/Bamg/Exchange.h \
+					 ./shared/Bamg/extrema.h \
+					 ./shared/Bamg/HeapSort.h \
+					 ./shared/Bamg/OppositeAngle.h \
+					 ./modules/Bamgx/Bamgx.cpp\
+					 ./modules/Bamgx/Bamgx.h\
+					 ./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
+					 ./modules/BamgConvertMeshx/BamgConvertMeshx.h\
+					 ./modules/BamgTriangulatex/BamgTriangulatex.cpp\
+					 ./modules/BamgTriangulatex/BamgTriangulatex.h
+#}}}
+#Kriging sources  {{{
+if KRIGING
+kriging_sources = ./classes/kriging/Observations.h\
+					./classes/kriging/Observations.cpp\
+					./classes/kriging/Variogram.h \
+					./classes/kriging/GaussianVariogram.h\
+					./classes/kriging/GaussianVariogram.cpp\
+					./classes/kriging/ExponentialVariogram.h\
+					./classes/kriging/ExponentialVariogram.cpp\
+					./classes/kriging/SphericalVariogram.h\
+					./classes/kriging/SphericalVariogram.cpp\
+					./classes/kriging/PowerVariogram.h\
+					./classes/kriging/PowerVariogram.cpp\
+					./classes/kriging/Quadtree.h\
+					./classes/kriging/Quadtree.cpp\
+					./classes/kriging/Observation.h\
+					./classes/kriging/Observation.cpp\
+					./modules/Krigingx/Krigingx.cpp\
+					./modules/Krigingx/Krigingx.h
+issm_sources +=$(kriging_sources)
+issm_sources +=./modules/Krigingx/pKrigingx.cpp
+endif
+#}}}
+#Kml sources  {{{
+kml_sources = ./modules/Exp2Kmlx/Exp2Kmlx.h\
+				  ./modules/Exp2Kmlx/Exp2Kmlx.cpp\
+				  ./modules/Kml2Expx/Kml2Expx.h\
+				  ./modules/Kml2Expx/Kml2Expx.cpp\
+				  ./modules/Shp2Kmlx/Shp2Kmlx.h\
+				  ./modules/Shp2Kmlx/Shp2Kmlx.cpp\
+				  ./modules/KMLFileReadx/KMLFileReadx.h\
+				  ./modules/KMLFileReadx/KMLFileReadx.cpp\
+				  ./modules/KMLMeshWritex/KMLMeshWritex.h\
+				  ./modules/KMLMeshWritex/KMLMeshWritex.cpp\
+				  ./modules/KMLOverlayx/KMLOverlayx.h\
+				  ./modules/KMLOverlayx/KMLOverlayx.cpp\
+				  ./kml/kmlobjects.h\
+				  ./kml/KML_Attribute.cpp\
+				  ./kml/KML_Attribute.h\
+				  ./kml/KML_Comment.cpp\
+				  ./kml/KML_Comment.h\
+				  ./kml/KML_ColorStyle.cpp\
+				  ./kml/KML_ColorStyle.h\
+				  ./kml/KML_Container.cpp\
+				  ./kml/KML_Container.h\
+				  ./kml/KML_Document.cpp\
+				  ./kml/KML_Document.h\
+				  ./kml/KML_Feature.cpp\
+				  ./kml/KML_Feature.h\
+				  ./kml/KML_File.cpp\
+				  ./kml/KML_File.h\
+				  ./kml/KML_Folder.cpp\
+				  ./kml/KML_Folder.h\
+				  ./kml/KML_Geometry.cpp\
+				  ./kml/KML_Geometry.h\
+				  ./kml/KML_GroundOverlay.cpp\
+				  ./kml/KML_GroundOverlay.h\
+				  ./kml/KML_Icon.cpp\
+				  ./kml/KML_Icon.h\
+				  ./kml/KML_LatLonBox.cpp\
+				  ./kml/KML_LatLonBox.h\
+				  ./kml/KML_LinearRing.cpp\
+				  ./kml/KML_LinearRing.h\
+				  ./kml/KML_LineString.cpp\
+				  ./kml/KML_LineString.h\
+				  ./kml/KML_LineStyle.cpp\
+				  ./kml/KML_LineStyle.h\
+				  ./kml/KML_MultiGeometry.cpp\
+				  ./kml/KML_MultiGeometry.h\
+				  ./kml/KML_Object.cpp\
+				  ./kml/KML_Object.h\
+				  ./kml/KML_Overlay.cpp\
+				  ./kml/KML_Overlay.h\
+				  ./kml/KML_Point.cpp\
+				  ./kml/KML_Point.h\
+				  ./kml/KML_Placemark.cpp\
+				  ./kml/KML_Placemark.h\
+				  ./kml/KML_Polygon.cpp\
+				  ./kml/KML_Polygon.h\
+				  ./kml/KML_PolyStyle.cpp\
+				  ./kml/KML_PolyStyle.h\
+				  ./kml/KML_Style.cpp\
+				  ./kml/KML_Style.h\
+				  ./kml/KML_StyleSelector.cpp\
+				  ./kml/KML_StyleSelector.h\
+				  ./kml/KML_SubStyle.cpp\
+				  ./kml/KML_SubStyle.h\
+				  ./kml/KML_Unknown.cpp\
+				  ./kml/KML_Unknown.h\
+				  ./kml/KMLFileReadUtils.cpp\
+				  ./kml/KMLFileReadUtils.h
 #}}}
 #Modules sources{{{
@@ -847,108 +825,4 @@
 endif
 #}}}
-
-#{{{ Conditional build-up of sources
-#ISSM sources are a combination of core sources and sources related to specific capabilities (which can 
-#be activated by autotools conditionals 
-
-#First the core
-issm_sources  =  $(core_sources)
-
-#Now the optional source
-if DAKOTA
-issm_sources  +=  $(dakota_sources)
-endif
-
-if PETSC
-issm_sources  +=  $(petsc_sources)
-endif
-
-if MUMPS
-issm_sources  +=  $(mumps_sources)
-endif
-
-if GSL
-issm_sources  +=  $(gsl_sources)
-endif
-
-if TRANSIENT
-issm_sources  +=  $(transient_sources)
-endif
-
-if STEADYSTATE
-issm_sources  +=  $(steadystate_sources)
-endif
-
-if MASSTRANSPORT
-issm_sources  +=  $(masstransport_sources)
-endif
-
-if THERMAL
-issm_sources  +=  $(thermal_sources)
-endif
-
-if GIA
-issm_sources  +=  $(gia_sources)
-endif
-
-if CONTROL
-issm_sources  +=  $(control_sources)
-endif
-
-if HYDROLOGY
-issm_sources  +=  $(hydrology_sources)
-endif
-
-if STRESSBALANCE
-issm_sources  +=  $(stressbalance_sources)
-endif
-
-if BALANCED
-issm_sources  +=  $(balanced_sources)
-endif
-
-if SLOPE
-issm_sources  +=  $(slope_sources)
-endif
-
-if MESHDEFORMATION
-issm_sources  +=  $(meshdeformation_sources)
-endif
-
-if GROUNDINGLINE
-issm_sources +=  $(groundingline_sources)
-endif
-
-if RIFTS
-issm_sources +=  $(rifts_sources)
-endif
-
-if RESPONSES
-issm_sources +=  $(responses_sources)
-endif
-
-if ANDROID
-issm_sources +=  $(android_sources)
-endif
-
-if THREED
-issm_sources +=  $(threed_sources)
-endif
-
-if MPI
-issm_sources +=  $(mpi_sources)
-endif
-
-if METIS
-issm_sources +=  $(metis_sources)
-endif
-
-if KRIGING
-issm_sources +=  $(pkriging_sources)
-endif
-
-if DAMAGE
-issm_sources +=  $(damage_sources)
-endif
 #}}}
 #Library flags and sources {{{
@@ -971,7 +845,4 @@
 libISSMModules_a_SOURCES = $(modules_sources)
 libISSMModules_a_SOURCES += $(bamg_sources)
-if KRIGING
-libISSMModules_a_SOURCES += $(kriging_sources)
-endif
 if KML
 libISSMModules_a_SOURCES += $(kml_sources)
@@ -1026,5 +897,5 @@
 endif
 #}}}
-#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
+#Automatic differentiation (must be done at the end) {{{
 if ADIC2 
 lib_LIBRARIES += libAD.a libISSMRose.a
@@ -1034,5 +905,4 @@
 libAD_a_SOURCES = 
 libAD_a_CFLAGS = -fPIC -D_C_ $(COPTFLAGS)
-
 
 #test rose preprocessing 
@@ -1042,11 +912,7 @@
 libISSMRose_a_CXXFLAGS= -fPIC -D_C_ $(CXXOPTFLAGS)
 
-
-
 #Automatic differentiation rules: 
 %.ad.c: %.c
 	adic2 -mforward  $< --nary
-
-
 
 #Executable
Index: /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 17236)
@@ -14,28 +14,76 @@
 
 	switch(analysis_enum){
+		#ifdef _HAVE_ADJOINTBALANCETHICKNESS_
 		case AdjointBalancethicknessAnalysisEnum : return new AdjointBalancethicknessAnalysis();
+		#endif
+		#ifdef _HAVE_ADJOINTHORIZ_
 		case AdjointHorizAnalysisEnum : return new AdjointHorizAnalysis();
+		#endif
+		#ifdef _HAVE_BALANCETHICKNESS_
 		case BalancethicknessAnalysisEnum : return new BalancethicknessAnalysis();
+		#endif
+		#ifdef _HAVE_BALANCETHICKNESSSOFT_
 		case BalancethicknessSoftAnalysisEnum : return new BalancethicknessSoftAnalysis();
+		#endif
+		#ifdef _HAVE_BALANCEVELOCITY_
 		case BalancevelocityAnalysisEnum : return new BalancevelocityAnalysis();
+		#endif
+		#ifdef _HAVE_L2PROJECTIONEPL_
+		case L2ProjectionEPLAnalysisEnum : return new L2ProjectionEPLAnalysis();
+		#endif
+		#ifdef _HAVE_L2PROJECTIONBASE_
 		case L2ProjectionBaseAnalysisEnum : return new L2ProjectionBaseAnalysis();
-		case L2ProjectionEPLAnalysisEnum : return new L2ProjectionEPLAnalysis();
+		#endif
+		#ifdef _HAVE_DAMAGEEVOLUTION_
 		case DamageEvolutionAnalysisEnum : return new DamageEvolutionAnalysis();
+		#endif
+		#ifdef _HAVE_STRESSBALANCE_
 		case StressbalanceAnalysisEnum : return new StressbalanceAnalysis();
+		#endif
+		#ifdef _HAVE_STRESSBALANCESIA_
 		case StressbalanceSIAAnalysisEnum : return new StressbalanceSIAAnalysis();
+		#endif
+		#ifdef _HAVE_STRESSBALANCEVERTICAL_
 		case StressbalanceVerticalAnalysisEnum : return new StressbalanceVerticalAnalysis();
+		#endif
+		#ifdef _HAVE_ENTHALPY_
 		case EnthalpyAnalysisEnum : return new EnthalpyAnalysis();
+		#endif
+		#ifdef _HAVE_HYDROLOGYSHREVE_
 		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
+		#endif
+		#ifdef _HAVE_HYDROLOGYDCINEFFICIENT_
 		case HydrologyDCInefficientAnalysisEnum : return new HydrologyDCInefficientAnalysis();
+		#endif
+		#ifdef _HAVE_HYDROLOGYDCEFFICIENT_
 		case HydrologyDCEfficientAnalysisEnum : return new HydrologyDCEfficientAnalysis();
+		#endif
+		#ifdef _HAVE_MELTING_
 		case MeltingAnalysisEnum : return new MeltingAnalysis();
+		#endif
+		#ifdef _HAVE_MASSTRANSPORT_
 		case MasstransportAnalysisEnum : return new MasstransportAnalysis();
+		#endif
+		#ifdef _HAVE_FREESURFACEBASE_
 		case FreeSurfaceBaseAnalysisEnum : return new FreeSurfaceBaseAnalysis();
+		#endif
+		#ifdef _HAVE_FREESURFACETOP_
 		case FreeSurfaceTopAnalysisEnum : return new FreeSurfaceTopAnalysis();
+		#endif
+		#ifdef _HAVE_EXTRUDEFROMBASE_
 		case ExtrudeFromBaseAnalysisEnum : return new ExtrudeFromBaseAnalysis();
+		#endif
+		#ifdef _HAVE_EXTRUDEFROMTOP_
 		case ExtrudeFromTopAnalysisEnum : return new ExtrudeFromTopAnalysis();
+		#endif
+		#ifdef _HAVE_SMOOTHEDSURFACESLOPEX_
+		case SmoothedSurfaceSlopeXAnalysisEnum : return new SmoothedSurfaceSlopeXAnalysis();
+		#endif
+		#ifdef _HAVE_SMOOTHEDSURFACESLOPEY_
+		case SmoothedSurfaceSlopeYAnalysisEnum : return new SmoothedSurfaceSlopeYAnalysis();
+		#endif
+		#ifdef _HAVE_THERMAL_
 		case ThermalAnalysisEnum : return new ThermalAnalysis();
-		case LevelsetAnalysisEnum : return new LevelsetAnalysis();
-		case ExtrapolationAnalysisEnum : return new ExtrapolationAnalysis();
+		#endif
 		#ifdef _HAVE_GIA_
 		case GiaAnalysisEnum : return new GiaAnalysis();
@@ -44,6 +92,10 @@
 		case MeshdeformationAnalysisEnum : return new MeshdeformationAnalysis();
 		#endif
-		case SmoothedSurfaceSlopeXAnalysisEnum: return new SmoothedSurfaceSlopeXAnalysis();
-		case SmoothedSurfaceSlopeYAnalysisEnum: return new SmoothedSurfaceSlopeYAnalysis();
+		#ifdef _HAVE_LEVELSET_
+		case LevelsetAnalysisEnum : return new LevelsetAnalysis();
+		#endif
+		#ifdef _HAVE_EXTRAPOLATION_
+		case ExtrapolationAnalysisEnum : return new ExtrapolationAnalysis();
+		#endif
 		default : _error_("enum provided not supported ("<<EnumToStringx(analysis_enum)<<")");
 	}
Index: /issm/trunk-jpl/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Element.h	(revision 17236)
@@ -224,5 +224,4 @@
 		virtual void   GetNormalFromLSF(IssmDouble *pnormal)=0;
 
-		#ifdef _HAVE_RESPONSES_
 		virtual void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
 		virtual void   MinVel(IssmDouble* pminvel)=0;
@@ -247,5 +246,4 @@
 		virtual int    VertexConnectivity(int vertexindex)=0;
 		virtual void   VerticalSegmentIndices(int** pindices,int* pnumseg)=0;
-		#endif
 
 		#ifdef _HAVE_GIA_
@@ -253,5 +251,4 @@
 		#endif
 
-		#ifdef _HAVE_CONTROL_
 		virtual void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
 		virtual IssmDouble ThicknessAbsMisfit(void)=0;
@@ -274,10 +271,8 @@
 		virtual void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
 		virtual void   InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
-		#endif
 
 		virtual void UpdateConstraintsExtrudeFromBase(void)=0;
 		virtual void UpdateConstraintsExtrudeFromTop(void)=0;
 
-		#ifdef _HAVE_HYDROLOGY_
 		virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index)=0;
 		virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode)=0;
@@ -286,11 +281,8 @@
 		virtual void HydrologyEPLGetActive(Vector<IssmDouble>* active)=0;
 		virtual void ComputeEPLThickness(void)=0;
-		#endif
-
-		#ifdef _HAVE_GROUNDINGLINE_
+
 		virtual void   MigrateGroundingLine(IssmDouble* sheet_ungrounding)=0;
 		virtual void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
 		virtual int    UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
-		#endif
 
 };
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 17236)
@@ -1739,5 +1739,4 @@
 
 	/*Control Inputs*/
-	#ifdef _HAVE_CONTROL_
 	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
 		for(i=0;i<num_control_type;i++){
@@ -1783,5 +1782,4 @@
 		}
 	}
-	#endif
 
 	/*Need to know the type of approximation for this element*/
@@ -3177,5 +3175,4 @@
 /*}}}*/
 
-#ifdef _HAVE_RESPONSES_
 /*FUNCTION Penta::AverageOntoPartition {{{*/
 void  Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
@@ -3456,5 +3453,4 @@
 }
 /*}}}*/
-#endif
 
 #ifdef _HAVE_GIA_
@@ -3466,5 +3462,4 @@
 #endif
 
-#ifdef _HAVE_CONTROL_
 /*FUNCTION Penta::ControlInputGetGradient{{{*/
 void Penta::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){
@@ -4263,5 +4258,4 @@
 }
 /*}}}*/
-#endif
 
 #ifdef _HAVE_DAKOTA_
@@ -4408,5 +4402,4 @@
 #endif
 
-#ifdef _HAVE_HYDROLOGY_
 /*FUNCTION Penta::CreateEPLDomainMassMatrix {{{*/
 ElementMatrix* Penta::CreateEPLDomainMassMatrix(void){
@@ -4572,7 +4565,5 @@
 }
 /*}}}*/
-#endif
-
-#ifdef _HAVE_GROUNDINGLINE_
+
 /*FUNCTION Penta::MigrateGroundingLine{{{*/
 void  Penta::MigrateGroundingLine(IssmDouble* phi_ungrounding){
@@ -4728,3 +4719,2 @@
 }
 /*}}}*/
-#endif
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 17236)
@@ -134,5 +134,4 @@
 		void   ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
 
-		 #ifdef _HAVE_RESPONSES_
 		void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
 		IssmDouble IceVolume(void);
@@ -153,5 +152,4 @@
 		void   MaxVy(IssmDouble* pmaxvy);
 		void   MaxVz(IssmDouble* pmaxvz);
-		#endif
 
 		#ifdef _HAVE_GIA_
@@ -159,5 +157,4 @@
 		#endif
 
-		#ifdef _HAVE_CONTROL_
 		IssmDouble DragCoefficientAbsGradient(void);
 		void   GradientIndexing(int* indexing,int control_index);
@@ -189,12 +186,8 @@
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
 		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
-		#endif
-
-		#ifdef _HAVE_GROUNDINGLINE_
+
 		void   MigrateGroundingLine(IssmDouble* sheet_ungrounding);
 		void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
 		int    UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
-		#endif
-
 		/*}}}*/
 		/*Penta specific routines:{{{*/
@@ -262,5 +255,4 @@
 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
 
-		#ifdef _HAVE_HYDROLOGY_
 		ElementMatrix* CreateEPLDomainMassMatrix(void);
 		void           GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode);
@@ -270,5 +262,4 @@
 		void           HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask);
 		void           ComputeEPLThickness(void);
-		#endif
 
 		void           UpdateConstraintsExtrudeFromBase(void);
Index: /issm/trunk-jpl/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Seg.h	(revision 17236)
@@ -163,5 +163,4 @@
 		void        GetNormalFromLSF(IssmDouble *pnormal){_error_("not implemented yet");};
 
-		#ifdef _HAVE_HYDROLOGY_
 		void    GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode){_error_("not implemented yet");};
 		void    GetHydrologyDCInefficientHmax(IssmDouble* ph_max,int index){_error_("not implemented yet");};
@@ -170,5 +169,4 @@
 		void    HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask){_error_("not implemented yet");};
 		void    ComputeEPLThickness(void){_error_("not implemented yet");};
-		#endif
 		void        GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type){_error_("not implemented yet");};
 		void        GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum){_error_("not implemented yet");};
@@ -190,5 +188,4 @@
 		void UpdateConstraintsExtrudeFromTop(){_error_("not implemented");};
 
-#ifdef _HAVE_RESPONSES_
 		void       AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){_error_("not implemented yet");};
 		IssmDouble IceVolume(void){_error_("not implemented yet");};
@@ -211,5 +208,4 @@
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
 		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
-#endif
 
 #ifdef _HAVE_GIA_
@@ -217,5 +213,4 @@
 #endif
 
-#ifdef _HAVE_CONTROL_
 		IssmDouble DragCoefficientAbsGradient(void){_error_("not implemented yet");};
 		void       GradientIndexing(int* indexing,int control_index){_error_("not implemented yet");};
@@ -250,11 +245,8 @@
 		IssmDouble SurfaceAverageVelMisfit(void){_error_("not implemented yet");};
 		void       InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};
-#endif
-
-#ifdef _HAVE_GROUNDINGLINE_
+
 		void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");};
 		void   MigrateGroundingLine(IssmDouble* sheet_ungrounding){_error_("not implemented yet");};
 		int    UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){_error_("not implemented yet");};
-#endif
 		/*}}}*/
 };
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 17236)
@@ -925,6 +925,6 @@
 
 	/* Intermediaries */
-	const int dim=2;
-	int i,counter;
+	int         i;
+	const int   dim=2;
 	IssmDouble* xyz_list = NULL;
 	IssmDouble  dlevelset[dim], norm_dlevelset;
@@ -935,5 +935,5 @@
 	this->GetVerticesCoordinates(&xyz_list);
 	
-	counter=0;
+	IssmDouble counter=0.;
 	Gauss* gauss = this->NewGauss(2);
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
@@ -946,6 +946,6 @@
 		counter++;
 	}
-	_assert_(counter>0);
-	for(i=0;i<dim;i++) normal[i]/counter;
+	_assert_(counter>0.);
+	for(i=0;i<dim;i++) normal[i] = normal[i]/counter;
 	
 	pnormal=&normal[0];
@@ -1356,5 +1356,4 @@
 
 	/*Control Inputs*/
-	#ifdef _HAVE_CONTROL_
 	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
 		for(i=0;i<num_control_type;i++){
@@ -1408,5 +1407,4 @@
 		}
 	}
-	#endif
 
 	/*DatasetInputs*/
@@ -2384,10 +2382,6 @@
 
 	/*Get for Vx and Vy, the max of abs value: */
-	#ifdef _HAVE_RESPONSES_
 	this->MaxAbsVx(&maxabsvx);
 	this->MaxAbsVy(&maxabsvy);
-	#else
-		_error_("ISSM was not compiled with responses compiled in, exiting!");
-	#endif
 
 	/* Get node coordinates and dof list: */
@@ -2595,5 +2589,4 @@
 /*}}}*/
 
-#ifdef _HAVE_RESPONSES_
 /*FUNCTION Tria::AverageOntoPartition {{{*/
 void  Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
@@ -3072,5 +3065,4 @@
 }
 /*}}}*/
-#endif
 
 #ifdef _HAVE_GIA_
@@ -3203,5 +3195,4 @@
 #endif
 
-#ifdef _HAVE_CONTROL_
 /*FUNCTION Tria::BalancethicknessMisfit{{{*/
 IssmDouble Tria::BalancethicknessMisfit(void){
@@ -4600,7 +4591,5 @@
 }
 /*}}}*/
-#endif
-
-#ifdef _HAVE_HYDROLOGY_
+
 /*FUNCTION Tria::CreateHydrologyWaterVelocityInput {{{*/
 void Tria::CreateHydrologyWaterVelocityInput(void){
@@ -5050,5 +5039,4 @@
 }
 /*}}}*/
-#endif
 
 #ifdef _HAVE_DAKOTA_
@@ -5183,5 +5171,4 @@
 #endif
 
-#ifdef _HAVE_GROUNDINGLINE_
 /*FUNCTION Tria::MigrateGroundingLine{{{*/
 void  Tria::MigrateGroundingLine(IssmDouble* phi_ungrounding){
@@ -5332,3 +5319,2 @@
 }
 /*}}}*/
-#endif
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 17236)
@@ -135,5 +135,4 @@
 		bool        IsZeroLevelset(int levelset_enum);
 
-		#ifdef _HAVE_RESPONSES_
 		void       AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
 		IssmDouble IceVolume(void);
@@ -156,5 +155,4 @@
 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
 		IssmDouble MisfitArea(int weightsenum);
-		#endif
 
 		#ifdef _HAVE_GIA_
@@ -162,5 +160,4 @@
 		#endif
 
-		#ifdef _HAVE_CONTROL_
 		IssmDouble DragCoefficientAbsGradient(void);
 		void       GradientIndexing(int* indexing,int control_index);
@@ -195,11 +192,8 @@
 		IssmDouble SurfaceAverageVelMisfit(void);
 		void       InputControlUpdate(IssmDouble scalar,bool save_parameter);
-		#endif
-
-		#ifdef _HAVE_GROUNDINGLINE_
+
 		void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
 		void   MigrateGroundingLine(IssmDouble* sheet_ungrounding);
 		int    UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
-		#endif
 
 		/*}}}*/
@@ -272,5 +266,4 @@
 		void UpdateConstraintsExtrudeFromTop(void);
 
-		#ifdef _HAVE_HYDROLOGY_
 		ElementMatrix* CreateEPLDomainMassMatrix(void);
 		void           CreateHydrologyWaterVelocityInput(void);
@@ -281,5 +274,4 @@
 		void           HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask);
 		void           ComputeEPLThickness(void);
-		#endif
 		/*}}}*/
 
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 17236)
@@ -428,5 +428,4 @@
 	switch (response_descriptor_enum){
 
-		#ifdef _HAVE_RESPONSES_
 		case IceVolumeEnum:                this->IceVolumex(responses); break;
 		case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(responses); break;
@@ -443,5 +442,4 @@
 		case MaxAbsVzEnum:                 this->MaxAbsVzx(                responses); break;
 		case MassFluxEnum:                 this->MassFluxx(         responses); break;
-		#ifdef _HAVE_CONTROL_
 		case SurfaceAbsVelMisfitEnum:      SurfaceAbsVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
 		case SurfaceRelVelMisfitEnum:      SurfaceRelVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
@@ -456,13 +454,8 @@
 		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
 		case BalancethicknessMisfitEnum:   BalancethicknessMisfitx(responses); break;
-		#endif
 		case TotalSmbEnum:					  this->TotalSmbx(responses); break;
 		case MaterialsRheologyBbarEnum:    this->ElementResponsex(responses,MaterialsRheologyBbarEnum); break;
 		case VelEnum:                      this->ElementResponsex(responses,VelEnum); break;
 		case FrictionCoefficientEnum:      NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters); break;
-		default: _error_("response descriptor \"" << EnumToStringx(response_descriptor_enum) << "\" not supported yet!"); break;
-		#else
-		default: _error_("ISSM was not compiled with responses capabilities, exiting!");
-		#endif
 	}
 
@@ -505,5 +498,4 @@
 			switch(output_enum){
 
-				#ifdef _HAVE_RESPONSES_
 				/*Scalar output*/
 				case IceVolumeEnum:                this->IceVolumex(&double_result);                break;
@@ -524,5 +516,4 @@
 
 			   /*Scalar control output*/
-				#ifdef _HAVE_CONTROL_
 				case SurfaceAbsVelMisfitEnum:       SurfaceAbsVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
 				case SurfaceRelVelMisfitEnum:       SurfaceRelVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
@@ -537,5 +528,4 @@
 				case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters); break;
 				case BalancethicknessMisfitEnum:    BalancethicknessMisfitx(&double_result);                                                        break;
-				#endif
 
 			   /*Vector */
@@ -594,8 +584,4 @@
 					isvec = true;
 					break;
-
-				#else
-				default: _error_("ISSM was not compiled with responses capabilities, exiting!");
-				#endif
 			}
 		}
@@ -713,5 +699,4 @@
 }
 /*}}}*/
-#ifdef _HAVE_RESPONSES_
 void FemModel::MassFluxx(IssmDouble* pmass_flux){/*{{{*/
 
@@ -1124,6 +1109,4 @@
 
 }/*}}}*/
-#endif
-#ifdef _HAVE_CONTROL_
 void FemModel::BalancethicknessMisfitx(IssmDouble* presponse){/*{{{*/
 
@@ -1248,5 +1231,4 @@
 }
 /*}}}*/
-#endif
 #ifdef  _HAVE_DAKOTA_
 void FemModel::DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses){/*{{{*/
@@ -1361,5 +1343,4 @@
 /*}}}*/
 #endif
-#ifdef _HAVE_HYDROLOGY_
 void FemModel::HydrologyEPLupdateDomainx(void){ /*{{{*/
 
@@ -1443,5 +1424,4 @@
 }
 /*}}}*/
-
 void FemModel::HydrologyEPLThicknessx(void){ /*{{{*/
 
@@ -1452,5 +1432,4 @@
 }
 /*}}}*/
-
 void FemModel::UpdateConstraintsL2ProjectionEPLx(void){ /*{{{*/
 
@@ -1495,3 +1474,2 @@
 }
 /*}}}*/
-#endif
Index: /issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 17236)
@@ -59,5 +59,4 @@
 
 		/*Modules*/ 
-		#ifdef _HAVE_RESPONSES_
 		void MassFluxx(IssmDouble* presponse);
 		void MaxAbsVxx(IssmDouble* presponse);
@@ -77,5 +76,4 @@
 		void ElementResponsex(IssmDouble* presponse,int response_enum);
 		void BalancethicknessMisfitx(IssmDouble* pV);
-		#endif
 		#ifdef  _HAVE_DAKOTA_
 		void DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses);
@@ -86,9 +84,7 @@
 		void Responsex(IssmDouble* presponse,int response_descriptor_enum);
 		void Responsex(IssmDouble* presponse,const char* response_descriptor);
-		#ifdef _HAVE_CONTROL_
 		void OutputControlsx(Results **presults);
 		void CostFunctionx( IssmDouble* pJ);
 		void ThicknessAbsGradientx( IssmDouble* pJ);
-		#endif
 		#ifdef _HAVE_GIA_
 		void Deflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
@@ -99,10 +95,8 @@
 		void UpdateConstraintsExtrudeFromBasex();
 		void UpdateConstraintsExtrudeFromTopx();
-		#ifdef _HAVE_HYDROLOGY_
 		void HydrologyTransferx(void);
 		void HydrologyEPLupdateDomainx(void);
 		void HydrologyEPLThicknessx(void);
 		void UpdateConstraintsL2ProjectionEPLx(void);
-		#endif
 };
 
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 17236)
@@ -230,5 +230,4 @@
 
 	switch(analysis_type){
-		#ifdef _HAVE_THERMAL_
 		case ThermalAnalysisEnum:
 			Ke=PenaltyCreateKMatrixThermal(kmax);
@@ -237,15 +236,10 @@
 			Ke=PenaltyCreateKMatrixMelting(kmax);
 			break;
-		#endif
-		#ifdef _HAVE_HYDROLOGY_
 		case HydrologyDCInefficientAnalysisEnum:
 			Ke=PenaltyCreateKMatrixHydrologyDCInefficient(kmax);
 			break;
-		#endif
-		#ifdef _HAVE_DAMAGE_
 		case DamageEvolutionAnalysisEnum:
 			Ke=PenaltyCreateKMatrixDamageEvolution(kmax);
 			break;
-		#endif
 		default:
 			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
@@ -268,5 +262,4 @@
 
 	switch(analysis_type){
-		#ifdef _HAVE_THERMAL_
 		case ThermalAnalysisEnum:
 			pe=PenaltyCreatePVectorThermal(kmax);
@@ -277,16 +270,10 @@
 		case StressbalanceAnalysisEnum: case AdjointHorizAnalysisEnum:
 			break;
-		#endif
-		#ifdef _HAVE_HYDROLOGY_
 		case HydrologyDCInefficientAnalysisEnum:
 			pe=PenaltyCreatePVectorHydrologyDCInefficient(kmax);
 			break;
-		#endif
-		#ifdef _HAVE_DAMAGE_
 		case DamageEvolutionAnalysisEnum:
 			pe=PenaltyCreatePVectorDamageEvolution(kmax);
 			break;
-		#endif
-
 		default:
 			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
@@ -421,5 +408,4 @@
 		return;
 	}
-	#ifdef _HAVE_THERMAL_
 	else if (analysis_type==ThermalAnalysisEnum){
 		ConstraintActivateThermal(punstable);
@@ -429,17 +415,12 @@
 		return;
 	}
-	#endif
-	#ifdef _HAVE_HYDROLOGY_
 	else if (analysis_type==HydrologyDCInefficientAnalysisEnum){
 		ConstraintActivateHydrologyDCInefficient(punstable);
 		return;
 	}
-	#endif
-	#ifdef _HAVE_DAMAGE_
 	else if (analysis_type==DamageEvolutionAnalysisEnum){
 		ConstraintActivateDamageEvolution(punstable);
 		return;
 	}
-	#endif
 
 	else{
@@ -449,5 +430,4 @@
 }
 /*}}}*/
-#ifdef _HAVE_THERMAL_
 /*FUNCTION Pengrid::ConstraintActivateThermal {{{*/
 void  Pengrid::ConstraintActivateThermal(int* punstable){
@@ -629,6 +609,4 @@
 }
 /*}}}*/
-#endif
-#ifdef _HAVE_HYDROLOGY_
 /*FUNCTION Pengrid::ConstraintActivateHydrologyDCInefficient{{{*/
 void  Pengrid::ConstraintActivateHydrologyDCInefficient(int* punstable){
@@ -728,6 +706,4 @@
 }
 /*}}}*/
-#endif
-#ifdef _HAVE_DAMAGE_
 /*FUNCTION Pengrid::ConstraintActivateDamageEvolution {{{*/
 void  Pengrid::ConstraintActivateDamageEvolution(int* punstable){
@@ -828,6 +804,4 @@
 }
 /*}}}*/
-#endif
-
 /*FUNCTION Pengrid::ResetConstraint {{{*/
 void  Pengrid::ResetConstraint(void){
Index: /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 17236)
@@ -83,5 +83,4 @@
 		/*}}}*/
 		/*Pengrid management {{{*/
-		#ifdef _HAVE_THERMAL_
 		ElementMatrix* PenaltyCreateKMatrixThermal(IssmDouble kmax);
 		ElementMatrix* PenaltyCreateKMatrixMelting(IssmDouble kmax);
@@ -89,16 +88,10 @@
 		ElementVector* PenaltyCreatePVectorMelting(IssmDouble kmax);
 		void           ConstraintActivateThermal(int* punstable);
-		#endif
-		#ifdef _HAVE_DAMAGE_
 		ElementMatrix* PenaltyCreateKMatrixDamageEvolution(IssmDouble kmax);
 		ElementVector* PenaltyCreatePVectorDamageEvolution(IssmDouble kmax);
 		void           ConstraintActivateDamageEvolution(int* punstable);
-		#endif
-
-		#ifdef _HAVE_HYDROLOGY_
 		ElementMatrix* PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax);
 		ElementVector* PenaltyCreatePVectorHydrologyDCInefficient(IssmDouble kmax);
 		void           ConstraintActivateHydrologyDCInefficient(int* punstable);
-		#endif
 		void  ConstraintActivate(int* punstable);
 		void  ResetConstraint(void);
Index: /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 17236)
@@ -763,5 +763,4 @@
 					return;
 				}
-				#ifdef _HAVE_3D_
 				case PentaEnum: {
 					IssmDouble valuesp[6];
@@ -770,5 +769,4 @@
 					return;
 				}
-			  	#endif
 				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
 			}
@@ -819,5 +817,4 @@
 					return;
 				}
-				#ifdef _HAVE_3D_
 				case PentaEnum:{
 					IssmDouble valuesp[6];
@@ -826,5 +823,4 @@
 					return;
 				}
-				# endif
 				default: _error_("element " << EnumToStringx(element->ObjectEnum()) << " not implemented yet");
 			}
@@ -892,5 +888,4 @@
 
 		/*Control Inputs*/
-		#ifdef _HAVE_CONTROL_
 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
 			for(i=0;i<num_control_type;i++){
@@ -917,5 +912,4 @@
 			}
 		}
-		#endif
 	}
 	else if(iomodel->meshtype==Mesh2DverticalEnum){
@@ -945,5 +939,4 @@
 		}
 	}
-	#ifdef _HAVE_3D_
 	else if(iomodel->meshtype==Mesh3DEnum){
 
@@ -973,5 +966,4 @@
 		
 		/*Control Inputs*/
-		#ifdef _HAVE_CONTROL_
 		if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
 			for(i=0;i<num_control_type;i++){
@@ -999,7 +991,5 @@
 			}
 		}
-		#endif
-	}
-	#endif
+	}
 	else{
 		_error_("Mesh type not supported yet!");
Index: /issm/trunk-jpl/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Node.cpp	(revision 17236)
@@ -54,5 +54,4 @@
 
 	/*Stressbalance Horiz*/
-	#ifdef _HAVE_STRESSBALANCE_
 	if(analysis_enum==StressbalanceAnalysisEnum){
 
@@ -88,5 +87,4 @@
 		}
 	}
-	#endif
 
 	/*2d solutions in 3d, we need to constrain all the nodes that are not on base*/
@@ -110,6 +108,5 @@
 	}
 	if(
-				analysis_enum==FreeSurfaceTopAnalysisEnum ||
-				analysis_enum==L2ProjectionTopAnalysisEnum
+				analysis_enum==FreeSurfaceTopAnalysisEnum
 				){
 		if(iomodel->meshtype==Mesh3DEnum || iomodel->meshtype==Mesh2DverticalEnum){
@@ -363,5 +360,4 @@
 }
 /*}}}*/
-#ifdef _HAVE_STRESSBALANCE_
 /*FUNCTION Node::GetCoordinateSystem{{{*/
 void Node::GetCoordinateSystem(IssmDouble* coord_system_out){
@@ -372,5 +368,4 @@
 }
 /*}}}*/
-#endif
 /*FUNCTION Node::InAnalysis{{{*/
 bool Node::InAnalysis(int in_analysis_enum){
@@ -901,5 +896,4 @@
 }
 /*}}}*/
-#ifdef _HAVE_STRESSBALANCE_
 void TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum){/*{{{*/
 
@@ -1173,3 +1167,2 @@
 }
 /*}}}*/
-#endif
Index: /issm/trunk-jpl/src/c/classes/Node.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Node.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/classes/Node.h	(revision 17236)
@@ -56,7 +56,5 @@
 		int   Sid(void); 
 		int   Lid(void); 
-#ifdef _HAVE_STRESSBALANCE_
 		void  GetCoordinateSystem(IssmDouble* coord_system_out);
-#endif
 		bool  InAnalysis(int analysis_enum);
 		int   GetApproximation();
@@ -91,5 +89,4 @@
 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation);
 int  GetNumberOfDofs(Node** nodes,int numnodes,int setenum,int approximation);
-#ifdef _HAVE_STRESSBALANCE_
 void TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum);
 void TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int* cs_array);
@@ -101,5 +98,4 @@
 void TransformStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int* cs_array);
 void CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
-#endif
 
 #endif  /* _NODE_H_ */
Index: /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 17236)
@@ -24,96 +24,46 @@
 
 		case StressbalanceSolutionEnum:
-			#ifdef _HAVE_STRESSBALANCE_
 			solutioncore=&stressbalance_core;
-			#else
-			_error_("ISSM was not compiled with stressbalance capabilities. Exiting");
-			#endif
 			break;
 		case SteadystateSolutionEnum:
-			#ifdef _HAVE_STEADYSTATE_
 			solutioncore=&steadystate_core;
-			#else
-			_error_("ISSM was not compiled with steady state capabilities. Exiting");
-			#endif
 			break;
 		case ThermalSolutionEnum:
-			#ifdef _HAVE_THERMAL_
 			solutioncore=&thermal_core;
-			#else
-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
-			#endif
 			break;
 		case BalancethicknessSolutionEnum:
-			#ifdef _HAVE_BALANCED_
 			solutioncore=&balancethickness_core;
-			#else
-			_error_("ISSM was not compiled with balanced capabilities. Exiting");
-			#endif
 			break;
 		case BalancethicknessSoftSolutionEnum:
-			#ifdef _HAVE_BALANCED_
 			solutioncore=&dummy_core;
-			#else
-			_error_("ISSM was not compiled with balanced capabilities. Exiting");
-			#endif
 			break;
 		case BalancevelocitySolutionEnum:
-			#ifdef _HAVE_BALANCED_
 			solutioncore=&balancevelocity_core;
-			#else
-			_error_("ISSM was not compiled with balanced capabilities. Exiting");
-			#endif
 			break;
 		case HydrologySolutionEnum:
-			#ifdef _HAVE_HYDROLOGY_
 			solutioncore=&hydrology_core;
-			#else
-			_error_("ISSM was not compiled with hydrology capabilities. Exiting");
-			#endif
 			break;
 		case SurfaceSlopeSolutionEnum:
-			#ifdef _HAVE_SLOPE_
 			solutioncore=&surfaceslope_core;
-			#else
-			_error_("ISSM was not compiled with slope capabilities. Exiting");
-			#endif
 			break;
 		case BedSlopeSolutionEnum:
-			#ifdef _HAVE_SLOPE_
 			solutioncore=&bedslope_core;
-			#else
-			_error_("ISSM was not compiled with slope capabilities. Exiting");
-			#endif
 			break;
 		case TransientSolutionEnum:
-			#ifdef _HAVE_TRANSIENT_
 			solutioncore=&transient_core;
-			#else
-			_error_("ISSM was not compiled with transient capabilities. Exiting");
-			#endif
 			break;
 		case MasstransportSolutionEnum:
-			#ifdef _HAVE_MASSTRANSPORT_
 			solutioncore=&masstransport_core;
-			#else
-			_error_("ISSM was not compiled with masstransport capabilities. Exiting");
-			#endif
 			break;
-
 		case GiaSolutionEnum:
-			#ifdef _HAVE_GIA_
+			#if _HAVE_GIA_
 			solutioncore=&gia_core;
 			#else
-			_error_("ISSM was not compiled with gia capabilities. Exiting");
+			_error_("ISSM not compiled with Gia capability");
 			#endif
 			break;
 		case DamageEvolutionSolutionEnum:
-			#ifdef _HAVE_DAMAGE_
 			solutioncore=&damage_core;
-			#else
-			_error_("ISSM was not compiled with damage evolution capabilities. Exiting");
-			#endif
 			break;
-
 		default:
 			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
@@ -124,4 +74,3 @@
 	_assert_(psolutioncore);
 	*psolutioncore=solutioncore;
-
 }
Index: /issm/trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp	(revision 17236)
@@ -42,10 +42,6 @@
 	}
 	else if(control_analysis){
-		#ifdef _HAVE_CONTROL_
 		if(tao_analysis) solutioncore=controltao_core;
 		else solutioncore=control_core;
-		#else
-		_error_("ISSM was not compiled with control support, cannot carry out control analysis!");
-		#endif
 	}
 	else CorePointerFromSolutionEnum(&solutioncore,parameters,solutiontype);  /*This means we retrieve a core solution that is not a wrapper*/
Index: /issm/trunk-jpl/src/c/cores/steadystate_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/steadystate_core.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/cores/steadystate_core.cpp	(revision 17236)
@@ -50,11 +50,7 @@
 
 		if(VerboseSolution()) _printf0_("   computing temperature and velocity for step: " << step << "\n");
-		#ifdef _HAVE_THERMAL_
 		thermal_core(femmodel);
 		if(!isenthalpy)femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);/*Could be MeltingAnalysis...*/
 		GetSolutionFromInputsx(&tg,femmodel);
-		#else
-		_error_("ISSM was not compiled with thermal capabilities. Exiting");
-		#endif
 
 		if(VerboseSolution()) _printf0_("   computing new velocity\n");
Index: /issm/trunk-jpl/src/c/cores/transient_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/transient_core.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/cores/transient_core.cpp	(revision 17236)
@@ -115,18 +115,10 @@
 		if(isthermal && meshtype==Mesh3DEnum){
 			if(VerboseSolution()) _printf0_("   computing thermal regime\n");
-			#ifdef _HAVE_THERMAL_
 			thermal_core(femmodel);
-			#else
-			_error_("ISSM was not compiled with thermal capabilities. Exiting");
-			#endif
 		}
 
 		if(isstressbalance){
 			if(VerboseSolution()) _printf0_("   computing new velocity\n");
-			#ifdef _HAVE_STRESSBALANCE_
 			stressbalance_core(femmodel);
-			#else
-			_error_("ISSM was not compiled with stressbalance capabilities. Exiting");
-			#endif
 		}
 
@@ -140,9 +132,5 @@
 		if(isgroundingline){
 			if(VerboseSolution()) _printf0_("   computing new grounding line position\n");
-			#ifdef _HAVE_GROUNDINGLINE_
 			GroundinglineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
-			#else
-			_error_("ISSM was not compiled with grounding line migration capabilities. Exiting");
-			#endif
 			if(save_results){
 				int outputs[3] = {SurfaceEnum,BedEnum,MaskGroundediceLevelsetEnum};
Index: /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp	(revision 17236)
@@ -26,9 +26,7 @@
 
 	/*Rift penalties first*/
-	#ifdef _HAVE_RIFTS_
 	if(RiftIsPresent(femmodel->loads,analysis_type)){
 		RiftConstraintsState(&converged,&num_unstable_constraints,femmodel->loads,min_mechanical_constraints,analysis_type);
 	}
-	#endif
 
 	/*Deal with pengrid*/
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 17236)
@@ -38,5 +38,4 @@
 			}
 			break;
-		#ifdef _HAVE_3D_
 		case Mesh3DEnum:
 			iomodel->FetchData(2,MeshUpperelementsEnum,MeshLowerelementsEnum);
@@ -45,5 +44,4 @@
 			}
 			break;
-		#endif
 		default:
 			_error_("Mesh not supported yet");
@@ -60,9 +58,7 @@
 						materials->InputDuplicate(MaterialsRheologyBbarEnum,QmuMaterialsRheologyBEnum);
 						break;
-				   #ifdef _HAVE_3D_
 					case Mesh3DEnum:
 						materials->InputDuplicate(MaterialsRheologyBEnum,QmuMaterialsRheologyBEnum); 
 						break;
-				   #endif
 					default:
 						_error_("Mesh not supported yet");
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 17236)
@@ -209,7 +209,5 @@
 	
 	/*Before returning, create parameters in case we are running Qmu or control types runs: */
-	#ifdef _HAVE_CONTROL_
 	CreateParametersControl(parameters,iomodel,solution_type);
-	#endif
 
 	#ifdef _HAVE_DAKOTA_
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 17236)
@@ -97,15 +97,11 @@
 
 	/*Solution specific updates*/
-	#ifdef _HAVE_CONTROL_
 	UpdateElementsAndMaterialsControl(elements,materials,iomodel);
-	#endif
 	#ifdef _HAVE_DAKOTA_
 	UpdateElementsAndMaterialsDakota(elements,materials,iomodel);
 	#endif
-	#ifdef _HAVE_TRANSIENT_
 	if(solution_enum==TransientSolutionEnum){
 		UpdateElementsTransient(elements,parameters,iomodel,analysis_enum);
 	}
-	#endif
 
 	/*Output definitions dataset: */
Index: /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 17236)
@@ -24,9 +24,7 @@
 
 	/*Deal with rift first*/
-	#ifdef _HAVE_RIFTS_
 	if(RiftIsPresent(femmodel->loads,analysis_type)){
 		_error_("rift constraints reset not supported yet!");
 	}
-	#endif
 
 	/*Reset pengrid to inactive mode*/
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 17235)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 17236)
@@ -342,5 +342,4 @@
 	ExtrudeFromTopAnalysisEnum,
 	SteadystateSolutionEnum,
-	L2ProjectionTopAnalysisEnum,
 	SurfaceSlopeSolutionEnum,
 	SmoothedSurfaceSlopeXAnalysisEnum,
Index: /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 17236)
@@ -343,5 +343,4 @@
 		case ExtrudeFromTopAnalysisEnum : return "ExtrudeFromTopAnalysis";
 		case SteadystateSolutionEnum : return "SteadystateSolution";
-		case L2ProjectionTopAnalysisEnum : return "L2ProjectionTopAnalysis";
 		case SurfaceSlopeSolutionEnum : return "SurfaceSlopeSolution";
 		case SmoothedSurfaceSlopeXAnalysisEnum : return "SmoothedSurfaceSlopeXAnalysis";
Index: /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 17235)
+++ /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 17236)
@@ -349,5 +349,4 @@
 	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
-	      else if (strcmp(name,"L2ProjectionTopAnalysis")==0) return L2ProjectionTopAnalysisEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
 	      else if (strcmp(name,"SmoothedSurfaceSlopeXAnalysis")==0) return SmoothedSurfaceSlopeXAnalysisEnum;
@@ -383,9 +382,9 @@
 	      else if (strcmp(name,"Results")==0) return ResultsEnum;
 	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
+	      else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
          else stage=4;
    }
    if(stage==4){
-	      if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
-	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+	      if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
 	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
 	      else if (strcmp(name,"Contour")==0) return ContourEnum;
@@ -506,9 +505,9 @@
 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
-	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+	      if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
 	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
 	      else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
@@ -629,9 +628,9 @@
 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
 	      else if (strcmp(name,"Verbose")==0) return VerboseEnum;
+	      else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
          else stage=6;
    }
    if(stage==6){
-	      if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
-	      else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
+	      if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
 	      else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
 	      else if (strcmp(name,"XY")==0) return XYEnum;
Index: /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh
===================================================================
--- /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 17235)
+++ /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 17236)
@@ -104,36 +104,36 @@
 END
 #}}}
-##Build EnumToAnalysis.cpp {{{
-##Header
-#cat <<END > $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
-#/*
-#* \file EnumToAnalysis.cpp
-#* \brief: output class depending on enum
-#*
-#*   WARNING: DO NOT MODIFY THIS FILE
-#*            this file has been automatically generated by Synchronize.sh
-#*            Please read README for more information
-#*/
-#
-##include "./analyses.h"
-##include "../shared/shared.h"
-#
-#Analysis* EnumToAnalysis(int analysis_enum){
-#
-#	switch(analysis_enum){
-#END
-##core
-#cat temp | grep [a-z]Analysis | \
-#	grep -v DefaultAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
-#	awk '{print "\t\t#ifdef _HAVE_"toupper(substr($1,1,length($1)-12))"_\n\t\t" "case " $1" : return new " substr($1,1,length($1)-4) "();\n\t\t#endif"}' \
-#		>> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
-#
-##Footer
-#cat <<END >> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
-#default : _error_("enum provided not supported ("<<EnumToStringx(analysis_enum)<<")");
-#	}
-#}
-#END
-##}}}
+#Build EnumToAnalysis.cpp {{{
+#Header
+cat <<END > $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
+/*
+* \file EnumToAnalysis.cpp
+* \brief: output class depending on enum
+*
+*   WARNING: DO NOT MODIFY THIS FILE
+*            this file has been automatically generated by Synchronize.sh
+*            Please read README for more information
+*/
+
+#include "./analyses.h"
+#include "../shared/shared.h"
+
+Analysis* EnumToAnalysis(int analysis_enum){
+
+	switch(analysis_enum){
+END
+#core
+cat temp | grep [a-zA-Z]Analysis | \
+	grep -v DefaultAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
+	awk '{print "\t\t#ifdef _HAVE_"toupper(substr($1,1,length($1)-12))"_\n\t\t" "case " $1" : return new " substr($1,1,length($1)-4) "();\n\t\t#endif"}' \
+		>> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
+
+#Footer
+cat <<END >> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
+		default : _error_("enum provided not supported ("<<EnumToStringx(analysis_enum)<<")");
+	}
+}
+END
+#}}}
 #Build EnumDefinitions.py{{{
 cat <<END > $ISSM_DIR/src/m/enum/EnumDefinitions.py
