Skip to content

3. Runoffs

tbrivoal edited this page Nov 22, 2022 · 9 revisions

IMPORTANT NOTICE : For now, the version of the code cannot work on global ORCA grids because of the outer band (i.e: it can only work on regional orca grids)=> When the runoffs are at the edge of the domain, the program (for now) only searches for points inside the domain and not on the over side of the file. Thus, the "global grid" case remain to be coded.

1. Introduction

This page describe how to generate a runoff forcing file over the child grid. To do this, there is two solutions:

  • Generate a new runoff forcing file over the child grid from an external source
  • Generate a new runoff forcing file over the child grid from the already existing runoff file of the parent configuration.

This page describes the second solution only.

To do this, a python tool is available. The tool is composed in two scripts: extrap_near_coasts.py and place_on_child_grid.py.clim.

It works in two steps (see figure below):

  • In the first step (extrap_near_coasts.py), the tool replace the runoffs along the coast on the parent grid (since the coastline of the parent configuration has changed because of the AGRIF update). Note that this step can be skipped if the child bathymetry was computed from the parent (i.e, with nn_bathy=3).
  • In the second step (place_on_child_grid.py.clim), the tool place the runoffs over the child grid and (optionnally) move them along the child coastline.

*Shematic representation of the operations realized by the runoff tool*

1. extrap_near_coasts.py

Note: This script can be used to move runoffs along the coast in the case of any land sea mask change. Thus, it can be used for other purposes than Agrif preprocessing.

This script reads a runoff file and the domain_cfg.nc file of the new configuration (in which the coastline has changed). The script will, for each runoff point:

  • Check if the point is over sea, or over land
  • If the point is over sea:
    • check if the point is along the coastline. If so, the program just copy the previous runoff value at the same position.
    • If not, the program search for the nearest coast point(s), preferentially along i & j direction, and then diagonally and move the runoffs to this (these) new position(s).
  • If the point is over land:
    • search for the nearest sea point(s) (again, preferentially along i & j direction, and then diagonally) and move the runoffs to this (these) point(s).

2. place_on_child_grid.py

Note: This script only works if the refinement factor of AGRIF is impair (e.g: in our case, 3).

This script performs two operations on every runoffs points of parent domain:

  • First, it finds the points bellow the parent runoff points, and dispatch the runoff on all these points (=> central panel on the figure above)
  • Then, it lays off the runoffs along the coast (right panel on the figure above).

An example script to run these two script is also available here.

Clone this wiki locally