#!/bin/bash

# ICON
#
# ------------------------------------------
# Copyright (C) 2004-2026, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ------------------------------------------

set -eu

unset CDPATH
script_dir=$(cd "$(dirname "$0")"; pwd)
icon_dir=$(cd "${script_dir}/../.."; pwd)

if test -n "${BB_NAME-}"; then
  job_count=${SLURM_NTASKS:-22}
else
  job_count=8
fi

unset MAKEFLAGS
makeflags="--jobs=${job_count} --no-print-directory --output-sync=target V=1"

set -x

${icon_dir}/config/csc/lumi.gpu.cce --enable-mixed-precision

make ${makeflags}
