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

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

Modifying Makefiles to meet the new Fortran's structure

File size: 3.2 KB
RevLine 
[1155]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
[1172]4# Diagnostics compilation _______
[1607]5# f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log
[1172]6# make
[1607]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
[1172]8# Interpolation compilation _______
[1607]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
[1155]11
12FC              = gfortran-4.7
13FCFLAGS         = -c
14LIB_INC         =
15RM              = rm -f
[1611]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
[1155]17NCFOLD          = /usr
18LIB_NETCDF      = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include
19
[1611]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
[1155]27####### ###### ##### #### ### ## #
28
29MODULES = \
[1611]30        module_definitions.o \
31        module_scientific.o \
32        module_generic.o \
33        module_ForDiagnosticsVars.o \
34        module_ForDiagnostics.o \
35        module_DistriCorrection.o
[1155]36
37all : \
[1611]38        module_ForDiagnostics.o \
39        DistriCorrection.o \
[1155]40        interpolate.o \
[1611]41        pydistrimods.o \
42        pydiagmods.o \
43        pyintmods.o
[1155]44
45diags : \
46        module_ForDiagnostics.o
[1611]47
[1155]48clean :
[1611]49        $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so
[1155]50
51########    #######
52##
53    ########
54
[1611]55module_definitions.o:
56        $(FC) $(FCFLAGS) module_definitions.f90
57
58module_generic.o: module_definitions.o
[1607]59        $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90
[1155]60
[1611]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
[1607]65        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
[1155]66
[1611]67module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o
[1607]68        $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90
[1155]69
[1611]70module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o
71        $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90
72
[1155]73FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
74
[1611]75interpolate.o: module_definitions.o module_generic.o module_scientific.o
[1607]76        $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate
[1155]77
[1611]78DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o
79        $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection
[1155]80
[1611]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.