FluxCalculator

This module contains the infrastructure to compute turbulent fluxes.

How are fluxes computed?

The key function that computes surface fluxes is FluxCalculator.turbulent_fluxes!. This function computes turbulent fluxes and ancillary quantities, such as the Obukhov length, using SurfaceFluxes.jl. Generally, this function is called at the end of each coupling step.

All the quantities computed in turbulent_fluxes! are calculated separately for each surface type using the FluxCalculator.compute_surface_fluxes! function. This function can be extended by component models if they need specific type of flux calculation, and a default is provided for models that can use the standard flux calculation. The final result of turbulent_fluxes! is an area-weighted sum of all the contributions of the various surfaces.

The default method of FluxCalculator.compute_surface_fluxes!, in turn, calls FluxCalculator.get_surface_fluxes!. This function uses a thermal state obtained by using the model surface temperature, extrapolates atmospheric density adiabatically to the surface, and with the surface humidity (if available, if not, assuming a saturation specific humidity for liquid phase). compute_surface_fluxes! also updates the component internal fluxes fields with FluxCalculator.update_turbulent_fluxes!, and adds the area-weighted contribution from this component model to the CoupledSimulation fluxes fields. Any extension of this function for a particular surface model is also expected to update both the component models' internal fluxes and the CoupledSimulation object's fluxes fields.

FluxCalculator.compute_surface_fluxes! sets:

  • the flux of momenta, F_turb_ρτxz, F_turb_ρτyz;
  • the flux of energy, F_turb_energy;
  • the flux of moisture, F_turb_moisture;
  • the Obukhov length, L_MO;
  • the buoyancy flux, buoyancy_flux;
  • the roughness lengths for momentum and buoyancy, z0m and z0b;
  • the evaporation scaling factor, beta,
  • the frictional velocity ustar.
Note

FluxCalculator.compute_surface_fluxes! always returns the area weighted sum, even if this is not necessarily the most meaningful operation for a given quantity (e.g., for the Obukhov length). This can be improved in the future, if you know how, please open an issue.

Note also that FluxCalculator.turbulent_fluxes! only computes turbulent fluxes, not radiative fluxes. Currently, these are computed within the atmospheric model.

FluxCalculator API

ClimaCoupler.FluxCalculator.turbulent_fluxes!Function
turbulent_fluxes!(model_sims::NamedTuple,
                              csf::CC.Fields.Field,
                              boundary_space::CC.Spaces.AbstractSpace,
                              thermo_params::TD.Parameters.ThermodynamicsParameters)

Compute turbulent fluxes and associated quantities. Store the results in fields as area-weighted sums.

This function uses SurfaceFluxes.jl under the hood.

Args:

  • model_sims: [NamedTuple] containing ComponentModelSimulations.
  • fields: [NamedTuple] containing coupler fields.
  • boundary_space: [CC.Spaces.AbstractSpace] the space of the coupler surface.
  • thermo_params: [TD.Parameters.ThermodynamicsParameters] the thermodynamic parameters.

TODO:

  • generalize interface for regridding and take land state out of atmos's integrator.p
  • add flux accumulation
  • add flux bounds

(NB: Radiation surface fluxes are calculated by the atmosphere.)

source
ClimaCoupler.FluxCalculator.compute_surface_fluxes!Function
compute_surface_fluxes!(csf, sim, atmos_sim, boundary_space, thermo_params)

This function computes surface fluxes between the input component model simulation and the atmosphere.

Update the input coupler surface fields csf in-place with the computed fluxes for this model. These are then summed using area-weighting across all surface models to get the total fluxes.

Since the fluxes are computed between the input model and the atmosphere, this function does nothing if called on an atmosphere model simulation.

Arguments

  • csf: [CC.Fields.Field] containing a NamedTuple of turbulent flux fields: F_turb_ρτxz, F_turb_ρτyz, F_turb_energy, F_turb_moisture.
  • sim: [Interfacer.ComponentModelSimulation] the surface simulation to compute fluxes for.
  • atmos_sim: [Interfacer.AtmosModelSimulation] the atmosphere simulation to compute fluxes with.
  • boundary_space: [CC.Spaces.AbstractSpace] the space of the coupler surface.
  • thermo_params: [TD.Parameters.ThermodynamicsParameters] the thermodynamic parameters.
source
ClimaCoupler.FluxCalculator.get_surface_fluxes!Function
get_surface_fluxes!(inputs, surface_params::SF.Parameters.SurfaceFluxesParameters)

Uses SurfaceFluxes.jl to calculate turbulent surface fluxes. It should be atmos model agnostic, and columnwise. Fluxes are computed over the entire surface, even where the relevant surface model is not present.

When available, it also computes ancillary quantities, such as the Monin-Obukov lengthscale.

source