-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·81 lines (65 loc) · 3.22 KB
/
makefile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Start of the makefile
# Defining variables
FC = gfortran
# FC = ifort
CPFLAGS =
CPFLAGS += -Dno_intr_findloc # need to use in cluster
# CPFLAGS += -Dshow_PSDiter # showing iteration process during PSD calculation
# CPFLAGS += -Dparallel_ON # testing parallelization
# CPFLAGS += -Dnpar_in=1 # number of threads for parallelization
# CPFLAGS += -Dnpar_in=1 # number of threads for parallelization
# CPFLAGS += -Dparpsd_chk # checking parallelization results
# CPFLAGS += -Dksld_chk # checking rate consts for sld species
CPFLAGS += -DolddustPSD # using old PSD for dust (not user input but prescribed one)
# CPFLAGS += -Ddisp_cnst=6.59754e-2 # forcing constant and common dispersion for aqueous species
# CPFLAGS += -Dnrec_prof_in=120 # number of profile records
# CPFLAGS += -Derrmtx_printout #
CPFLAGS += -Dmod_basalt_cmp # using basalt composition defined in <basalt_define.h>
# CPFLAGS += -Ddef_flx_save_alltime # flux reported each integration (costs lots of bites)
# CPFLAGS += -Dfull_flux_report # output all cumulative flux
# CPFLAGS += -Ddisp_lim # limiting the display of results
# CPFLAGS += -Ddiss_only # not allowing precipitation of minerals
# CPFLAGS += -Dlim_minsld # limiting mineral lowest conc.
# CPFLAGS += -Dporoiter # do iteration for porosity
# CPFLAGS += -Dcalcw_full # fully coupled w calcuation
# CPFLAGS += -Ddispiter # showing PSD flux in each iteration
# CPFLAGS += -DdispPSDiter # showing PSD flux in each iteration
# CPFLAGS += -Dcalcporo_full # fully coupled poro calcuation
# CPFLAGS += -Diwtypein=0 # uplift type 0--cnst w, 1-- cnst poro*w, 2-- cnst (1-poro)*w, 3--- w-flexible, if not defined 0 is taken
ifeq ($(FC),gfortran)
# CFLAGS = -fcheck=all -g -O3
# CFLAGS = -Wall -O3 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace
# CFLAGS = -Wall -O3 -g -fcheck=all -fbacktrace
CFLAGS = -fimplicit-none -Wall -Wline-truncation -Wcharacter-truncation -Wsurprising \
-Waliasing -Wimplicit-interface -Wunused-parameter -fwhole-file -fcheck=all -std=gnu -pedantic -fbacktrace -O3
endif
ifeq ($(FC),ifort)
CFLAGS = -O3 -heap-arrays -g -traceback -check bounds -fp-stack-check -gen-interfaces -warn interfaces -check arg_temp_created
endif
# LDFLAGS = -L/usr/local/lib
LDFLAGS =
LIBS = -lopenblas
ifneq (,$(findstring -Dmod_basalt_cmp,$(CPFLAGS)))
# Found -Dmod_basalt_cmp
INC = -I/storage/coda1/p-creinhard3/0/ykanzaki3/PyWeath/data
else
# Not found
INC =
endif
ifneq (,$(findstring -Dparallel_ON,$(CPFLAGS)))
# Found -Dparallel_ON
CFLAGS += -fopenmp
else
# Not found
endif
OBJS = scepter.o
SRC = scepter.f90
PROGRAM = scepter
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
$(FC) $(OBJS) -o $(PROGRAM) -cpp $(CPFLAGS) $(CFLAGS) $(LIBS) $(LDFLAGS) $(INC)
$(OBJS): $(SRC)
$(FC) $(SRC) -c -cpp $(CPFLAGS) $(CFLAGS) $(LIBS) $(LDFLAGS) $(INC)
clean:; rm -f *.o *~ $(PROGRAM)
blank:; truncate -s 0 *.out
cleanall:; rm -f *.o *.out *~ $(PROGRAM)