# Makefile for TOMAS box model
# questions or comments, email Jeff Pierce, jrpierce@andrew.cmu.edu
###########################################################################

# options
comp = ifort
# to run quickly, use -O2 flag (optimize level 2) or -O if using g77 with no -g flag (for debugger)
# to debug, remove -O2 and add -g flag
#o_flags = -fbacktrace -c -O2 # flags for the compiling of *.o files
#exe_flags = -fbacktrace -O2 # flags for the compiling of *.exe files
#o_flags = -traceback -check all -check bounds -check uninit -c -g # flags for the compiling of *.o files
#exe_flags = -traceback -check all -check bounds -check uninit -g # flags for the compiling of *.exe files
o_flags = -traceback -c -O2 # flags for the compiling of *.o files
exe_flags = -traceback -O2 # flags for the compiling of *.exe files


# groups
# ALH: have added in so4cond and boxchem 10/28/16
box_obj  = box.o	boxinit.o	getlen.o
cond_obj = tmcond.o 	dmdt_int.o  ezcond.o    ezmass.o    \
           getCondSink.o      getMassSink.o     soacond.o
coag_obj = multicoag.o
size_obj = initbounds.o	loginit.o	report.o	speciesmap.o	\
	   storenm.o	aerodiag.o	ezwatereqm.o	eznh3eqm.o	\
	   mnfix.o	scalemom.o	waterso4.o	waternacl.o \
	   so4cond.o boxchem.o hetChem.o 
prop_obj = gasdiff.o	aerodens.o


# executables
box.exe : $(box_obj) $(cond_obj) $(coag_obj) $(size_obj) $(prop_obj) BB192SM9.COM BT263box.COM sizecode.COM makefile
	$(comp)  $(exe_flags) -o box.exe $(box_obj) $(cond_obj) $(coag_obj) $(size_obj) $(prop_obj) $(emis_obj)


# object files
aerodiag.o:aerodiag.f BB192SM9.COM BT263box.COM sizecode.COM makefile
	$(comp) $(o_flags) aerodiag.f
box.o : box.f BB192SM9.COM BT263box.COM sizecode.COM  makefile
	$(comp) $(o_flags) box.f
boxinit.o : boxinit.f BB192SM9.COM BT263box.COM makefile
	$(comp) $(o_flags) boxinit.f
tmcond.o : tmcond.f sizecode.COM makefile
	$(comp) $(o_flags) tmcond.f
ezcond.o : ezcond.f sizecode.COM makefile
	$(comp) $(o_flags) ezcond.f
ezmass.o : ezmass.f sizecode.COM makefile
	$(comp) $(o_flags) ezmass.f
getCondSink.o : getCondSink.f sizecode.COM makefile
	$(comp) $(o_flags) getCondSink.f
getMassSink.o : getMassSink.f sizecode.COM makefile
	$(comp) $(o_flags) getMassSink.f
getlen.o : getlen.f makefile
	$(comp) $(o_flags) getlen.f
multicoag.o : multicoag.f sizecode.COM makefile
	$(comp) $(o_flags) multicoag.f
soacond.o : soacond.f sizecode.COM makefile
	$(comp) $(o_flags) soacond.f
so4cond.o : so4cond.f sizecode.COM makefile
	$(comp) $(o_flags) so4cond.f
boxchem.o : boxchem.f makefile
	$(comp) $(o_flags) boxchem.f
hetChem.o : hetChem.f sizecode.COM makefile
	$(comp) $(o_flags) hetChem.f
dmdt_int.o : dmdt_int.f makefile
	$(comp) $(o_flags) dmdt_int.f
initbounds.o : initbounds.f sizecode.COM makefile
	$(comp) $(o_flags) initbounds.f
loginit.o : loginit.f BB192SM9.COM BT263box.COM sizecode.COM makefile
	$(comp) $(o_flags) loginit.f
report.o : report.f BB192SM9.COM BT263box.COM makefile
	$(comp) $(o_flags) report.f
speciesmap.o : speciesmap.f BB192SM9.COM BT263box.COM makefile
	$(comp) $(o_flags) speciesmap.f
storenm.o : storenm.f sizecode.COM makefile
	$(comp) $(o_flags) storenm.f
ezwatereqm.o : ezwatereqm.f sizecode.COM makefile
	$(comp) $(o_flags) ezwatereqm.f
eznh3eqm.o : eznh3eqm.f sizecode.COM makefile
	$(comp) $(o_flags) eznh3eqm.f
gasdiff.o  : gasdiff.f makefile
	$(comp) $(o_flags) gasdiff.f
aerodens.o : aerodens.f makefile
	$(comp) $(o_flags) aerodens.f
mnfix.o : mnfix.f sizecode.COM makefile
	$(comp) $(o_flags) mnfix.f
scalemom.o : scalemom.f BB192SM9.COM BT263box.COM makefile
	$(comp) $(o_flags) scalemom.f
waterso4.o : waterso4.f makefile
	$(comp) $(o_flags) waterso4.f
waternacl.o : waternacl.f makefile
	$(comp) $(o_flags) waternacl.f
clean :
	rm *.o box.exe




