Changeset 23400
- Timestamp:
- 10/07/18 01:01:56 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r23357 r23400 53 53 #do not include AmrBamg with AD 54 54 if ADOLC 55 issm_sources +=./shared/Numerics/isnan.cpp \ 56 ./shared/MemOps/MemOps.cpp 55 57 else 56 58 if CODIPACK 59 issm_sources +=./shared/Numerics/isnan.cpp 57 60 else 58 61 issm_sources += ./classes/AmrBamg.cpp … … 142 145 ./classes/Params/DataSetParam.cpp\ 143 146 ./classes/Profiler.cpp\ 144 ./shared/MemOps/MemOps.cpp\145 147 ./shared/Matrix/MatrixUtils.cpp\ 146 148 ./shared/io/Disk/pfopen.cpp\ … … 158 160 ./shared/Numerics/GaussPoints.cpp\ 159 161 ./shared/Numerics/cross.cpp\ 160 ./shared/Numerics/isnan.cpp\161 162 ./shared/Numerics/cubic.cpp\ 162 163 ./shared/Numerics/NewtonSolveDnorm.cpp\ … … 756 757 issm_dakota_LDADD= $(LDADD) 757 758 endif 758 759 #}}} 760 #Automatic differentiation (must be done at the end) {{{ 761 if ADIC2 762 if !WINDOWS 763 lib_LTLIBRARIES += libAD.la libISSMRose.la 764 else 765 noinst_LTLIBRARIES += libAD.la libISSMRose.la 766 endif 767 768 #ADIC2 library, for automatic differentiation 769 #libAD_a_SOURCES = ./mini1.ad.c 770 libAD_la_SOURCES = 771 libAD_la_CFLAGS = -D_C_ -fPIC $(COPTFLAGS) 772 773 #test rose preprocessing 774 %.r2cpp.cpp : %.cpp 775 testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $< 776 libISSMRose_la_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp) 777 libISSMRose_la_CXXFLAGS= -D_C_ $(CXXOPTFLAGS) 778 779 #Automatic differentiation rules: 780 %.ad.c: %.c 781 adic2 -mforward $< --nary 782 783 #Executable 784 bin_PROGRAMS += issmRose.exe 785 issmRose_exe_LDADD = ./libISSMRose.a $(LDADD) 786 issmRose_exe_SOURCES = main/issm.cpp 787 issmRose_exe_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 788 LDADD += $(ADIC2LIB) 789 endif #}}} 759 #}}} -
issm/trunk-jpl/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp
r23066 r23400 6 6 #include "./elements.h" 7 7 #include "../Numerics/numerics.h" 8 #include <cmath> 8 9 9 10 void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled, … … 21 22 deltaTemp = dpermil * (d018+34.83); 22 23 23 for 24 for(int imonth = 0; imonth<12; imonth++){ 24 25 25 if 26 if(isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp; 26 27 else{ 27 28 monthlytemperaturestmp[imonth] = TemperatureReconstructed[imonth]; -
issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
r19008 r23400 6 6 #include "./elements.h" 7 7 #include "../Numerics/numerics.h" 8 #include <cmath> 8 9 9 10 void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime, -
issm/trunk-jpl/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp
r23066 r23400 7 7 #include "./elements.h" 8 8 #include "../Numerics/numerics.h" 9 #include <cmath> 9 10 10 11 void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime, -
issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
r23066 r23400 7 7 #include "./elements.h" 8 8 #include "../Numerics/numerics.h" 9 #include <cmath> 9 10 10 11 IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, -
issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
r23323 r23400 6 6 #include "../Numerics/numerics.h" 7 7 #include "../Exceptions/exceptions.h" 8 #include <cmath> 8 9 9 10 IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, -
issm/trunk-jpl/src/c/shared/MemOps/MemOps.h
r21615 r23400 18 18 static char const DEFCONTIG = 'f'; 19 19 20 / / AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.20 /* AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.*/ 21 21 #ifdef _HAVE_AD_ 22 template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG) { /*{{{*/22 template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG){ 23 23 #else 24 template <class T> T* xNew(unsigned int size) { /*{{{*/24 template <class T> T* xNew(unsigned int size){ 25 25 #endif 26 26 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES … … 33 33 return aT_p; 34 34 #endif 35 } /*}}}*/35 } 36 36 template <class T> T** xNew(unsigned int dim1, unsigned int dim2) { /*{{{*/ 37 37 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES … … 58 58 // AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use. 59 59 #ifdef _HAVE_AD_ 60 template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG) {/*{{{*/60 template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG){ 61 61 #else 62 template <class T> T* xNewZeroInit(unsigned int size) {/*{{{*/62 template <class T> T* xNewZeroInit(unsigned int size){ 63 63 #endif 64 64 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES … … 76 76 return aT_p; 77 77 #endif 78 } /*}}}*/78 } 79 79 template <class T> T** xNewZeroInit(unsigned int dim1, unsigned int dim2) {/*{{{*/ 80 80 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES -
issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
r23066 r23400 11 11 #include <float.h> 12 12 #include <iomanip> 13 #include <cmath> 13 14 14 15 #include "../Exceptions/exceptions.h" -
issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp
r23244 r23400 1 /*This routine only used by Intel compler: */2 3 1 #ifdef HAVE_CONFIG_H 4 2 #include <config.h> … … 7 5 #endif 8 6 9 #include "./isnan.h" 7 /*Special overloading definitions for AD*/ 10 8 11 9 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) 12 template <> int xIsNan<adouble> (const adouble& X){ 13 return std::isnan(X.getValue()); 14 } 15 template <> int xIsInf<adouble> (const adouble& X){ 16 return std::isinf(X.getValue()); 17 } 10 template <> int xIsNan<adouble> (const adouble& X){ return std::isnan(X.getValue()); } 11 template <> int xIsInf<adouble> (const adouble& X){ return std::isinf(X.getValue()); } 18 12 #endif 19 13 20 14 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_) 21 template <> int xIsNan<IssmDouble> (const IssmDouble& X){ 22 return std::isnan(X.getValue()); 23 } 24 template <> int xIsInf<IssmDouble> (const IssmDouble& X){ 25 return std::isinf(X.getValue()); 26 } 15 template <> int xIsNan<IssmDouble> (const IssmDouble& X){ return std::isnan(X.getValue()); } 16 template <> int xIsInf<IssmDouble> (const IssmDouble& X){ return std::isinf(X.getValue()); } 27 17 #endif -
issm/trunk-jpl/src/c/shared/Numerics/isnan.h
r23244 r23400 1 /*!\file: isnan.h2 * \brief: only used for intel compiler.3 */4 5 1 #ifndef _XISNAN_H_ 6 2 #define _XISNAN_H_ … … 12 8 #endif 13 9 14 /* If include cmath instead of math, isnan on linux64 murdo does not work:*/10 /*cmath defines isnan and isinf*/ 15 11 #include <cmath> 16 12 17 template <class T> int xIsNan(const T& X) {18 13 #ifdef _INTEL_WIN_ 19 return (X!=X)?1:0; 14 template <class T> int xIsNan(const T& X){return (X!=X)?1:0;} 20 15 #else 21 return std::isnan(X); 16 template <class T> int xIsNan(const T& X){return std::isnan(X); } 22 17 #endif 23 }18 template <class T> int xIsInf(const T& X){return std::isinf(X); } 24 19 25 template <class T> int xIsInf(const T& X) { 26 return std::isinf(X); 27 } 20 /*Special overloading definitions for AD*/ 28 21 29 22 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
Note:
See TracChangeset
for help on using the changeset viewer.