-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3be54f
commit 8e96477
Showing
7 changed files
with
202 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |