Skip to content

Commit

Permalink
update envmodules
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelissariou1 authored and zacharyburnett committed May 13, 2021
1 parent a3be54f commit 8e96477
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 23 deletions.
101 changes: 101 additions & 0 deletions modulefiles/PlatformFuncs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
###########################################################################
### NEMS Build System
### PlatformFuncs :: Utility functions
###
### Author: Panagiotis Velissariou <panagiotis.velissariou@noaa.gov>
###########################################################################

get_env_hdf5()
{
# if [ "${_found_hdf5:-FALSE}" = "FALSE" ]; then
_found_hdf5=FALSE
if [ -n "${HDF5:+1}" ]; then
HDF5="${HDF5}"
export HDF5HOME="${HDF5}"
HDF5_DIR="${HDF5}"
HDF5_PATH="${HDF5}"
HDF5_ROOT="${HDF5}"
_found_hdf5=TRUE
else
for _var in DIR HOME PATH ROOT
do
_var_val="$(eval "echo \"\$HDF5${_var}\"")"
if [ -n "${_var_val:+1}" ]; then
HDF5="${_var_val}"
export HDF5HOME="${_var_val}"
HDF5_DIR="${_var_val}"
HDF5_PATH="${_var_val}"
HDF5_ROOT="${_var_val}"
_found_hdf5=TRUE
break
else
_var_val="$(eval "echo \"\$HDF5_${_var}\"")"
if [ -n "${_var_val:+1}" ]; then
HDF5="${_var_val}"
export HDF5HOME="${_var_val}"
HDF5_DIR="${_var_val}"
HDF5_PATH="${_var_val}"
HDF5_ROOT="${_var_val}"
_found_hdf5=TRUE
break
fi
fi
done
fi
unset _name _var _var_val
# fi

return 0
}


get_env_netcdf()
{
# if [ "${_found_netcdf:-FALSE}" = "FALSE" ]; then
export _found_netcdf=FALSE
for _name in NETCDF NETCDF4 NetCDF NetCDF4
do
if [ "${_found_netcdf}" = "TRUE" ]; then
break
fi

_var_val="$(eval "echo \"\$${_name}\"")"
if [ -n "${_var_val:+1}" ]; then
export NETCDF="${_var_val}"
export NETCDFHOME="${_var_val}"
export NETCDF_DIR="${_var_val}"
export NETCDF_PATH="${_var_val}"
export NETCDF_ROOT="${_var_val}"
export _found_netcdf=TRUE
else
for _var in DIR HOME PATH ROOT
do
_var_val="$(eval "echo \"\$${_name}${_var}\"")"
if [ -n "${_var_val:+1}" ]; then
export NETCDF="${_var_val}"
export NETCDFHOME="${_var_val}"
export NETCDF_DIR="${_var_val}"
export NETCDF_PATH="${_var_val}"
export NETCDF_ROOT="${_var_val}"
export _found_netcdf=TRUE
break
else
_var_val="$(eval "echo \"\$${_name}_${_var}\"")"
if [ -n "${_var_val:+1}" ]; then
export NETCDF="${_var_val}"
export NETCDFHOME="${_var_val}"
export NETCDF_DIR="${_var_val}"
export NETCDF_PATH="${_var_val}"
export NETCDF_ROOT="${_var_val}"
export _found_netcdf=TRUE
break
fi
fi
done
fi
done
unset _name _var _var_val
# fi

return 0
}
16 changes: 10 additions & 6 deletions modulefiles/envmodules_gnu.linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@

####################
### (1) Load all needed environment modules.
#module purge
#module load gcc impi
module purge
module load intel impi
#module load szip hdf5
#module load netcdf
module load netcdf

#module load esmf
module load esmf


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

export HDF5HOME=${HDF5}
export NETCDFHOME=${NETCDF}

get_env_hdf5
get_env_netcdf

export NETCDF_CONFIG=${NETCDFHOME:+${NETCDFHOME}/bin/nc-config}
export NETCDF_INCDIR=${NETCDFHOME:+${NETCDFHOME}/include}
Expand Down
11 changes: 6 additions & 5 deletions modulefiles/envmodules → modulefiles/envmodules_gnu.local
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

####################
### (1) Load all needed environment modules.
#module purge
#module load intel impi
#module load szip hdf5
#module load netcdf
module purge
module load gcc impi
module load szip hdf5
module load netcdf

#module load esmf
module use /contrib/modulefiles
module load esmf


####################
Expand Down
17 changes: 11 additions & 6 deletions modulefiles/envmodules_intel.linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@

####################
### (1) Load all needed environment modules.
#module purge
#module load intel impi
module purge
module load intel impi
#module load szip hdf5
#module load netcdf
module load netcdf

#module load esmf
module load esmf


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

export HDF5HOME=${HDF5}
export NETCDFHOME=${NETCDF}

get_env_hdf5
get_env_netcdf

export NETCDF_CONFIG=${NETCDFHOME:+${NETCDFHOME}/bin/nc-config}
export NETCDF_INCDIR=${NETCDFHOME:+${NETCDFHOME}/include}
export NETCDF_LIBDIR=${NETCDFHOME:+${NETCDFHOME}/lib}

Expand Down
29 changes: 29 additions & 0 deletions modulefiles/envmodules_intel.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash-*-Shell-script-modules*-

# 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 intel/18.0.5.274 impi/2018.0.4
module load szip

module use /home/emc.nemspara/SOFT-hera/modulefiles
module load hdf5_parallel/1.10.6.release
module load netcdf_parallel/4.7.4.release
module load esmf/8.1.0bs36g


####################
### (2) Set some environments varaiables related to the loaded
### modules and required to compile the NEMS application properly.

export HDF5HOME=${HDF5}
export NETCDFHOME=${NETCDF}

export NETCDF_CONFIG=${NETCDFHOME:+${NETCDFHOME}/bin/nc-config}
export NETCDF_INCDIR=${NETCDFHOME:+${NETCDFHOME}/include}
export NETCDF_LIBDIR=${NETCDFHOME:+${NETCDFHOME}/lib}

export ESMFMKFILE=${ESMFMKFILE}
17 changes: 11 additions & 6 deletions modulefiles/envmodules_pgi.linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@

####################
### (1) Load all needed environment modules.
#module purge
#module load pgi impi
module purge
module load intel impi
#module load szip hdf5
#module load netcdf
module load netcdf

#module load esmf
module load esmf


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

export HDF5HOME=${HDF5}
export NETCDFHOME=${NETCDF}

get_env_hdf5
get_env_netcdf

export NETCDF_CONFIG=${NETCDFHOME:+${NETCDFHOME}/bin/nc-config}
export NETCDF_INCDIR=${NETCDFHOME:+${NETCDFHOME}/include}
export NETCDF_LIBDIR=${NETCDFHOME:+${NETCDFHOME}/lib}

export ESMFMKFILE=${ESMFMKFILE}

34 changes: 34 additions & 0 deletions modulefiles/envmodules_pgi.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash-*-Shell-script-modules*-
#----------
[[ "$0" == "bash" || "$0" == "-bash" ]] && retv=return || retv=exit
echo "$(basename ${BASH_SOURCE[0]}) :: This environment is either not configured or not supported"
echo " Exiting ..."
${retv} 1
#----------

# 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 pgi impi
module load szip hdf5
module load netcdf

module use /contrib/modulefiles
module load esmf


####################
### (2) Set some environments varaiables related to the loaded
### modules and required to compile the NEMS application properly.

export HDF5HOME=${HDF5}
export NETCDFHOME=${NETCDF}

export NETCDF_CONFIG=${NETCDFHOME:+${NETCDFHOME}/bin/nc-config}
export NETCDF_INCDIR=${NETCDFHOME:+${NETCDFHOME}/include}
export NETCDF_LIBDIR=${NETCDFHOME:+${NETCDFHOME}/lib}

export ESMFMKFILE=${ESMFMKFILE}

0 comments on commit 8e96477

Please sign in to comment.