source: lmdz_wrf/trunk/tools/Makefile.camelot.gcc @ 2294

Last change on this file since 2294 was 1814, checked in by lfita, 7 years ago

Fixing right python

File size: 4.9 KB
Line 
1# L. Fita, LMD. October 2016
2# Compilation of all required Fortran modules in `camelot' 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 gnu/4.4.7
8# module load python/2.7-anaconda
9# export LD_LIBRARY_PATH=/opt/anaconda/lib/:$LD_LIBRARY_PATH
10# Diagnostics compilation _______
11# f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log
12# make
13# f2py -L/opt/anaconda/lib/ -m module_ForDiag -c --fcompiler=gnu95 module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_compile.log
14# Interpolation compilation _______
15# f2py -m module_ForInt -h module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90  >& run_f2py_ForInt_wrapper.log
16# f2py -L/opt/anaconda/lib/ -m module_ForInt -c --fcompiler=gnu95 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90  >& run_f2py_ForInt_compile.log
17#
18# using netcdf4.3.3.1gfortran
19## module load netcdf4/4.3.3.1-gfortran
20
21FC              = /usr/bin/gfortran
22FCF     = -c -fPIC
23LIB_INC         =
24RM              = rm -f
25F2PY    = /opt/canopy-1.3.0/Canopy_64bit/User/bin/f2py -L/opt/anaconda/lib/ --fcompiler=gnu95
26#DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
27NCLIBFOLD       = /opt/netcdf43/gfortran/bin/
28NCINCFOLD       = /opt/netcdf43/gfortran/include/
29LIB_NETCDF      = -L$(NCLIBFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -static-libgfortran
30
31FCFLAGS = $(FCF) $(DBGFLAGS)
32
33# Sources for f2py
34srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90
35distrisrcs = $(srcs) module_DistriCorrection.f90
36diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
37intsrcs = $(srcs) module_ForInterpolate.f90
38scisrcs = $(srcs)
39defsrcs = module_definitions.f90
40
41####### ###### ##### #### ### ## #
42
43MODULES = \
44        module_definitions.o \
45        module_basic.o \
46        module_generic.o \
47        module_NCgeneric.o \
48        module_scientific.o \
49        module_ForInterpolate.o \
50        module_ForDiagnosticsVars.o \
51        module_ForDiagnostics.o \
52        module_DistriCorrection.o
53
54FINTMODULES = \
55        module_definitions.o \
56        module_basic.o \
57        module_generic.o \
58        module_scientific.o \
59        module_ForInterpolate.o
60
61all : \
62        module_ForDiagnostics.o \
63        interpolate.o \
64        DistriCorrection.o \
65        pydistrimods.o \
66        pydiagmods.o \
67        pyintmods.o \
68        pyscimods.o \
69        pydefmods.o \
70        trajectories_overlap.o
71
72diags : \
73        module_ForDiagnostics.o
74
75clean :
76        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so
77
78########    #######
79##
80    ########
81
82module_definitions.o:
83        $(FC) $(FCFLAGS) module_definitions.f90
84
85module_basic.o: module_definitions.o
86        $(FC) $(FCFLAGS) module_basic.f90
87
88module_generic.o: module_definitions.o module_basic.o
89        $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90
90
91module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o
92        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90
93
94module_scientific.o: module_definitions.o module_basic.o module_generic.o
95        $(FC) $(FCFLAGS) module_scientific.f90
96
97module_ForInterpolate.o: module_definitions.o module_generic.o
98        $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90
99
100module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o
101        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
102
103module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o
104        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
105
106module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
107        $(FC) $(FCFLAGS) module_DistriCorrection.f90
108
109FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC)
110FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
111
112interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o
113        $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate
114
115DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o
116        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
117
118pydistrimods.o:
119        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD)
120
121pydiagmods.o:
122        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD)
123
124pyintmods.o:
125        $(F2PY) -c -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD)
126
127pyscimods.o:
128        $(F2PY) -c -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD)
129
130pydefmods.o:
131        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD)
132
133trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o
134        $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap
Note: See TracBrowser for help on using the repository browser.