source: lmdz_wrf/trunk/tools/Makefile.tupa.anaconda2 @ 2828

Last change on this file since 2828 was 2244, checked in by lfita, 6 years ago

Adding the new explanations for the compilation

File size: 5.6 KB
Line 
1# L. Fita, CIMA. November 2018
2# Compilation of all required Fortran modules in CIMA's `tupa' with gcc compilers and anaconda environment
3#   NOTE: One will not be able to compile all the set of programs within an anaconda environment
4#     due to problems with anaconda. Installation of netcdf4 colides with installed libnetcdff
5#   - netcdf4
6# The following packages will be downloaded:
7#
8#    package                    |            build
9#    ---------------------------|-----------------
10#    libnetcdf-4.6.1            |       h10edf3e_2         1.3 MB
11#
12# The following NEW packages will be INSTALLED:
13#
14#    netcdf4:    1.4.2-py27h4b4f87f_0               
15#
16# The following packages will be REMOVED:
17#
18#    libnetcdff: 4.4.4-0              matthewharrison
19#
20# The following packages will be UPDATED:
21#
22#    libnetcdf:  4.4.0-hf6ef953_0     matthewharrison --> 4.6.1-h10edf3e_2
23#####
24# Because of that, Makefile is splitted in two compilation sub-sets
25##
26#  $ make pymods: compilation of Fortran modules used in the python scripts
27#  $ make NCfortran: compiation of Fortran modules and main programs which require
28#     netCDF-fortran interface: (for: DistriCorrection and trajectories_overlap)
29#  $ make: compiles all components
30##
31
32# A following python 'library' creation is required
33## Compilation
34# make >& run_make.log
35
36FC              = gfortran
37FCF     = -c
38LIB_INC =
39RM              = rm -f
40F2PY    =  /home/lluis.fita/anaconda2/bin/f2py
41F2PYF   =
42DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 #-fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
43NCLIBFOLD       = /home/lluis.fita/anaconda2/lib
44NCINCFOLD       = /home/lluis.fita/anaconda2/include
45NCLIBFFOLD      = /home/lluis.fita/anaconda2/lib
46NCINCFFOLD      = /home/lluis.fita/anaconda2/include
47LIB_NETCDF      = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD)
48
49FCFLAGS = $(FCF) #$(DBGFLAGS)
50
51# Sources for f2py
52srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90
53distrisrcs = $(srcs) module_DistriCorrection.f90
54diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
55intsrcs = $(srcs) module_ForInterpolate.f90
56scisrcs = $(srcs)
57defsrcs = module_definitions.f90
58
59####### ###### ##### #### ### ## #
60
61MODULES = \
62        module_definitions.o \
63        module_basic.o \
64        module_generic.o \
65        module_scientific.o \
66        module_ForInterpolate.o \
67        module_ForDiagnosticsVars.o \
68        module_ForDiagnostics.o
69
70FINTMODULES = \
71        module_definitions.o \
72        module_basic.o \
73        module_generic.o \
74        module_scientific.o \
75        module_ForInterpolate.o
76
77FEXECMODULES = \
78        module_definitions.o \
79        module_basic.o \
80        module_generic.o \
81        module_scientific.o \
82        module_NCgeneric.o \
83        module_ForInterpolate.o \
84        module_DistriCorrection.o
85
86all : \
87        module_ForDiagnostics.o \
88        interpolate.o \
89        DistriCorrection.o \
90        pydistrimods.o \
91        pydiagmods.o \
92        pyintmods.o \
93        pyscimods.o \
94        pydefmods.o \
95        trajectories_overlap.o
96
97pymods : \
98        module_ForDiagnostics.o \
99        pydistrimods.o \
100        pydiagmods.o \
101        pyintmods.o \
102        pyscimods.o \
103        pydefmods.o
104
105NCfortran : \
106        module_definitions.o \
107        module_basic.o \
108        module_generic.o \
109        module_NCgeneric.o \
110        module_ForInterpolate.o \
111        DistriCorrection.o \
112        trajectories_overlap.o
113
114diags : \
115        module_ForDiagnostics.o
116
117clean :
118        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so
119
120########    #######
121##
122    ########
123
124module_definitions.o:
125        $(FC) $(FCFLAGS) module_definitions.f90
126
127module_basic.o: module_definitions.o
128        $(FC) $(FCFLAGS) module_basic.f90
129
130module_generic.o: module_definitions.o module_basic.o
131        $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90
132
133module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o
134        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90
135
136module_scientific.o: module_definitions.o module_basic.o module_generic.o
137        $(FC) $(FCFLAGS) module_scientific.f90
138
139module_ForInterpolate.o: module_definitions.o module_generic.o
140        $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90
141
142module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
143        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
144
145module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o
146        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
147
148module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
149        $(FC) $(FCFLAGS) module_DistriCorrection.f90
150
151FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC)
152FCEXECFLAGS = $(FEXECMODULES) $(LIB_NETCDF) $(LIB_INC)
153
154interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o
155        $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate
156
157DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o
158        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
159
160pydistrimods.o:
161        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD)
162
163pydiagmods.o:
164        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD)
165
166pyintmods.o:
167        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD)
168
169pyscimods.o:
170        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD)
171
172pydefmods.o:
173        $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD)
174
175trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o
176        $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap
177
Note: See TracBrowser for help on using the repository browser.