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

Refactor examples.

parent f26cc8d9
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#######################################################################################################################
# Three variables are required to define the test case
# Variables that are required to define the test case
EXPID="rfipsp"
ICON_CASE="real-from-ideal"
ICON_VERSION="psp"
PLATFORM="LOCAL"
EXTRA_NAMELIST=$(
cat <<-END
atmosphere_namelist: |
......@@ -16,6 +17,7 @@ atmosphere_namelist_ideal: |
psp_scale: 5.0
END
)
EXTRA_CONFIGURATION=""
#######################################################################################################################
set -euo pipefail
......@@ -23,12 +25,8 @@ set -euo pipefail
# Get path to the script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# Import the function setup_autoicon_example
# Import the function run_autoicon_example
source ${SCRIPT_DIR}/example_utils.sh
# Setup the experiment
# setup_autoicon_example takes the following arguments:
# case: right now it can be real-from-ideal or real-from-dwd-ana
# ICON_VERSION: it can be master, psp, plexrt or a specific version like 2.6.5-nwp0 (the latest at that moment)
# EXTRA_NAMELIST: In case we want to provide extra parameters we can use it
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "${EXTRA_NAMELIST}"
# Setup and run the experiment
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "$PLATFORM" "${EXTRA_NAMELIST}" "${EXTRA_CONFIGURATION}"
#!/bin/bash
#######################################################################################################################
# Three variables are required to define the test case
# Variables that are required to define the test case
EXPID="rfi"
ICON_CASE="real-from-ideal"
ICON_VERSION="2.6.5-nwp0"
PLATFORM="LOCAL"
EXTRA_NAMELIST=""
EXTRA_CONFIGURATION=""
#######################################################################################################################
set -euo pipefail
......@@ -12,14 +14,11 @@ set -euo pipefail
# Get path to the script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# Import the function setup_autoicon_example
# Import the function run_autoicon_example
source ${SCRIPT_DIR}/example_utils.sh
# Setup the experiment
# setup_autoicon_example takes the following arguments:
# case: right now it can be real-from-ideal or real-from-dwd-ana
# ICON_VERSION: it can be master, psp, plexrt or a specific version like 2.6.5-nwp0 (the latest at that moment)
# EXTRA_NAMELIST: In case we want to provide extra parameters we can use it
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "${EXTRA_NAMELIST}"
# Setup and run the experiment
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "$PLATFORM" "${EXTRA_NAMELIST}" "${EXTRA_CONFIGURATION}"
#!/bin/bash
#######################################################################################################################
# Three variables are required to define the test case
# Variables that are required to define the test case
EXPID="rfda"
ICON_CASE="real-from-dwd-ana"
ICON_VERSION="2.6.5-nwp0"
PLATFORM="LOCAL"
EXTRA_NAMELIST=""
EXTRA_CONFIGURATION=""
#######################################################################################################################
set -euo pipefail
......@@ -12,12 +14,8 @@ set -euo pipefail
# Get path to the script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# Import the function setup_autoicon_example
# Import the function run_autoicon_example
source ${SCRIPT_DIR}/example_utils.sh
# Setup the experiment
# setup_autoicon_example takes the following arguments:
# case: right now it can be real-from-ideal or real-from-dwd-ana
# ICON_VERSION: it can be master, psp, plexrt or a specific version like 2.6.5-nwp0 (the latest at that moment)
# EXTRA_NAMELIST: In case we want to provide extra parameters we can use it
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "${EXTRA_NAMELIST}"
# Setup and run the experiment
run_autoicon_example "$EXPID" "$ICON_CASE" "$ICON_VERSION" "$PLATFORM" "${EXTRA_NAMELIST}" "${EXTRA_CONFIGURATION}"
# setup_autoicon_example function that sets up an AutoSub environment for the ICON model
#/bin/bash
# run_autoicon_example function that sets up an Autosubmit environment for the ICON model
function run_autoicon_example() {
# Read the input parameters
local EXPID=$1
local ICON_CASE=$2
local ICON_VERSION=$3
local EXTRA_NAMELIST=$4
local PLATFORM=$4
local EXTRA_NAMELIST=${5:-""}
local EXTRA_CONFIGURATION=${6:-""}
# Setup environment
......@@ -16,6 +20,7 @@ function run_autoicon_example() {
# Set up project
setup_project "$EXPID"
# Create and run the experiment
create_and_run_experiment "$EXPID"
}
......@@ -85,7 +90,7 @@ CONFIG:
RETRIALS: 0
DEFAULT:
EXPID: "$EXPID"
HPCARCH: "LOCAL" # use LMU to run on cluster
HPCARCH: "${PLATFORM}" # use LMU to run on cluster
CUSTOM_CONFIG:
PRE:
- "%PROJDIR%/conf/common"
......@@ -123,14 +128,21 @@ icon:
data_management:
# Where do we put the output files afterwards?
local_destination_folder: $OUTPUTDIR/
Platforms:
DUMMY:
TYPE: ps
Dummy:
type: ps
EOF
# If EXTRA_NAMELIST is provided, create and write the extra namelist file
if [ -z "$EXTRA_NAMELIST" ]; then
if [ ! -z "$EXTRA_CONFIGURATION" ]; then
cat >autosubmit/${EXPID}/conf/extra_conf.yml <<EOF
$EXTRA_CONFIGURATION
EOF
fi
# If EXTRA_NAMELIST is provided, create and write the extra namelist file
if [ ! -z "$EXTRA_NAMELIST" ]; then
cat >autosubmit/${EXPID}/conf/extra_namelist.yml <<EOF
$EXTRA_NAMELIST
EOF
......
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