source: lmdz_wrf/trunk/tools/Makefile.trueno @ 2828

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

Adding comentary to make the copy of the `test_Fmods.f90'

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