#!/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
# ------------------------------------------

# abort on error
set -euo pipefail

cd $(dirname "${BASH_SOURCE[0]}")

addexp="./addexp"
#############################################################################
##
## create seamless list
##
#############################################################################
## create list for icon-seamless on levante: Prototype-2 [and Prototype-1)

listname=${1:-seamless}
./rmlist $listname
# ./mklist $listname
./create_all_builders $listname

## new seamless entries for levante - hybrid with 4 openmp-threads with gcc (1 thread with intel_hybrid due to ecrad radiation)
#-----------------------------------------------------------
## Prototype-3:
# $addexp exp.seamless_bb-proto3 --builders "levante_intel levante_gcc" --runflags "cpu_time=00:10:00 no_of_nodes=4" --list $listname
# $addexp exp.seamless_bb-proto3 --builders "levante_intel_hybrid" \
#          --runflags "cpu_time=00:10:00 no_of_nodes=4 openmp_threads=1" --list $listname
# $addexp exp.seamless_bb-proto3 --builders "levante_gcc_hybrid" \
#          --runflags "cpu_time=00:10:00 no_of_nodes=4 openmp_threads=4" --list $listname
## Prototype-2:
$addexp exp.seamless_bb-proto2 --builders "levante_intel levante_gcc" --runflags "cpu_time=00:10:00 no_of_nodes=4" --list $listname
$addexp exp.seamless_bb-proto2 --builders "levante_intel_hybrid" \
         --runflags "cpu_time=00:10:00 no_of_nodes=4 openmp_threads=1" --list $listname
$addexp exp.seamless_bb-proto2 --builders "levante_gcc_hybrid" \
         --runflags "cpu_time=00:10:00 no_of_nodes=4 openmp_threads=4" --list $listname
## Prototype-1:
$addexp exp.seamless_bb-proto1 --builders "levante_intel levante_gcc levante_nag" --runflags "cpu_time=00:10:00 no_of_nodes=4" --list $listname
$addexp exp.seamless_bb-proto1 --builders "levante_intel_hybrid levante_gcc_hybrid" \
         --runflags "cpu_time=00:10:00 no_of_nodes=4 openmp_threads=4" --list $listname
## ICON-NWP/ECRAD test:
$addexp exp.seamless_bb-ecradmin --builders "levante_intel levante_gcc" --runflags "cpu_time=00:10:00 no_of_nodes=2" --list $listname
$addexp exp.seamless_bb-ecradmin --builders "levante_intel_hybrid levante_gcc_hybrid" \
         --runflags "cpu_time=00:10:00 no_of_nodes=2 openmp_threads=4" --list $listname
#-----------------------------------------------------------


## new seamless entries for DWD-NEC - needs compilation with yac: dwd_nec_coupling
#-----------------------------------------------------------
## Prototype-1 (identical grid):
$addexp checksuite.nwp/nwpexp.run_ICON_17_R2B4_AO_coupled         --builders dwd_nec_coupling --list $listname
## Prototype-2 (different grid):
$addexp checksuite.nwp/nwpexp.run_ICON_20_R2B4_R2B6_AO_coupled    --builders dwd_nec_coupling --list $listname
## Prototype-3 (TERRA and HD coupled through YAC):
$addexp checksuite.nwp/nwpexp.run_ICON_26_R2B4_R2B6_AO-HD_coupled --builders dwd_nec_coupling --list $listname
## Prototype-2 with GRIB-IO in both domains (TERRA coupled through YAC):
$addexp checksuite.nwp/nwpexp.run_ICON_29_R2B5_R2B6_AO_coupled_gribInitOce --builders dwd_nec_coupling --list $listname



#lets see the list
./lslist $listname
#-----------------------------------------------------------
