source: lmdz_wrf/trunk/tools/Makefile.foudre @ 2322

Last change on this file since 2322 was 1611, checked in by lfita, 7 years ago

Modifying Makefiles to meet the new Fortran's structure

File size: 3.2 KB
Line 
1# L. Fita, LMD. October 2016
2# Compilation of all required Fortran modules in `foudre' with gcc compilers
3# A following python 'library' creation is required
4# Diagnostics compilation _______
5# f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log
6# make
7# f2py -m module_ForDiag -c --f90exec=/usr/bin/gfortran-4.7 module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_compile.log
8# Interpolation compilation _______
9# f2py -m module_ForInt -h module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90  >& run_f2py_ForInt_wrapper.log
10# f2py -m module_ForInt -c --f90exec=/usr/bin/gfortran-4.7 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90  >& run_f2py_ForInt_compile.log
11
12FC              = gfortran-4.7
13FCFLAGS         = -c
14LIB_INC         =
15RM              = rm -f
16#DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
17NCFOLD          = /usr
18LIB_NETCDF      = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include
19
20FCFLAGS = $(FCF) $(DBGFLAGS)
21
22# Sources for f2py
23distrisrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_DistriCorrection.f90
24diagsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
25intsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForInterpolate.f90
26
27####### ###### ##### #### ### ## #
28
29MODULES = \
30        module_definitions.o \
31        module_scientific.o \
32        module_generic.o \
33        module_ForDiagnosticsVars.o \
34        module_ForDiagnostics.o \
35        module_DistriCorrection.o
36
37all : \
38        module_ForDiagnostics.o \
39        DistriCorrection.o \
40        interpolate.o \
41        pydistrimods.o \
42        pydiagmods.o \
43        pyintmods.o
44
45diags : \
46        module_ForDiagnostics.o
47
48clean :
49        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so
50
51########    #######
52##
53    ########
54
55module_definitions.o:
56        $(FC) $(FCFLAGS) module_definitions.f90
57
58module_generic.o: module_definitions.o
59        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90
60
61module_scientific.o: module_definitions.o module_generic.o
62        $(FC) $(FCFLAGS) module_scientific.f90
63
64module_ForDiagnosticsVars.o: module_definitions.o module_generic.o
65        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
66
67module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o
68        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
69
70module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o
71        $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90
72
73FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
74
75interpolate.o: module_definitions.o module_generic.o module_scientific.o
76        $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate
77
78DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o
79        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
80
81pydistrimods.o:
82        f2py -c -m module_ForDistriCorrect $(distrisrcs)
83
84pydiagmods.o:
85        f2py -c -m module_ForDiag $(diagsrcs)
86
87pyintmods.o:
88        f2py -c -m module_ForInt $(intsrcs)
89
Note: See TracBrowser for help on using the repository browser.