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.
Changeset 12065 for NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/cfgs/AGRIF_DEMO/README.rst – NEMO

Ignore:
Timestamp:
2019-12-05T12:06:36+01:00 (4 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/trunk@12055 (ticket #2194)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/cfgs/AGRIF_DEMO/README.rst

    r10460 r12065  
    22Embedded zooms 
    33************** 
     4 
     5.. todo:: 
     6 
     7 
    48 
    59.. contents:: 
     
    913======== 
    1014 
    11 AGRIF (Adaptive Grid Refinement In Fortran) is a library that allows the seamless space and time refinement over 
    12 rectangular regions in NEMO. 
     15AGRIF (Adaptive Grid Refinement In Fortran) is a library that 
     16allows the seamless space and time refinement over rectangular regions in NEMO. 
    1317Refinement factors can be odd or even (usually lower than 5 to maintain stability). 
    14 Interaction between grid is "two-ways" in the sense that the parent grid feeds the child grid open boundaries and 
    15 the child grid provides volume averages of prognostic variables once a given number of time step is completed. 
     18Interaction between grid is "two-ways" in the sense that 
     19the parent grid feeds the child grid open boundaries and 
     20the child grid provides volume averages of prognostic variables once 
     21a given number of time step is completed. 
    1622These pages provide guidelines how to use AGRIF in NEMO. 
    17 For a more technical description of the library itself, please refer to http://agrif.imag.fr. 
     23For a more technical description of the library itself, please refer to AGRIF_. 
    1824 
    1925Compilation 
    2026=========== 
    2127 
    22 Activating AGRIF requires to append the cpp key ``key_agrif`` at compilation time:  
     28Activating AGRIF requires to append the cpp key ``key_agrif`` at compilation time: 
    2329 
    2430.. code-block:: sh 
    2531 
    26    ./makenemo add_key 'key_agrif' 
     32   ./makenemo [...] add_key 'key_agrif' 
    2733 
    28 Although this is transparent to users, the way the code is processed during compilation is different from 
    29 the standard case: 
    30 a preprocessing stage (the so called "conv" program) translates the actual code so that 
     34Although this is transparent to users, 
     35the way the code is processed during compilation is different from the standard case: 
     36a preprocessing stage (the so called ``conv`` program) translates the actual code so that 
    3137saved arrays may be switched in memory space from one domain to an other. 
    3238 
     
    3440================================ 
    3541 
    36 An additional text file ``AGRIF_FixedGrids.in`` is required at run time. 
     42An additional text file :file:`AGRIF_FixedGrids.in` is required at run time. 
    3743This is where the grid hierarchy is defined. 
    38 An example of such a file, here taken from the ``ICEDYN`` test case, is given below:: 
     44An example of such a file, here taken from the ``ICEDYN`` test case, is given below 
    3945 
    40    1 
    41    34 63 34 63 3 3 3 
    42    0 
     46.. literalinclude:: ../../../tests/ICE_AGRIF/EXPREF/AGRIF_FixedGrids.in 
    4347 
    4448The first line indicates the number of zooms (1). 
    4549The second line contains the starting and ending indices in both directions on the root grid 
    46 (imin=34 imax=63 jmin=34 jmax=63) followed by the space and time refinement factors (3 3 3). 
     50(``imin=34 imax=63 jmin=34 jmax=63``) followed by the space and time refinement factors (3 3 3). 
    4751The last line is the number of child grid nested in the refined region (0). 
    4852A more complex example with telescoping grids can be found below and 
    49 in the ``AGRIF_DEMO`` reference configuration directory. 
     53in the :file:`AGRIF_DEMO` reference configuration directory. 
    5054 
    51 [Add some plots here with grid staggering and positioning ?] 
     55.. todo:: 
    5256 
    53 When creating the nested domain, one must keep in mind that the child domain is shifted toward north-east and 
    54 depends on the number of ghost cells as illustrated by the (attempted) drawing below for nbghostcells=1 and 
    55 nbghostcells=3. 
    56 The grid refinement is 3 and nxfin is the number of child grid points in i-direction.   
     57   Add some plots here with grid staggering and positioning? 
     58 
     59When creating the nested domain, one must keep in mind that 
     60the child domain is shifted toward north-east and 
     61depends on the number of ghost cells as illustrated by 
     62the *attempted* drawing below for ``nbghostcells=1`` and ``nbghostcells=3``. 
     63The grid refinement is 3 and ``nxfin`` is the number of child grid points in i-direction. 
    5764 
    5865.. image:: _static/agrif_grid_position.jpg 
     
    6269boundary data exchange and update being only performed between root and child grids. 
    6370Use of east-west periodic or north-fold boundary conditions is not allowed in child grids either. 
    64 Defining for instance a circumpolar zoom in a global model is therefore not possible.  
     71Defining for instance a circumpolar zoom in a global model is therefore not possible. 
    6572 
    6673Preprocessing 
    6774============= 
    6875 
    69 Knowing the refinement factors and area, a ``NESTING`` pre-processing tool may help to create needed input files 
     76Knowing the refinement factors and area, 
     77a ``NESTING`` pre-processing tool may help to create needed input files 
    7078(mesh file, restart, climatological and forcing files). 
    7179The key is to ensure volume matching near the child grid interface, 
    72 a step done by invoking the ``Agrif_create_bathy.exe`` program. 
    73 You may use the namelists provided in the ``NESTING`` directory as a guide. 
     80a step done by invoking the :file:`Agrif_create_bathy.exe` program. 
     81You may use the namelists provided in the :file:`NESTING` directory as a guide. 
    7482These correspond to the namelists used to create ``AGRIF_DEMO`` inputs. 
    7583 
     
    7886 
    7987Each child grid expects to read its own namelist so that different numerical choices can be made 
    80 (these should be stored in the form ``1_namelist_cfg``, ``2_namelist_cfg``, etc... according to their rank in 
    81 the grid hierarchy). 
     88(these should be stored in the form :file:`1_namelist_cfg`, :file:`2_namelist_cfg`, etc... 
     89according to their rank in the grid hierarchy). 
    8290Consistent time steps and number of steps with the chosen time refinement have to be provided. 
    8391Specific to AGRIF is the following block: 
    8492 
    85 .. code-block:: fortran 
    86  
    87    !----------------------------------------------------------------------- 
    88    &namagrif      !  AGRIF zoom                                            ("key_agrif") 
    89    !----------------------------------------------------------------------- 
    90       ln_spc_dyn    = .true.  !  use 0 as special value for dynamics 
    91       rn_sponge_tra = 2880.   !  coefficient for tracer   sponge layer [m2/s] 
    92       rn_sponge_dyn = 2880.   !  coefficient for dynamics sponge layer [m2/s] 
    93       ln_chk_bathy  = .false. !  =T  check the parent bathymetry 
    94    /              
     93.. literalinclude:: ../../namelists/namagrif 
     94   :language: fortran 
    9595 
    9696where sponge layer coefficients have to be chosen according to the child grid mesh size. 
    9797The sponge area is hard coded in NEMO and applies on the following grid points: 
    98 2 x refinement factor (from i=1+nbghostcells+1 to i=1+nbghostcells+sponge_area)  
     982 x refinement factor (from ``i=1+nbghostcells+1`` to ``i=1+nbghostcells+sponge_area``) 
    9999 
    100 References 
    101 ========== 
     100.. rubric:: References 
    102101 
    103102.. bibliography:: zooms.bib 
    104    :all: 
    105    :style: unsrt 
    106    :labelprefix: A 
    107    :keyprefix: a- 
     103   :all: 
     104   :style: unsrt 
     105   :labelprefix: A 
     106   :keyprefix: a- 
Note: See TracChangeset for help on using the changeset viewer.