Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 23399)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 23400)
@@ -53,6 +53,9 @@
 #do not include AmrBamg with AD
 if ADOLC
+issm_sources +=./shared/Numerics/isnan.cpp \
+					./shared/MemOps/MemOps.cpp
 else
 if CODIPACK
+issm_sources +=./shared/Numerics/isnan.cpp
 else
 issm_sources += ./classes/AmrBamg.cpp
@@ -142,5 +145,4 @@
 					./classes/Params/DataSetParam.cpp\
 					./classes/Profiler.cpp\
-					./shared/MemOps/MemOps.cpp\
 					./shared/Matrix/MatrixUtils.cpp\
 					./shared/io/Disk/pfopen.cpp\
@@ -158,5 +160,4 @@
 					./shared/Numerics/GaussPoints.cpp\
 					./shared/Numerics/cross.cpp\
-					./shared/Numerics/isnan.cpp\
 					./shared/Numerics/cubic.cpp\
 					./shared/Numerics/NewtonSolveDnorm.cpp\
@@ -756,34 +757,3 @@
 issm_dakota_LDADD= $(LDADD)
 endif
-
-#}}}
-#Automatic differentiation (must be done at the end) {{{
-if ADIC2 
-if !WINDOWS
-lib_LTLIBRARIES += libAD.la libISSMRose.la
-else
-noinst_LTLIBRARIES += libAD.la libISSMRose.la
-endif
-
-#ADIC2 library, for automatic differentiation 
-#libAD_a_SOURCES = ./mini1.ad.c
-libAD_la_SOURCES = 
-libAD_la_CFLAGS = -D_C_ -fPIC $(COPTFLAGS)
-
-#test rose preprocessing 
-%.r2cpp.cpp : %.cpp
-	testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $<
-libISSMRose_la_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp)
-libISSMRose_la_CXXFLAGS= -D_C_ $(CXXOPTFLAGS)
-
-#Automatic differentiation rules: 
-%.ad.c: %.c
-	adic2 -mforward  $< --nary
-
-#Executable
-bin_PROGRAMS +=  issmRose.exe
-issmRose_exe_LDADD = ./libISSMRose.a $(LDADD)
-issmRose_exe_SOURCES = main/issm.cpp
-issmRose_exe_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 
-LDADD +=  $(ADIC2LIB) 
-endif #}}}
+#}}}
Index: /issm/trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp	(revision 23400)
@@ -6,4 +6,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled,
@@ -21,7 +22,7 @@
   deltaTemp = dpermil * (d018+34.83);   
 
-  for (int imonth = 0; imonth<12; imonth++){
+  for(int imonth = 0; imonth<12; imonth++){
 
-	 if (isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
+	 if(isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
 	 else{
 		 monthlytemperaturestmp[imonth] = TemperatureReconstructed[imonth];
Index: /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 23400)
@@ -6,4 +6,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
Index: /issm/trunk-jpl/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp	(revision 23400)
@@ -7,4 +7,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime,
Index: /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 23400)
@@ -7,4 +7,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
Index: /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 23400)
@@ -6,4 +6,5 @@
 #include "../Numerics/numerics.h"
 #include "../Exceptions/exceptions.h"
+#include <cmath>
 
 IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
Index: /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 23400)
@@ -18,9 +18,9 @@
 static char const DEFCONTIG = 'f';
 
-// AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.
+/* AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.*/
 #ifdef _HAVE_AD_
-template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG) { /*{{{*/
+template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG){
 #else
-template <class T> T* xNew(unsigned int size) { /*{{{*/
+template <class T> T* xNew(unsigned int size){
 #endif
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -33,5 +33,5 @@
   return aT_p;
 #endif  
-}/*}}}*/
+}
 template <class T> T** xNew(unsigned int dim1, unsigned int dim2) { /*{{{*/
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -58,7 +58,7 @@
 // AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.
 #ifdef _HAVE_AD_
-template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG) {/*{{{*/
+template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG){
 #else
-template <class T> T* xNewZeroInit(unsigned int size) {/*{{{*/
+template <class T> T* xNewZeroInit(unsigned int size){
 #endif
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -76,5 +76,5 @@
   return aT_p;
 #endif
-}/*}}}*/
+}
 template <class T> T** xNewZeroInit(unsigned int dim1, unsigned int dim2) {/*{{{*/
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
Index: /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 23400)
@@ -11,4 +11,5 @@
 #include <float.h>
 #include <iomanip>
+#include <cmath>
 
 #include "../Exceptions/exceptions.h"
Index: /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 23400)
@@ -1,4 +1,2 @@
-/*This routine only used by Intel compler: */
-
 #ifdef HAVE_CONFIG_H
    #include <config.h>
@@ -7,21 +5,13 @@
 #endif
 
-#include "./isnan.h"
+/*Special overloading definitions for AD*/
 
 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
-template <> int xIsNan<adouble> (const adouble& X){
-  return std::isnan(X.getValue());
-}
-template <> int xIsInf<adouble> (const adouble& X){
-  return std::isinf(X.getValue());
-}
+template <> int xIsNan<adouble> (const adouble& X){ return std::isnan(X.getValue()); }
+template <> int xIsInf<adouble> (const adouble& X){ return std::isinf(X.getValue()); }
 #endif
 
 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
-template <> int xIsNan<IssmDouble> (const IssmDouble& X){
-	  return std::isnan(X.getValue());
-}
-template <> int xIsInf<IssmDouble> (const IssmDouble& X){
-	return std::isinf(X.getValue());
-}
+template <> int xIsNan<IssmDouble> (const IssmDouble& X){ return std::isnan(X.getValue()); }
+template <> int xIsInf<IssmDouble> (const IssmDouble& X){ return std::isinf(X.getValue()); }
 #endif
Index: /issm/trunk-jpl/src/c/shared/Numerics/isnan.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 23399)
+++ /issm/trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 23400)
@@ -1,6 +1,2 @@
-/*!\file:  isnan.h
- * \brief: only used for intel compiler.
- */ 
-
 #ifndef _XISNAN_H_
 #define _XISNAN_H_
@@ -12,18 +8,15 @@
 #endif
 
-/*If include cmath instead of math, isnan on linux64 murdo does not work: */
+/*cmath defines isnan and isinf*/
 #include <cmath>
 
-template <class T> int xIsNan(const T& X) {
 #ifdef _INTEL_WIN_
-		return (X!=X)?1:0;
+template <class T> int xIsNan(const T& X){return (X!=X)?1:0;}
 #else
-		return std::isnan(X);
+template <class T> int xIsNan(const T& X){return std::isnan(X); }
 #endif
-}
+template <class T> int xIsInf(const T& X){return std::isinf(X); }
 
-template <class T> int xIsInf(const T& X) {
-	return std::isinf(X);
-}
+/*Special overloading definitions for AD*/
 
 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
