@ -33,14 +33,19 @@ MODULEPATH_DEFAULT=/cm/local/modulefiles:/cm/shared/modulefiles:/cm/shared/compi
# It requires the following variables to be set:
# It requires the following variables to be set:
# - MODULESHOME (optional; default provided above)
# - MODULESHOME (optional; default provided above)
# - MODULEPATH
# - MODULEPATH
# - LA ODEDMODULES
# - LOA DEDMODULES
RestoreModuleEnv () {
RestoreModuleEnv () {
local LOADEDMODULES_SAVE
local LOADEDMODULES_SAVE
: ${MODULESHOME:=$MODULESHOME_DEFAULT}
# : ${MODULESHOME:=$MODULESHOME_DEFAULT}
: ${MODULEPATH:=$MODULEPATH_DEFAULT}
# : ${MODULEPATH:=$MODULEPATH_DEFAULT}
MODULESHOME=$MODULESHOME_DEFAULT
MODULEPATH=$MODULEPATH_DEFAULT
export MODULESHOME
export MODULESHOME
export MODULEPATH
export MODULEPATH
if [[ ":${MODULEPATH}:" != *":${MODULEPATH_DEFAULT}:"* ]]; then
MODULEPATH=${MODULEPATH}:${MODULEPATH_DEFAULT}
fi
LOADEDMODULES_SAVE=$LOADEDMODULES
LOADEDMODULES_SAVE=$LOADEDMODULES
unset LOADEDMODULES
unset LOADEDMODULES