######################################################################
#
#   Makefile for CMAQ2CAMx v2
#
#   DIRECTORIES:
#
#     IOAPI_INC  - I/O-API include file directory
#     IOAPI_LIB  - I/O-API library file directory
#     NETCDF_LIB - NetCDF library file directory
#
######################################################################

#IOAPI_INC  = /garnet/home/wdx/lib/x86_64/ifc/ioapi_3/ioapi/fixed_src 
#IOAPI_INC = /garnet/local/apps/ioapi-3.1/gcc-4.4.7/ioapi/fixed_src/
#IOAPI_LIB  = /garnet/home/wdx/lib/x86_64/ifc/ioapi_3/Linux2_x86_64ifort 
#IOAPI_LIB = /garnet/local/apps/ioapi-3.1/gcc-4.4.7/lib/
#NETCDF_LIB = /garnet/local/apps/netcdf-4.1.2/gcc-4.4.7/lib
#PVM3_LIB = /garnet/local/apps/pvm3/lib
IOAPI_INC  =  /garnet/home/wdx/lib/src/ioapi_3/ioapi/fixed_src
#IOAPI_LIB  = /vortex/work/wdx/tools/ioapi_3/Linux2_ia64ifort
#IOAPI_INC  = /orchid/share/em_v4/subsys/ioapi/fixed_src
IOAPI_LIB  = /garnet/home/wdx/lib/x86_64/ifc/ioapi_3/Linux2_x86_64ifort
NETCDF_LIB = /garnet/home/wdx/lib/x86_64/ifc/netcdf-3.6.3/lib


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

FC  = ifort 
OPT = -convert big_endian
#OPT = -O2 -pc 64
#LIB = -L$(IOAPI_LIB) -lioapi -L$(NETCDF_LIB) -lnetcdf -lpvm3 -L$(PVM3_LIB) -lnetcdff
LIB =  -L$(IOAPI_LIB) -lioapi -L$(NETCDF_LIB) -lnetcdf
INC = -I$(IOAPI_INC)


.PHONY: all clean

all : spcmap cmaq2uam ptht pthtq


spcmap : spcmap.o
	$(FC) $(OPT) -o $@ $^ $(LIB)

cmaq2uam : cmaq2uam.o
	$(FC) $(OPT) -o $@ $^ $(LIB)

ptht : ptht.o
	$(FC) $(OPT) -o $@ $^

pthtq : pthtq.o
	$(FC) $(OPT) -o $@ $^ $(LIB)

.f.o :
	$(FC) $(INC) $(OPT) -c $<

clean :
	rm -f *.o


