SHELL=/bin/sh
############################################################################
#
#     Makefile for glmp_gridpost_2p5
#     Use: 
#      make        - build the executable
#      make clean  - start with a clean slate
#
#     Module loaded before building the executable:
#      modulefiles/glmp/v1.1.0
#
#     History:
#      05/19/2015 Ghirardelli - modified for NCO standards
#
############################################################################
#
# This makefile was produced by /usr/bin/fmgen at 03:45:31 PM on 03/07/96
# If it is invoked by the command line
#	make -f makefile
# it will compile the fortran modules indicated by SRCS into the object
# modules indicated by OBJS and produce an executable named a.out.
#
# To remove all the objects but leave the executables use the command line
#	make -f makefile clean
#
# To remove everything but the source files use the command line
#	make -f makefile clobber
#
# To remove the source files created by /usr/bin/fmgen and this makefile
# use the command line
#	make -f makefile void
#
# The parameters SRCS and OBJS should not need to be changed.  If, however,
# you need to add a new module add the name of the source module to the
# SRCS parameter and add the name of the resulting object file to the OBJS
# parameter.  The new modules are not limited to fortran, but may be C, YACC,
# LEX, or CAL.  An explicit rule will need to be added for PASCAL modules.
#
SRCS=	gridpost.f u202.f pred23.f pred24.f rdpred.f option.f ckbounds.f grduntcvt.f cmpdpgr.f cmpwdrgr.f ckwspdgr.f ckwndgst.f ckgpop.f cmpqpfgr.f hrrrgrd.f ratlgrd.f cnvtgrd.f w3fb11.f w3fb12.f mrmsqc.f ltgsum.f \
	rapgrd.f hrrrgrd5.f pcpeff.f cycavg3_rap.f divw1.f extrap.f functions.f kindex.f ltgthermo.f mdiv.f tpcp3.f optn2.f

OBJS=	gridpost.o u202.o pred23.o pred24.o rdpred.o option.o ckbounds.o grduntcvt.o cmpdpgr.o cmpwdrgr.o ckwspdgr.o ckwndgst.o ckgpop.o cmpqpfgr.o hrrrgrd.o ratlgrd.o cnvtgrd.o w3fb11.o w3fb12.o mrmsqc.o ltgsum.o \
        rapgrd.o hrrrgrd5.o pcpeff.o cycavg3_rap.o divw1.o extrap.o functions.o kindex.o ltgthermo.o mdiv.o tpcp3.o optn2.o

#
# Tunable parameters
#
# FC		Name of the fortran compiling system to use
# LDFLAGS	Flags to the loader
# LIBS		List of libraries
# CMD		Name of the executable
#
FC =            ${COMP}    # Use Intel FORTRAN Compiler, ifort
LDFLAGS =
#LIBS = ${LMPMDL_LIB4} ${LMP_LIB4} ${W3NCO_LIB4}
LIBS =          -liomp5 ${LMPMDL_LIB4} ${LMP_LIB4} ${W3NCO_LIB4} ${W3EMC_LIB4}
CMD =           lmp_gridpost_2p5

PROFLIB =

#FFLAGS = -O3 -nofree -xHost -i4 -real-size 32 -fpscomp logicals -fp-model strict -assume byterecl
FFLAGS =        -O3 -nofree -integer-size 32 -real-size 32 -auto -fpscomp logicals -fp-model strict -assume byterecl -align array64byte -xHost -qopenmp
DEBUG =         -DDEBUG -g -traceback -check all

# Lines from here on down should not need to be changed.  They are the
# actual rules which make uses to build a.out.
#
all:		$(CMD)

$(CMD):		$(OBJS)
	$(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)

# Make the profiled version of the command and call it a.out.prof
#
$(CMD).prof:	$(OBJS)
	$(FC) $(LDFLAGS) -o $(@) $(OBJS) $(PROFLIB) $(LIBS)

clean:
	-rm -f $(OBJS)

clobber:	clean
	-rm -f $(CMD) $(CMD).prof

void:	clobber
	-rm -f $(SRCS) makefile