######################################################################
#
#   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_LIB  = /garnet/home/wdx/lib/x86_64/ifc/ioapi_3/Linux2_x86_64ifort 
NETCDF_LIB = /usr/local/netcdf-4.0/lib 

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

FC  = ifort
#OPT = -O2 -pc 64 -Mdalign -Mnoframe -byteswapio -Mlfs -Wl,-Bstatic
OPT = -convert big_endian 
LIB = -L$(IOAPI_LIB) -lioapi -L$(NETCDF_LIB) -lnetcdf -lnetcdff
INC = -I$(IOAPI_INC)


.PHONY: all clean

all : spcmap cmaq2uam ptht


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

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

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

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

clean :
	rm -f *.o


