makefile.gfortran.fptest 4.56 KB
Newer Older
Don Morton's avatar
Don Morton committed
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
###############################################################
#
# DJM 2015-09-17 
# This is an evolving, experimental Makefile in which we explore
# the incorporation of libraries - no change in the fundamental FLEXPART
# code, just the use of libraries in compilation
#
###############################################################
SHELL = /bin/bash
MAIN = FLEXPART_GFORTRAN

FC       = gfortran


##############   Conditional compilation for testing  #################
####  These are used for development and testing of .fp file functionality
####  Hopefully they will be obsolete once WO4 is completed
####
####  For normal FLEXPART usage (no dumping or loading of .fp files), both
####  of the DEFS should be commented out.
####  
####  Users should uncomment only one of the following.  They are mutually
####  exclusive 
####  
####  Uncommenting GENFPFILESANDTEST will run FLEXPART normally, reading from
####  met files, but every time a met file is processed, a .fp file with the 
####  same basename will be created.  You will need to edit the destination
####  of the .fp files, FPDIR, in getfields.F90

#DEFS = -DGENFPFILESANDTEST 

####
####  Uncommenting TESTUSEGETFPFIELDS will cause FLEXPART to run from .fp files
####  rather than met files.  The path to the .fp files, FPDIR, must be 
####  hardcoded in
####  FLEXPART.f90. 

DEFS = -DTESTUSEGETFPFIELDS 

#######################################################################

INCPATH  = /opt/grib-api/include

LIBPATH1 = /opt/grib-api/lib
LIBPATH2 = /usr/lib/x86_64-linux-gnu
FFLAGS   =   -O2 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I$(INCPATH)
LDFLAGS  = $(FFLAGS) -L$(LIBPATH2) -L$(LIBPATH1) -L./ -lmetio -lfputil -lgrib_api_f90 -lgrib_api -lm -ljasper

METIO_LIB = libmetio.a
FPUTIL_LIB = libfputil.a

METIO_LIB_OBJS = fpmetbinary_mod.o getfields.o \
fpgridcheck.o getfpfields.o \
readwind.o readwind_gfs.o readwind_nests.o \
calcpar.o calcpar_gfs.o calcpar_nests.o    \
gridcheck_gfs.o \
gridcheck.o \
gridcheck_nests.o \
verttransform.o verttransform_gfs.o verttransform_nests.o

FPUTIL_LIB_OBJS = calcpv.o calcpv_nests.o caldate.o cmapf_mod.o \
com_mod.o conv_mod.o ew.o flux_mod.o getrb.o getrc.o getvdep.o \
getvdep_nests.o juldate.o shift_field_0.o obukhov.o obukhov_gfs.o \
par_mod.o partdep.o pbl_profile.o psih.o psim.o qvsat.o raerod.o \
richardson.o richardson_gfs.o scalev.o shift_field.o


MODOBJS = \
par_mod.o               com_mod.o \
conv_mod.o              hanna_mod.o \
interpol_mod.o          cmapf_mod.o \
unc_mod.o               oh_mod.o \
xmass_mod.o             flux_mod.o \
point_mod.o             outg_mod.o \
fpmetbinary_mod.o


OBJECTS = \
writeheader.o           assignland.o\
part0.o \
detectformat.o \
coordtrafo.o            \
drydepokernel.o         random.o \
erf.o                   readavailable.o \
readcommand.o \
advance.o               readdepo.o \
releaseparticles.o      \
FLEXPART.o              readlanduse.o \
getfields.o             init_domainfill.o\
interpol_wind.o         readoutgrid.o \
interpol_all.o          readpaths.o \
readreceptors.o \
readreleases.o \
readspecies.o \
interpol_misslev.o  \
conccalc.o              \
concoutput.o            \
readOHfield.o\
timemanager.o \
interpol_vdep.o         interpol_rain.o \
partoutput.o \
hanna.o                 wetdepokernel.o \
mean.o                  wetdepo.o \
hanna_short.o           windalign.o \
hanna1.o                initialize.o \
interpol_all_nests.o \
interpol_wind_nests.o   interpol_misslev_nests.o \
interpol_vdep_nests.o   interpol_rain_nests.o \
readageclasses.o        readpartpositions.o \
calcfluxes.o            fluxoutput.o \
skplin.o \
convmix.o               calcmatrix.o \
convmix_gfs.o		calcmatrix_gfs.o \
convect43c.o               redist.o \
sort2.o                 distance.o \
centerofmass.o          plumetraj.o \
openouttraj.o           \
distance2.o \
clustering.o            interpol_wind_short.o \
interpol_wind_short_nests.o shift_field_0.o \
outgrid_init.o \
openreceptors.o         boundcond_domainfill.o\
partoutput_short.o      readoutgrid_nest.o \
outgrid_init_nest.o     writeheader_nest.o \
concoutput_nest.o       wetdepokernel_nest.o \
drydepokernel_nest.o    zenithangle.o \
ohreaction.o            \
initial_cond_calc.o     initial_cond_output.o \
dynamic_viscosity.o     get_settling.o


$(MAIN): $(MODOBJS) $(OBJECTS) $(METIO_LIB) $(FPUTIL_LIB)
	$(FC) *.o -o $(MAIN) $(LDFLAGS)

$(OBJECTS): $(MODOBJS)

$(METIO_LIB): $(METIO_LIB_OBJS)
	ar rcs $@ $^
	rm $^

$(FPUTIL_LIB): $(FPUTIL_LIB_OBJS)
	ar rcs $@ $^
	rm $^

%.o: %.f90
	$(FC) -c $(FFLAGS) $<

%.o: %.F90
	$(FC) -c $(FFLAGS) $(DEFS) $<

clean:
	rm *.o *.mod *.a