#
#     ##################################################################
#     ##################################################################
#     ######                                                      ######
#     ######      Advanced Regional Prediction System (ARPS)      ######
#     ######                   Version 5.0                        ######
#     ######                                                      ######
#     ######                     Developed by                     ######
#     ######     Center for Analysis and Prediction of Storms     ######
#     ######                University of Oklahoma                ######
#     ######                                                      ######
#     ##################################################################
#     ##################################################################
#
#=======================================================================
#
#  PURPOSE: This makefile generates the JOINWRF executable
#
#  AUTHOR:  Yunheng Wang
#           9/28/2003
#
#  Modification history:
#
#
#  OTHER INFORMATION:
#
#=======================================================================

INCFILE = /dev/null

#-----------------------------------------------------------------------
#
# Default names of the loader and tar, can be replaced on the command
# line for other system
#
#-----------------------------------------------------------------------

FTN   = pgf90
LDR   = $(FTN)
CC    = cc
CPP   = cpp

TAR = tar
RM  = rm

#-----------------------------------------------------------------------
#
# Compiler Flag of Options. The default is for AIX Fortran xlf.
#
#-----------------------------------------------------------------------

FFLAGS = -I/usr/local/netcdf/include -O -byteswapio
LDFLAGS =

FREEFLAGS  = -Mfree  -g -Mbounds -Ktrap=fp
LIBS       = -L/usr/local/netcdf/lib -lnetcdf

#-----------------------------------------------------------------------
#
# Dependencies
#
#-----------------------------------------------------------------------
.SUFFIXES: $(SUFFIXES) .f90

.f.o:
	$(FTN) $(FFLAGS) $(FIXFLAGS) -c $<
.f90.o:
	$(FTN) $(FFLAGS) $(FREEFLAGS) -c $<
.c.o:
	$(CC)  $(CFLAGS) -c $<

#-----------------------------------------------------------------------
#
# Executable to be generated by this make file:
#
#-----------------------------------------------------------------------

JOINWRFEXE = joinwrf

JOINWRFOBJS = joinwrf.o fjoinwrf.o timelib3d.o

#-----------------------------------------------------------------------
#
# Set Default
#
#-----------------------------------------------------------------------

default: $(JOINWRFEXE)

#-----------------------------------------------------------------------
#
# Compile and link
#
#-----------------------------------------------------------------------


$(JOINWRFEXE): $(JOINWRFOBJS) 
	$(LDR) $(LDFLAGS) -o $@ $(JOINWRFOBJS) $(LIBS)
	@ls -l $(JOINWRFEXE)

#-----------------------------------------------------------------------
#
# Remove the object code for individual programs
#
#-----------------------------------------------------------------------

clean:
	-$(RM) -f $(JOINWRFEXE) $(JOINWRFOBJS)

#-----------------------------------------------------------------------
#
# Object code dependency list:
#
#-----------------------------------------------------------------------
