Changeset 23400


Ignore:
Timestamp:
10/07/18 01:01:56 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: cosmetics

Location:
issm/trunk-jpl/src/c
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Makefile.am

    r23357 r23400  
    5353#do not include AmrBamg with AD
    5454if ADOLC
     55issm_sources +=./shared/Numerics/isnan.cpp \
     56                                        ./shared/MemOps/MemOps.cpp
    5557else
    5658if CODIPACK
     59issm_sources +=./shared/Numerics/isnan.cpp
    5760else
    5861issm_sources += ./classes/AmrBamg.cpp
     
    142145                                        ./classes/Params/DataSetParam.cpp\
    143146                                        ./classes/Profiler.cpp\
    144                                         ./shared/MemOps/MemOps.cpp\
    145147                                        ./shared/Matrix/MatrixUtils.cpp\
    146148                                        ./shared/io/Disk/pfopen.cpp\
     
    158160                                        ./shared/Numerics/GaussPoints.cpp\
    159161                                        ./shared/Numerics/cross.cpp\
    160                                         ./shared/Numerics/isnan.cpp\
    161162                                        ./shared/Numerics/cubic.cpp\
    162163                                        ./shared/Numerics/NewtonSolveDnorm.cpp\
     
    756757issm_dakota_LDADD= $(LDADD)
    757758endif
    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  
    66#include "./elements.h"
    77#include "../Numerics/numerics.h"
     8#include <cmath>
    89
    910void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled,
     
    2122  deltaTemp = dpermil * (d018+34.83);   
    2223
    23   for (int imonth = 0; imonth<12; imonth++){
     24  for(int imonth = 0; imonth<12; imonth++){
    2425
    25          if (isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
     26         if(isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
    2627         else{
    2728                 monthlytemperaturestmp[imonth] = TemperatureReconstructed[imonth];
  • issm/trunk-jpl/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp

    r19008 r23400  
    66#include "./elements.h"
    77#include "../Numerics/numerics.h"
     8#include <cmath>
    89
    910void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
  • issm/trunk-jpl/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp

    r23066 r23400  
    77#include "./elements.h"
    88#include "../Numerics/numerics.h"
     9#include <cmath>
    910
    1011void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime,
  • issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp

    r23066 r23400  
    77#include "./elements.h"
    88#include "../Numerics/numerics.h"
     9#include <cmath>
    910
    1011IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
  • issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp

    r23323 r23400  
    66#include "../Numerics/numerics.h"
    77#include "../Exceptions/exceptions.h"
     8#include <cmath>
    89
    910IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
  • issm/trunk-jpl/src/c/shared/MemOps/MemOps.h

    r21615 r23400  
    1818static char const DEFCONTIG = 'f';
    1919
    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.*/
    2121#ifdef _HAVE_AD_
    22 template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG) { /*{{{*/
     22template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG){
    2323#else
    24 template <class T> T* xNew(unsigned int size) { /*{{{*/
     24template <class T> T* xNew(unsigned int size){
    2525#endif
    2626#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
     
    3333  return aT_p;
    3434#endif 
    35 }/*}}}*/
     35}
    3636template <class T> T** xNew(unsigned int dim1, unsigned int dim2) { /*{{{*/
    3737#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
     
    5858// AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.
    5959#ifdef _HAVE_AD_
    60 template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG) {/*{{{*/
     60template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG){
    6161#else
    62 template <class T> T* xNewZeroInit(unsigned int size) {/*{{{*/
     62template <class T> T* xNewZeroInit(unsigned int size){
    6363#endif
    6464#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
     
    7676  return aT_p;
    7777#endif
    78 }/*}}}*/
     78}
    7979template <class T> T** xNewZeroInit(unsigned int dim1, unsigned int dim2) {/*{{{*/
    8080#ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
  • issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp

    r23066 r23400  
    1111#include <float.h>
    1212#include <iomanip>
     13#include <cmath>
    1314
    1415#include "../Exceptions/exceptions.h"
  • issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp

    r23244 r23400  
    1 /*This routine only used by Intel compler: */
    2 
    31#ifdef HAVE_CONFIG_H
    42   #include <config.h>
     
    75#endif
    86
    9 #include "./isnan.h"
     7/*Special overloading definitions for AD*/
    108
    119#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 }
     10template <> int xIsNan<adouble> (const adouble& X){ return std::isnan(X.getValue()); }
     11template <> int xIsInf<adouble> (const adouble& X){ return std::isinf(X.getValue()); }
    1812#endif
    1913
    2014#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 }
     15template <> int xIsNan<IssmDouble> (const IssmDouble& X){ return std::isnan(X.getValue()); }
     16template <> int xIsInf<IssmDouble> (const IssmDouble& X){ return std::isinf(X.getValue()); }
    2717#endif
  • issm/trunk-jpl/src/c/shared/Numerics/isnan.h

    r23244 r23400  
    1 /*!\file:  isnan.h
    2  * \brief: only used for intel compiler.
    3  */
    4 
    51#ifndef _XISNAN_H_
    62#define _XISNAN_H_
     
    128#endif
    139
    14 /*If include cmath instead of math, isnan on linux64 murdo does not work: */
     10/*cmath defines isnan and isinf*/
    1511#include <cmath>
    1612
    17 template <class T> int xIsNan(const T& X) {
    1813#ifdef _INTEL_WIN_
    19                 return (X!=X)?1:0;
     14template <class T> int xIsNan(const T& X){return (X!=X)?1:0;}
    2015#else
    21                 return std::isnan(X);
     16template <class T> int xIsNan(const T& X){return std::isnan(X); }
    2217#endif
    23 }
     18template <class T> int xIsInf(const T& X){return std::isinf(X); }
    2419
    25 template <class T> int xIsInf(const T& X) {
    26         return std::isinf(X);
    27 }
     20/*Special overloading definitions for AD*/
    2821
    2922#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
Note: See TracChangeset for help on using the changeset viewer.