@@ -67,6 +67,18 @@ this function for both `AtmosModelSimulation` and
6767the coupler. This function can optionally be extended to include
6868additional field updates as desired.
6969
70+ - ` get_field(::ComponentModelSimulation, ::Val{property}) ` :
71+ Default ` get_field ` functions are provided for ` energy ` and ` water ` fields,
72+ described in the table below.
73+ These quantities are used to track conservation, and the defaults
74+ return ` nothing ` . To check conservation throughout a simulation, these
75+ functions must be extended for all models being run.
76+
77+ | Coupler name | Description | Units | Default value |
78+ | -------------------| -------------| -------| ---------------|
79+ | ` energy ` | globally integrated energy | J | ` nothing ` |
80+ | ` water ` | globally integrated water | kg | ` nothing ` |
81+
7082### AtmosModelSimulation - required functions
7183In addition to the functions required for a general
7284` ComponentModelSimulation ` , an ` AtmosModelSimulation ` requires the
@@ -79,7 +91,6 @@ for the following properties:
7991| Coupler name | Description | Units |
8092| -------------------| -------------| -------|
8193| ` air_density ` | air density of the atmosphere | kg m^-3 |
82- | ` energy ` | globally integrated energy | J |
8394| ` height_int ` | height at the first internal model level | m |
8495| ` height_sfc ` | height at the surface (only required when using ` PartitionedStateFluxes ` ) | m |
8596| ` liquid_precipitation ` | liquid precipitation at the surface | kg m^-2 s^-1 |
@@ -90,9 +101,6 @@ for the following properties:
90101| ` turbulent_moisture_flux ` | aerodynamic turbulent surface fluxes of energy (evaporation) | kg m^-2 s^-1 |
91102| ` thermo_state_int ` | thermodynamic state at the first internal model level | |
92103| ` uv_int ` | horizontal wind velocity vector at the first internal model level | m s^-1 |
93- | ` water ` | globally integrated water | kg |
94-
95-
96104
97105- ` update_field!(::AtmosModelSimulation. ::Val{property}, field) ` :
98106A function to update the value of property in the component model
@@ -118,23 +126,22 @@ extrapolated to the surface, with units of [kg m^-3].
118126### SurfaceModelSimulation - required functions
119127Analogously to the ` AtmosModelSimulation ` , a ` SurfaceModelSimulation `
120128requires additional functions to those required for a general ` ComponentModelSimulation ` .
121- - ` get_field(::SurfaceModelSimulation. ::Val{property}) ` : This getter
129+ - ` get_field(::SurfaceModelSimulation, ::Val{property}) ` : This getter
122130function returns the value of the field property for the simulation at
123131the current time. For a ` SurfaceModelSimulation ` , it must be extended
124132for the following properties:
125133
126134| Coupler name | Description | Units |
127135| -------------------| -------------| -------|
128136| ` area_fraction ` | fraction of the simulation grid surface area this model covers | |
129- | ` beta ` | factor that scales evaporation based on its estimated level of saturation | |
130137| ` roughness_buoyancy ` | aerodynamic roughness length for buoyancy | m |
131138| ` roughness_momentum ` | aerodynamic roughness length for momentum | m |
132139| ` surface_direct albedo ` | bulk direct surface albedo | |
133140| ` surface_diffuse albedo ` | bulk diffuse surface albedo | |
134141| ` surface_humidity ` | surface humidity | kg kg^-1 |
135142| ` surface_temperature ` | surface temperature | K |
136143
137- - ` update_field!(::SurfaceModelSimulation. ::Val{property}, field) ` :
144+ - ` update_field!(::SurfaceModelSimulation, ::Val{property}, field) ` :
138145A function to update the value of property in the component model
139146simulation, using the values in ` field ` passed from the coupler
140147This update should be done in place. If this function
@@ -157,6 +164,16 @@ following properties:
157164| ` surface_diffuse_albedo ` | bulk diffuse surface albedo; needed if calculated externally of the surface model (e.g. ocean albedo from the atmospheric state) | |
158165
159166### SurfaceModelSimulation - optional functions
167+ - ` get_field(::SurfaceModelSimulation, ::Val{property}) ` :
168+ For some quantities, default ` get_field ` functions are provided, which may be
169+ overwritten or used as-is. These currently include the following:
170+
171+ | Coupler name | Description | Units | Default value |
172+ | -------------------| -------------| -------| ---------------|
173+ | ` beta ` | factor that scales evaporation based on its estimated level of saturation | | 1 |
174+ | ` emissivity ` | measure of how much energy a surface radiates | | 1 |
175+ | ` height_disp ` | displacement height relative to the surface | m | 0 |
176+
160177- ` update_turbulent_fluxes!(::ComponentModelSimulation, fields::NamedTuple) ` :
161178This function updates the turbulent fluxes of the component model simulation
162179at this point in horizontal space. The values are updated using the energy
@@ -176,13 +193,11 @@ the cache variables specified as:
176193```
177194get_field(sim::AbstractSurfaceStub, ::Val{:area_fraction}) = sim.cache.area_fraction
178195get_field(sim::AbstractSurfaceStub, ::Val{:beta}) = sim.cache.beta
179- get_field(sim::AbstractSurfaceStub, ::Val{:energy}) = nothing
180196get_field(sim::AbstractSurfaceStub, ::Val{:roughness_buoyancy}) = sim.cache.z0b
181197get_field(sim::AbstractSurfaceStub, ::Val{:roughness_momentum}) = sim.cache.z0m
182198get_field(sim::AbstractSurfaceStub, ::Union{Val{:surface_direct_albedo}, Val{:surface_diffuse_albedo}}) = sim.cache.α
183199get_field(sim::AbstractSurfaceStub, ::Val{:surface_humidity}) = TD.q_vap_saturation_generic.(sim.cache.thermo_params, sim.cache.T_sfc, sim.cache.ρ_sfc, sim.cache.phase)
184200get_field(sim::AbstractSurfaceStub, ::Val{:surface_temperature}) = sim.cache.T_sfc
185- get_field(sim::AbstractSurfaceStub, ::Val{:water}) = nothing
186201```
187202and with the corresponding ` update_field! ` functions
188203```
0 commit comments