source: lmdz_wrf/trunk/tools/Makefile.ada.ifort @ 2828

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

Modifying Makefiles to meet the new Fortran's structure

File size: 3.4 KB
Line 
1# L. Fita, LMD. October 2016
2# Compilation of all required Fortran modules in `ada' with intel 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 intel/2013.1
8# module load python/2.7.5
9# module load module load netcdf/seq/4.1.3
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 -m module_ForDiag -c --fcompiler=intelem 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 -m module_ForInt -c --fcompiler=intelem module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90  >& run_f2py_ForInt_compile.log
17#
18
19FC              = /smplocal/pub/Modules/IDRIS/wrappers/ifort
20FCF     = -c -fPIC
21LIB_INC         =
22RM              = rm -f
23#DBGFLAGS = -g -check all -fpe0 -warn -traceback -debug extended
24NCFOLD          = /smplocal/pub/NetCDF/4.1.3/seq
25LIB_NETCDF      = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include
26
27FCFLAGS = $(FCF) $(DBGFLAGS)
28
29# Sources for f2py
30distrisrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_DistriCorrection.f90
31diagsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90
32intsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForInterpolate.f90
33
34####### ###### ##### #### ### ## #
35
36MODULES = \
37        module_definitions.o \
38        module_scientific.o \
39        module_generic.o \
40        module_ForDiagnosticsVars.o \
41        module_ForDiagnostics.o \
42        module_DistriCorrection.o
43
44all : \
45        module_ForDiagnostics.o \
46        DistriCorrection.o \
47        interpolate.o \
48        pydistrimods.o \
49        pydiagmods.o \
50        pyintmods.o
51
52diags : \
53        module_ForDiagnostics.o
54
55clean :
56        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so
57
58########    #######
59##
60    ########
61
62module_definitions.o:
63        $(FC) $(FCFLAGS) module_definitions.f90
64
65module_generic.o: module_definitions.o
66        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90
67
68module_scientific.o: module_definitions.o module_generic.o
69        $(FC) $(FCFLAGS) module_scientific.f90
70
71module_ForDiagnosticsVars.o: module_definitions.o module_generic.o
72        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
73
74module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o
75        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
76
77module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o
78        $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90
79
80FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
81
82interpolate.o: module_definitions.o module_generic.o module_scientific.o
83        $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate
84
85DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o
86        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
87
88pydistrimods.o:
89        f2py -c -m module_ForDistriCorrect $(distrisrcs)
90
91pydiagmods.o:
92        f2py -c -m module_ForDiag $(diagsrcs)
93
94pyintmods.o:
95        f2py -c -m module_ForInt $(intsrcs)
Note: See TracBrowser for help on using the repository browser.