From 8b056f9150610692d16b640616281b38f8e12616 Mon Sep 17 00:00:00 2001 From: Ahmad Nawab Date: Thu, 21 Nov 2024 19:35:55 +0000 Subject: [PATCH 1/2] PREPROC: also cache subgrid files --- .../scripts/ecwam_run_create_bathymetry.sh | 19 +++++++++++++++++-- share/ecwam/scripts/ecwam_runtime.sh | 5 ++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/share/ecwam/scripts/ecwam_run_create_bathymetry.sh b/share/ecwam/scripts/ecwam_run_create_bathymetry.sh index 42c76e6e..feff4c58 100755 --- a/share/ecwam/scripts/ecwam_run_create_bathymetry.sh +++ b/share/ecwam/scripts/ecwam_run_create_bathymetry.sh @@ -136,11 +136,13 @@ fi cat reference_levels >> for_md5 md5=$(cat for_md5 | md5sum | awk '{print $1}') -WAM_TOPO=v${ecwam_bathymetry_version}/bathymetry_${wamresol}_nfre${wamnfre}_${wambathy}_${md5} + +# Only double-precision files are cached +WAM_TOPO=v${ecwam_bathymetry_version}/bathymetry_dp_${wamresol}_nfre${wamnfre}_${wambathy}_${md5} subgrid_files=() for ip in 0 1 2; do - subgrid_files+=(v${ecwam_bathymetry_version}/wam_grib_subgrid_${ip}_${wamnfre}_${wambathy}_${md5}) + subgrid_files+=(v${ecwam_bathymetry_version}/wam_grib_subgrid_dp_${wamresol}_${ip}_${wamnfre}_${wambathy}_${md5}) done grid_files_found=true @@ -158,6 +160,15 @@ else echo "\n\n\t File ${DATA_DIR}/data/bathymetry/${WAM_TOPO} and/or subgrid files were not found\n" echo "\t They need to be computed from the $wambathy data set\n" + # We update the file names with the current precision to ensure we never accidentally + # cache single-precision files + WAM_TOPO=v${ecwam_bathymetry_version}/bathymetry_${ecwam_prec}_${wamresol}_nfre${wamnfre}_${wambathy}_${md5} + + subgrid_files=() + for ip in 0 1 2; do + subgrid_files+=(v${ecwam_bathymetry_version}/wam_grib_subgrid_${ecwam_prec}_${wamresol}_${ip}_${wamnfre}_${wambathy}_${md5}) + done + if [[ $wambathy = "ETOPO1" ]] ; then echo "\n\n\t Getting ETOPO1 data set\n" log ${SCRIPTS_DIR}/ecwam_retrieve.sh ${ETOPO1} ${DATA_DIR}/${ETOPO1} @@ -235,6 +246,10 @@ EOF mv wam_topo_${cwamresol} ${DATA_DIR}/data/bathymetry/${WAM_TOPO} for ip in 0 1 2; do + if [[ ! -r wam_grib_subgrid_${ip} ]] ; then + echo "\n\n\t File wam_grib_subgrid_${ip} does not exist\n\n" + abort 9 + fi mv wam_grib_subgrid_${ip} ${DATA_DIR}/data/bathymetry/${subgrid_files[$ip]} done diff --git a/share/ecwam/scripts/ecwam_runtime.sh b/share/ecwam/scripts/ecwam_runtime.sh index b935e1d2..5bdd7ace 100644 --- a/share/ecwam/scripts/ecwam_runtime.sh +++ b/share/ecwam/scripts/ecwam_runtime.sh @@ -11,7 +11,7 @@ SCRIPTS_DIR="$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd -P )" # Version of topography result, to be increased when results for same run would be different. # e.g. when a bug is fixed. -export ecwam_bathymetry_version=1 +export ecwam_bathymetry_version=2 ECWAM_CACHE_PATH_DEFAULT=${HOME}/cache/ecwam [[ ${HPCPERM} ]] && ECWAM_CACHE_PATH_DEFAULT=${HPCPERM}/cache/ecwam @@ -55,3 +55,6 @@ export DR_HOOK_ASSERT_MPI_INITIALIZED=0 # export python interpreter export ECWAM_PYTHON_INTERP=@ECWAM_PYTHON_INTERP@ + +# export ecWAM precision +export ecwam_prec=@prec@ From ca794264e45e0af920eb8b61a1c3e7f1ef307f68 Mon Sep 17 00:00:00 2001 From: Ahmad Nawab Date: Thu, 21 Nov 2024 19:36:34 +0000 Subject: [PATCH 2/2] O320: add single precision validation hashes --- tests/etopo1_oper_an_fc_O320.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/etopo1_oper_an_fc_O320.yml b/tests/etopo1_oper_an_fc_O320.yml index 02bc9e47..5fb504ba 100644 --- a/tests/etopo1_oper_an_fc_O320.yml +++ b/tests/etopo1_oper_an_fc_O320.yml @@ -83,3 +83,36 @@ validation: maximum: 0.7470872982664355E+01 relative_tolerance: 1.e-14 hashes: ['0x401DE22C86F4741A'] + + single_precision: + + # initial analysis time + - name: swh + time: 2022-12-31 12:00:00 + average: 0.1334386110305786E+01 + relative_tolerance: 1.e-6 + hashes: ['0x3FF559A540000000'] + + # initial forecast time + - name: swh + time: 2023-01-01 00:00:00 + average: 0.1522688865661621E+01 + relative_tolerance: 1.e-6 + hashes: ['0x3FF85CEF00000000'] + + # 6h into forcast + - name: swh + time: 2023-01-01 06:00:00 + average: 0.1602301239967346E+01 + relative_tolerance: 1.e-6 + hashes: ['0x3FF9A306A0000000'] + - name: swh + time: 2023-01-01 06:00:00 + minimum: 0.1733699254691601E-01 + relative_tolerance: 1.e-6 + hashes: ['0x3F91C0C9E0000000'] + - name: swh + time: 2023-01-01 06:00:00 + maximum: 0.7470870018005371E+01 + relative_tolerance: 1.e-6 + hashes: ['0x401DE22BC0000000']