
function set-roms-gfortran ()
{
    echo Setting environment variables for ROMS with GFORTRAN on CentOS 7

    export FC=gfortran
    export FORT=${FC}

    # CentOS keeps its module files in a non-standard location,
    # so we have to specify the netCDF interface locations
    # explicitly
    export USE_NETCDF4=
    export NETCDF_INCDIR=/usr/lib64/gfortran/modules
    export NETCDF_LIBDIR=/usr/lib64
    export NETCDF_LIBS=-lnetcdff
    
    export MCT_INCDIR=${HOME}/local/include
    export MCT_LIBDIR=${HOME}/local/lib

    export USE_MPIF90=on
    export PATH=/usr/lib64/openmpi/bin:${PATH}
}

function set-roms-cray ()
{
    echo Setting environment variables for ROMS with PrgEnv-cray on the NeSI Cray XC50

    module unload PrgEnv-gnu PrgEnv-intel craype-broadwell
    module load PrgEnv-cray craype-x86-skylake cray-netcdf cray-hdf5

    export FORT=ftn-cray
    export FC=ftn

    export PLATFORM=$(uname -s -m | tr " " "-")-cray

    export USE_NETCDF4=on

    export MCT_INCDIR=${HOME}/local/${PLATFORM}/include
    export MCT_LIBDIR=${HOME}/local/${PLATFORM}/lib
}

function set-roms-intel ()
{
    echo Setting environment variables for ROMS with PrgEnv-intel on the NeSI Cray XC50

    module unload PrgEnv-cray PrgEnv-gnu craype-x86-skylake
    module load PrgEnv-intel craype-broadwell cray-netcdf cray-hdf5

    export FORT=ftn-intel
    export FC=ftn

    export PLATFORM=$(uname -s -m | tr " " "-")-intel

    export USE_NETCDF4=on

    export MCT_INCDIR=${HOME}/local/${PLATFORM}/include
    export MCT_LIBDIR=${HOME}/local/${PLATFORM}/lib
}

function set-roms-gnu ()
{
    echo Setting environment variables for ROMS with PrgEnv-gnu on the NeSI Cray XC50

    module unload PrgEnv-cray PrgEnv-intel craype-x86-skylake
    module load PrgEnv-gnu craype-broadwell cray-netcdf cray-hdf5

    export FORT=ftn-gnu
    export FC=ftn

    export PLATFORM=$(uname -s -m | tr " " "-")-gnu

    export USE_NETCDF4=on

    export MCT_INCDIR=${HOME}/local/${PLATFORM}/include
    export MCT_LIBDIR=${HOME}/local/${PLATFORM}/lib
}


