source: lmdz_wrf/trunk/tools/Makefile.ciclad.gcc @ 1749

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

Modifying Makefiles to meet the new Fortran's structure

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