export EW_HOME=/earthworm
export EW_VERSION=trunk
EW_RUN_DIR=$EW_HOME/run_working

# this next env var is required if you run statmgr:
export SYS_NAME=`hostname`

# Set environment variables used by earthworm modules at run-time
# Path names must end with the slash "/"
export EW_INSTALLATION="INST_DPSN"
export EW_PARAMS="${EW_RUN_DIR}/params/"
export EW_LOG="${EW_RUN_DIR}/log/"
export EW_DATA_DIR="${EW_RUN_DIR}/data/"


#set path=( ${EW_HOME}/${EW_VERSION}/bin $path )
export PATH="$EW_HOME/$EW_VERSION/bin:$PATH"


# Set environment variables for compiling earthworm modules
# add in -m32 if you are running a 64 bit linux architecture! Some EW codes may not work otherwise.
#
export GLOBALFLAGS="-Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I${EW_HOME}/${EW_VERSION}/include"
export PLATFORM="LINUX"

export LINK_LIBS="-lm -lpthread"
export KEEP_STATE=""

# Set initial defaults
export CFLAGS=$GLOBALFLAGS
export CPPFLAGS=$GLOBALFLAGS
# be explicit about which compiler to use

export CC=`which gcc`
export CXX=g++
export CXXFLAGS=$GLOBALFLAGS

# Auto-detect fortran compiler and flags
# We simply use whichever we find first in: g77, f77, gfortran
export FFLAGS=""
if which gfortran 1> /dev/null 2>&1
then
    export FC=`which gfortran`
elif which g77 1> /dev/null 2>&1
then
    export FC=`which g77`
elif which f77 1> /dev/null 2>&1
then
    export FC=`which f77`
fi

# Alternatively, you can hard-code values here:
#export FC='...'
#export FFLAGS='...'
