Subsections

# Theoretical details

## Horizontal interpolation methods

Consider an observation point with with longitude and latitude and the four nearest neighbouring model grid points , , and with longitude and latitude ( , ), ( , ) etc. All horizontal interpolation methods implemented in NEMO estimate the value of a model variable at point as a weighted linear combination of the values of the model variables at the grid points , etc.:

 (12.1)

where , etc. are the respective weights for the model field at points , etc., and .

Four different possibilities are available for computing the weights.

1.
Great-Circle distance-weighted interpolation. The weights are computed as a function of the great-circle distance between and the model grid points , etc. For example, the weight given to the field is specified as the product of the distances from to the other points:

where
 (12.2)

and corresponds to , or . A more stable form of the great-circle distance formula for small distances ( near 1) involves the arcsine function ( see p. 101 of Daley and Barker [2001]:

where

and

2.
Great-Circle distance-weighted interpolation with small angle approximation. Similar to the previous interpolation but with the distance computed as
 (12.3)

where corresponds to , , or .

3.
Bilinear interpolation for a regular spaced grid. The interpolation is split into two 1D interpolations in the longitude and latitude directions, respectively.

4.
Bilinear remapping interpolation for a general grid. An iterative scheme that involves first mapping a quadrilateral cell into a cell with coordinates (0,0), (1,0), (0,1) and (1,1). This method is based on the SCRIP interpolation package [Jones, 1998].

## Grid search

For many grids used by the NEMO model, such as the ORCA family, the horizontal grid coordinates and are not simple functions of latitude and longitude. Therefore, it is not always straightforward to determine the grid points surrounding any given observational position. Before the interpolation can be performed, a search algorithm is then required to determine the corner points of the quadrilateral cell in which the observation is located. This is the most difficult and time consuming part of the 2D interpolation procedure. A robust test for determining if an observation falls within a given quadrilateral cell is as follows. Let denote the observation point, and let , , and denote the bottom left, bottom right, top left and top right corner points of the cell, respectively. To determine if P is inside the cell, we verify that the cross-products

 (12.4)

point in the opposite direction to the unit normal (i.e., that the coefficients of are negative), where , , etc. correspond to the vectors between points P and A, P and B, etc.. The method used is similar to the method used in the SCRIP interpolation package [Jones, 1998].

In order to speed up the grid search, there is the possibility to construct a lookup table for a user specified resolution. This lookup table contains the lower and upper bounds on the and indices to be searched for on a regular grid. For each observation position, the closest point on the regular grid of this position is computed and the and ranges of this point searched to determine the precise four points surrounding the observation.

## Parallel aspects of horizontal interpolation

For horizontal interpolation, there is the basic problem that the observations are unevenly distributed on the globe. In numerical models, it is common to divide the model grid into subgrids (or domains) where each subgrid is executed on a single processing element with explicit message passing for exchange of information along the domain boundaries when running on a massively parallel processor (MPP) system. This approach is used by NEMO.

For observations there is no natural distribution since the observations are not equally distributed on the globe. Two options have been made available: 1) geographical distribution; and 2) round-robin.

### Geographical distribution of observations among processors

This is the simplest option in which the observations are distributed according to the domain of the grid-point parallelization. Figure 12.1 shows an example of the distribution of the in situ data on processors with a different colour for each observation on a given processor for a 4 2 decomposition with ORCA2. The grid-point domain decomposition is clearly visible on the plot.

The advantage of this approach is that all information needed for horizontal interpolation is available without any MPP communication. Of course, this is under the assumption that we are only using a grid-point stencil for the interpolation (e.g., bilinear interpolation). For higher order interpolation schemes this is no longer valid. A disadvantage with the above scheme is that the number of observations on each processor can be very different. If the cost of the actual interpolation is expensive relative to the communication of data needed for interpolation, this could lead to load imbalance.

### Round-robin distribution of observations among processors

An alternative approach is to distribute the observations equally among processors and use message passing in order to retrieve the stencil for interpolation. The simplest distribution of the observations is to distribute them using a round-robin scheme. Figure 12.2 shows the distribution of the in situ data on processors for the round-robin distribution of observations with a different colour for each observation on a given processor for a 4 2 decomposition with ORCA2 for the same input data as in Fig. 12.1. The observations are now clearly randomly distributed on the globe. In order to be able to perform horizontal interpolation in this case, a subroutine has been developed that retrieves any grid points in the global space.

## Vertical interpolation operator

Vertical interpolation is achieved using either a cubic spline or linear interpolation. For the cubic spline, the top and bottom boundary conditions for the second derivative of the interpolating polynomial in the spline are set to zero. At the bottom boundary, this is done using the land-ocean mask.

Gurvan Madec and the NEMO Team
NEMO European Consortium2017-02-17