Skip to content
Snippets Groups Projects
Commit c4841458 authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Stupid bug again .

parent 58be9770
No related branches found
No related tags found
1 merge request!2Split prepare_rundir.sh into three different stages for the whole experiment,...
......@@ -6,10 +6,9 @@ SPACK_URL=%spack.url%
SPACK_BRANCH=%spack.branch%
SPACK_COMPILER=%spack.compiler%
# If the workdir directory does not exist create it
if [ ! -d ${WORKDIR} ] ; then
mkdir -p ${WORKDIR}
if [ ! -d ${WORKDIR} ]; then
mkdir -p ${WORKDIR}
fi
# Go to the working directory
......@@ -17,7 +16,7 @@ cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV=spack/share/spack/setup-env.sh
if [ ! -f ${SPACK_ENV} ] ; then
if [ ! -f ${SPACK_ENV} ]; then
git clone ${SPACK_URL} -b ${SPACK_BRANCH}
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
fi
......@@ -25,29 +24,28 @@ fi
# Setup the environment
source ${SPACK_ENV}
if [ $( spack find icon-nwp@${ICON_VERSION} &> /dev/null ; echo $? ) -ne 0 ]; then
echo "Installing icon-nwp@${ICON_VERSION}."
# Compile openmpi with schedulers=slurm
spack install openmpi%${SPACK_COMPILER}+legacylaunchers schedulers=slurm
spack install icon-nwp@${ICON_VERSION}%${SPACK_COMPILER} ^openmpi%${SPACK_COMPILER}
if [ $(
spack find icon-nwp@${ICON_VERSION} &>/dev/null
echo $?
) -ne 0 ]; then
echo "Installing icon-nwp@${ICON_VERSION}."
# Compile openmpi with schedulers=slurm
spack install openmpi%${SPACK_COMPILER}+legacylaunchers schedulers=slurm
spack install icon-nwp@${ICON_VERSION}%${SPACK_COMPILER} ^openmpi%${SPACK_COMPILER}
else
echo "icon-nwp@${ICON_VERSION} already installed!"
echo "icon-nwp@${ICON_VERSION} already installed!"
fi
# Need to get ECCODES DWD definitions:
eccodes_version=$(spack find eccodes | grep eccodes@ | cut -d "@" -f 2)
definitions_tar_file=eccodes_definitions.edzw-${eccodes_version}-1.tar.bz2
if [ ! -f ${definitions_tar_file}]; then
if [ ! -f ${definitions_tar_file} ]; then
defs_url=https://opendata.dwd.de/weather/lib/grib/${definitions_tar_file}
wget ${defs_url}
# Decompress definitions file
tar -xf ${definitions_tar_file}
# Create a file containing the environment variable that needs to be set in order to use DWD's definitions:
echo "export ECCODES_DEFINITION_PATH=${WORKDIR}/definitions.edzw-${eccodes_version}-1" > eccodes_defs.env
echo "export ECCODES_DEFINITION_PATH=${WORKDIR}/definitions.edzw-${eccodes_version}-1" >eccodes_defs.env
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment