FieldExchanger
This module contains general functions for the exchange of fields between the atmospheric and surface component models.
The FieldExchanger
needs to populate the coupler with
- atmospheric fields (mostly fluxes), via the
import_atmos_fields!
function - average surface properties of each coupler gridpoint, via the
import_combined_surface_fields!
function
The component models are updated by broadcasting the coupler fields, via the update_model_sims!
function. For an update, this function requires that update_field!
is defined for the particular variable and component model. Currently, we support the:
AtmosModelSimulation
:albedo
,surface_temperature
- if calculating fluxes in the atmospheric model:
roughness_momentum
,roughness_buoyancy
,beta
- if calculating fluxes in the atmospheric model:
SurfaceModelSimulation
:air_density
,turbulent_energy_flux
,turbulent_moisture_flux
,radiative_energy_flux_sfc
,liquid_precipitation
,snow_precipitation
If an update_field!
function is not defined for a particular component model, it will be ignored.
FieldExchanger API
ClimaCoupler.FieldExchanger.import_atmos_fields!
— Functionimport_atmos_fields!(csf, model_sims, boundary_space, turbulent_fluxes)
Updates the coupler with the atmospheric fluxes. The Interfacer.get_field
functions (:turbulent_energy_flux
, :turbulent_moisture_flux
, :radiative_energy_flux_sfc
, :liquid_precipitation
, :snow_precipitation
) have to be defined for the amtospheric component model type.
Arguments
csf
: [NamedTuple] containing coupler fields.model_sims
: [NamedTuple] containingComponentModelSimulation
s.boundary_space
: [Spaces.AbstractSpace] the space of the coupler surface.turbulent_fluxes
: [TurbulentFluxPartition] denotes a flag for turbulent flux calculation.
ClimaCoupler.FieldExchanger.import_combined_surface_fields!
— Functionimport_combined_surface_fields!(csf, model_sims, turbulent_fluxes)
Updates the coupler with the surface properties. The Interfacer.get_field
functions for (:surface_temperature
, :surface_direct_albedo
, :surface_diffuse_albedo
, :roughness_momentum
, :roughness_buoyancy
, :beta
) need to be specified for each surface model.
Arguments
csf
: [NamedTuple] containing coupler fields.model_sims
: [NamedTuple] containingComponentModelSimulation
s.turbulent_fluxes
: [TurbulentFluxPartition] denotes a flag for turbulent flux calculation.
ClimaCoupler.FieldExchanger.update_model_sims!
— Functionupdate_model_sims!(model_sims, csf, turbulent_fluxes)
Iterates update_sim!
over all component model simulations saved in cs.model_sims
.
Arguments
model_sims
: [NamedTuple] containingComponentModelSimulation
s.csf
: [NamedTuple] containing coupler fields.turbulent_fluxes
: [TurbulentFluxPartition] denotes a flag for turbulent flux calculation.
ClimaCoupler.FieldExchanger.update_sim!
— Functionupdate_sim!(atmos_sim::Interfacer.AtmosModelSimulation, csf)
Updates the surface fields for temperature, roughness length, albedo, and specific humidity.
Arguments
atmos_sim
: [Interfacer.AtmosModelSimulation] containing an atmospheric model simulation object.csf
: [NamedTuple] containing coupler fields.
update_sim!(sim::SurfaceModelSimulation, csf, area_fraction)
Updates the surface component model cache with the current coupler fields of Fturbenergy, Fradiative, Fturbmoisture, Pliq, and ρ_sfc.
Arguments
sim
: [Interfacer.SurfaceModelSimulation] containing a surface model simulation object.csf
: [NamedTuple] containing coupler fields.
ClimaCoupler.FieldExchanger.reinit_model_sims!
— Functionreinit_model_sims!(model_sims)
Iterates reinit!
over all component model simulations saved in cs.model_sims
.
Arguments
model_sims
: [NamedTuple] containingComponentModelSimulation
s.
ClimaCoupler.FieldExchanger.step_model_sims!
— Functionstep_model_sims!(model_sims, t)
Iterates step!
over all component model simulations saved in cs.model_sims
.
Arguments
model_sims
: [NamedTuple] containingComponentModelSimulation
s.t
: [AbstractFloat] denoting the simulation time.