Dynamical coupling : MARS-WW3

The MARS-WW3 coupling has been instrumented by Anthony Thévenin (Cerfacs) and Valérie Garnier (Ifremer) thanks to the precious help of Fabrice Ardhuin and Mickael Accensi (Ifremer). The integration of the OASIS coupler benefited from the work of Anne-Claire Bennis who has initially coupled MARS and WW3 codes with the PALM coupler.

The following technical report explains the OASIS instrumentation in MARS and WW3. Lien DOC AnthonyXXXX

Version of the codes

To couple MARS and WW3 with OASIS, use the following or newer versions:

  • MARS : V10.5 or r1771 for developpers only
  • WW3 : The official WW3 release XXX or r1083 from IFREMER SVN repository

Compilation

WW3 : add the following switches in switch.OASIS: COU OASIS OASOCM

MARS : add the following CPP keys: -Dkey_oasis -Dkey_oasis_mars_ww3

Compile each code in its own environment. Be careful, MARS, OASIS and WW3 must use (and must be compiled with) the same libraries.

Note

You must compile WW3 and MARS in parallel (MPI or MPT)

Exchanged variables

18 variables are exchanged between MARS and WW3:

+====================+===================================+================+===================+
| Variable Name (WW3)| Signification                     |    MARS name   |     WW3 name      |
+====================+===================================+================+===================+
| WLV     (MARS var) | Sea surface Height (m)            |   MARS_SSH     |    WW3__SSH       |
+--------------------+-----------------------------------+----------------+-------------------+
| CX      (MARS var) | Oceanic current u-component (m/s) |   MARS__UZ     |    WW3___UZ       |
+--------------------+-----------------------------------+----------------+-------------------+
| CY      (MARS var) | Oceanic current v-component (m/s) |   MARS__VZ     |    WW3___VZ       |
+====================+===================================+================+===================+
| T0M1     (WW3 var) | Mean wave period (s)              |   MARST0M1     |    WW3_T0M1       |
+--------------------+-----------------------------------+----------------+-------------------+
| HS       (WW3 var) | Wave height (hs in m)             |   MARS__HS     |    WW3___HS       |
+--------------------+-----------------------------------+----------------+-------------------+
| THM      (WW3 var) | Mean wave direction (degrees)     |   MARS_DIR     |    WW3__DIR       |
+--------------------+-----------------------------------+----------------+-------------------+
| BHD      (WW3 var) | Wave-induced Bernoulli head       |   MARS_BHD     |    WW3__BHD       |
|                    | pressure (N.m-1) (J term)         |                |                   |
+--------------------+-----------------------------------+----------------+-------------------+
| TAUOX    (WW3 var) | Wave-ocean momentum flux (m2.s-2) |   MARSTWOX     |    WW3_TWOX       |
+--------------------+-----------------------------------+----------------+-------------------+
| TAUOY    (WW3 var) | Wave-ocean momentum flux (m2.s-2) |   MARSTWOY     |    WW3_TWOY       |
+--------------------+-----------------------------------+----------------+-------------------+
| UBA      (WW3 var) | Bottom rms velocity (m/s)         |   MARS_UBR     |    WW3__UBR       |
+--------------------+-----------------------------------+----------------+-------------------+
| PHIOC    (WW3 var) | Wave-to-ocean TKE flux (W.m-2)    |   MARS_FOC     |    WW3__FOC       |
+--------------------+-----------------------------------+----------------+-------------------+
| TAUWIX   (WW3 var) | Net wave-supported stress (m2.s-2)|   MARSTAWX     |   WW3_TAWX        |
+--------------------+-----------------------------------+----------------+-------------------+
| TAUWIY   (WW3 var) | Net wave-supported stress (m2.s-2)|   MARSTAWY     |   WW3_TAWY        |
+--------------------+-----------------------------------+----------------+-------------------+
| WLM      (WW3 var) | Mean wave length (m)              |   MARS__LM     |   WW3___LM        |
+====================+===================================+================+===================+

For the wave variables, the _LM, _TAWY extensions correspond to the names introduced in ww3_shel.inp to estimate and save the variables in WW3.

Coupling namelist

An exemple of namcouple file is available under namcouple

Main rules

To estimate the gridding weigths at the begining of the run (spatial interpolation)

To use previously estimated gridding weigths (spatial interpolation)

Run MARS and WW3 together

  • In a data directory, save the following files:

    bathymetric MARS and WW3 files,
    restart files,
    job_mars_ww3_coupling.pbs file,
    namcouple file
    

The job_mars_ww3_coupling.pbs file specifies the libraries, the run optimization and the number of cpu allocated to each of the codes:

#!/bin/csh

#PBS -q parallel8
#PBS -l select=1:ncpus=8:mpiprocs=8
##PBS -q parallel32
##PBS -l select=1:ncpus=32:mpiprocs=32
source /usr/share/modules/init/csh
module purge ; module load mpt/2.06 intel-comp/12.1.5
setenv MKL_SERIAL YES

setenv LD_LIBRARY_PATH /home13/caparmor/previmer/op/bin/netcdf4.1.2_mpt/lib:$LD_LIBRARY_PATH

setenv MPI_TYPE_DEPTH 50
setenv MPI_TYPE_MAX 50000
setenv MPI_DEFAULT_SINGLE_COPY_OFF "ON"

echo $LD_LIBRARY_PATH

# cd to the directory you submitted your job
cd $PBS_O_WORKDIR
mpiexec_mpt -np 4 ./mars_exe : -np 4 ./ww3_shel >& Job_coupling_output
~