From efdf6a5ccd7a4e1954570caef5ff1eb6a8b6dad8 Mon Sep 17 00:00:00 2001
From: Quentin Rodier <quentin.rodier@meteo.fr>
Date: Fri, 7 Oct 2022 15:00:57 +0200
Subject: [PATCH] Quentin 07/10/2022: check_commit_mesonh : add OCEAN_LES case
 test

---
 tools/check_commit_mesonh.sh | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/tools/check_commit_mesonh.sh b/tools/check_commit_mesonh.sh
index dcd9ef33f..73ee6a071 100755
--- a/tools/check_commit_mesonh.sh
+++ b/tools/check_commit_mesonh.sh
@@ -8,7 +8,8 @@ set -e
 # Repertoire où MNH-V5-5-0_PHYEX.tar.gz modifie pour accueillir PHYEX se trouve
 #TARGZDIR=$HOME
 
-availTests="007_16janvier/008_run2, 007_16janvier/008_run2_turb3D, COLD_BUBBLE/002_mesonh, ARMLES/RUN, COLD_BUBBLE_3D/002_mesonh,"
+availTests="007_16janvier/008_run2, 007_16janvier/008_run2_turb3D, COLD_BUBBLE/002_mesonh, 
+            ARMLES/RUN, COLD_BUBBLE_3D/002_mesonh,OCEAN_LES/004_run2"
 defaultTest="007_16janvier/008_run2"
 separator='_' #- be carrefull, gmkpack (at least on belenos) has multiple allergies (':', '.', '@')
               #- seprator must be in sync with prep_code.sh separator
@@ -294,6 +295,9 @@ if [ $check -eq 1 ]; then
     elif   [ $t == ARMLES/RUN ]; then
       path_user=$path_user_beg/MY_RUN/KTEST/ARMLES/RUN$path_user_end
       path_ref=$path_ref_beg/MY_RUN/KTEST/ARMLES/RUN$path_ref_end
+    elif   [ $t == OCEAN_LES/004_run2 ]; then
+      path_user=$path_user_beg/MY_RUN/KTEST/OCEAN_LES/004_run2$path_user_end
+      path_ref=$path_ref_beg/MY_RUN/KTEST/OCEAN_LES/004_run2$path_ref_end
     else
       echo "cas $t non reconnu"
     fi
@@ -361,6 +365,32 @@ if [ $check -eq 1 ]; then
       fi
     fi
 
+   if [ $case == OCEAN_LES ]; then
+        echo "Compare with python..."
+        # Compare variable of both Synchronous files with printing difference
+        file1=$path_user/SPWAN.2.25m00.001.nc
+        file2=$path_ref/SPWAN.2.25m00.001.nc
+        set +e
+        $PHYEXTOOLSDIR/compare.py --f1 $file1 --f2 $file2
+        t=$?
+        set -e
+        allt=$(($allt+$t))
+  
+        #Check bit-repro before date of creation of Synchronous file from ncdump of all values (pb with direct .nc file checks)
+        echo "Compare with ncdump..."
+        if [ -f $file1 -a -f $file2 ]; then
+          set +e
+          diff <(ncdump $file1 | head -c 18400) <(ncdump $file2 | head -c 18400)
+          t=$?
+          set -e
+          allt=$(($allt+$t))
+        else
+          [ ! -f $file1 ] && echo "  $file1 is missing"
+          [ ! -f $file2 ] && echo "  $file2 is missing"
+          allt=$(($allt+1))
+        fi
+      fi
+
     if [ $case == COLD_BUBBLE_3D ]; then
       echo "Compare with python..."
       # Compare variable of both Synchronous and Diachronic files with printing difference
-- 
GitLab