source: lmdz_wrf/trunk/tools/Makefile.hydra.gcc @ 2318

Last change on this file since 2318 was 2237, checked in by lfita, 6 years ago

Updating hydra's compilation

File size: 4.0 KB
Line 
1# L. Fita, CIMA January 2017
2# Compilation of all required Fortran modules in `hydra' with gcc compilers
3# A following python 'library' creation is required
4## Compilation
5# make >& run_make.log
6
7FC              = gfortran
8FCF     = -c
9LIB_INC =
10RM              = rm -f
11F2PY            = /usr/bin/f2py
12#DBGFLAGS = g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
13NCLIBFOLD       = /share/tools/bin/netcdf/4.5.0/gcc/lib
14NCINCFOLD       = /share/tools/bin/netcdf/4.5.0/gcc/include
15NCLIBFFOLD      = /share/tools/bin/netcdf/4.5.0/gcc/lib
16NCINCFFOLD      = /share/tools/bin/netcdf/4.5.0/gcc/include
17LIB_NETCDF      = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD)
18
19FCFLAGS = $(FCF) $(DBGFLAGS)
20
21# Sources for f2py
22srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90
23distrisrcs = $(srcs) module_DistriCorrection.f90
24diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
25intsrcs = $(srcs) module_ForInterpolate.f90
26scisrcs = $(srcs)
27defsrcs = module_definitions.f90
28
29####### ###### ##### #### ### ## #
30
31MODULES = \
32        module_definitions.o \
33        module_basic.o \
34        module_generic.o \
35        module_NCgeneric.o \
36        module_scientific.o \
37        module_ForInterpolate.o \
38        module_ForDiagnosticsVars.o \
39        module_ForDiagnostics.o \
40        module_DistriCorrection.o
41
42FINTMODULES = \
43        module_definitions.o \
44        module_basic.o \
45        module_generic.o \
46        module_scientific.o \
47        module_ForInterpolate.o
48
49all : \
50        module_ForDiagnostics.o \
51        interpolate.o \
52        DistriCorrection.o \
53        pydistrimods.o \
54        pydiagmods.o \
55        pyintmods.o \
56        pyscimods.o \
57        pydefmods.o \
58        trajectories_overlap.o
59
60diags : \
61        module_ForDiagnostics.o
62
63clean :
64        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so
65
66########    #######
67##
68    ########
69
70module_definitions.o:
71        $(FC) $(FCFLAGS) module_definitions.f90
72
73module_basic.o: module_definitions.o
74        $(FC) $(FCFLAGS) module_basic.f90
75
76module_generic.o: module_definitions.o module_basic.o
77        $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90
78
79module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o
80        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90
81
82module_scientific.o: module_definitions.o module_basic.o module_generic.o
83        $(FC) $(FCFLAGS) module_scientific.f90
84
85module_ForInterpolate.o: module_definitions.o module_generic.o
86        $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90
87
88module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
89        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
90
91module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o
92        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
93
94module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
95        $(FC) $(FCFLAGS) module_DistriCorrection.f90
96
97FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC)
98FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
99
100interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o
101        $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate
102
103DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o
104        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
105
106pydistrimods.o:
107        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD)
108
109pydiagmods.o:
110        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD)
111
112pyintmods.o:
113        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD)
114
115pyscimods.o:
116        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD)
117
118pydefmods.o:
119        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD)
120
121trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o
122        $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap
123
Note: See TracBrowser for help on using the repository browser.