#! /bin/bash -f

#===============================================================================
# Titan machine specific settings
#===============================================================================

#-------------------------------------------------------------------------------
# Modules
#-------------------------------------------------------------------------------

  source /opt/modules/default/init/bash
  export MODULEPATH=${MODULEPATH}:/ccs/home/norton/.modules
  module rm PrgEnv-intel
  module rm pgi
  module rm PrgEnv-pgi
  module rm PrgEnv-cray
  module rm PrgEnv-gnu
  module rm PrgEnv-pathscale
  module rm intel
  module rm pgi
  module rm cray
  module rm pathscale
  module rm parallel-netcdf
  module rm netcdf
  module rm cmake
# module rm cray-mpich
  module rm cray-mpich2
  module rm cray-libsci
  module rm xt-libsci
  module rm cray-netcdf
  module rm cray-netcdf-hdf5parallel
  module rm cray-parallel-netcdf
    module load PrgEnv-pgi
#   module switch pgi pgi/14.2.0
    module switch pgi pgi/15.10.lustre
    module switch cray-mpich cray-mpich/7.2.2
    module switch cray-libsci cray-libsci/13.0.4
    module load esmf/5.2.0rp2
    module switch atp atp/1.7.5
    module load cudatoolkit

    export CRAY_CPU_TARGET=istanbul
    module load cray-netcdf-hdf5parallel/4.3.3.1
    module load cray-parallel-netcdf/1.5.0
    module load cray-hdf5-parallel
    module load curl/7.30.0
  module load subversion
  module load cmake/2.8.11.2

module list

ulimit -c unlimited
ulimit -s unlimited

# The environment variable below increase the stack size, which is necessary for
# CICE to run threaded on this machine. 
export MPSTKZ=64M
export OMP_STACKSIZE=64M

# Capture logical to physics PE assignment and active environment variable 
# settings
export MPICH_ENV_DISPLAY=1
export MPICH_VERSION_DISPLAY=1
export MPICH_CPUMASK_DISPLAY=1
# export MPICH_RANK_REORDER_DISPLAY=1
