Skip to content

Commit

Permalink
added support for spack-stack on hera
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelissariou1 committed Apr 11, 2024
1 parent ec29995 commit 32a379a
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 12 deletions.
2 changes: 1 addition & 1 deletion NEMS
Submodule NEMS updated from 11482f to b239e2
23 changes: 12 additions & 11 deletions modulefiles/envmodules_intel.hera
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ myDIRS="${myDIRS} . ${APPMODS_DIR}"
####################
### (1) Load all needed environment modules.
module purge
module load cmake

module use /scratch2/STI/coastal/common/apps/modulefiles
module load hpc-common
module use /scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.5.1/envs/unified-env-rocky8/install/modulefiles/Core

#module load hpc-intel/19.0.5.281 hpc-impi
#module load hpc-intel/2020.2 hpc-impi
module load hpc-intel/2022.1.2 hpc-impi
#module load hpc-intel/2022.3.0 hpc-impi
module load stack-intel/2021.5.1
module load stack-intel-oneapi-mpi/2021.5.1

module load hdf5/1.10.9 netcdf/4.7.4
module load proj/4.8.0
module load parmetis/4.0.3
module load esmf/8.3.1
module load cmake/3.23.1

#module load jasper/2.0.32
#module load zlib/1.2.13
#module load libpng/1.6.37

module load hdf5/1.14.0
module load netcdf-c/4.9.2 netcdf-fortran/4.6.0
module load esmf/8.5.0


###################
Expand Down
95 changes: 95 additions & 0 deletions modulefiles/envmodules_intel.hera.cmmb_libs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env bash-*-Shell-script-functions*-

###########################################################################
### Module File to load the required environment modules for the NEMS application
###
### Author: Panagiotis Velissariou <[email protected]>
### Date: June 26 2021
###########################################################################


####################
# Get the directory where the script is located
if [[ $(uname -s) == Darwin ]]; then
myDIRS="$(cd "$(dirname "$(grealpath -s "${BASH_SOURCE[0]}" )" )" && pwd -P)"
else
myDIRS="$(cd "$(dirname "$(realpath -s "${BASH_SOURCE[0]}" )" )" && pwd -P)"
fi
myDIRS="${myDIRS} . ${APPMODS_DIR}"
####################


# This script is responsible for loading modules that are
# compatible with the NUOPC Layer version used in NEMS.


####################
### (1) Load all needed environment modules.
module purge
module load cmake

module use /scratch2/STI/coastal/common/apps/modulefiles
module load hpc-common

#module load hpc-intel/19.0.5.281 hpc-impi
#module load hpc-intel/2020.2 hpc-impi
module load hpc-intel/2022.1.2 hpc-impi
#module load hpc-intel/2022.3.0 hpc-impi

module load hdf5/1.10.9 netcdf/4.7.4
module load proj/4.8.0
module load parmetis/4.0.3
module load esmf/8.3.1


###################
### (2) Set some environments varaiables related to the loaded
### modules and required to compile the NEMS application properly.
funcs="$( find ${myDIRS} -type f -iname "PlatformFuncs" | head -n 1 )"
if [ -f "${funcs}" ]; then
source "${funcs}"

get_env_hdf5
get_env_netcdf
fi
unset funcs myDIRS


########## BEG:: PLATFORM CUSTOMIZED SETTINGS ##########
# Is this needed in all systems?
# If file locking is not allowed in the filesystem, or the
# HDF5 locking mechanism is not compatible with the
# OS locking mechanism, then HDF5 (>=1.10.x) throws errors like
# access denied when trying to READ/WRITE NetCDF files.
# On some platforms HDF5 locking is disabled on other it is not.
# If you experience these problems uncomment the next line
# (this should be done automatically when loading this file - todo).
#export HDF5_USE_FILE_LOCKING=FALSE

if [ -z "${NETCDF_CONFIG}" ]; then
export NETCDF_CONFIG=${NETCDF_HOME:+${NETCDF_HOME}/bin/nc-config}
fi

if [ -z "${NETCDF_INCDIR}" ]; then
export NETCDF_INCDIR=${NETCDF_INC:+${NETCDF_INC}}
if [ -z "${NETCDF_INCDIR}" ]; then
export NETCDF_INCDIR=${NETCDF_HOME:+${NETCDF_HOME}/include}
fi
fi

if [ -z "${NETCDF_LIBDIR}" ]; then
export NETCDF_LIBDIR=${NETCDF_LIB:+${NETCDF_LIB}}
if [ -z "${NETCDF_LIBDIR}" ]; then
export NETCDF_LIBDIR=${NETCDF_HOME:+${NETCDF_HOME}/lib}
fi
fi

if [ -z "${ESMFMKFILE}" ]; then
echo "The variable ESMFMKFILE is not set. Please load the esmf module for your platform"
echo "Exiting ..."
exit 1
else
export ESMFMKFILE=${ESMFMKFILE}
fi
########## END:: PLATFORM CUSTOMIZED SETTINGS ##########

0 comments on commit 32a379a

Please sign in to comment.