Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 15842)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 15843)
@@ -610,4 +610,8 @@
 	if test "x$HAVE_AMPI" == "xyes"; then
 		AMPIINCL="-I$AMPI_ROOT/include"
+		echo "adolc_root: |$ADOLC_ROOT|"
+		if test "x$ADOLC_ROOT" == "xno"; then
+			AC_MSG_ERROR([cannot run adjoinable mpi without adolc]);
+		fi
 		AMPILIB="-dy -L$AMPI_ROOT/lib -lampiCommon -L$ADOLC_ROOT/lib -ladolc -L$AMPI_ROOT/lib -lampiCommon -lampiBookkeeping -lampiTape"
 		AC_DEFINE([_HAVE_AMPI_],[1],[with adjoinable mpi in ISSM src])
@@ -1865,4 +1869,10 @@
 			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
+			AC_MSG_ERROR([cannot compile kriging.exe under adolc conditions!]);
+		fi
+
 
 		  AC_MSG_RESULT(done)
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15843)
@@ -9746,5 +9746,5 @@
 	/*Viscosity*/
 	viscosity = 1./(2.*A*(tau_par*tau_par + tau_perp*tau_perp));
-	_assert_(!isnan(viscosity));
+	//_assert_(!isnan(viscosity)); this is not defined for adoubles
 	_assert_(viscosity > 0.);
 
Index: /issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp
===================================================================
--- /issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp	(revision 15843)
@@ -556,7 +556,7 @@
 	if (!*pdval)
 		if (maxlen)
-			*pdval=xNew<IssmDouble>(maxlen            );
-		else
-			*pdval=xNew<IssmDouble>((strlen(kstr)+1)/2);
+			*pdval=xNew<IssmPDouble>(maxlen            );
+		else
+			*pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2);
 
 /*  loop through string to get all values  */
@@ -622,7 +622,7 @@
 	if (!*pdval)
 		if (maxlen)
-			*pdval=xNew<IssmDouble>(maxlen*n          );
-		else
-			*pdval=xNew<IssmDouble>((strlen(kstr)+1)/2);
+			*pdval=xNew<IssmPDouble>(maxlen*n          );
+		else
+			*pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2);
 
 /*  loop through string to get all values  */
Index: /issm/trunk-jpl/src/c/kml/KML_LineString.cpp
===================================================================
--- /issm/trunk-jpl/src/c/kml/KML_LineString.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/kml/KML_LineString.cpp	(revision 15843)
@@ -181,6 +181,6 @@
 /*  extract latitude and longitude into vectors  */
 
-	lat=xNew<IssmDouble>(ncoord);
-	lon=xNew<IssmDouble>(ncoord);
+	lat=xNew<IssmPDouble>(ncoord);
+	lon=xNew<IssmPDouble>(ncoord);
 	for (i=0; i<ncoord; i++) {
 		lon[i]=coords[3*i+0];
@@ -190,6 +190,6 @@
 /*  convert latitude and longitude to x and y  */
 
-	x  =xNew<IssmDouble>(ncoord);
-	y  =xNew<IssmDouble>(ncoord);
+	x  =xNew<IssmPDouble>(ncoord);
+	y  =xNew<IssmPDouble>(ncoord);
 	if (sgn) {
 		Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
@@ -222,10 +222,10 @@
 	fprintf(fid,"\n");
 
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(lon);
-	xDelete<IssmDouble>(lat);
-
-	return;
-}
-/*}}}*/
+	xDelete<IssmPDouble>(y);
+	xDelete<IssmPDouble>(x);
+	xDelete<IssmPDouble>(lon);
+	xDelete<IssmPDouble>(lat);
+
+	return;
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/kml/KML_LinearRing.cpp
===================================================================
--- /issm/trunk-jpl/src/c/kml/KML_LinearRing.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/kml/KML_LinearRing.cpp	(revision 15843)
@@ -169,6 +169,6 @@
 /*  extract latitude and longitude into vectors  */
 
-	lat=xNew<IssmDouble>(ncoord);
-	lon=xNew<IssmDouble>(ncoord);
+	lat=xNew<IssmPDouble>(ncoord);
+	lon=xNew<IssmPDouble>(ncoord);
 	for (i=0; i<ncoord; i++) {
 		lon[i]=coords[3*i+0];
@@ -178,6 +178,6 @@
 /*  convert latitude and longitude to x and y  */
 
-	x  =xNew<IssmDouble>(ncoord);
-	y  =xNew<IssmDouble>(ncoord);
+	x  =xNew<IssmPDouble>(ncoord);
+	y  =xNew<IssmPDouble>(ncoord);
 	if (sgn) {
 		Ll2xyx(x,y,lat,lon,ncoord,sgn,cm,sp);
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Stressbalance/CreateLoadsStressbalance.cpp	(revision 15843)
@@ -1,5 +1,5 @@
 /*! \file CreateLoadsStressbalance.c:
  */
-
+#include <string.h>
 #include "../../../toolkits/toolkits.h"
 #include "../../../classes/classes.h"
@@ -29,4 +29,5 @@
 	IssmDouble *vertices_type  = NULL;
 	IssmDouble *penalties      = NULL;
+	int         assert_int;
 
 	/*Fetch parameters: */
@@ -54,5 +55,5 @@
 
 			/*In debugging mode, check that the second node is in the same cpu*/
-			_assert_(iomodel->my_vertices[(int)penalties[2*i+1]-1]);
+			assert_int=iomodel->my_vertices[reCast<int,IssmDouble>(penalties[2*i+1]-1)]; _assert_(assert_int);
 
 			/*Get node ids*/
Index: /issm/trunk-jpl/src/c/shared/Elements/Arrhenius.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/Arrhenius.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/shared/Elements/Arrhenius.cpp	(revision 15843)
@@ -33,7 +33,7 @@
 
 	/*convert temperature to absolute temperature*/
-	_assert_(depth);
+	_assert_(depth>0);
 	Tstar=temperature-beta*depth;
-	_assert_(Tstar);
+	_assert_(Tstar>0);
 
 	/*Get A*/
Index: /issm/trunk-jpl/src/c/shared/Elements/LliboutryDuval.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/LliboutryDuval.cpp	(revision 15842)
+++ /issm/trunk-jpl/src/c/shared/Elements/LliboutryDuval.cpp	(revision 15843)
@@ -47,6 +47,6 @@
   IssmDouble A,B,Tstar,Tpmp,H_sp,waterfraction;
 	
-  _assert_(pressure);
-  _assert_(enthalpy);
+  _assert_(pressure>0);
+  _assert_(enthalpy>0);
   Tpmp=273.15-beta*pressure; 
   H_sp=heatcapacity*(Tpmp - Tref);
@@ -70,5 +70,5 @@
 
   /*Convert to B*/
-  _assert_(n);
+  _assert_(n>0);
   B=pow(A,-1./n);
 
@@ -89,7 +89,7 @@
   IssmDouble latentheat=3.34*pow(10,5.); // from Aschwanden 2012
   IssmDouble Tstar, enthalpy, pressure, B;
-  _assert_(temperature);
-  _assert_(waterfraction);
-  _assert_(depth);
+  _assert_(temperature>0);
+  _assert_(waterfraction>0);
+  _assert_(depth>0);
 
   /*get pressure*/
