diff --git a/analyse_wac_t3d.html b/analyse_wac_t3d.html new file mode 100644 index 0000000..be28e24 --- /dev/null +++ b/analyse_wac_t3d.html @@ -0,0 +1,10530 @@ + + + + + +analyse_wac_t3d + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ +
+ + +
+
+ +
+ + +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+ + +
+ + +
+
+ +
+ + +
+ + +
+ + +
+
+ +
+
+ + diff --git a/analyse_wac_t3d.ipynb b/analyse_wac_t3d.ipynb new file mode 100644 index 0000000..5d96f35 --- /dev/null +++ b/analyse_wac_t3d.ipynb @@ -0,0 +1,2983 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Time series exports in TELEMAC" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1 - Run the validation test" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To run this notebook, install opentelemac conda package: \n", + "```\n", + "mamba create -n telemac_test opentelemac\n", + "mamba activate telemac_test\n", + "```\n", + "\n", + "then, install `ipykernel` an `xarray-selafin`\n", + "```\n", + "pip install ipykernel xarray-selafin hvplot holoviews jupyter-bokeh\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/bin/bash: line 1: /home/tomsail/miniconda3/envs/telemac_compil_test/opentelemac: Is a directory\n" + ] + } + ], + "source": [ + "!$HOMETEL" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "change HOMETEL to the repo where the source code and the example are: " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "env: HOMETEL=/home/tomsail/work/opentelemac\n" + ] + } + ], + "source": [ + "%env HOMETEL=/home/tomsail/work/opentelemac" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "###\n", + "### See http://wiki.opentelemac.org/doku.php?id=installation_notes_2_beta\n", + "### On how to install telemac\n", + "###\n", + "# _____ _______________________________\n", + "# ____/ TELEMAC Project Definitions /______________________________/\n", + "#\n", + "[Configurations]\n", + "#configs: gnu.dynamic\n", + "configs: gnu.dynamic gnu.dynamic.debug\n", + "# _____ ____________________________________\n", + "# ____/ General /___________________________________/\n", + "# Global declaration used for all configurations\n", + "[general]\n", + "language: 2\n", + "modules: system\n", + "version: main\n", + "#\n", + "sfx_zip: gztar\n", + "sfx_lib: .a\n", + "sfx_obj: .o\n", + "sfx_mod: .mod\n", + "sfx_exe:\n", + "#\n", + "#\n", + "val_root: /home/tomsail/work/opentelemac/examples\n", + "#\n", + "val_rank: all\n", + "#\n", + "mods_all: -I \n" + ] + } + ], + "source": [ + "!head -30 $SYSTELCFG" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "recompile the source code (already done before in this case)\n", + "\n", + "Here we test a dev branch called `nearest-node-ts` for nearest neighbor interpolation" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "Loading Options and Configurations\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " _ _ _ \n", + " | | | | | | \n", + " _ __ ___ __ _ _ __ ___ ___ | |_ ______ _ __ ___ __| | ___ ______ | |_ ___ \n", + " | '_ \\ / _ \\ / _` || '__| / _ \\/ __|| __||______|| '_ \\ / _ \\ / _` | / _ \\|______|| __|/ __|\n", + " | | | || __/| (_| || | | __/\\__ \\| |_ | | | || (_) || (_| || __/ | |_ \\__ \\\n", + " |_| |_| \\___| \\__,_||_| \\___||___/ \\__| |_| |_| \\___/ \\__,_| \\___| \\__||___/\n", + " \n", + " \n", + "\n", + " _ _ \n", + " | | (_) \n", + " __ _ _ __ _ _ __| | _ _ _ __ __ _ _ __ ___ _ ___ \n", + " / _` || '_ \\ | | | | / _` || | | || '_ \\ / _` || '_ ` _ \\ | | / __|\n", + " | (_| || | | || |_| | _ | (_| || |_| || | | || (_| || | | | | || || (__ \n", + " \\__, ||_| |_| \\__,_|(_) \\__,_| \\__, ||_| |_| \\__,_||_| |_| |_||_| \\___|\n", + " __/ | __/ | \n", + " |___/ |___/ \n", + "\n", + "Scanning the source code for:\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + "\n", + "\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + "gnu.dynamic: \n", + " \n", + "\n", + " +> Scibian 10 dynamic build using GFortran 8.3.0 and Open MPI.\n", + "\n", + " +> root: /home/tomsail/work/opentelemac\n", + " +> module: ad / api / artemis / bief\n", + " damocles / gaia / gretel / hermes\n", + " identify_liq_bnd / khione / mascaret / nestor\n", + " parallel / partel / postel3d / special\n", + " stbtel / telemac2d / telemac3d / tomawac\n", + " waqtel\n", + "\n", + "\n", + "Compiling from the tree top api plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top artemis plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top damocles plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top gredelhyd_autop plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top gredelmet_autop plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top gredelpts_autop plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top gredelseg_autop plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top grehis_autop plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top gretel plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top identify_liq_bnd plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top HOMERE_MASCARET plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to compile C object\n", + " +> There is no need to compile C object\n", + " - completed: .../opentelemac/builds/gnu.dynamic/lib/libmascaret.so\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top partel plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top partel_para plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top partel_prelim plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top postel3d plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top stbtel plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top telemac2d plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top telemac3d plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "\n", + "Compiling from the tree top tomawac plus dependents\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " +> There is no need to compile any object\n", + " +> There is no need to package any library\n", + " +> There is no need to create the associated executable\n", + "\n", + "Building the Python API \n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " ~> Wrap_api built\n", + " ~> Generating the API Python wrapper\n", + " ~> First part of F2PY passed\n", + " ~> Second part of F2PY passed\n", + " ~> Generating the Hermes Python wrapper\n", + " ~> First part of F2PY passed\n", + " ~> Second part of F2PY passed\n", + "\n", + "\n", + "My work is done\n", + "\n", + "\n" + ] + } + ], + "source": [ + "!compile_telemac.py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "check if the changes in the code are correct" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " IF(ABS(X(I)-X1).LT.EPS.AND.ABS(X(I)-X1).LT.EPS) IP(K)=I\n", + " ENDDO\n", + " ENDIF\n", + " WRITE(LU,*)\n", + " WRITE(LU,*) 'SOURCE POINT ',K,'PUT ON POINT'\n", + " WRITE(LU,*) X1,' AND ',Y1\n", + " D2 = SQRT(P_MIN(DIST2))\n", + " WRITE(LU,*) 'LOCATED AT ',D2,' METRES'\n", + "! LINE FEED FOR THE LISTING\n", + " IF(K.EQ.NP) WRITE(LU,*)\n", + " ENDIF\n", + " ENDDO\n", + " ENDIF\n", + "!\n", + "!-----------------------------------------------------------------------\n", + "!\n", + " RETURN\n", + " END SUBROUTINE NEAREST_NODE\n", + "\n", + " END MODULE OUT_HISTORY" + ] + } + ], + "source": [ + "!tail -20 $HOMETEL/sources/utils/bief/out_history.F90" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "run 3D coupling test case: " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "Loading Options and Configurations\n", + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "\n", + " _ _ _ \n", + " | | | | | | \n", + " _ __ ___ __ _ _ __ ___ ___ | |_ ______ _ __ ___ __| | ___ ______ | |_ ___ \n", + " | '_ \\ / _ \\ / _` || '__| / _ \\/ __|| __||______|| '_ \\ / _ \\ / _` | / _ \\|______|| __|/ __|\n", + " | | | || __/| (_| || | | __/\\__ \\| |_ | | | || (_) || (_| || __/ | |_ \\__ \\\n", + " |_| |_| \\___| \\__,_||_| \\___||___/ \\__| |_| |_| \\___/ \\__,_| \\___| \\__||___/\n", + " \n", + " \n", + " +> gnu.dynamic: stbtel, khione, gaia, postel3d, waqtel, courlis, tomawac, mascaret, telemac3d, telemac2d, artemis, nestor, python3\n", + "\n", + "\n", + "Validation < 1/1 > of /examples/tomawac/3Dcoupling/vnv_3d_coupling.py\n", + " ~> Checking keyword/rubrique coherence\n", + " ~> Checking keyword/rubrique coherence\n", + " ~> vnv_1: Nothing to do (up-to-date)\n", + " ~> vnv_2: Nothing to do (up-to-date)\n", + " ~> vnv_3: Nothing to do (up-to-date)\n", + " ~> vnv_4: Nothing to do (up-to-date)\n", + " ~> vnv_5: Nothing to do (up-to-date)\n", + " ~> vnv_6: Nothing to do (up-to-date)\n", + " ~> vnv_7: Nothing to do (up-to-date)\n", + " ~> vnv_8: Nothing to do (up-to-date)\n", + " ~> vnv_9: Nothing to do (up-to-date)\n", + " ~> vnv_10: Nothing to do (up-to-date)\n", + " ~> vnv_11: Nothing to do (up-to-date)\n", + " ~> vnv_12: Nothing to do (up-to-date)\n", + " ~> vnv_13: Nothing to do (up-to-date)\n", + " ~> vnv_14: Nothing to do (up-to-date)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_1/gnu.dynamic/r3d_littoral.slf and f3d_littoral.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 4.440892098500626e-16 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_2/gnu.dynamic/r3d_littoral.slf and f3d_littoral.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 5.684341886080802e-14 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_1/gnu.dynamic/r3d_littoral.slf and ./vnv_3d_coupling/vnv_2/gnu.dynamic/r3d_littoral.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 5.684341886080802e-14 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_1/gnu.dynamic/tom_littoral.slf and fom_littoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_2/gnu.dynamic/tom_littoral.slf and fom_littoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_1/gnu.dynamic/tom_littoral.slf and ./vnv_3d_coupling/vnv_2/gnu.dynamic/tom_littoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r3d_littoralcoup.slf and f3d_littoralcoup.slf:\n", + " - Difference for variable ELEVATION Z: 3.725290298461914e-09 (eps=0.0001)\n", + " - Difference for variable VELOCITY U: 7.450580596923828e-09 (eps=0.006)\n", + " - Difference for variable VELOCITY V: 5.960464477539063e-08 (eps=0.007)\n", + " - Difference for variable VELOCITY W: 1.862645149230957e-09 (eps=0.0004)\n", + " - Difference for variable USTOKES: 9.313225746154785e-10 (eps=2e-05)\n", + " - Difference for variable VSTOKES: 3.725290298461914e-09 (eps=5e-05)\n", + " - Difference for variable WSTOKES: 2.3283064365386963e-10 (eps=6e-06)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/tom_couplittoral.slf and fom_couplittoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 5.960464477539063e-08 (eps=0.005)\n", + " - Difference for variable MEAN DIRECTION: 9.5367431640625e-07 (eps=0.1)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 7.450580596923828e-09 (eps=0.0002)\n", + " - Difference for variable VELOCITY U: 7.450580596923828e-09 (eps=0.007)\n", + " - Difference for variable VELOCITY V: 7.450580596923828e-09 (eps=0.003)\n", + " - Difference for variable FORCE FX: 1.1641532182693481e-10 (eps=6e-06)\n", + " - Difference for variable FORCE FY: 9.313225746154785e-10 (eps=2e-05)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=0.02)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r3d_littoralcoup.slf and ./vnv_3d_coupling/vnv_4/gnu.dynamic/r3d_littoralcoup.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 8.881784197001252e-16 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/tom_couplittoral.slf and ./vnv_3d_coupling/vnv_4/gnu.dynamic/tom_couplittoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=3e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 5.684341886080802e-14 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r2d_hist.slf and f2d_histcoup.slf:\n", + " - Difference for variable VELOCITY U: 1.4551915228366852e-11 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable FREE SURFACE: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_4/gnu.dynamic/r2d_hist.slf and f2d_histcoup.slf:\n", + " - Difference for variable VELOCITY U: 1.4551915228366852e-11 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable FREE SURFACE: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r3d_hist.slf and f3d_histcoup.slf:\n", + " - Difference for variable ELEVATION Z: 9.313225746154785e-10 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 1.1641532182693481e-10 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 2.3283064365386963e-10 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_4/gnu.dynamic/r3d_hist.slf and f3d_histcoup.slf:\n", + " - Difference for variable ELEVATION Z: 9.313225746154785e-10 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 1.1641532182693481e-10 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 2.3283064365386963e-10 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r2d_hist.slf and ./vnv_3d_coupling/vnv_4/gnu.dynamic/r2d_hist.slf:\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable FREE SURFACE: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_3/gnu.dynamic/r3d_hist.slf and ./vnv_3d_coupling/vnv_4/gnu.dynamic/r3d_hist.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 0.0 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_13/gnu.dynamic/r2d_hist.slf and f2d_histcoup.slf:\n", + " - Difference for variable VELOCITY U: 1.4551915228366852e-11 (eps=0.0001)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=0.0001)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=0.0001)\n", + " - Difference for variable FREE SURFACE: 0.0 (eps=0.0001)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_13/gnu.dynamic/r3d_hist.slf and f3d_histcoup.slf:\n", + " - Difference for variable ELEVATION Z: 9.313225746154785e-10 (eps=0.0001)\n", + " - Difference for variable VELOCITY U: 1.1641532182693481e-10 (eps=0.0001)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=0.0001)\n", + " - Difference for variable VELOCITY W: 2.3283064365386963e-10 (eps=0.0001)\n", + " - Difference for variable USTOKES: 0.0 (eps=0.0001)\n", + " - Difference for variable VSTOKES: 0.0 (eps=0.0001)\n", + " - Difference for variable WSTOKES: 0.0 (eps=0.0001)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_14/gnu.dynamic/r2d_hist.slf and f2d_histcoup.slf:\n", + " - Difference for variable VELOCITY U: 1.4551915228366852e-11 (eps=0.0001)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=0.0001)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=0.0001)\n", + " - Difference for variable FREE SURFACE: 0.0 (eps=0.0001)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_14/gnu.dynamic/r3d_hist.slf and f3d_histcoup.slf:\n", + " - Difference for variable ELEVATION Z: 9.313225746154785e-10 (eps=0.0001)\n", + " - Difference for variable VELOCITY U: 1.1641532182693481e-10 (eps=0.0001)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=0.0001)\n", + " - Difference for variable VELOCITY W: 2.3283064365386963e-10 (eps=0.0001)\n", + " - Difference for variable USTOKES: 0.0 (eps=0.0001)\n", + " - Difference for variable VSTOKES: 0.0 (eps=0.0001)\n", + " - Difference for variable WSTOKES: 0.0 (eps=0.0001)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_5/gnu.dynamic/r3d_littoral_diff.slf and f3d_littoral_diff.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 4.547473508864641e-13 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 1.7763568394002505e-15 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_5/gnu.dynamic/tom_littoral_diff.slf and fom_littoral_diff.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 3.76158192263132e-36 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_5/gnu.dynamic/r3d_littoral_diff.slf and ./vnv_3d_coupling/vnv_6/gnu.dynamic/r3d_littoral_diff.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 4.547473508864641e-13 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 7.275957614183426e-12 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_5/gnu.dynamic/tom_littoral_diff.slf and ./vnv_3d_coupling/vnv_6/gnu.dynamic/tom_littoral_diff.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 3.0844971765576824e-35 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_7/gnu.dynamic/r3d_couplittoral_diff.slf and f3d_couplittoral_diff.slf:\n", + " - Difference for variable ELEVATION Z: 3.725290298461914e-09 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 1.4901161193847656e-08 (eps=6e-08)\n", + " - Difference for variable VELOCITY V: 5.960464477539063e-08 (eps=6e-08)\n", + " - Difference for variable VELOCITY W: 1.862645149230957e-09 (eps=1e-08)\n", + " - Difference for variable USTOKES: 9.313225746154785e-10 (eps=6e-08)\n", + " - Difference for variable VSTOKES: 1.862645149230957e-09 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 2.3283064365386963e-10 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_7/gnu.dynamic/tom_3Dcouplittoral_diff.slf and fom_couplittoral_diff.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 3.725290298461914e-09 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 3.725290298461914e-09 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 2.2737367544323206e-13 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 3.725290298461914e-09 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_7/gnu.dynamic/r3d_couplittoral_diff.slf and ./vnv_3d_coupling/vnv_8/gnu.dynamic/r3d_couplittoral_diff.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 7.275957614183426e-12 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 3.637978807091713e-12 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_7/gnu.dynamic/tom_3Dcouplittoral_diff.slf and ./vnv_3d_coupling/vnv_8/gnu.dynamic/tom_3Dcouplittoral_diff.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 3.552713678800501e-15 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_9/gnu.dynamic/r3d_littoral.slf and f3d_littoral.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 4.440892098500626e-16 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_9/gnu.dynamic/tom_littoral.slf and fom_littoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_9/gnu.dynamic/r3d_littoral.slf and ./vnv_3d_coupling/vnv_10/gnu.dynamic/r3d_littoral.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 5.684341886080802e-14 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_9/gnu.dynamic/tom_littoral.slf and ./vnv_3d_coupling/vnv_10/gnu.dynamic/tom_littoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_11/gnu.dynamic/r3d_couplittoral_same.slf and f3d_littoralcoup.slf:\n", + " - Difference for variable ELEVATION Z: 3.725290298461914e-09 (eps=0.0001)\n", + " - Difference for variable VELOCITY U: 7.450580596923828e-09 (eps=0.006)\n", + " - Difference for variable VELOCITY V: 5.960464477539063e-08 (eps=0.007)\n", + " - Difference for variable VELOCITY W: 1.862645149230957e-09 (eps=0.0004)\n", + " - Difference for variable USTOKES: 9.313225746154785e-10 (eps=2e-05)\n", + " - Difference for variable VSTOKES: 3.725290298461914e-09 (eps=5e-05)\n", + " - Difference for variable WSTOKES: 2.3283064365386963e-10 (eps=6e-06)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_11/gnu.dynamic/tom_3Dcouplittoral_same.slf and fom_couplittoral.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 5.960464477539063e-08 (eps=0.005)\n", + " - Difference for variable MEAN DIRECTION: 9.5367431640625e-07 (eps=0.1)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 7.450580596923828e-09 (eps=0.0002)\n", + " - Difference for variable VELOCITY U: 7.450580596923828e-09 (eps=0.007)\n", + " - Difference for variable VELOCITY V: 7.450580596923828e-09 (eps=0.003)\n", + " - Difference for variable FORCE FX: 1.1641532182693481e-10 (eps=6e-06)\n", + " - Difference for variable FORCE FY: 9.313225746154785e-10 (eps=2e-05)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=0.02)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_11/gnu.dynamic/r3d_couplittoral_same.slf and ./vnv_3d_coupling/vnv_12/gnu.dynamic/r3d_couplittoral_same.slf:\n", + " - Difference for variable ELEVATION Z: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY W: 8.881784197001252e-16 (eps=1e-08)\n", + " - Difference for variable USTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable VSTOKES: 0.0 (eps=1e-08)\n", + " - Difference for variable WSTOKES: 0.0 (eps=1e-08)\n", + " +> checking epsilon between files ./vnv_3d_coupling/vnv_11/gnu.dynamic/tom_3Dcouplittoral_same.slf and ./vnv_3d_coupling/vnv_12/gnu.dynamic/tom_3Dcouplittoral_same.slf:\n", + " - Difference for variable WAVE HEIGHT HM0: 0.0 (eps=1e-08)\n", + " - Difference for variable MEAN DIRECTION: 0.0 (eps=1e-08)\n", + " - Difference for variable BOTTOM: 0.0 (eps=1e-08)\n", + " - Difference for variable WATER DEPTH: 0.0 (eps=1e-08)\n", + " - Difference for variable VELOCITY U: 5.684341886080802e-14 (eps=1e-08)\n", + " - Difference for variable VELOCITY V: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FX: 0.0 (eps=1e-08)\n", + " - Difference for variable FORCE FY: 0.0 (eps=1e-08)\n", + " - Difference for variable PEAK PERIOD TPR5: 0.0 (eps=1e-08)\n", + " ~> Plotting img/fond\n", + " ~> Plotting img/resultscoupVert\n", + " ~> Plotting img/resultscoupVert2\n", + " ~> Plotting img/resultshori\n", + " ~> Plotting img/HM01\n", + " ~> Plotting img/resultscoupVert3\n", + " ~> Plotting img/resultscoupVert23\n", + " ~> Plotting img/resultshori3\n", + " ~> Plotting img/HM03\n", + " ~> Plotting img/mesh5T3D\n", + " ~> Plotting img/mesh5WAC\n", + " ~> Plotting img/HM05\n", + " ~> Plotting img/HM07\n", + "\n", + "\n", + "My work is done\n", + "\n", + "\n" + ] + } + ], + "source": [ + "!validate_telemac.py $HOMETEL/examples/tomawac/3Dcoupling/vnv_3d_coupling.py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2 - Visualise and compare 1D / 2D results" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "compare file exports" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "hist_file2D = os.environ['HOMETEL'] + \"/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/r2d_hist.slf\"\n", + "out_file2D = os.environ['HOMETEL'] + \"/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/r2d_littoralcoup.slf\"\n", + "hist_file_WAC=os.environ['HOMETEL'] + \"/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/tom_hist.slf\"\n", + "out_fileWAC = os.environ['HOMETEL'] + \"/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/tom_couplittoral.slf\"" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 3kB\n",
+       "Dimensions:  (time: 21, node: 8)\n",
+       "Coordinates:\n",
+       "    x        (node) float32 32B ...\n",
+       "    y        (node) float32 32B ...\n",
+       "  * time     (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n",
+       "Dimensions without coordinates: node\n",
+       "Data variables:\n",
+       "    U        (time, node) float32 672B ...\n",
+       "    V        (time, node) float32 672B ...\n",
+       "    H        (time, node) float32 672B ...\n",
+       "    S        (time, node) float32 672B ...\n",
+       "Attributes:\n",
+       "    title:       HISTORY FILE\n",
+       "    language:    en\n",
+       "    float_size:  4\n",
+       "    endian:      >\n",
+       "    params:      (1, 0, 0, 0, 0, 0, 0, 8, 0, 1)\n",
+       "    ipobo:       [1 2 3 4 5 6 7 8]\n",
+       "    ikle2:       [[1]\\n [2]\\n [3]\\n [4]\\n [5]\\n [6]\\n [7]\\n [8]]\n",
+       "    variables:   {'U': ('VELOCITY U', 'M/S'), 'V': ('VELOCITY V', 'M/S'), 'H'...\n",
+       "    date_start:  (1900, 1, 1, 0, 0, 0)
" + ], + "text/plain": [ + " Size: 3kB\n", + "Dimensions: (time: 21, node: 8)\n", + "Coordinates:\n", + " x (node) float32 32B ...\n", + " y (node) float32 32B ...\n", + " * time (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n", + "Dimensions without coordinates: node\n", + "Data variables:\n", + " U (time, node) float32 672B ...\n", + " V (time, node) float32 672B ...\n", + " H (time, node) float32 672B ...\n", + " S (time, node) float32 672B ...\n", + "Attributes:\n", + " title: HISTORY FILE\n", + " language: en\n", + " float_size: 4\n", + " endian: >\n", + " params: (1, 0, 0, 0, 0, 0, 0, 8, 0, 1)\n", + " ipobo: [1 2 3 4 5 6 7 8]\n", + " ikle2: [[1]\\n [2]\\n [3]\\n [4]\\n [5]\\n [6]\\n [7]\\n [8]]\n", + " variables: {'U': ('VELOCITY U', 'M/S'), 'V': ('VELOCITY V', 'M/S'), 'H'...\n", + " date_start: (1900, 1, 1, 0, 0, 0)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 719kB\n",
+       "Dimensions:  (time: 21, node: 2091)\n",
+       "Coordinates:\n",
+       "    x        (node) float32 8kB ...\n",
+       "    y        (node) float32 8kB ...\n",
+       "  * time     (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n",
+       "Dimensions without coordinates: node\n",
+       "Data variables:\n",
+       "    U        (time, node) float32 176kB ...\n",
+       "    V        (time, node) float32 176kB ...\n",
+       "    H        (time, node) float32 176kB ...\n",
+       "    S        (time, node) float32 176kB ...\n",
+       "Attributes:\n",
+       "    title:       TELEMAC 3D : COUPLAGE TOMAWAC\n",
+       "    language:    en\n",
+       "    float_size:  4\n",
+       "    endian:      >\n",
+       "    params:      (1, 0, 0, 0, 0, 0, 0, 180, 0, 1)\n",
+       "    ipobo:       [1 2 3 ... 0 0 0]\n",
+       "    ikle2:       [[   1    2  181]\\n [   1  181  180]\\n [   2    3  181]\\n .....\n",
+       "    variables:   {'U': ('VELOCITY U', 'M/S'), 'V': ('VELOCITY V', 'M/S'), 'H'...\n",
+       "    date_start:  (1900, 1, 1, 0, 0, 0)
" + ], + "text/plain": [ + " Size: 719kB\n", + "Dimensions: (time: 21, node: 2091)\n", + "Coordinates:\n", + " x (node) float32 8kB ...\n", + " y (node) float32 8kB ...\n", + " * time (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n", + "Dimensions without coordinates: node\n", + "Data variables:\n", + " U (time, node) float32 176kB ...\n", + " V (time, node) float32 176kB ...\n", + " H (time, node) float32 176kB ...\n", + " S (time, node) float32 176kB ...\n", + "Attributes:\n", + " title: TELEMAC 3D : COUPLAGE TOMAWAC\n", + " language: en\n", + " float_size: 4\n", + " endian: >\n", + " params: (1, 0, 0, 0, 0, 0, 0, 180, 0, 1)\n", + " ipobo: [1 2 3 ... 0 0 0]\n", + " ikle2: [[ 1 2 181]\\n [ 1 181 180]\\n [ 2 3 181]\\n .....\n", + " variables: {'U': ('VELOCITY U', 'M/S'), 'V': ('VELOCITY V', 'M/S'), 'H'...\n", + " date_start: (1900, 1, 1, 0, 0, 0)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import xarray as xr\n", + "ds1D = xr.open_dataset(hist_file2D);ds1D\n", + "ds2D = xr.open_dataset(out_file2D);ds2D" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Use hvplot package for inter-active visualisation" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "import hvplot.xarray" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ee6f2abf300e4e46bda755c390d821dc", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "BokehModel(combine_events=True, render_bundle={'docs_json': {'9d6fddcb-a0bf-492c-8f57-4cf73ac29669': {'version…" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds2D.hvplot.scatter(x='x', y='y', c='S', s = 20)*ds1D.hvplot.scatter(x='x', y='y', c='S', s= 150, line_color = 'k')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": {}, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_exec.v0+json": "", + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "text/plain": [ + ":Overlay\n", + " .Curve.Node_0 :Curve [time] (S)\n", + " .Curve.Node_1 :Curve [time] (S)\n", + " .Curve.Node_2 :Curve [time] (S)\n", + " .Curve.Node_3 :Curve [time] (S)\n", + " .Curve.Node_4 :Curve [time] (S)\n", + " .Curve.Node_5 :Curve [time] (S)\n", + " .Curve.Node_6 :Curve [time] (S)\n", + " .Curve.Node_7 :Curve [time] (S)" + ] + }, + "execution_count": 28, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1743" + } + }, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_1D(ds, var):\n", + " plot = ds[var].isel(node=0).hvplot.line(label = \"node 0\")\n", + " for node in range(len(ds.node))[1:]:\n", + " plot *= ds[var].isel(node=node).hvplot.line(label = f\"node {node}\")\n", + " return plot\n", + "\n", + "plot_1D(ds1D, \"S\")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 6kB\n",
+       "Dimensions:   (time: 21, node: 8)\n",
+       "Coordinates:\n",
+       "    x         (node) float32 32B ...\n",
+       "    y         (node) float32 32B ...\n",
+       "  * time      (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n",
+       "Dimensions without coordinates: node\n",
+       "Data variables:\n",
+       "    WH        (time, node) float32 672B ...\n",
+       "    THETAW    (time, node) float32 672B ...\n",
+       "    B         (time, node) float32 672B ...\n",
+       "    H         (time, node) float32 672B ...\n",
+       "    U         (time, node) float32 672B ...\n",
+       "    V         (time, node) float32 672B ...\n",
+       "    FORCE FX  (time, node) float32 672B ...\n",
+       "    FORCE FY  (time, node) float32 672B ...\n",
+       "    PPT       (time, node) float32 672B ...\n",
+       "Attributes:\n",
+       "    title:       HISTORY FILE\n",
+       "    language:    en\n",
+       "    float_size:  4\n",
+       "    endian:      >\n",
+       "    params:      (1, 0, 0, 0, 0, 0, 0, 8, 0, 0)\n",
+       "    ipobo:       [1 2 3 4 5 6 7 8]\n",
+       "    ikle2:       [[1]\\n [2]\\n [3]\\n [4]\\n [5]\\n [6]\\n [7]\\n [8]]\n",
+       "    variables:   {'WH': ('WAVE HEIGHT HM0', 'M'), 'THETAW': ('MEAN DIRECTION'...\n",
+       "    date_start:  (1900, 1, 1, 0, 0, 0)
" + ], + "text/plain": [ + " Size: 6kB\n", + "Dimensions: (time: 21, node: 8)\n", + "Coordinates:\n", + " x (node) float32 32B ...\n", + " y (node) float32 32B ...\n", + " * time (time) datetime64[ns] 168B 1900-01-01 ... 1900-01-01T00:16:40\n", + "Dimensions without coordinates: node\n", + "Data variables:\n", + " WH (time, node) float32 672B ...\n", + " THETAW (time, node) float32 672B ...\n", + " B (time, node) float32 672B ...\n", + " H (time, node) float32 672B ...\n", + " U (time, node) float32 672B ...\n", + " V (time, node) float32 672B ...\n", + " FORCE FX (time, node) float32 672B ...\n", + " FORCE FY (time, node) float32 672B ...\n", + " PPT (time, node) float32 672B ...\n", + "Attributes:\n", + " title: HISTORY FILE\n", + " language: en\n", + " float_size: 4\n", + " endian: >\n", + " params: (1, 0, 0, 0, 0, 0, 0, 8, 0, 0)\n", + " ipobo: [1 2 3 4 5 6 7 8]\n", + " ikle2: [[1]\\n [2]\\n [3]\\n [4]\\n [5]\\n [6]\\n [7]\\n [8]]\n", + " variables: {'WH': ('WAVE HEIGHT HM0', 'M'), 'THETAW': ('MEAN DIRECTION'...\n", + " date_start: (1900, 1, 1, 0, 0, 0)" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 845kB\n",
+       "Dimensions:   (time: 11, node: 2091)\n",
+       "Coordinates:\n",
+       "    x         (node) float32 8kB ...\n",
+       "    y         (node) float32 8kB ...\n",
+       "  * time      (time) datetime64[ns] 88B 1900-01-01 ... 1900-01-01T00:16:40\n",
+       "Dimensions without coordinates: node\n",
+       "Data variables:\n",
+       "    WH        (time, node) float32 92kB ...\n",
+       "    THETAW    (time, node) float32 92kB ...\n",
+       "    B         (time, node) float32 92kB ...\n",
+       "    H         (time, node) float32 92kB ...\n",
+       "    U         (time, node) float32 92kB ...\n",
+       "    V         (time, node) float32 92kB ...\n",
+       "    FORCE FX  (time, node) float32 92kB ...\n",
+       "    FORCE FY  (time, node) float32 92kB ...\n",
+       "    PPT       (time, node) float32 92kB ...\n",
+       "Attributes:\n",
+       "    title:       LITTORAL\n",
+       "    language:    en\n",
+       "    float_size:  4\n",
+       "    endian:      >\n",
+       "    params:      (1, 0, 0, 0, 0, 0, 0, 180, 0, 0)\n",
+       "    ipobo:       [1 2 3 ... 0 0 0]\n",
+       "    ikle2:       [[   1    2  181]\\n [   1  181  180]\\n [   2    3  181]\\n .....\n",
+       "    variables:   {'WH': ('WAVE HEIGHT HM0', 'M'), 'THETAW': ('MEAN DIRECTION'...\n",
+       "    date_start:  (1900, 1, 1, 0, 0, 0)
" + ], + "text/plain": [ + " Size: 845kB\n", + "Dimensions: (time: 11, node: 2091)\n", + "Coordinates:\n", + " x (node) float32 8kB ...\n", + " y (node) float32 8kB ...\n", + " * time (time) datetime64[ns] 88B 1900-01-01 ... 1900-01-01T00:16:40\n", + "Dimensions without coordinates: node\n", + "Data variables:\n", + " WH (time, node) float32 92kB ...\n", + " THETAW (time, node) float32 92kB ...\n", + " B (time, node) float32 92kB ...\n", + " H (time, node) float32 92kB ...\n", + " U (time, node) float32 92kB ...\n", + " V (time, node) float32 92kB ...\n", + " FORCE FX (time, node) float32 92kB ...\n", + " FORCE FY (time, node) float32 92kB ...\n", + " PPT (time, node) float32 92kB ...\n", + "Attributes:\n", + " title: LITTORAL\n", + " language: en\n", + " float_size: 4\n", + " endian: >\n", + " params: (1, 0, 0, 0, 0, 0, 0, 180, 0, 0)\n", + " ipobo: [1 2 3 ... 0 0 0]\n", + " ikle2: [[ 1 2 181]\\n [ 1 181 180]\\n [ 2 3 181]\\n .....\n", + " variables: {'WH': ('WAVE HEIGHT HM0', 'M'), 'THETAW': ('MEAN DIRECTION'...\n", + " date_start: (1900, 1, 1, 0, 0, 0)" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "hist_WAC = xr.open_dataset(hist_file_WAC);hist_WAC\n", + "dsWAC = xr.open_dataset(out_fileWAC);dsWAC" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here you might get errors because the history fille has more time steps than the 2D TOMAWAC output " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "55c3968c76de4e77bed8410b4da37252", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "BokehModel(combine_events=True, render_bundle={'docs_json': {'359b8d90-c828-4841-ba26-d18ccb7bf4a6': {'version…" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dsWAC.hvplot.scatter(x='x', y='y', c='WH', s = 20)*hist_WAC.hvplot.scatter(x='x', y='y', c='WH', s= 150, line_color = 'k')" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": {}, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_exec.v0+json": "", + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "text/plain": [ + ":Overlay\n", + " .Curve.Node_0 :Curve [time] (WH)\n", + " .Curve.Node_1 :Curve [time] (WH)\n", + " .Curve.Node_2 :Curve [time] (WH)\n", + " .Curve.Node_3 :Curve [time] (WH)\n", + " .Curve.Node_4 :Curve [time] (WH)\n", + " .Curve.Node_5 :Curve [time] (WH)\n", + " .Curve.Node_6 :Curve [time] (WH)\n", + " .Curve.Node_7 :Curve [time] (WH)" + ] + }, + "execution_count": 16, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1426" + } + }, + "output_type": "execute_result" + } + ], + "source": [ + "plot_1D(hist_WAC, \"WH\")" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "SERAFIN VALIDATION ERROR: The number of nodes per element is not equal to 6\n" + ] + }, + { + "ename": "SerafinValidationError", + "evalue": "The number of nodes per element is not equal to 6", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mSerafinValidationError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[19], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m hist_file3D \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39menviron[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mHOMETEL\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/r3d_hist.slf\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m----> 2\u001b[0m ds \u001b[38;5;241m=\u001b[39m \u001b[43mxr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen_dataset\u001b[49m\u001b[43m(\u001b[49m\u001b[43mhist_file3D\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray/backends/api.py:611\u001b[0m, in \u001b[0;36mopen_dataset\u001b[0;34m(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)\u001b[0m\n\u001b[1;32m 599\u001b[0m decoders \u001b[38;5;241m=\u001b[39m _resolve_decoders_kwargs(\n\u001b[1;32m 600\u001b[0m decode_cf,\n\u001b[1;32m 601\u001b[0m open_backend_dataset_parameters\u001b[38;5;241m=\u001b[39mbackend\u001b[38;5;241m.\u001b[39mopen_dataset_parameters,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 607\u001b[0m decode_coords\u001b[38;5;241m=\u001b[39mdecode_coords,\n\u001b[1;32m 608\u001b[0m )\n\u001b[1;32m 610\u001b[0m overwrite_encoded_chunks \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moverwrite_encoded_chunks\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m--> 611\u001b[0m backend_ds \u001b[38;5;241m=\u001b[39m \u001b[43mbackend\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen_dataset\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 612\u001b[0m \u001b[43m \u001b[49m\u001b[43mfilename_or_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 613\u001b[0m \u001b[43m \u001b[49m\u001b[43mdrop_variables\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdrop_variables\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 614\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mdecoders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 615\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 616\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 617\u001b[0m ds \u001b[38;5;241m=\u001b[39m _dataset_from_backend_dataset(\n\u001b[1;32m 618\u001b[0m backend_ds,\n\u001b[1;32m 619\u001b[0m filename_or_obj,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 629\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[1;32m 630\u001b[0m )\n\u001b[1;32m 631\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray_selafin/xarray_backend.py:271\u001b[0m, in \u001b[0;36mSelafinBackendEntrypoint.open_dataset\u001b[0;34m(self, filename_or_obj, drop_variables, decode_times, lazy_loading, lang)\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mopen_dataset\u001b[39m(\n\u001b[1;32m 261\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 262\u001b[0m filename_or_obj,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 269\u001b[0m ):\n\u001b[1;32m 270\u001b[0m \u001b[38;5;66;03m# Initialize SELAFIN reader\u001b[39;00m\n\u001b[0;32m--> 271\u001b[0m slf \u001b[38;5;241m=\u001b[39m \u001b[43mread_serafin\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilename_or_obj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlang\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 272\u001b[0m is_2d \u001b[38;5;241m=\u001b[39m slf\u001b[38;5;241m.\u001b[39mheader\u001b[38;5;241m.\u001b[39mis_2d\n\u001b[1;32m 274\u001b[0m \u001b[38;5;66;03m# Prepare dimensions, coordinates, and data variables\u001b[39;00m\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray_selafin/xarray_backend.py:25\u001b[0m, in \u001b[0;36mread_serafin\u001b[0;34m(f, lang)\u001b[0m\n\u001b[1;32m 23\u001b[0m resin \u001b[38;5;241m=\u001b[39m Serafin\u001b[38;5;241m.\u001b[39mRead(f, lang)\n\u001b[1;32m 24\u001b[0m resin\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__enter__\u001b[39m()\n\u001b[0;32m---> 25\u001b[0m \u001b[43mresin\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_header\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 26\u001b[0m resin\u001b[38;5;241m.\u001b[39mget_time()\n\u001b[1;32m 27\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resin\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray_selafin/Serafin.py:1027\u001b[0m, in \u001b[0;36mRead.read_header\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1023\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"!\u001b[39;00m\n\u001b[1;32m 1024\u001b[0m \u001b[38;5;124;03m@brief Read the file header and check the file consistency\u001b[39;00m\n\u001b[1;32m 1025\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1026\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mheader \u001b[38;5;241m=\u001b[39m SerafinHeader(lang\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlanguage)\n\u001b[0;32m-> 1027\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mheader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_file\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfile_size\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray_selafin/Serafin.py:892\u001b[0m, in \u001b[0;36mSerafinHeader.from_file\u001b[0;34m(self, file, file_size)\u001b[0m\n\u001b[1;32m 889\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m SerafinValidationError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe magic number is not equal to one\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 890\u001b[0m file\u001b[38;5;241m.\u001b[39mread(\u001b[38;5;241m4\u001b[39m)\n\u001b[0;32m--> 892\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_check_dim\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 894\u001b[0m \u001b[38;5;66;03m# determine the number of nodes in 2D\u001b[39;00m\n\u001b[1;32m 895\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_2d:\n", + "File \u001b[0;32m~/miniconda3/envs/telemac_compil_test/lib/python3.11/site-packages/xarray_selafin/Serafin.py:200\u001b[0m, in \u001b[0;36mSerafinHeader._check_dim\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 199\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mnb_nodes_per_elem \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m6\u001b[39m:\n\u001b[0;32m--> 200\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m SerafinValidationError(\n\u001b[1;32m 201\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe number of nodes per element is not equal to 6\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 202\u001b[0m )\n\u001b[1;32m 203\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mnb_planes \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m 204\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m SerafinValidationError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe number of planes is less than 2\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "\u001b[0;31mSerafinValidationError\u001b[0m: The number of nodes per element is not equal to 6" + ] + } + ], + "source": [ + "hist_file3D = os.environ['HOMETEL'] + \"/examples/tomawac/3Dcoupling/vnv_3d_coupling/vnv_14/gnu.dynamic/r3d_hist.slf\"\n", + "ds = xr.open_dataset(hist_file3D)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we need to fix the xarray-selafin for reading time series outputs for 3D models.\n", + "\n", + "To be continued... " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "telemac_compil_test", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/index.html b/index.html index 700adcb..f58cbb4 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,7 @@