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

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

Updating compilation for camelot

File size: 4.5 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
19FC              = /usr/bin/gfortran
20FCF     = -c -fPIC
21LIB_INC         =
22RM              = rm -f
23F2PY    = /usr/bin/f2py
24#DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
25NCLIBFOLD       = /usr/lib/64
26NCINCFOLD       = /usr/include
27LIB_NETCDF      = -L$(NCLIBFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD)
28
29LIB_NETCDF      = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include
30
31FCFLAGS = $(FCF) $(DBGFLAGS)
32
33
34# Sources for f2py
35srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90
36distrisrcs = $(srcs) module_DistriCorrection.f90
37diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
38intsrcs = $(srcs) module_ForInterpolate.f90
39scisrcs = $(srcs)
40defsrcs = module_definitions.f90
41
42####### ###### ##### #### ### ## #
43
44MODULES = \
45        module_definitions.o \
46        module_basic.o \
47        module_generic.o \
48        module_NCgeneric.o \
49        module_scientific.o \
50        module_ForDiagnosticsVars.o \
51        module_ForDiagnostics.o \
52        module_DistriCorrection.o
53
54all : \
55        module_ForDiagnostics.o \
56        DistriCorrection.o \
57        interpolate.o \
58        pydistrimods.o \
59        pydiagmods.o \
60        pyintmods.o \
61        pyscimods.o \
62        pydefmods.o \
63        trajectories_overlap.o
64
65diags : \
66        module_ForDiagnostics.o
67
68clean :
69        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so
70
71########    #######
72##
73    ########
74
75module_definitions.o:
76        $(FC) $(FCFLAGS) module_definitions.f90
77
78module_basic.o: module_definitions.o
79        $(FC) $(FCFLAGS) module_basic.f90
80
81module_generic.o: module_definitions.o module_basic.o
82        $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90
83
84module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o
85        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90
86
87module_scientific.o: module_definitions.o module_basic.o module_generic.o
88        $(FC) $(FCFLAGS) module_scientific.f90
89
90module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o
91        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
92
93module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o
94        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
95
96module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
97        $(FC) $(FCFLAGS) module_DistriCorrection.f90
98
99FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
100
101interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
102        $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate
103
104DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o
105        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
106
107pydistrimods.o:
108        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD)
109
110pydiagmods.o:
111        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD)
112
113pyintmods.o:
114        $(F2PY) -c -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD)
115
116pyscimods.o:
117        $(F2PY) -c -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD)
118
119pydefmods.o:
120        $(F2PY) -c -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD)
121
122trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o
123        $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap
Note: See TracBrowser for help on using the repository browser.