# configure.upp
#
# 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 then rerun configure.
#

SHELL           	=       /bin/sh

LDFLAGS_MPI             =     # to be overridden later

#### Architecture specific settings ####


WRF_LIB_EXTRA = -L$(WRF_DIR)/external/RSL_LITE -lrsl_lite

# Settings for Linux x86_64, gfortran compiler  (dmpar)#
FORMAT_FREE = -ffree  

SFC     = ftn
SF90    = ftn 
# $(FORMAT_FREE)
SCC     = cc

DM_FC    = ftn 
DM_F90   = ftn $(FORMAT_FREE)
DM_CC    = cc 

FC      = $(DM_FC)
F90     = $(DM_F90)
CC      = $(DM_CC)
CPP     = /lib/cpp

LINUX_OBJ  = 
BYTE_ORDER = UPPLITTLEENDIAN
SIZE_I4R8  = -s integer32 -s real64
SIZE_I8R8  = -s default64
SIZE_I4R4  = -s default32
SIZE       =  

PPDEFINE   = -DCOMMCODE -DLINUX -D$(BYTE_ORDER)
FPPDEFINE  = $(PPDEFINE)

FDEBUG  = -G0 -O0 -embZ -Ktrap=fp 
CRTMDBUG=
CDEBUG  = -G0 -O0 -embZ -c

FOPT    = -O2 -h flex_mp=tolerant -embZ -c
CRTMOPT =
COPT    = -O2 -h flex_mp=tolerant -embZ -c
FC_FLAGS = $(FOPT) -c

CPP_FLAGS = -P -traditional-cpp $(FPPDEFINE)
INC_FLAGS =
LDFLAGS   = -h byteswapio 
FFLAGS    = $(FPPDEFINE) $(SIZE) $(FOPT) -x conditional_omp
CFLAGS    = $(PPDEFINE) -D_OPENMP $(COPT) -c
ARFLAGS   =

FFLAGS_CRTM = -static $(SIZE) $(FOPT) -embZ -c
FL_CRTM     =

###########################################################
#
#	Macros, these should be generic for all machines
LN		=   ln -sf
MAKE  =   make
RM		=   /bin/rm -f
CP		=   /bin/cp
MV              =   /bin/mv
AR		=   ar ru

WRF_DIR         =    /lustre_xc50/io/WRFTMP/src/UPPV3.2/../WRFV3
WRF_LIB2        =    
NETCDFPATH      =    ${NETCDF_DIR}
NETCDFLIBS      =    -lnetcdff -lnetcdf

COMMS_ADD_OBJ   =    
COMMS_ADD_OBJST =    
COMMS_LIB       =    

SERIAL_MPI_STUB =    
SERIAL_MPI_LIB  =    

GRIB2SUPT_LIB   =    -L/cray_home/local/lib -lpng -lz -ljasper
GRIB2SUPT_INC   =    -I/cray_home/local/include/jasper

BINDIR          =    /lustre_xc50/io/WRFTMP/src/UPPV3.2/bin
INCMOD          =    /lustre_xc50/io/WRFTMP/src/UPPV3.2/include
LIBDIR          =    /lustre_xc50/io/WRFTMP/src/UPPV3.2/lib

WRF_INCLUDE     = -I$(WRF_DIR)/frame


WRF_LIB         = -L$(WRF_DIR)/main  -lwrflib \
                  -L$(WRF_DIR)/external/io_int -lwrfio_int \
                  -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
                  -L$(WRF_DIR)/external/io_pnetcdf -lwrfio_pnf \
                  -L$(WRF_DIR)/external/io_pnetcdf -lwrfio_pnf \
                  -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
                  -L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
                  -L$(WRF_DIR)/external/esmf_time_f90 -lesmf_time \
                  -L$(WRF_DIR)/external/fftpack/fftpack5 -lfftpack

WRF_MODS        = $(WRF_DIR)/frame/module_internal_header_util.o \
                  $(WRF_DIR)/frame/pack_utils.o \
                  $(WRF_DIR)/frame/module_machine.o \
		  $(WRF_DIR)/frame/module_wrf_error.o \
		  $(WRF_DIR)/frame/wrf_debug.o

#
# These files may be changed to enable other files with the same 
# functions definitions, but different logic.  This is typically
# how backward compatibilty is achieved for the community code.
INITPOST_NMM_BIN_MPIIO = INITPOST_NMM_BIN_MPIIO_IJK.f
GRIBIT = GRIBIT.f
CALRAD = CALRAD_WCLOUD_crtm.f

# There is probably no reason to modify these rules
.SUFFIXES : .c .f .f90
.c.o:
	$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS)  $<

.f.o:
	$(FC) -c $(FFLAGS) $(EXTRA_FFLAGS) $<

.f90.o :
	$(F90) -c $(FFLAGS) $(EXTRA_FFLAGS) $<

.F.o:
	$(FC) -c $(FFLAGS) $(EXTRA_FFLAGS) $(FORMAT_FREE) $<
#	$(CPP) $(CPP_FLAGS) $< > $*.f

.F90.o:
	$(F90) -c $(FFLAGS) $(EXTRA_FFLAGS) $<
#	$(CPP) $(CPP_FLAGS) $< > $*.f90
