Drivers
ClimaLand.PrescribedAtmosphere — Type
PrescribedAtmosphere{FT, CA, DT} <: AbstractAtmosphericDrivers{FT}Container for holding prescribed atmospheric drivers and other information needed for computing turbulent surface fluxes when driving land models in standalone mode.
The default CO2 concentration is a constant as a function of time, equal to 4.2e-4 mol/mol.
Since not all models require co2 concentration, the default for that is nothing.
The keyword gustiness is a SurfaceFluxes gustiness model, or a number, which is stored as a SurfaceFluxes.ConstantGustinessSpec with that constant minimum wind speed [m/s]; the default is a SurfaceFluxes.FlooredDeardorffGustinessSpec with a floor of 1 m/s, the larger of that floor and the Deardorff convective gustiness.
liquid_precip: Precipitation (m/s) function of time: positive by definitionsnow_precip: Snow precipitation (m/s) function of time: positive by definitionT: Prescribed atmospheric temperature (function of time) at the reference height (K)u: Prescribed wind speed (function of time) at the reference height (m/s)q: Prescribed specific humidity (function of time) at the reference height (_)P: Prescribed air pressure (function of time) at the reference height (Pa)c_co2: CO2 concentration in atmosphere (mol/mol)start_date: Start date - the datetime corresponding to t=0 for the simulationh: Reference height (m), relative to surface elevationgustiness: Gustiness model of the effective wind speed (aSurfaceFluxes.AbstractGustinessSpec)thermo_params: Thermodynamic parameters
ClimaLand.PrescribedPrecipitation — Type
PrescribedPrecipitation{FT, LP} <: AbstractAtmosphericDrivers{FT}Container for holding prescribed precipitation driver for models which only require precipitation (RichardsModel).
liquid_precip: Precipitation (m/s) function of time: positive by definition
ClimaLand.PrescribedRadiativeFluxes — Type
PrescribedRadiativeFluxes{FT, SW, LW, DT, T, TP} <: AbstractRadiativeDrivers{FT}Container for the prescribed radiation functions needed to drive land models in standalone mode.
Note that some models require the zenith angle AND diffuse fraction. The diffuse fraction may be provided directly (of type TimeVaryingInput), or it may be computed empirically. In the latter case, it requires the thermodynamic parameters as well to compute.
Therefore, the allowed combinations are:
- Zenith angle and diffuse fraction not needed: zenith angle=nothing, thermo_params=nothing, diffuse fraction=nothing
- Zenith angle provided and diffuse fraction computed empirically: thermo params used, diffuse fraction=nothing
- Zenith angle provided and diffuse fraction provided: thermo_params not used, diffuse fraction TimeVaryingInput
SW_d: Downward shortwave radiation function of time (W/m^2): positive indicates towards surfacefrac_diff: Diffuse Fraction of shortwave radiation (unitless, [0,1])LW_d: Downward longwave radiation function of time (W/m^2): positive indicates towards surfacestart_date: Start date - the datetime corresponding to t=0 for the simulationcosθs: Sun zenith angle, in radiansthermo_params: Thermodynamic parameters
ClimaLand.CoupledAtmosphere — Type
CoupledAtmosphere{FT, T <: Union{FT, Fields.Field}} <: AbstractAtmosphericDrivers{FT}To be used when coupling to an atmosphere model. Contains fields that are used to compute surface fluxes in the coupled setup.
When constructed without a space, the struct doesn't contain anything, but it still acts as a flag that fluxes have been updated by the coupler and don't need to be recomputed. When constructed with a space, the struct contains the fields needed to compute surface fluxes in the coupled setup, which are accessed by ClimaCoupler.
The gustiness is a number, the constant minimum wind speed [m/s] that the coupler uses in its flux computation; land models driven by a CoupledAtmosphere inside ClimaLand use it as a SurfaceFluxes.ConstantGustinessSpec (see gustiness_spec).
ClimaLand.CoupledRadiativeFluxes — Type
CoupledRadiativeFluxes{
FT,
F <: Union{Function, Nothing},
T,
} <: AbstractRadiativeDrivers{FT}To be used when coupling to an atmosphere model. Either both cosθs and start_date must be nothing, or both must not be nothing`.
During the driver update, cosθs is unchanged if cosθs is nothing. This behavior differs from the PrescribedRadiativeFluxes where cosθs set to NaN if cosθs is nothing. Otherwise, cosθs recieves the following arguments: (time_from_start, start_date), and is expected to return zenith angle at the given time.
cosθs: Function that fills a climacore field with the zenith angle given the following arguments: (timefromstart,start_date)start_date: Start date - the datetime corresponding to t=0 for the simulation
ClimaLand.PrescribedGroundConditions — Type
PrescribedGroundConditions <: AbstractGroundConditionsA container for holding prescribed ground conditions needed by the canopy model when running the canopy in standalone mode, including the surface temperature, albedo, and emissivity, and soil water content, porosity, residual water fraction, and hydrology closure model.
Note that internally we enforce that the soil water content θ must be within the range (θ\_r, ν].
θ: Prescribed soil water content (m^3/m^3) in the root zone as a function of timeT: Prescribed ground surface temperature (K) as a function of timeα_PAR: Ground albedo for PARα_NIR: Ground albedo for NIRϵ: Ground emissivityν: Soil porosity (m^3/m^3θ_r: The soil residual water fraction (m^3/m^3)hydrology_cm: The soil hydrology closure model: van Genuchten or Brooks and Corey
ClimaLand.PrognosticGroundConditions — Type
PrognosticGroundConditions <: Canopy.AbstractGroundConditionsA type of AbstractGroundConditions to use when running the CanopyModel as part of an integrated model, i.e. with a prognostic EnergyHydrology soil model and either with or without a snow model.
Note that this struct is linked with the EnergyHydrology/SnowModel models. If we ever had a different soil model, we might need to construct a different PrognosticGroundConditions because the fields may be stored in different places.
ClimaLand.AbstractAtmosphericDrivers — Type
AbstractAtmosphericDrivers{FT}An abstract type of atmospheric drivers of land models.
ClimaLand.AbstractRadiativeDrivers — Type
AbstractRadiativeDrivers{FT}An abstract type of radiative drivers of land models.
ClimaLand.turbulent_fluxes! — Function
turbulent_fluxes!(dest,
atmos::CoupledAtmosphere,
model::BucketModel,
Y,
p,
t)Computes the turbulent surface fluxes terms at the ground for a coupled bucket. In this case, the coupler has already computed turbulent fluxes and updated them in each of the component models, so this function does nothing.
Note that this function is not used for the full land model; in that case, the turbulent fluxes are computed by the full land model during each step.
turbulent_fluxes!(dest,
atmos::AbstractAtmosphericDrivers,
model::AbstractModel,
Y,
p,
t;
h_atmos = atmos.h,
u_atmos = p.drivers.u,
T_atmos = p.drivers.T,
q_atmos = p.drivers.q,
gustiness = gustiness_spec(atmos),
)Computes the turbulent surface flux terms at the ground, including turbulent energy fluxes as well as the water vapor flux (in units of m^3/m^2/s of water). Positive fluxes indicate flow from the ground to the atmosphere.
It solves for these given atmospheric conditions, model parameters, and the surface conditions. The elements of dest select, by name, which of the quantities of turbulent_fluxes_at_a_point are stored (see select_fluxes).
The reference height h_atmos, the wind u_atmos, temperature T_atmos, and specific humidity q_atmos at it, and the gustiness model (a SurfaceFluxes.AbstractGustinessSpec, or a field of them) default to those of the atmospheric forcing (gustiness_spec). Integrated models pass the sub-canopy reference height, attenuated wind, canopy-air temperature and humidity, and gustiness model for the surfaces beneath a canopy (see Canopy.subcanopy_forcing).
ClimaLand.turbulent_fluxes_at_a_point — Function
turbulent_fluxes_at_a_point(return_extra_fluxes, P_atmos, T_atmos, q_tot_atmos,
u_atmos, h_atmos, T_sfc_guess, q_vap_sfc_guess,
roughness_model, update_T_sfc, update_q_vap_sfc, h_sfc,
displ, update_∂T_sfc∂T, update_∂q_sfc∂T, gustiness,
earth_param_set)
turbulent_fluxes_at_a_point(stored::Val{names}, args...)Computes turbulent surface fluxes at a point on a surface given (1) the prescribed atmospheric conditions, P_atmos, T_atmos, q_tot_atmos, u_atmos, and h_atmos the absolute height at which these measurements are made. u_atmos is a can be a scalar if only the horizontal wind speed is known, otherwise a tuple can be passed with the (u,v) components of the wind. (2) the surface temperature (T_sfc_guess), specific humidity (q_vap_sfc_guess). If no update_T_sfc and update_q_val_sfc functions are passed, these $guesses" are the values used in the solve. Otherwise, the update functions are used to modify the$guess" values to the actual surface values. (3) Other surface properties, such the roughness model (see SurfaceFluxes.jl for possible types), the surface height, relative to the same references as h_atmos, the displacement height. (4) functions for computing the partial derivatives of T_sfc and q_vap_sfc with respect to the actual temperature (of the leaves, soil, or snow). These functions are component specific. (5) the parameter set.
With return_extra_fluxes = Val(false), this returns the NamedTuple (; lhf, shf, vapor_flux, ∂lhf∂T, ∂shf∂T) of the energy fluxes, the liquid water volume flux, and the derivatives of the energy fluxes with respect to the component temperature; with Val(true), it also returns the momentum flux components in the horizontal directions, ρτxz and ρτyz, and the buoyancy flux buoyancy_flux (see flux_names). ClimaCoupler evaluates this method directly into its flux fields.
With a Val of a tuple of names, it returns the fields names of the full NamedTuple of turbulent_fluxes_from_output, which also holds the surface temperature T_sfc and specific humidity q_sfc at which the fluxes were evaluated and the friction velocity ustar, stability parameter ζ, and effective height Δz_eff of the Monin-Obukhov profiles. turbulent_fluxes! passes the field names of its destination, so that each model stores the subset it needs; space for the extra fluxes is only allocated in the cache when running with a CoupledAtmosphere.
ClimaLand.turbulent_fluxes_from_output — Function
turbulent_fluxes_from_output(return_extra_fluxes, output, T_sfc_guess, q_vap_sfc_guess,
update_∂T_sfc∂T, update_∂q_sfc∂T, P_atmos, T_atmos,
q_tot_atmos, Δz, displ, earth_param_set)Return the NamedTuple of turbulent_fluxes_at_a_point from the SurfaceFluxes.jl output of surface_fluxes_at_a_point: the latent and sensible heat fluxes, the vapor flux in volume of liquid water, the approximate derivatives of the heat fluxes with respect to the component temperature (evaluated with update_∂T_sfc∂T and update_∂q_sfc∂T at the surface temperature and humidity T_sfc_guess and q_vap_sfc_guess), the surface temperature T_sfc and specific humidity q_sfc at which the fluxes were evaluated, the friction velocity ustar, the stability parameter ζ and effective height Δz_eff of the Monin-Obukhov profiles (see screen_level_values), followed for return_extra_fluxes = Val(true) by the momentum fluxes and the buoyancy flux. The atmospheric state is given at height Δz above the surface, and the surface has displacement height displ. Models that solve for their surface temperature within the Monin-Obukhov iterations use it to obtain the fluxes from that solve.
ClimaLand.select_fluxes — Function
select_fluxes(::Val{names}, fluxes)Return the NamedTuple of the fields names of the NamedTuple fluxes returned by turbulent_fluxes_from_output. Each model stores the subset it needs in its cache: all store the energy and vapor fluxes and their temperature derivatives, and the soil, snow, and canopy also store the surface state and similarity scales of the flux solve for the screen-level diagnostics.
ClimaLand.surface_flux_config — Function
surface_flux_config(roughness_model, gustiness)Return the SurfaceFluxes configuration used for the turbulent fluxes of all land surfaces: the given roughness and gustiness models, moist thermodynamics, no roughness sublayer correction, and the MaxHeatFluxStabilityCap in stable conditions.
The stability cap holds the exchange coefficients at their values at the stability ζ_p at which the Monin-Obukhov sensible heat flux at fixed wind speed is maximal. ζ_p depends only on the ratio of the effective forcing height to the momentum roughness length: about 0.15–0.4 over tall forests, 0.4–0.8 over grass, 1–1.2 over bare soil, and 1.4–1.6 over snow. Without a cap, the Monin-Obukhov exchange collapses once the bulk Richardson number becomes supercritical, which decouples the surface from the atmosphere at night (runaway cooling). The cap has no free parameters. See the SurfaceFluxes documentation.
ClimaLand.gustiness_spec — Function
gustiness_spec(atmos::AbstractAtmosphericDrivers)Return the gustiness model of an atmospheric driver as a SurfaceFluxes.AbstractGustinessSpec: the gustiness field of a PrescribedAtmosphere, and a SurfaceFluxes.ConstantGustinessSpec with the constant minimum wind speed that a CoupledAtmosphere holds for the coupler.
ClimaLand.screen_level_values — Function
screen_level_values(T_sfc, q_sfc, ustar, ζ, Δz_eff, z0m, z0h, T_atmos, q_atmos,
z_screen, z_anemometer, earth_param_set)Return the NamedTuple (; T, q, u, g_h) of the air temperature [K] and specific humidity [kg/kg] at the height z_screen [m] above the apparent sink for heat displ + z0h, the wind speed [m/s] at the height z_anemometer [m] above the apparent sink for momentum displ + z0m, and the heat conductance g_h [m/s] of a surface, reconstructed from the Monin-Obukhov profiles of its flux solve (turbulent_fluxes_at_a_point) with SurfaceFluxes.screen_level_values. The inputs are the surface temperature T_sfc [K] and specific humidity q_sfc at which the fluxes were evaluated, the friction velocity ustar [m/s], the stability parameter ζ and the effective forcing height Δz_eff [m], the height of the forcing above the displacement height, of the solve, the roughness lengths for momentum z0m and heat z0h [m], and the atmospheric temperature T_atmos [K] and specific humidity q_atmos at the forcing height.
Between the surface and the forcing height, a quantity X carried by the heat profile takes the value X_sfc + (X_atmos - X_sfc) F̂_h(z) / F̂_h(Δz_eff) at the effective height z, with the dimensionless profile F̂_h of SurfaceFluxes.dimensionless_profile_value at the stability of the solve. The temperature follows this relation in terms of the dry static energy, with the surface state at the displacement height (SurfaceFluxes.surface_geopotential), so it includes the adiabatic temperature change g / c_p per meter between the screen and forcing heights, and the displacement height itself does not enter. The wind speed is ustar F̂_m(z) / κ, which at the forcing height is the wind speed the solve used (including gustiness). Levels at or above the forcing height take the forcing values.
ClimaLand.screen_level_mean — Function
screen_level_mean(::Val{name}, (w₁, s₁), (w₂, s₂), ...)Return the mean of the screen-level value name (:T, :q, or :u) of the NamedTuples sᵢ of screen_level_values of the surfaces of a land model, weighted by the area fractions wᵢ of the surfaces times their heat conductances sᵢ.g_h. The weighting treats the surfaces as parallel sources to the atmosphere, as the land models do: the mean is the value a thermometer would read if each surface's share of the exchange with the atmosphere is its share of the total conductance. If the total conductance is zero, the value of the first surface is returned.
ClimaLand.component_temperature — Function
ClimaLand.component_temperature(
model::EnergyHydrology{FT},
Y,
p,
) where {FT}Returns the surface temperature field of the EnergyHydrology soil model.
For atmospherically driven soil (AtmosDrivenFluxBC), this is the soil skin temperature p.soil.turbulent_fluxes.T_sfc, solved for from the surface energy balance (see update_soil_surface_temperature!); otherwise it is the temperature at the center of the first soil layer.
ClimaLand.component_temperature(model::SnowModel, Y, p)a helper function which returns the surface temperature for the snow model, which is stored in the aux state.
ClimaLand.component_temperature(model::BucketModel, Y, p)a helper function which returns the surface temperature for the bucket model, which is stored in the aux state.
component_temperature(model::AbstractModel, Y, p)A helper function which returns the component temperature for a given model. This is used in the turbulent_fluxes! function as the value of surface temperature and used to compute long wave radiative fluxes.
Extending this function for your model is only necessary if you need to compute surface fluxes and radiative fluxes at the surface using the functions in this file. If your model uses different temperatures to compute turbulent fluxes vs long wave radiative fluxes, please see the documentation for an update function in the turbulent_fluxes! call.
ClimaLand.component_temperature(model::CanopyModel, Y, p)a helper function which returns the component temperature for the canopy model, which is stored in the aux state.
ClimaLand.component_specific_humidity — Function
ClimaLand.component_specific_humidity(
model::EnergyHydrology,
Y,
p,
forcing = (;
h_atmos = model.boundary_conditions.top.atmos.h,
T_atmos = p.drivers.T,
q_atmos = p.drivers.q,
),
)Return the surface specific humidity for the EnergyHydrology soil model, updating p.soil.q_sfc in place. The surface air density is extrapolated from the air temperature T_atmos and specific humidity q_atmos at the reference height h_atmos of forcing, which default to the atmospheric forcing; below a canopy, the sub-canopy forcing is passed.
ClimaLand.component_specific_humidity(
model::SnowModel,
Y,
p,
forcing = (;
h_atmos = model.boundary_conditions.atmos.h,
T_atmos = p.drivers.T,
q_atmos = p.drivers.q,
),
)Returns the precomputed specific humidity over snow as a weighted fraction of the saturated specific humidity over liquid and frozen water.
The surface air density is extrapolated from the air temperature T_atmos and specific humidity q_atmos at the reference height h_atmos of forcing, which default to the atmospheric forcing; below a canopy, the sub-canopy forcing is passed.
ClimaLand.component_specific_humidity(model::BucketModel, Y, p)a helper function which returns the surface specific humidity for the bucket model, which is stored in the aux state.
component_specific_humidity(model::AbstractModel, Y, p)
component_specific_humidity(model::AbstractModel, Y, p, forcing)A helper function which returns the surface specific humidity for a given model, needed because different models compute and store q_sfc in different ways and places.
The second form takes the forcing (; h_atmos, T_atmos, q_atmos) of the flux solve, the reference height and the air temperature and specific humidity at it, which differ from the atmospheric forcing below a canopy. Models whose surface humidity depends on the forcing extend it; for other models, it returns the first form.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file. Please see the documentation for an update function in the turbulent_fluxes! call.
ClimaLand.component_specific_humidity(model::CanopyModel, Y, p)a helper function which returns the surface specific humidity for the canopy model.
ClimaLand.surface_roughness_model — Function
ClimaLand.surface_roughness_model(model::SnowModel, Y, p)a helper function which returns the surface roughness model for the snow model.
ClimaLand.surface_roughness_model(model::BucketModel, Y, p)a helper function which returns the surface roughness model for the bucket model.
surface_roughness_model(model::AbstractModel, Y, p)Returns the SurfaceFluxes roughness model for model.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.surface_roughness_model(model::CanopyModel, Y, p)a helper function which returns the surface roughness model for the canopy model.
ClimaLand.surface_displacement_height — Function
surface_displacement_height(model::AbstractModel, Y, p)Returns the displacement height for model.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.surface_displacement_height(model::CanopyModel, Y, p)a helper function which returns the displacement height for the canopy model.
ClimaLand.get_update_surface_temperature_function — Function
get_update_surface_temperature_function(model::AbstractModel, Y, p)Returns the SurfaceFluxes update_T_sfc function for model.
This is only required if the output of component_temperature does not coincide with the temperature that should be used to compute turbulent fluxes.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.get_update_surface_temperature_function(model::CanopyModel, Y, p)a helper function which computes and returns the function which updates the guess for surface temperature to the actual value, for the canopy model.
ClimaLand.get_update_surface_humidity_function — Function
ClimaLand.get_update_surface_humidity_function(model::BucketModel, Y, p)a helper function which creates and returns a function which modifies q_sfc given the evaporative scaling factor β and the air humidity.
get_update_surface_humidity_function(model::AbstractModel, Y, p)Returns the SurfaceFluxes update_q_vap_sfc function for model.
This is only required if the output of component_specific_humidity does not coincide with the specific humidity that should be used to compute turbulent fluxes.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.get_update_surface_humidity_function(model::CanopyModel, Y, p)a helper function which computes and returns the function which updates the guess for surface specific humidity to the actual value, for the canopy model.
ClimaLand.get_∂T_sfc∂T_function — Function
get_∂T_sfc∂T_function(model::AbstractModel, Y, p)Returns a function which computes the partial derivative of the surface temperature used in turbulent_fluxes! with respect to the component temperature. The expected arguments are (u_star, g_h, earth_param_set).
This is only required if the output of component_temperature does not coincide with the temperature that should be used to compute turbulent fluxes, and if your model requires derivatives of the fluxes with respect to the component temperature.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.get_∂T_sfc∂T_function(model::CanopyModel, Y, p)a helper function which creates and returns the function which computes the partial derivative of the surface temperature with respect to the canopy temperature.
ClimaLand.get_∂q_sfc∂T_function — Function
get_∂q_sfc∂T_function(model::AbstractModel, Y, p)Returns a function which computes the partial derivative of the surface humidity used in turbulent_fluxes! with respect to the component temperature. The expected arguments are (u_star, g_h, T_sfc, P_sfc, earth_param_set).
This is only required if the output of component_specific_humidity does not coincide with the humidity that should be used to compute turbulent fluxes, and if your model requires derivatives of the fluxes with respect to the component temperature.
Extending this function for your model is only necessary if you need to compute surface fluxes using the functions in this file.
ClimaLand.get_∂q_sfc∂T_function(model::CanopyModel, Y, p)a helper function which creates and returns the function which computes the partial derivative of the surface specific humididity with respect to the canopy temperature.
The derivative is zero where the surface humidity is held at the atmospheric value by get_update_surface_humidity_function, i.e. where the saturation specific humidity of the canopy q_sat does not exceed the atmospheric specific humidity.
ClimaLand.default_cos_zenith_angle — Function
default_cos_zenith_angle(
t::T,
start_date::Dates.DateTime;
latitude::LT,
longitude::LT,
insol_params::Insolation.Parameters.InsolationParameters{FT},
)Calculate cosine of the zenith angle with Insolation for the given start date, insolation parameters, latitude, and longitude. Note that Insolation.jl returns 0 for the cosine when the sun is below the horizon.
latitude and longitude can be a collections or a Number.
ClimaLand.prescribed_forcing_era5 — Function
prescribed_forcing_era5(start_date,
stop_date,
surface_space,
toml_dict::CP.ParamDict,
FT;
use_lowres_forcing = false,
gustiness = SurfaceFluxes.FlooredDeardorffGustinessSpec(FT(1)),
max_wind_speed = nothing,
c_co2 = TimeVaryingInput((t) -> 4.2e-4),
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
regridder_type = :InterpolationsRegridder,
context = nothing,
)A helper function which constructs the PrescribedAtmosphere and PrescribedRadiativeFluxes from ERA5 data stored in NetCDF files.
There are two versions of the ERA5 data available through ClimaLand:
- a high resolution version (1° x 1°) available for the years 1979-2024
- a low resolution version (8° x 8°) available only for the year 2008
The high resolution version will be used if use_lowres_forcing = false (the default). This artifact is used for global runs on compute clusters, but is too large to be used for local testing, and requires you to have acquired the data in advance. The low resolution version will be used if use_lowres_forcing = true. If the simulation dates are outside of 2008, the 2008 data will be reused for each year of simulation. This artifact is recommended for local testing or quick runs where accuracy is less critical.
The method for temporal interpolation is controlled via the time_interpolation_method kwarg. We suggest LinearInterpolation(PeriodicCalendar()), which implies linear interpolation in time; the inner argument implies how extrapolation outside the bounds of the data is handled. For example, the ERA5 forcing data we use is hourly, which implies Dec 31 of the last year of the data, at midnight, is not in the data. With the PeriodicCalendar() option, the interpolated value in the data at Jan 1 at timestamp 00 of the first year of the simulation will be used. For the low-resolution forcing data, which only exists for 2008, multi-year runs will repeat the forcing. If this behavior is not what you want, you can change the extrapolation argument to error LinearInterpolation(Throw()) or extrapolate by using the last value `LinearInterpolation(Flat()). More information is available in the ClimaUtilities documentation: https://clima.github.io/ClimaUtilities.jl/dev/inputs/#Extrapolation-boundary-conditions.
The ClimaLand default is to use nearest neighbor spatial interpolation for low resolution forcing, and linear spatial interpolation for high resolution forcing.
High wind speed anomalies (10-100x increase and decrease over a period of a several hours) appear in the ERA5 reanalysis data. These generate very large surface fluxes (due to wind speeds up to 300 m/s), which lead to instability. The kwarg max_wind_speed, with a value give in m/s, is used to clip these if it is not nothing. See here.
The full 40 year dataset of high resolution ERA5 data is only available on the clima cluster.
The wind is the ERA5 10 m wind, sqrt(u10² + v10²), and the reference height of the forcing is set to 10 m. The temperature and humidity are the ERA5 2 m fields (t2m, d2m), which are themselves products of ERA5's own surface-layer scheme, not 10 m values. The Monin-Obukhov solve therefore evaluates the temperature and humidity differences to the surface over 2 m but the wind over 10 m, which weakens the diagnosed stability and instability. The hourly-mean components also give a scalar wind speed somewhat below the mean of the instantaneous speed.
ClimaLand.prescribed_forcing_crujra — Function
prescribed_forcing_crujra(start_date,
stop_date,
surface_space,
toml_dict::CP.ParamDict,
FT;
gustiness = SurfaceFluxes.FlooredDeardorffGustinessSpec(FT(1)),
c_co2 = TimeVaryingInput((t) -> 4.2e-4),
time_interpolation_method = LinearInterpolation(),
regridder_type = :InterpolationsRegridder,
context = nothing,
)Construct PrescribedAtmosphere and PrescribedRadiativeFluxes drivers from the CRU-JRA reanalysis NetCDF data.
Time handling
- Defaults to
LinearInterpolation()in time (no periodic extrapolation).
How it differs from prescribed_forcing_era5
- CRU-JRA provides scalar 10 m wind speed (
"wind"), so no u/v combination is needed (ERA5 combinesu10/v10). - Only a single resolution is supported here; ERA5 exposes both high- and low-resolution artifacts and switches interpolation strategies accordingly.
- The default time interpolation is non-periodic; ERA5 defaults to
LinearInterpolation(PeriodicCalendar())to enable seamless multi-year reuse of limited data (especially for low-res forcing).
ClimaLand.prescribed_perturbed_temperature_era5 — Function
prescribed_perturbed_temperature_era5(era5_ncdata_path,
surface_space,
start_date,
toml_dict::CP.ParamDict,
ΔT,
FT;
gustiness = SurfaceFluxes.FlooredDeardorffGustinessSpec(FT(1)),
max_wind_speed = nothing,
c_co2 = TimeVaryingInput((t) -> 4.2e-4),
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
regridder_type = :InterpolationsRegridder,
interpolation_method = Interpolations.Constant(),)A helper function which constructs the PrescribedAtmosphere and PrescribedRadiativeFluxes from a file path pointing to the ERA5 data in a netcdf file, the surfacespace, the start date, and the `tomldict`, applying a change in the instantaneous temperature at each point of ΔT, while keeping the relative humidity fixed. The LWd shifts as LWd -> LW_d + aΔT, with a= 2W/m^2/K a surface climate sensitivity parameter.
Please see the documentation for prescribed_forcing_era5 for more information.
ClimaLand.prescribed_perturbed_rh_era5 — Function
prescribed_perturbed_rh_era5(era5_ncdata_path,
surface_space,
start_date,
toml_dict::CP.ParamDict,
Δrh,
FT;
gustiness = SurfaceFluxes.FlooredDeardorffGustinessSpec(FT(1)),
max_wind_speed = nothing,
c_co2 = TimeVaryingInput((t) -> 4.2e-4),
time_interpolation_method = LinearInterpolation(PeriodicCalendar()),
regridder_type = :InterpolationsRegridder,
interpolation_method = Interpolations.Constant(),)A helper function which constructs the PrescribedAtmosphere and PrescribedRadiativeFluxes from a file path pointing to the ERA5 data in a netcdf file, the surfacespace, the start date, and the `tomldict`, applying a change in the instantaneous change to relative humidity at each point of Δrh. The perturbed rh is clipped to be within the range (0,1].
Please see the documentation for prescribed_forcing_era5 for more information.
ClimaLand.prescribed_analytic_forcing — Function
prescribed_analytic_forcing(FT = Float32;
toml_dict::CP.ParamDict,
start_date = DateTime(2005),
SW_d = (t) -> 0,
LW_d = (t) -> 5.67e-8 * 280.0^4.0,
precip = (t) -> 0, # no precipitation
T_atmos = (t) -> 280.0,
u_atmos = (t) -> 1.0,
q_atmos = (t) -> 0.0, # no atmos water
h_atmos = FT(1),
P_atmos = (t) -> 101325,
atmos = PrescribedAtmosphere(
TimeVaryingInput(precip),
TimeVaryingInput(precip),
TimeVaryingInput(T_atmos),
TimeVaryingInput(u_atmos),
TimeVaryingInput(q_atmos),
TimeVaryingInput(P_atmos),
start_date,
h_atmos,
LP.LandParameters(toml_dict),
),
radiation = PrescribedRadiativeFluxes(
FT,
TimeVaryingInput(SW_d),
TimeVaryingInput(LW_d),
start_date,
),
)A helper function which constructs the PrescribedAtmosphere and PrescribedRadiativeFluxes for a simple analytic case.
ClimaLand.net_radiation! — Function
net_radiation!(dest::ClimaCore.Fields.Field,
radiation::AbstractRadiativeDrivers,
model::AbstractModel{FT},
Y::ClimaCore.Fields.FieldVector,
p::NamedTuple,
t,
) where {FT}Computes net radiative flux assuming that the incoming shortwave radiation is stored in p.drivers.SW_d, and the incoming longwave radiation is stored in p.drivers.LW_d. This can be because
- the prescribed functions are called to update these values
- the coupler has updated these values.
ClimaLand.get_drivers — Function
ClimaLand.get_drivers(model::RichardsModel)Returns the driver variable symbols for the RichardsModel; these depend on the boundary condition type and currently only are required for the RichardsAtmosDrivenFluxBC, which is driven by a prescribed time and space varying precipitation.
ClimaLand.get_drivers(model::SnowModel)Returns the driver variable symbols for the SnowModel.
get_drivers(model::AbstractModel)Returns the driver objects for the model - atmospheric and radiative forcing, etc - as a tuple (atmos, radiation, ...). If no drivers are needed by a model, an empty tuple should be returned
ClimaLand.get_drivers(model::LandModel)Returns the "drivers", or forcing variables, for the LandModel.
These consist of atmospheric and radiative forcing.
ClimaLand.make_update_drivers — Function
make_update_drivers(::AbstractClimaLandDrivers)Creates and returns a function which updates the driver variables in the default case of no drivers. More generally, this should return a function which updates the driver fields stored in p.drivers.
make_update_drivers(driver_tuple)Creates and returns a function which updates the forcing variables ("drivers"). If no drivers are being used, driver_tuple is empty, and the update function does nothing.
make_update_drivers(a::PrescribedGroundConditions{FT}) where {FT}Creates and returns a function which updates the driver variables in the case of a PrescribedGroundConditions.
make_update_drivers(a::PrescribedAtmosphere{FT}) where {FT}Creates and returns a function which updates the driver variables in the case of a PrescribedAtmosphere.
make_update_drivers(a::PrescribedPrecipitation{FT}) where {FT}Creates and returns a function which updates the driver variables in the case of a PrescribedPrecipitation.
make_update_drivers(r::CoupledRadiativeFluxes{FT}) where {FT}Creates and returns a function which updates the driver variables in the case of a CoupledRadiativeFluxes.
When r.cosθs is nothing, the cosine zenith angle not changed, and should be updated by the coupler. This differs from the behavior of PrescribedRadiativeFluxes, where the cosine zenith angle is set to NaN if cosθs is nothing.
Otherwise, the cosine zenith angle is computed using r.cosθs(t, r.start_date).
make_update_drivers(r::PrescribedRadiativeFluxes{FT}) where {FT}Creates and returns a function which updates the driver variables in the case of a PrescribedRadiativeFluxes.