-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.pdyn_beta_calc_LAWRENCIUM
60 lines (47 loc) · 1.65 KB
/
makefile.pdyn_beta_calc_LAWRENCIUM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#################
# Set Variables #
#################
INC_NETCDF = ${NETCDF_DIR}/include
LIB_NETCDF = ${NETCDF_DIR}/lib
LIB_HDF = ${HDF5_DIR}/lib
INC_HDF = ${HDF5_DIR}/include
LIB_FFTW =${FFTW_DIR}
FLAGS += -g -O0 -r8 -ipo -xhost -check bounds -g -traceback -I${INC_NETCDF}
# -I${INC_HDF} # remove as per TACC recommendation
#LDFLAGS = ${FLAGS} -L${LIB_NETCDF} -lnetcdf -lnetcdff\
# -L${LIB_FFTW} -lfftw3\
# -L${LIB_HDF} -lhdf5_hl -lhdf5\
# -lz -lm
# TACC recommendation: Just load netcdf/4.3.2 (do not load hdf5!)
LDFLAGS = ${FLAGS} -Wl,-rpath,${LIB_NETCDF} -L${LIB_NETCDF} -L${LIB_FFTW} -lnetcdff -lnetcdf -lfftw3 -lz
F90 = ifort -c
LD = ifort
src_files := netcdf_mod.f90 calculus_mod.f90 buoyancy_mod.f90 \
invert_tridiagonal.f90 pdyn_beta_calc.f90
obj_files := $(addsuffix .o, $(basename $(src_files)))
mod_files := $(addsuffix .mod,$(basename $(src_files)))
############
# Rules #
############
# Goal Program
pdyn_beta_calc: $(obj_files)
$(LD) -o $@ $(obj_files) ${LDFLAGS}
# Prerequisites for goal
netcdf_mod.o : netcdf_mod.f90
$(F90) $(FLAGS) -o $@ netcdf_mod.f90
netcdf_mod.mod : netcdf_mod.f90 # Note: not set as prereq for goal!
$(F90) $(FLAGS) -o $@ netcdf_mod.f90
calculus_mod.o : calculus_mod.f90
$(F90) $(FLAGS) -o $@ calculus_mod.f90
invert_tridiagonal.o : invert_tridiagonal.f90
$(F90) $(FLAGS) -o $@ invert_tridiagonal.f90
buoyancy_mod.o : buoyancy_mod.f90 calculus_mod.o \
invert_tridiagonal.o
$(F90) $(FLAGS) -o $@ buoyancy_mod.f90
pdyn_beta_calc.o : pdyn_beta_calc.f90 netcdf_mod.o \
buoyancy_mod.o
$(F90) $(FLAGS) pdyn_beta_calc.f90
.PHONY: clean
clean:
-rm $(obj_files)
-rm $(mod_files)