Merge branch 'fixf'
[wrf-fire-matlab.git] / femwind / fortran / Makefile
blob6204f4d51bda32e80fc739e7cd7fc37cd4ac5c09
1 #FC = gfortran
2 #CC = gcc
3 #FC = ifort
4 #CC = icc
5 FFLAGS = -g -C --ffpe-trap=invalid,zero,overflow,underflow -traceback -fpe0 # intel debug
6 FFLAGS = -g -C -fpe0 -r8 # intel debug
7 FFLAGS = -g -C -fdefault-real-8
8 FFLAGS = -g -C -I /opt/local/include
9 LFLAGS = -L/opt/local/lib -lnetcdf -l netcdff
10 FFLAGS = -pg -O3 -I $(NETCDF)/include
11 FFLAGSOPT = -O3 -I $(NETCDF)/include
12 FFLAGS = -g -C -I $(NETCDF)/include -I $(NETCDF)/modules
13 FFLAGS = -O3 -I $(NETCDF)/include -I $(NETCDF)/modules -pg
14 LFLAGS = -L$(NETCDF)/lib -lnetcdf -lnetcdff -pg
16 default: all
18 wrf: femwind_wrfout.exe
20 tests: clean_txt\
21 hexa_test.exe\
22 ndt_mult_test.exe\
23 sweeps_test.exe\
24 f_assembly_test.exe\
25 prolongation_test.exe\
26 restriction_test.exe\
27 ndt_assembly_test.exe\
28 w_assembly_test.exe\
29 coarsening_icl_test.exe\
30 ndt_boundary_conditions_test.exe\
31 vec_boundary_conditions_test.exe\
32 femwind_test.exe\
33 netcdf_test.exe\
34 msleep_test.exe
36 UTILS = \
37 module_lin_alg.o \
38 module_utils.o
40 all: wrf tests
42 hexa_test.exe: hexa_test.o module_hexa.o $(UTILS) Makefile
43 $(FC) $(FFLAGS) -o hexa_test.exe hexa_test.o module_hexa.o $(UTILS)
45 module_hexa.o: module_hexa.f90 $(UTILS) Makefile
46 $(FC) $(FFLAGS) -c module_hexa.f90
48 hexa_test.o: hexa_test.f90 module_hexa.o module_utils.o Makefile
49 $(FC) $(FFLAGS) -c hexa_test.f90
51 module_utils.o: module_utils.f90 Makefile
52 $(FC) $(FFLAGS) -c module_utils.f90
54 module_netcdf.o: module_utils.o module_netcdf.f90 Makefile
55 $(FC) $(FFLAGS) -c module_netcdf.f90
57 module_wrfout.o: module_wrfout.f90 module_netcdf.o module_msleep.o Makefile
58 $(FC) $(FFLAGS) -c module_wrfout.f90
60 module_common.o: module_common.f90 module_utils.o Makefile
61 $(FC) $(FFLAGS) -c module_common.f90
63 module_ndt_mult.o: module_ndt_mult.f90 module_utils.o Makefile
64 $(FC) $(FFLAGS) -c module_ndt_mult.f90
66 ndt_mult_test.exe: ndt_mult_test.f90 module_ndt_mult.o module_utils.o Makefile
67 $(FC) $(FFLAGS) -o ndt_mult_test.exe ndt_mult_test.f90 module_ndt_mult.o module_utils.o
69 sweeps_test.exe: sweeps_test.o module_sweeps.o module_utils.o Makefile
70 $(FC) $(FFLAGS) -o sweeps_test.exe sweeps_test.f90 module_sweeps.o module_utils.o
72 module_sweeps.o: module_sweeps.f90 module_utils.o Makefile
73 $(FC) $(FFLAGS) -c module_sweeps.f90
75 sweeps_test.o: sweeps_test.f90 module_sweeps.o module_utils.o Makefile
76 $(FC) $(FFLAGS) -c sweeps_test.f90
78 NDT_ASSEMBLY_TEST = ndt_assembly_test.o module_ndt_assembly.o module_hexa.o $(UTILS)
79 ndt_assembly_test.exe: $(NDT_ASSEMBLY_TEST) Makefile
80 $(FC) $(FFLAG) -o ndt_assembly_test.exe $(NDT_ASSEMBLY_TEST)
82 ndt_assembly_test.o: ndt_assembly_test.f90 module_hexa.o module_utils.o module_ndt_assembly.o Makefile
83 $(FC) $(FFLAGS) -c ndt_assembly_test.f90
85 module_ndt_assembly.o: module_ndt_assembly.f90 module_hexa.o Makefile
86 $(FC) $(FFLAGS) -c module_ndt_assembly.f90
88 F_ASSEMBLY_TEST = f_assembly_test.f90 module_f_assembly.o module_hexa.o $(UTILS)
89 f_assembly_test.exe: $(F_ASSEMBLY_TEST) Makefile
90 $(FC) $(FFLAGS) -o f_assembly_test.exe $(F_ASSEMBLY_TEST)
92 module_f_assembly.o: module_f_assembly.f90 module_hexa.o module_utils.o Makefile
93 $(FC) $(FFLAGS) -c module_f_assembly.f90
95 module_coarsening.o: module_coarsening.f90 module_hexa.o Makefile
96 $(FC) $(FFLAGS) -c module_coarsening.f90
98 PROLONGATION = prolongation_test.f90 module_coarsening.o module_utils.o
99 prolongation_test.exe: $(PROLONGATION)
100 $(FC) $(FFLAGS) -o prolongation_test.exe $(PROLONGATION)
102 RESTRICTION = restriction_test.f90 module_coarsening.o module_utils.o
103 restriction_test.exe: $(RESTRICTION) Makefile
104 $(FC) $(FFLAGS) -o restriction_test.exe $(RESTRICTION)
106 ICL = coarsening_icl_test.f90 module_coarsening.o module_utils.o
107 coarsening_icl_test.exe: $(ICL) Makefile
108 $(FC) $(FFLAGS) -o $@ $(ICL)
110 module_boundary_conditions.o: module_boundary_conditions.f90 module_utils.o Makefile
111 $(FC) $(FFLAGS) -c module_boundary_conditions.f90
113 NDT_BOUNDARY_CONDITIONS = ndt_boundary_conditions_test.f90 module_boundary_conditions.o module_utils.o
114 ndt_boundary_conditions_test.exe: $(NDT_BOUNDARY_CONDITIONS) Makefile
115 $(FC) $(FFLAGS) -o $@ $(NDT_BOUNDARY_CONDITIONS)
117 VEC_BOUNDARY_CONDITIONS = vec_boundary_conditions_test.f90 module_boundary_conditions.o module_utils.o
118 vec_boundary_conditions_test.exe: $(VEC_BOUNDARY_CONDITIONS) Makefile
119 $(FC) $(FFLAGS) -o $@ $(VEC_BOUNDARY_CONDITIONS)
121 w_assembly_test.exe: w_assembly_test.o module_w_assembly.o module_hexa.o $(UTILS) Makefile
122 $(FC) $(FFLAGS) -o w_assembly_test.exe w_assembly_test.o module_w_assembly.o module_utils.o module_hexa.o module_lin_alg.o
124 w_assembly_test.o: w_assembly_test.f90 module_hexa.o module_utils.o module_w_assembly.o Makefile
125 $(FC) $(FFLAGS) -c w_assembly_test.f90
127 module_w_assembly.o: module_w_assembly.f90 module_hexa.o $(UTILS) Makefile
128 $(FC) $(FFLAGS) -c module_w_assembly.f90
130 module_lin_alg.o: module_lin_alg.f90 module_utils.o Makefile
131 $(FC) $(FFLAGS) -c module_lin_alg.f90
133 lin_alg_test.exe: lin_alg_test.f90 $(UTILS) Makefile
134 $(FC) $(LFLAGS) -o $@ lin_alg_test.f90 $(UTILS)
136 module_multigrid.o: module_sweeps.o module_multigrid.f90 module_coarsening.o module_ndt_mult.o module_ndt_assembly.o module_boundary_conditions.o module_common.o module_utils.o Makefile
137 $(FC) $(FFLAGS) -c module_multigrid.f90
139 module_femwind.o: module_femwind.f90 module_multigrid.o module_f_assembly.o module_w_assembly.o module_boundary_conditions.o module_common.o module_utils.o Makefile
140 $(FC) $(FFLAGS) -c module_femwind.f90
142 MSLEEP = \
143 module_msleep.o \
144 msleep.o
146 WRFOUT_MODULES = \
147 $(MSLEEP) \
148 module_netcdf.o \
149 module_wrfout.o \
150 $(UTILS)
152 FEMWIND_MODULES = \
153 module_femwind.o\
154 module_multigrid.o\
155 module_ndt_assembly.o\
156 module_w_assembly.o\
157 module_ndt_mult.o\
158 module_f_assembly.o\
159 module_hexa.o\
160 module_coarsening.o\
161 module_sweeps.o\
162 module_boundary_conditions.o\
163 module_common.o
165 FEMWIND_TEST = femwind_test.f90 $(FEMWIND_MODULES) $(UTILS)
166 femwind_test.exe: $(FEMWIND_TEST) Makefile
167 $(FC) $(FFLAGS) -o $@ $(FEMWIND_TEST) $(LFLAGS)
169 FEMWIND_WRFOUT = femwind_wrfout.f90 $(FEMWIND_MODULES) $(WRFOUT_MODULES)
171 femwind_wrfout.exe: $(FEMWIND_WRFOUT) Makefile
172 $(FC) $(FFLAGS) -o $@ $(FEMWIND_WRFOUT) $(LFLAGS)
174 NETCDF_TEST = netcdf_test.f90 $(WRFOUT_MODULES)
176 netcdf_test.exe: $(NETCDF_TEST) Makefile
177 $(FC) $(FFLAGS) -o $@ $(NETCDF_TEST) $(LFLAGS)
179 msleep.o: msleep.c Makefile
180 $(CC) -c msleep.c
182 module_msleep.o: module_msleep.f90
183 $(FC) $(FFLAGS) -c module_msleep.f90
185 msleep_test.exe: msleep_test.f90 $(MSLEEP)
186 $(FC) -o msleep_test.exe msleep_test.f90 $(MSLEEP) $(LFLAGS)
188 # delete test data files
189 clean_txt:
190 rm -f ../*.txt
192 clean: clean_txt
193 rm -rf *.mod *.o *.exe *.dSYM