# configure.nps
#
# This file was automatically generated by the configure script in the
# top level directory. You may make changes to the settings in this
# file but be aware they will be overwritten each time you run configure.
# Ordinarily, it is necessary to run configure once, when the code is
# first installed.
#
# To permanently change options, change the settings for your platform
# in the file arch/configure.defaults, the preamble, and the postamble -
# then rerun configure.
#

.SUFFIXES: .F90 .f90 .F .f .c .o

SHELL                   = /bin/sh

COMPRESSION_LIBS        = ${JASPER_LIB} \
                          ${PNG_LIB} \
                          ${Z_LIB}

COMPRESSION_INC         = -I${JASPER_INC} \
                          -I${PNG_INC} \
                          -I${Z_INC}

FDEFS                   = -DUSE_JPEG2000 -DUSE_PNG

NCARG_LIBS              =
NCARG_LIBS2             =

DIO                     = $(DEV_TOP)/dio
DIO_INC                 = -I${DIO}
DIO_LIBS                = -L${DIO} -ldio

G2_LIBS                 = ${G2_LIB4}
G2_INCMOD               = -I${G2_INC4}

W3_LIBS                 = ${W3NCO_LIB4} ${W3EMC_LIB4}
W3D_LIBS                = ${W3NCO_LIBd} ${W3EMC_LIBd}
IP_LIBS                 = ${IP_LIBd}
IP_INCMOD               = -I${IP_INCd}
SP_LIBS                 = ${SP_LIB4}
SIGIO_LIBS              = ${SIGIO_LIB4}
SIGIO_INCMOD            = -I${SIGIO_INC4}

BACIO_LIBS              = ${BACIO_LIB4}

#NEMSIO_INC              = -I${NEMSIO_INC}
NEMSIO_LIBS             = ${NEMSIO_LIB}

LANDSFCUTIL_INC         = -I${LANDSFCUTIL_INCd}
LANDSFCUTIL_LIBS        = ${LANDSFCUTIL_LIBd}

#NETCDF_INC              = -I${NETCDF_INC}
NETCDF_LIB              = ${NETCDF_LDFLAGS_F} ${NETCDF_LDFLAGS_C}


# Listing of options that are usually independent of machine type.
# When necessary, these are over-ridden by each architecture.

ARFLAGS =
PERL    = perl
RANLIB  = echo

#### Architecture specific settings ####
# Settings for PC Linux x86_64 (dell), Intel(ifort) compiler, DM parallel
#
#FC              =       mpiifort -O3 -fp-model strict -g # -debug all -check all -O0 -ftrapuv -fpe0
FC              =       ftn -O3 -fp-model strict -g # -debug all -check all -O0 -ftrapuv -fpe0
#SFC             =       ifort -O3 -fp-model strict -g # -debug all -check all -O0 -ftrapuv -fpe0
SFC             =       ftn -O3 -fp-model strict -g # -debug all -check all -O0 -ftrapuv -fpe0
FFLAGS          =       -FR -convert big_endian -assume noold_ldout_format
F77FLAGS        =       -convert big_endian -assume noold_ldout_format
FNGFLAGS        =       $(FFLAGS)
R8              =       -r8
LDFLAGS         =       -qopenmp -auto
#CC              =       mpiicc
#SCC             =       icc
CC              =       cc
SCC             =       cc
CFLAGS          =       -O
CPP             =       /usr/bin/cpp -P -traditional
CPPFLAGS        =       -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DIO_BINARY -DIO_GRIB1 -D_MPI -DBIT32

#########################################################
#
#	Macros, these should be generic for all machines

LN		=	ln -sf
MAKE		=	make -i -r
RM		= 	/bin/rm -f
CP		= 	/bin/cp
AR		=	ar ru

.IGNORE:
.SUFFIXES: .c .f90 .F90 .f .F .o

#	There is probably no reason to modify these rules

.c.o:
	$(RM) $@
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<

.f90.o:
	$(RM) $@ $*.mod
	$(CP) $< $*.f
	$(FC) $(FFLAGS) $(DIO_INC) -I$(NEMSIO_INC) $(G2_INCMOD) -I$(NETCDF_INC) -c $*.f
	$(RM) $*.f

.f.o:
	$(RM) $@ $*.mod
	$(FC) $(F77FLAGS) -c $<

.F90.o:
	$(RM) $@ $*.mod
	$(CPP) $(CPPFLAGS) $(FDEFS) $< > $*.f
	$(FC) $(FFLAGS) $(DIO_INC) -I$(NEMSIO_INC) $(G2_INCMOD) -I$(NETCDF_INC) -c $*.f
	$(RM) $*.f

.F.o:
	$(RM) $@ $*.mod
	$(CPP) $(CPPFLAGS) $(FDEFS) $< > $*.f
	$(FC) $(F77FLAGS) $(DIO_INC) -I$(NEMSIO_INC) $(G2_INCMOD) -I$(NETCDF_INC) -c $*.f
	$(RM) $*.f