2. Tonkin Gulf tidal modeling

Table of contents

Structured grid’s files:

General input files:

Tidal input files

Preliminary step:

First, go to today’s directory :

cd ~/tuesday

Make sure you have exported the environment variables :

. export_path_aerotp

Exercice I: unstructured grid creation from a structured one

T-UGOm spectral tidal solver can be used to rapidly compute a tidal atlas from a structured grid.

Objectives

T-UGOm embedded spectral solver is a very cheap way to compute tidal solutions on a region of interest. It can easily be used by the finite difference (i.e. structured grid) community by generating a unstructured grid by cutting FD cells into 2 FE elements (triangles). A similar strategy is used to run WW3 on stretched structured grid.

Exercise I aims to run the COMODO-TOOLS softwares (symtools and symmic) that will do the grid conversion.

Starting from a ROMS NetCDF grid

You can now change directory to  :

cd ~/tuesday/Tonkin/tonkin_ex1/roms

where you will find the roms_grd.nc NetCDF grid file. Then execute:

symmic -g roms_grd.nc roms_grd.nc -source roms

On output, unstructured grid file (*.nei format) : symmic-regular.nei

Starting from a SYMPHONIE notebook (grid)

You can now change directory to  :

cd ~/tuesday/Tonkin/tonkin_ex1/symphonie

where you will find the notebook-grid (SYMPHONIE grid construction parameters) and tonkin.plg files (polygons ASCCI file to generate the land/sea mask).

First step: create SYMPHONIE NetCDF grid file

symtools -zmin 5. -b $DATA/topography/gebco/gridone.grd -n notebook-grid -p tonkin

Second step: create T-UGOm grid file (*.nei format)

symmic -g symphonie.chk.spherical.nc symphonie.chk.spherical.nc

On output, unstructured grid file (*.nei format) : symmic-regular.nei

Looking closer to the resulting unstructured grids

Let’s use xscan to display the grids. First edit the startup file and fix defaults paths:

gedit ~/tuesday/Tonkin/data/tonkin.startup

Now let’s play with it:

xscan -s ~/tuesday/Tonkin/data/tonkin.startup

Go to “Elements edition” menu, then use “open” in File menu to select and load the symmic-regular.nei.

Exercise II: tidal simulation

  1. generation of model input files
  2. model setting
  3. tidal simulations
  4. validation against tide gauges and altimetry

detailed instructions

Suggested architecture:

  • data
    • OBC-FES2004

tides.obc

  • bathymetry

topo-LGP1-1.s2r

slope-LGP1-1.v2r

tonkin.nei

tonkin.bel

  • simulation-tides

spectrum.info

spectral-DNP1xLGP2-quadratic.intg

Objectives

Ushant Sea is dominated by semi-diurnal tides, and sea floor is quite rough (sandy and rocky bed). The Tonkin Gulf is dominated by diurnal tides, and sea floor is partly cover by fine sediments.

Exercise II aims :

  • to complete the Exercise I (i.e. achieving tidal modeling from a FD grid)
  • highlight the sensitivity of tidal simulation to friction parameters setting

Prepare the input data:

Go to the Tonkin directory :

cd ~/tuesday/Tonkin/tonkin_ex2

tonkin.startup: a startup for xscan (defining zoom frames, default coastline, etc.)  which wiil be useful to look at the model outputs (run xscan -s tonkin.startup at the command line prompt).

Go to the data directory that will contains the general input data necessary to run the model :

cd data

Copy the mesh file genrated from the SYMPHONIE notebook:

cp ../tonkin_ex2/symphonie/symmic-regular.nei tonkin.nei

Generate dephts and slopes files (optional):

Grid file tonkin.nei already contains bathymetry values at vertices. However you can use a different bottom topography without rebuilding the grid file. External depths and bathymetry slopes can be set for true model discretisation nodes (discontinuous ncP1 and continuous LGP2 in this exercise), or simply at LGP1 ones (vertices), from which depths and slopes will be interpolated to model discretisation nodes.

mkdir bathymetry ; cd bathymetry
mesh-topo -m ../tonkin.nei -b ~/softs/xscan/data/topography/data/gebco_08.grd -p LGP0xLGP1
cd ..

Generate (with xscan) the Boundary ELement description file : mesh.bel

xscan -s ~/tuesday/Tonkin/tonkin.startup

Generate the Open Boundary Conditions file : tides.obc.

This file contains the tidal elevation (amplitude and phase) from a tidal atlas, interpolated at the open boundary points of your mesh.

Create the data directory containing the input data necessary to run the model :

mkdir OBC-FES2004 ; cd OBC-FES2004 

Generate the Open Boundary Conditions file : tides.obc.

To create it, use the atlas2obc command line tool :

atlas2obc -m ../tonkin.nei -b ../tonkin.bel -p $DATA/tides/FES2004/ -c WAVE.tide.nc M2 K1 O1 M4

where WAVE.tide.nc is the naming conventions of the FES2004 atlas files.

At that point, you should have the following files in data:

  • a final mesh version : tonkin.nei
  • the boundary element description file : tonkin.bel
  • the bathymetry, interpolated on the mesh vertices : topo.s2r (s2r stands for Scalar Real)
  • the bathymetry gradient : slope.v2r (for Vector Real)

Model parameters setting:

You can now change directory to simulation-tides :

cd ../simulation-tides

where you will find

  • trill.nei : a symbolic link to the mesh.nei (tugo needs to have it here with a name finishing by “ll.nei”)
  • spectral-DNP1xLGP2-quadratic.intg : a Tugo-m configuration file defining all the parameters to launch the run (including quadratic bottom friction).
  • spectral-DNP1xLGP2-linear.intg : a Tugo-m configuration file defining all the parameters to launch the run (including linear bottom friction).

Better than a long explanation, take a look at it. This is a ascci file so you can edit it manually, or use the tugo-gui-1.0 graphical interfaceBetter than a long explanation, take a look at it. This is a ascci file so you can edit it manually, or use the tugo-gui-1.0 graphical interface

tugo-gui spectral-DNP1xLGP2-quadratic.intg

Once you’re done, click on FILE -> save complete to save your changes.

We shall focus on the following settings:

  • spectral solver
  • dominant waves
  • bottom friction

Running the model with quadratic bottom friction:

Launch the model (redirect the output to a text file log00):

tugo spectral-DNP1xLGP2-quadratic.intg > log00 &

You can look at the progression (ctrl+c to stop) :

tail -f log00

Or stop the process :

ps -edf | grep tugo

to get the PID (first number of the tugo line of the previous command), then :

kill -9 the_pid
kill -9 `ps -edf | grep tugo | head -n1 | cut -d' ' -f5`

Examine the outputs :

The model outputs are stored in the subdirectory out-spectralDNP1xLGP2 (or any other name according to what you put in the  configuration file).

T-UGOm generates various output files :

ls out-spectralDNP1xLGP2-quadratic

Some of them can be directly visualised with xscan :

xscan -s ~/tuesady/Tonkin/data/tonkin.startup

Validate against tide gauges :

You will now validate the tidal model outputs (harmonic constants from tugo’s harmonic analysis) against available tide gauges (or altimetry) data :

Launch the tides-validate tool with the -h option to get help :

tides-validate -h

Here is an example to perform the validation of the model results (on unstructured LGP2 grid ) against tide gauges data (tonkin-tg.mgr) :

tides-validate -p ../ -g $DATA/gauges/validation/china-sea/tonkin-tg.mgr -a WAVE.spectral.nc -unstructured LGP2 M2 K1

Here is another  example to perform the validation of the model results (on structured grid ) against altimetry data (tonkin-alti.mgr) :

tides-validate -p ../ -g $DATA/gauges/validation/china-sea/tonkin-alti.mgr -a WAVE-AUTO.01.SG.nc M2 K1

The result is in the text file validate.out

more validate.out

Running the model with linear bottom friction:

Launch the model (redirect the output to a text file log01):

tugo spectral-DNP1xLGP2-linear.intg > log01 &

Then you can follow the same steps as for quadratic friction simulation.

Search