From 339d3b13b44465499d114f44aca7a9b17258c81c Mon Sep 17 00:00:00 2001 From: minghangli-uni <24727729+minghangli-uni@users.noreply.github.com> Date: Mon, 22 Sep 2025 09:06:34 +1000 Subject: [PATCH 1/3] Add a payu init script to auto-generate updated diag_table after payu setup / payu run --- .../init_scripts/run_make_diag_table.sh | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 payu_config/init_scripts/run_make_diag_table.sh diff --git a/payu_config/init_scripts/run_make_diag_table.sh b/payu_config/init_scripts/run_make_diag_table.sh new file mode 100755 index 0000000..a487aea --- /dev/null +++ b/payu_config/init_scripts/run_make_diag_table.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -e # exit on error + +source /etc/profile.d/modules.sh +module use /g/data/vk83/prerelease/modules && module load payu/dev + +# detect model +if [ ! -f "config.yaml" ]; then + echo "Error: config.yaml not found!" + exit 1 +fi +MODEL=$(grep '^model:' config.yaml | awk '{print $2}') +echo "-- Detected model: $MODEL" + +case $MODEL in + access-om3) + DEST="diagnostic_profiles/source_yaml_files/make_diag_table" + ;; + access-om2) + DEST="tools/make_diag_table" + ;; + access | access-esm1.6) + DEST="ocean/diagnostic_profiles/source_yaml_files/make_diag_table" + ;; + *) + echo "Error: Unknown model '$MODEL' (expected access-om3 | access-om2 | access-esm1.6 | access)" >&2 + exit 1 + ;; +esac + +BASE=$(dirname $DEST) + +mkdir -p $BASE + +if [ -d "$DEST" ]; then + echo "Directory $DEST already exists!" >&2 + +else + git clone https://github.com/COSIMA/make_diag_table $DEST + scp $DEST/make_diag_table.py $BASE/ + + cd $BASE + echo "-- Cloned make_diag_table repo to $DEST" + + if [ $MODEL = "access-om2" ]; then + python3 make_diag_table.py + else + cp -f diag_table_standard_source.yaml diag_table_source.yaml + echo "-- Copied diag_table_standard_source.yaml to diag_table_source.yaml" + python3 make_diag_table.py + cp -f diag_table ../diag_table_standard + fi + + echo "-- diag_table is ready for use! (model: $MODEL)" +fi \ No newline at end of file From 1c96cd19b82d60cd514bedaae0eef17a3e839fc9 Mon Sep 17 00:00:00 2001 From: minghangli-uni <24727729+minghangli-uni@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:23:45 +1100 Subject: [PATCH 2/3] Fix dest path for om3 --- payu_config/init_scripts/run_make_diag_table.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payu_config/init_scripts/run_make_diag_table.sh b/payu_config/init_scripts/run_make_diag_table.sh index a487aea..c720250 100755 --- a/payu_config/init_scripts/run_make_diag_table.sh +++ b/payu_config/init_scripts/run_make_diag_table.sh @@ -14,7 +14,7 @@ echo "-- Detected model: $MODEL" case $MODEL in access-om3) - DEST="diagnostic_profiles/source_yaml_files/make_diag_table" + DEST="make_diag_table" ;; access-om2) DEST="tools/make_diag_table" @@ -52,4 +52,4 @@ else fi echo "-- diag_table is ready for use! (model: $MODEL)" -fi \ No newline at end of file +fi From b2c9bb10a3f67cf19a9df70e1df79e8f9842947e Mon Sep 17 00:00:00 2001 From: minghangli-uni <24727729+minghangli-uni@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:25:36 +1100 Subject: [PATCH 3/3] Add MODEL == 'access-om3' in addition to access-om2 --- payu_config/init_scripts/run_make_diag_table.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payu_config/init_scripts/run_make_diag_table.sh b/payu_config/init_scripts/run_make_diag_table.sh index c720250..2bd7359 100755 --- a/payu_config/init_scripts/run_make_diag_table.sh +++ b/payu_config/init_scripts/run_make_diag_table.sh @@ -42,7 +42,7 @@ else cd $BASE echo "-- Cloned make_diag_table repo to $DEST" - if [ $MODEL = "access-om2" ]; then + if [[ $MODEL == "access-om2" || $MODEL == "access-om3" ]]; then python3 make_diag_table.py else cp -f diag_table_standard_source.yaml diag_table_source.yaml