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

# options
comp = gfortran
# 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 = -c -O2 # flags for the compiling of *.o files
exe_flags = -O2 # flags for the compiling of *.exe files


# groups
box_obj  = box.o	boxinit.o	getlen.o	wallloss.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 \
       addbackground.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
addbackground.o: addbackground.f BB192SM9.COM BT263box.COM sizecode.COM makefile
	$(comp) $(o_flags) addbackground.f
wallloss.o: wallloss.f90 makefile
	$(comp) $(o_flags) wallloss.f90
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
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




