[496c607] | 1 | ############################################################### |
---|
| 2 | # |
---|
| 3 | # DJM 2015-09-17 |
---|
| 4 | # This is an evolving, experimental Makefile in which we explore |
---|
| 5 | # the incorporation of libraries - no change in the fundamental FLEXPART |
---|
| 6 | # code, just the use of libraries in compilation |
---|
| 7 | # |
---|
| 8 | ############################################################### |
---|
| 9 | SHELL = /bin/bash |
---|
| 10 | MAIN = FLEXPART_GFORTRAN |
---|
| 11 | |
---|
| 12 | FC = gfortran |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | ############## Conditional compilation for testing ################# |
---|
| 16 | #### These are used for development and testing of .fp file functionality |
---|
| 17 | #### Hopefully they will be obsolete once WO4 is completed |
---|
| 18 | #### |
---|
| 19 | #### For normal FLEXPART usage (no dumping or loading of .fp files), both |
---|
| 20 | #### of the DEFS should be commented out. |
---|
| 21 | #### |
---|
| 22 | #### Users should uncomment only one of the following. They are mutually |
---|
| 23 | #### exclusive |
---|
| 24 | #### |
---|
| 25 | #### Uncommenting GENFPFILESANDTEST will run FLEXPART normally, reading from |
---|
| 26 | #### met files, but every time a met file is processed, a .fp file with the |
---|
| 27 | #### same basename will be created. You will need to edit the destination |
---|
| 28 | #### of the .fp files, FPDIR, in getfields.F90 |
---|
| 29 | |
---|
| 30 | #DEFS = -DGENFPFILESANDTEST |
---|
| 31 | |
---|
| 32 | #### |
---|
| 33 | #### Uncommenting TESTUSEGETFPFIELDS will cause FLEXPART to run from .fp files |
---|
| 34 | #### rather than met files. The path to the .fp files, FPDIR, must be |
---|
| 35 | #### hardcoded in |
---|
| 36 | #### FLEXPART.f90. |
---|
| 37 | |
---|
| 38 | DEFS = -DTESTUSEGETFPFIELDS |
---|
| 39 | |
---|
| 40 | ####################################################################### |
---|
| 41 | |
---|
| 42 | INCPATH = /opt/grib-api/include |
---|
| 43 | |
---|
| 44 | LIBPATH1 = /opt/grib-api/lib |
---|
| 45 | LIBPATH2 = /usr/lib/x86_64-linux-gnu |
---|
| 46 | FFLAGS = -O2 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I$(INCPATH) |
---|
| 47 | LDFLAGS = $(FFLAGS) -L$(LIBPATH2) -L$(LIBPATH1) -L./ -lmetio -lfputil -lgrib_api_f90 -lgrib_api -lm -ljasper |
---|
| 48 | |
---|
| 49 | METIO_LIB = libmetio.a |
---|
| 50 | FPUTIL_LIB = libfputil.a |
---|
| 51 | |
---|
| 52 | METIO_LIB_OBJS = fpmetbinary_mod.o getfields.o \ |
---|
| 53 | fpgridcheck.o getfpfields.o \ |
---|
| 54 | readwind.o readwind_gfs.o readwind_nests.o \ |
---|
| 55 | calcpar.o calcpar_gfs.o calcpar_nests.o \ |
---|
| 56 | gridcheck_gfs.o \ |
---|
| 57 | gridcheck.o \ |
---|
| 58 | gridcheck_nests.o \ |
---|
| 59 | verttransform.o verttransform_gfs.o verttransform_nests.o |
---|
| 60 | |
---|
| 61 | FPUTIL_LIB_OBJS = calcpv.o calcpv_nests.o caldate.o cmapf_mod.o \ |
---|
| 62 | com_mod.o conv_mod.o ew.o flux_mod.o getrb.o getrc.o getvdep.o \ |
---|
| 63 | getvdep_nests.o juldate.o shift_field_0.o obukhov.o obukhov_gfs.o \ |
---|
| 64 | par_mod.o partdep.o pbl_profile.o psih.o psim.o qvsat.o raerod.o \ |
---|
| 65 | richardson.o richardson_gfs.o scalev.o shift_field.o |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | MODOBJS = \ |
---|
| 69 | par_mod.o com_mod.o \ |
---|
| 70 | conv_mod.o hanna_mod.o \ |
---|
| 71 | interpol_mod.o cmapf_mod.o \ |
---|
| 72 | unc_mod.o oh_mod.o \ |
---|
| 73 | xmass_mod.o flux_mod.o \ |
---|
| 74 | point_mod.o outg_mod.o \ |
---|
| 75 | fpmetbinary_mod.o |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | OBJECTS = \ |
---|
| 79 | writeheader.o assignland.o\ |
---|
| 80 | part0.o \ |
---|
| 81 | detectformat.o \ |
---|
| 82 | coordtrafo.o \ |
---|
| 83 | drydepokernel.o random.o \ |
---|
| 84 | erf.o readavailable.o \ |
---|
| 85 | readcommand.o \ |
---|
| 86 | advance.o readdepo.o \ |
---|
| 87 | releaseparticles.o \ |
---|
| 88 | FLEXPART.o readlanduse.o \ |
---|
| 89 | getfields.o init_domainfill.o\ |
---|
| 90 | interpol_wind.o readoutgrid.o \ |
---|
| 91 | interpol_all.o readpaths.o \ |
---|
| 92 | readreceptors.o \ |
---|
| 93 | readreleases.o \ |
---|
| 94 | readspecies.o \ |
---|
| 95 | interpol_misslev.o \ |
---|
| 96 | conccalc.o \ |
---|
| 97 | concoutput.o \ |
---|
| 98 | readOHfield.o\ |
---|
| 99 | timemanager.o \ |
---|
| 100 | interpol_vdep.o interpol_rain.o \ |
---|
| 101 | partoutput.o \ |
---|
| 102 | hanna.o wetdepokernel.o \ |
---|
| 103 | mean.o wetdepo.o \ |
---|
| 104 | hanna_short.o windalign.o \ |
---|
| 105 | hanna1.o initialize.o \ |
---|
| 106 | interpol_all_nests.o \ |
---|
| 107 | interpol_wind_nests.o interpol_misslev_nests.o \ |
---|
| 108 | interpol_vdep_nests.o interpol_rain_nests.o \ |
---|
| 109 | readageclasses.o readpartpositions.o \ |
---|
| 110 | calcfluxes.o fluxoutput.o \ |
---|
| 111 | skplin.o \ |
---|
| 112 | convmix.o calcmatrix.o \ |
---|
| 113 | convmix_gfs.o calcmatrix_gfs.o \ |
---|
| 114 | convect43c.o redist.o \ |
---|
| 115 | sort2.o distance.o \ |
---|
| 116 | centerofmass.o plumetraj.o \ |
---|
| 117 | openouttraj.o \ |
---|
| 118 | distance2.o \ |
---|
| 119 | clustering.o interpol_wind_short.o \ |
---|
| 120 | interpol_wind_short_nests.o shift_field_0.o \ |
---|
| 121 | outgrid_init.o \ |
---|
| 122 | openreceptors.o boundcond_domainfill.o\ |
---|
| 123 | partoutput_short.o readoutgrid_nest.o \ |
---|
| 124 | outgrid_init_nest.o writeheader_nest.o \ |
---|
| 125 | concoutput_nest.o wetdepokernel_nest.o \ |
---|
| 126 | drydepokernel_nest.o zenithangle.o \ |
---|
| 127 | ohreaction.o \ |
---|
| 128 | initial_cond_calc.o initial_cond_output.o \ |
---|
| 129 | dynamic_viscosity.o get_settling.o |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | $(MAIN): $(MODOBJS) $(OBJECTS) $(METIO_LIB) $(FPUTIL_LIB) |
---|
| 133 | $(FC) *.o -o $(MAIN) $(LDFLAGS) |
---|
| 134 | |
---|
| 135 | $(OBJECTS): $(MODOBJS) |
---|
| 136 | |
---|
| 137 | $(METIO_LIB): $(METIO_LIB_OBJS) |
---|
| 138 | ar rcs $@ $^ |
---|
| 139 | rm $^ |
---|
| 140 | |
---|
| 141 | $(FPUTIL_LIB): $(FPUTIL_LIB_OBJS) |
---|
| 142 | ar rcs $@ $^ |
---|
| 143 | rm $^ |
---|
| 144 | |
---|
| 145 | %.o: %.f90 |
---|
| 146 | $(FC) -c $(FFLAGS) $< |
---|
| 147 | |
---|
| 148 | %.o: %.F90 |
---|
| 149 | $(FC) -c $(FFLAGS) $(DEFS) $< |
---|
| 150 | |
---|
| 151 | clean: |
---|
| 152 | rm *.o *.mod *.a |
---|
| 153 | |
---|
| 154 | |
---|