diff --git a/examples/01_real-from-ideal+psp.sh b/examples/01_real-from-ideal+psp.sh index 259a98888ee1d628145453b6c9439878dcf08fd9..6520e6ea154a9e20e92ebeb3b85cb57f6d1789b3 100755 --- a/examples/01_real-from-ideal+psp.sh +++ b/examples/01_real-from-ideal+psp.sh @@ -1,9 +1,10 @@ #!/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}" diff --git a/examples/01_real-from-ideal.sh b/examples/01_real-from-ideal.sh index 85d0cc62ad93d4c75499315033c2bdd394daf5d7..62bab10e902566a2087223f22292976883fa3b25 100755 --- a/examples/01_real-from-ideal.sh +++ b/examples/01_real-from-ideal.sh @@ -1,10 +1,12 @@ #!/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}" + diff --git a/examples/02_real-from-dwd-ana.sh b/examples/02_real-from-dwd-ana.sh index 7e3796ac174da1032a55e8a8e948e8144b60e96e..f75b4b0aea5aca771454e02bc2baa9f7c8e35f2c 100755 --- a/examples/02_real-from-dwd-ana.sh +++ b/examples/02_real-from-dwd-ana.sh @@ -1,10 +1,12 @@ #!/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}" diff --git a/examples/example_utils.sh b/examples/example_utils.sh index 1bb48de169fa1fc4086ab7c30cfbf4e569987477..c4f8b78a42d95547aeb9dd300f2a041aefaad62f 100644 --- a/examples/example_utils.sh +++ b/examples/example_utils.sh @@ -1,10 +1,14 @@ -# 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