SHELL=/bin/sh # requires GNU make MAKE=make PROGRAMS= \ testaeolus ## select compiler and environment settings for the machine ## TODO: select it automagically # disable some annoying remarks from Intel compiler # remark #1: last line of file ends without a newline # remark #981: operands are evaluated in unspecified order # remark #1572: floating-point equality and inequality comparisons are unreliable # remark #1782 : #pragma once is obsolete INTEL_DIAG_DISABLE=-diag-disable 1,981,1572,1782 # -march implies -mtune but -mcpu is deprecated # -march=native finds out the best match for the machine the # compiler is running on. Requires gcc >= 4.3 # for vis servers #CXX=g++-4.3 #CC=gcc-4.3 #FC=gfortran -ffree-line-length-none -fcray-pointer -fdefault-real-8 #FCFLAGS= #FCLIBS=-lgfortran #OPTFLAGS=-O3 -march=native -msse4a -mfpmath=sse -ftree-vectorizer-verbose=2 -fno-exceptions #DEBUGFLAGS=-g -Wall # -Wextra # -pg #INCLUDE=-IAtmosphereIII_test #LIBPATH= # for Stefans desktop CXX=g++ FC=gfortran -ffree-line-length-none -fcray-pointer -fdefault-real-8 -D'FLUSH\(s,i\)=flush\(s\)' FCFLAGS= FCLIBS=-lgfortran #OPTFLAGS=-O2 #OPTFLAGS=-O3 -march=native -mtune=native -mssse3 -mfpmath=sse -fno-exceptions -DNDEBUG # -ftree-vectorizer-verbose=2 DEBUGFLAGS=-g -Wall -DDEBUG # -Wextra # -pg INCLUDE=-IAtmosphereIII_test LIBPATH= # clme is same CPU as desktop, but old gcc does not know -march=native #CXX=g++ #OPTFLAGS=-O3 -march=nocona -mssse3 -mfpmath=sse -ftree-vectorizer-verbose=2 -fno-exceptions #INCLUDE=-I/scratch/02/sys/libraries/include #LIBPATH=-L/scratch/02/sys/libraries/lib # on CLME cluster and vis servers we also can use Intel Compiler 10.x #CXX=icpc $(INTEL_DIAG_DISABLE) #OPTFLAGS=-O3 -xT #INCLUDE=-I/scratch/02/sys/libraries/include #LIBPATH=-L/scratch/02/sys/libraries/lib # on IPLEX cluster and vis servers we also can use Intel Compiler 11.x #CXX=icpc -Wall $(INTEL_DIAG_DISABLE) #FC=ifort -i4 -r8 -warn -traceback #FCFLAGS=-check #FCLIBS=-lifcore ##OPTFLAGS=-O3 -xSSE4.1 -DNDEBUG #DEBUGFLAGS=-g -DDEBUG # -pg #INCLUDE=-IAtmosphereIII_test -I/iplex/01/sys/libraries/include #LIBPATH=-L/iplex/01/sys/libraries/lib # for ZUSE cluster with gcc-4.3 (available as module) #CXX=g++ #FC=gfortran -ffree-line-length-none -fcray-pointer -fdefault-real-8 #FCFLAGS= #FCLIBS=-lgfortran #OPTFLAGS=-O3 -march=native -mtune=native -mssse3 -mfpmath=sse -ftree-vectorizer-verbose=2 -fno-exceptions -DNDEBUG #DEBUGFLAGS=-g -DDEBUG # -pg #INCLUDE=-IAtmosphereIII_test -I$(NETCDFINCLUDE) #LIBPATH=-L$(NETCDFDIR) # for ZUSE cluster with Intel compiler 11.0.x (available as module) #CXX=icpc #FC=ifort -i4 -r8 -warn -traceback #FCFLAGS=-check #FCLIBS=-lifcore #OPTFLAGS=-O3 -xSSE4.1 -DNDEBUG #DEBUGFLAGS=-g -DDEBUG # -pg #INCLUDE=-IAtmosphereIII_test -I$(NETCDFINCLUDE) #LIBPATH=-L$(NETCDFDIR) CXXFLAGS=$(INCLUDE) $(DEBUGFLAGS) $(OPTFLAGS) FFLAGS=$(INCLUDE) $(DEBUGFLAGS) $(OPTFLAGS) $(FCFLAGS) LDLIBS=$(LIBPATH) -lnetcdf_c++ -lnetcdf -lstdc++ SRCS_CORE= \ Aeolus.cpp \ Aeolus_SkillScore_q.cpp \ Aeolus_SkillScore_ua_va.cpp \ AtmosphereIII_test/Atmosphere.cpp \ AtmosphereIII_test/AuxiliaryFunctionality.cpp \ AtmosphereIII_test/Cell.cpp \ AtmosphereIII_test/CellVariable.cpp \ AtmosphereIII_test/Cloudiness_2.cpp \ AtmosphereIII_test/Cloudiness_3Layers.cpp \ AtmosphereIII_test/Clouds-3lc.cpp \ AtmosphereIII_test/Compute.cpp \ AtmosphereIII_test/Conversions.cpp \ AtmosphereIII_test/DataStorage.cpp \ AtmosphereIII_test/Earth.cpp \ AtmosphereIII_test/FMSAstronomy.cpp \ AtmosphereIII_test/HeatTransfer.cpp \ AtmosphereIII_test/HorizontalVariable.cpp \ AtmosphereIII_test/Interface.cpp \ AtmosphereIII_test/InterfaceVariable.cpp \ AtmosphereIII_test/LargeScaleDynamics.cpp \ AtmosphereIII_test/LongWaveRadiation.cpp \ AtmosphereIII_test/LongWaveRadiation-ts.cpp \ AtmosphereIII_test/MathOperators.cpp \ AtmosphereIII_test/MeridionalVariable.cpp \ AtmosphereIII_test/MeridionalVariable1D.cpp \ AtmosphereIII_test/Namelist.cpp \ AtmosphereIII_test/NetCDFInput.cpp \ AtmosphereIII_test/NetCDFOutput.cpp \ AtmosphereIII_test/Parameter.cpp \ AtmosphereIII_test/PlanetaryBoundaryLayerPhysics.cpp \ AtmosphereIII_test/PlanWave.cpp \ AtmosphereIII_test/PolynomialInterpolation.cpp \ AtmosphereIII_test/RadiativeTransfer.cpp \ AtmosphereIII_test/Restart.cpp \ AtmosphereIII_test/ShortWaveRadiation.cpp \ AtmosphereIII_test/ShortWaveRadiation-3lc.cpp \ AtmosphereIII_test/SimenvOutput.cpp \ AtmosphereIII_test/SphericalGrid.cpp \ AtmosphereIII_test/SurfaceFluxes.cpp \ AtmosphereIII_test/SynopticScaleDynamics.cpp \ AtmosphereIII_test/TransportScheme.cpp \ AtmosphereIII_test/Variable.cpp \ AtmosphereIII_test/VerticalVariable.cpp \ AtmosphereIII_test/WaterVaporTransfer.cpp \ AtmosphereIII_test/WrapSinsol.cpp SRCS_FORTRAN77= \ AtmosphereIII_test/swr-3lc.F \ AtmosphereIII_test/clouds_skillscore.F SRCS_FORTRAN90= \ atmosphere.F90 \ constants_poem.F90 \ fmsclocks.F90 \ AtmosphereIII_test/sinsol.F90 all: $(PROGRAMS) $(PROGRAMS): $(SRCS_CORE:.cpp=.o) $(SRCS_FORTRAN77:.F=.o) $(SRCS_FORTRAN90:.F90=.o) WrapSinsol: WrapSinsol.cpp sinsol.o SphericalGrid.o Cell.o Interface.o $(CXX) -DTEST_SINSOL $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) $(FCLIBS) -o $@ TAGS: $(SRCS_CORE) $(SRC_CORE:.cpp=.h) $(SRCS_FORTRAN77) $(SRCS_FORTRAN90) $(PROGRAMS:=.F90) etags --regex='/^[ \t]*interface[ \t]+[^ \t(]+/i' --regex='/^[ \t]*type[ \t]+[^ \t(]+/i' *.cpp *.F *.F90 *.h Makefile \ $(SRCS_CORE) $(SRC_CORE:.cpp=.h) $(SRCS_FORTRAN77) $(SRCS_FORTRAN90) # override default implicit rule for linking %: %.o $(FC) $(FFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) $(FCLIBS) -o $@ %.o: %.F90 $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $*.o # Rules for automatics generation of dependency files, which are then included below. # Preprocessor option -MM works with GNU and Intel compilers %.d: %.c @set -e; rm -f $@; \ $(CC) -MM $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ %.d: %.cpp @set -e; rm -f $@; \ $(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ include $(SRCS_CORE:.cpp=.d) # $(PROGRAMS:=.d) #.depend: # g++ -MM $(CXXFLAGS) $(SRCS_CORE) > .depend clean: rm -f *.o *.d *.d.* *.mod *__genmod.* a.out core $(PROGRAMS)