Mediator
Mediator Documentation

NEMS Mediator Overview

This page is up-to-date with respect to the version: DREV58214.

This page describes the main NEMS mediator. There is also a NEMS space weather mediator.

In the NUOPC Layer architecture, the mediator (often called the coupler) handles the scientific and customized aspects of coupling for a modeling system.  For example, it may handle treatments of coastlines or field transformations.  

For mediator diagrams and additional description, see the NEMS mediator overview presentation (Craig, Feb. 6 2015).

Components

The main NEMS mediator is capable of technically coupling atmosphere, ocean, sea ice, land, hydrology, and wave components. Only atmosphere, ocean, and sea ice components have been evaluated for correct physical coupling.

All components do not have to be present to operate the meddiator.

Coupling Periods

There is a slow and a fast coupling period in the NEMS mediator.  The slow coupling period is associated with the ocean model and allows the ocean model to be coupled at a lower frequency than other components.  The fast coupling period is for the atmosphere and ice model.  They are coupled at the same frequency in the system.

Accumulation and Averaging

The mediator accumulates all fields between coupling periods for all components.  For example, the atmosphere and ice coupling fields are accumulated and averaged between calls to the ocean model.  At the same time, the ocean fields coupled to the atmosphere and ice models are held static between the longer ocean coupling periods.

Field Matching

The mediator receives fields from all components and matches field names from different components to establish coupling connections.  Any field that is exported from one component and imported to another component with the same standard name is coupled between those components.

Merging

The mediator contains a generic merge method that allows multiple fields to be merged together into a destination field. The source field(s) can be weighted by fractions or other arrays.  The merging method is used to convert mean_laten_heat_flux to mean_evap_rate in the atmosphere to ocean coupling.  It is also used to apply fraction weighting to merge atm and/or ice fields for the ocean component for mean_prec_rate, mean_fprec_rate, mean_evap_rate, mean_sensi_heat_flx, mean_laten_heat_flx, mean_down_lw_flx, mean_zonal_moment_flx, and mean_merid_moment_flx.

Custom Field Derivations

In addition, there is a section of the mediator that allows for custom coupling interactions.  In general, coupling fields can be derived and set there.  This can be used to derive fields from other fields or to change signs or units.  Custom calculations are used to derive the downward solar to the ocean component from atmosphere shortwave and albedo fields.

Grids

Model grids are passed to the mediator at initialization.  The mediator receives those grids and instantiates a decomposition of those grids on its PETs (persistent execution threads, similar to processors).  The mediator is then able to receive all model fields on the native model grids.

The ocean and ice components will generally be run on the same grid for science reasons, but the mediator is implemented such that this is not a requirement.

Interpolation (Regridding)

Regridding is performed by the mediator. The regridding method is defined in the mediator on a field by field basis when the field is defined. In general, fluxes are mapped conservatively, and states are mapped bilinearly. The higher order finite element patch method was not used for any fields because of an observed reproducibility issue.

In the current revision, fields transferred from the ocean to the sea ice component are copied rather than interpolated. This can be done because the ocean and sea ice components are on the same grid. When different grids are detected for these components, the interpolation method defaults to bilinear.

Run Sequence

The core run sequence is set up as follows.  There are 3 advance subroutines, advance_slow, advance_fast_before, advance_fast_after.  The atmosphere and ice run every coupling period (fast) and the ocean model runs at the same or slower coupling period.

advance_fast_before runs before the atmosphere and ice models advance, and performs the following functions:

advance_fast_after runs after the atm and ice models advance.  It does the following:

advance_slow runs before the ocean model.  It does the following:

Reconciliation of Masks

The land mask implementation is described in more detail here.

Fluxes and other Exchange Fields

The atmosphere model currently computes the atmosphere/ocean, atmosphere/ice, and atmosphere/land fluxes.  The sea ice model computes the atmosphere/ice fluxes as well and those fluxes are passed through the mediator to the atmosphere model for merging with other surface fluxes. However, in this revision the fluxes computed by the sea ice model are not yet used by the atmosphere model.

The mediator interpolates the time evolving ice fraction from the sea ice model and that is sent to the atmosphere model as a coupling field.

The sea ice model sends its momentum flux merged with the atmosphere momentum flux to the ocean. The ocean sends ocean currents to sea ice and sea surface temperature to both the atmosphere and sea ice.

The sea ice model receives from the atmosphere fields including wind and stress, and thermodynamic fields such as lowest level temperature, specific humidity, height, radiation, precipitation, and derived air density. It also receives currents and sea surface temperature from the ocean. The ocean model receives surface pressure, merged momentum flux, mean net longwave and banded shortwave radiation, precipitation, and sensible heat flux from the atmosphere.