The new MARS client with the MIR interpolation library is currently in BETA, and it is meant for tests only. Do not use it for any operational purpose. You can try the new MIR-enabled MARS client with:
mars -m
You are encouraged to test this new version of the MARS client and report any issues to advisory@ecmwf.int .
MIR stands for Meteorological Interpolation and Regridding and is a library of routines for interpolation and regridding of meteorological fields. This new piece of software is replacing the veteran EMOSLIB when it comes to perform those operations in MARS. Beyond this, MIR’s flexible design facilitates scalability improvements and additional features. These include efficiency gains, a high degree of user configurability, and support for a wider range of grids than in the current package. See the related article in the ECMWF newsletter no.152 for a more complete description of this new library.
Questions and Answers
Highlights and main differences
Interpolation methods and distance computation
By default, MIR uses a linear method (based on a triangular mesh) which replaces the EMOSLIB bilinear method (based on 4 points).
MIR also computes distance in 3D whereas EMOSLIB computes distances on the 2D lat-lon grid. Consequently, different nearest points may be selected for the interpolation methods, and the nearest neighbour method should improve as a result.
See Distance metrics for more details.
Parameter classification
In MIR, parameters have been classified into groups, which have an associated default interpolation method. As a result some parameters have a significantly different default interpolation method compared to EMOSLIB. Most parameters use the default linear method in MIR, while some specific groups or parameters will use the nearest neighbour method:
- index parameters: integer values associated to a predefined table
- ocean wave spectra and associated parameters: intensity as a function of discrete wavelengths
- vegetation cover ratio parameters
Precipitation
Sub-areas
MIR brings a number of improvements in the sub-area and cropping operations.
Consistency with fields from dissemination
MIR moves the boundaries inwards onto an underlying global grid with a point at latitude=0, longitude=0. This behaviour is a change in respect to EMOSLIB, and it brings it closer to the product generation for dissemination.
Subareas of reduced Gaussian grids
EMOSLIB only supports sub-area operations on regular Gaussian or lat-lon grids. MIR is capable of cropping sub-areas and frames directly from global reduced Gaussian grids, including the octahedral reduced Gaussian grid.
Support for shifted grids
MIR can work with shifted grids, with no point at latitude=0, longitude=0. An example would be: AREA=89.5/0.5/-89.5/359.5, GRID=1.0/1.0 This is done automatically provided the differences between N-S and E-W limits are both divisible by the corresponding increments without remainder. This represents a change in respect to EMOSLIB, which would adjust the area to fit. In the previous example, EMOSLIB would adjust the N/W/S/E boundaries to the more conventional area 90/0/-90/359. In this example the black points represent the original grid with 1 degree spacing. The red points show the user defined area, which has the same spacing but shifted by half a degree. MARS with EMOSLIB would expand the area to fit in the original grid, as seen in the yellow rectangle. MARS with MIR would honour the user defined area and would return the inner grid shown in green. |
Land-sea mask processing
By default, MIR does not use land-sea mask processing for any parameters. However, users will be able to specify the land-sea mask to use LSM processing for both input and output grids with a new set of MARS keywords.
Note that as a consequence, MIR does not apply land-sea mask processing when using the nearest neighbour method, which was the case in EMOSLIB. Actually, the EMOSLIB interpolation "nearest neighbour" and "nearest lsm" produce the same results.
Grid to grid interpolations
EMOSLIB cannot handle interpolations from a regular latitude-longitude grid to a reduced gaussian, but MIR does not have that limitation. Interpolations from any global regular or reduced gaussian or latitude-longitude grids to regular or reduced gaussian or regular latitude longitude grids are now supported in MIR.
Spectral to grid point transformations
Concept of "RESOL=AV" ("Archived Value") when going to a lower resolution is different. With MIR, RESOL=AV specifies that the transformation is made first to the corresponding octahedral reduced Gaussian grid (i.e., T1279 → O1280 or T639 → O640) followed by grid point interpolation to the user-specified grid.
Default truncation values for "RESOL=AUTO" (Automatic Truncation) have also changed. MIR uses a formula to truncate the spectral series to correspond to the equivalent linear Gaussian grid, replacing the fixed table used in EMOSLIB. Transformations to regular latitude-longitude grids then use an intermediate full (regular) Gaussian grid.
EMOSLIB imposes some limitations in the possible combinations of spectral truncation and output grid, only allowing predefined set. These restrictions no longer apply when using MIR
This diagram illustrates an example transformation going from T1279 to a regular lat-lon 1.0/1.0 grid. Depending on the values of RESOL and GRID, MIR will follow different paths. As a reference, also the original EMOSLIB behaviour is shown for each case:
MIR Behaviour | EMOSLIB Behaviour |
---|---|
|
|
Path | Keywords | MIR Behaviour | EMOSLIB Behaviour |
---|---|---|---|
Red | RESOL=AUTO, GRID=1.0/1.0 | Default Behaviour. Transformation from T1279 to an intermediate F90 full (regular) Gaussian grid (with an automatic truncation to T179) followed by a grid-to-grid interpolation from the F90 grid to 1.0/1.0. | Default Behaviour. Direct transformation from T1279 to 1.0/1.0, with an automatic truncation to T213 according to EMOSLIB's truncation table |
Green | RESOL=AV, GRID=1.0/1.0 | Transformation from T1279 to the corresponding intermediate reduced octahedral Gaussian O1280, before going to 1.0/1.0. See Known issues | Direct transformation from T1279 to 1.0/1.0, with no truncation. |
Blue | RESOL=179, GRID=F90, and then GRID=1.0/1.0 | Transformation from T1279 to the F90 full (regular) Gaussian grid (with a user-specified truncation to T179) followed by a grid-to-grid interpolation from the F90 grid to 1.0/1.0. | Same as in MIR, but a separate MARS request is needed for each of the two steps. |
Intermediate Gaussian grids
When doing spectral to grid transformations, MIR may produce smoother fields compared to EMOSLIB. This is due to the fact that MIR uses the intermediate gaussian grid, while EMOSLIB does this transformation directly.
Usage of IFS spectral transform library
While EMOSLIB has its own implementation for the transformations from spherical harmonics to grid space, MIR makes use of the spectral transform library, called Trans from the IFS. That means MIR behaviour is more consistent to what is done in the IFS and will benefit from any improvements made in Trans.
Waves
Due to the differences mentioned above, the nearest neighbour method selects different points due to the difference in the computation of the distance (3D versus 2D). Different treatment of neighbouring missing values produces a smoother interpolation close to coasts.
Also, note that all "Spectra-related" parameters have been classified and are interpolated in the same way as the 2D spectra, using a nearest neighbour in MIR instead of EMOSLIB's bilinear method.
Interpolation from limited-area wave data on a regular lat-lon grid, not working with EMOSLIB, is now supported in MIR.
Rotated grids
MIR does not support the 12-point interpolation method, used by EMOSLIB for rotated grids. Therefore, the default interpolation method used is the linear. Rotated spherical harmonics are not supported in MIR or EMOSLIB.
Land-sea mask values
When interpolating the land-sea mask field, MIR returns fractional values greater than or equal to 0 and less than or equal to 1 whereas EMOSLIB returns only 0s and 1s. Users should regard land-sea mask values greater than or equal to 0.5 as representing land points and those less than 0.5 as representing sea points.
Treatment of values at the poles
MIR is providing different values at the poles to those obtained with EMOSLIB for interpolations to regular latitude-longitude grids which include points at latitudes 90ºN or 90ºS.
Known Issues
RESOL=AV uses wrong intermediate Gaussian grid
When using RESOL=AV and transforming from spectral to grid, the corresponding intermediate Gaussian grid to be used should be the cubic reduced Gaussian grid by default (i.e., O = T+1), as described above. However, at this point MIR uses a full (regular) gaussian grid with linear truncation (i.e., F = (T+1)/2).
This issue has been resolved in a version of the MARS client using MIR (version 0.8.5) released on 14 November 2017.
Winds on rotated grids
There are known issues with wind fields when working with rotated grids. In particular, wind speeds are correct but the direction is wrong due to a problem in computing the angles.
This issue has been resolved in a version of the MARS client using MIR (version 0.8.5) released on 14 November 2017.
Performance for small subareas
When defining small subareas, MIR tends to be slower compared to EMOSLIB. At the moment, MIR does the interpolation on a global grid and performs the cropping operation later, whereas EMOSLIB will only interpolate on the subarea defined. This may be optimised in future versions.