New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
README.rst in NEMO/trunk/cfgs/AGRIF_DEMO – NEMO

source: NEMO/trunk/cfgs/AGRIF_DEMO/README.rst @ 11734

Last change on this file since 11734 was 11734, checked in by nicolasmartin, 5 years ago

Review README for reference confgiurations

File size: 4.5 KB
Line 
1**************
2Embedded zooms
3**************
4
5.. todo::
6
7
8
9.. contents::
10   :local:
11
12Overview
13========
14
15AGRIF (Adaptive Grid Refinement In Fortran) is a library that allows the seamless space and time refinement over
16rectangular regions in NEMO.
17Refinement factors can be odd or even (usually lower than 5 to maintain stability).
18Interaction between grid is "two-ways" in the sense that the parent grid feeds the child grid open boundaries and
19the child grid provides volume averages of prognostic variables once a given number of time step is completed.
20These pages provide guidelines how to use AGRIF in NEMO.
21For a more technical description of the library itself, please refer to http://agrif.imag.fr.
22
23Compilation
24===========
25
26Activating AGRIF requires to append the cpp key ``key_agrif`` at compilation time:
27
28.. code-block:: sh
29
30   ./makenemo add_key 'key_agrif'
31
32Although this is transparent to users, the way the code is processed during compilation is different from
33the standard case:
34a preprocessing stage (the so called "conv" program) translates the actual code so that
35saved arrays may be switched in memory space from one domain to an other.
36
37Definition of the grid hierarchy
38================================
39
40An additional text file ``AGRIF_FixedGrids.in`` is required at run time.
41This is where the grid hierarchy is defined.
42An example of such a file, here taken from the ``ICEDYN`` test case, is given below::
43
44   1
45   34 63 34 63 3 3 3
46   0
47
48The first line indicates the number of zooms (1).
49The second line contains the starting and ending indices in both directions on the root grid
50(imin=34 imax=63 jmin=34 jmax=63) followed by the space and time refinement factors (3 3 3).
51The last line is the number of child grid nested in the refined region (0).
52A more complex example with telescoping grids can be found below and
53in the ``AGRIF_DEMO`` reference configuration directory.
54
55[Add some plots here with grid staggering and positioning ?]
56
57When creating the nested domain, one must keep in mind that the child domain is shifted toward north-east and
58depends on the number of ghost cells as illustrated by the (attempted) drawing below for nbghostcells=1 and
59nbghostcells=3.
60The grid refinement is 3 and nxfin is the number of child grid points in i-direction.
61
62.. image:: _static/agrif_grid_position.jpg
63
64Note that rectangular regions must be defined so that they are connected to a single parent grid.
65Hence, defining overlapping grids with the same refinement ratio will not work properly,
66boundary data exchange and update being only performed between root and child grids.
67Use of east-west periodic or north-fold boundary conditions is not allowed in child grids either.
68Defining for instance a circumpolar zoom in a global model is therefore not possible.
69
70Preprocessing
71=============
72
73Knowing the refinement factors and area, a ``NESTING`` pre-processing tool may help to create needed input files
74(mesh file, restart, climatological and forcing files).
75The key is to ensure volume matching near the child grid interface,
76a step done by invoking the ``Agrif_create_bathy.exe`` program.
77You may use the namelists provided in the ``NESTING`` directory as a guide.
78These correspond to the namelists used to create ``AGRIF_DEMO`` inputs.
79
80Namelist options
81================
82
83Each child grid expects to read its own namelist so that different numerical choices can be made
84(these should be stored in the form ``1_namelist_cfg``, ``2_namelist_cfg``, etc... according to their rank in
85the grid hierarchy).
86Consistent time steps and number of steps with the chosen time refinement have to be provided.
87Specific to AGRIF is the following block:
88
89.. code-block:: fortran
90
91   !-----------------------------------------------------------------------
92   &namagrif      !  AGRIF zoom                                            ("key_agrif")
93   !-----------------------------------------------------------------------
94      ln_spc_dyn    = .true.  !  use 0 as special value for dynamics
95      rn_sponge_tra = 2880.   !  coefficient for tracer   sponge layer [m2/s]
96      rn_sponge_dyn = 2880.   !  coefficient for dynamics sponge layer [m2/s]
97      ln_chk_bathy  = .false. !  =T  check the parent bathymetry
98   /
99
100where sponge layer coefficients have to be chosen according to the child grid mesh size.
101The sponge area is hard coded in NEMO and applies on the following grid points:
1022 x refinement factor (from i=1+nbghostcells+1 to i=1+nbghostcells+sponge_area)
103
104.. rubric:: References
105
106.. bibliography:: zooms.bib
107   :all:
108   :style: unsrt
109   :labelprefix: A
110   :keyprefix: a-
Note: See TracBrowser for help on using the repository browser.