Standard#
- class abcmodel.rad.standard.StandardRadiationState(net_rad, in_srad=<factory>, out_srad=<factory>, in_lrad=<factory>, out_lrad=<factory>)[source]#
Bases:
AbstractRadiationStateStandard radiation model state.
- net_rad: Array#
Net surface rad [W m-2].
- in_srad: Array#
Incoming solar rad [W m-2].
- out_srad: Array#
Outgoing solar rad [W m-2].
- in_lrad: Array#
Incoming longwave rad [W m-2].
- out_lrad: Array#
Outgoing longwave rad [W m-2].
- class abcmodel.rad.standard.StandardRadiationModel(lat=51.97, lon=-4.93, doy=268.0, cc=0.0)[source]#
Bases:
AbstractRadiationModel[StandardRadiationState]Standard radiation model with solar position and atmospheric effects.
Calculates time-varying solar rad based on geographic location and atmospheric conditions. Includes both shortwave (solar) and longwave (thermal) rad components.
- Parameters:
lat (
float) – latitude [degrees], range -90 to +90. Default is 51.97 (Cabauw, NL).lon (
float) – longitude [degrees], range -180 to +180. Default is -4.93 (Cabauw, NL).doy (
float) – day of year [-], range 1 to 365. Default is 268.0.cc (
float) – cloud cover fraction [-], range 0 to 1. Default is 0.0.
- init_state(net_rad=400.0)[source]#
Initialize the model state.
- Parameters:
net_rad (
float) – Net surface radiation [W m-2]. Default is 400.0.- Returns:
The initial radiation state.
- run(state, t, dt, tstart)[source]#
Calculate rad components and net surface rad.
- Parameters:
state (
AbstractCoupledState[StandardRadiationState,TypeVar(LandT, bound=AbstractLandState),TypeVar(AtmosT, bound=AbstractAtmosphereState)]) – CoupledState.t (
Array) – Current time step index [-].dt (
float) – Time step duration [s].tstart (
float) – Start time of day [hours UTC], range 0 to 24.
- Returns:
The updated rad state object.
- compute_solar_declination(doy)[source]#
Compute solar declination angle based on day of year.
- Parameters:
doy (
float) – Day of year [-], range 1 to 365.- Returns:
Solar declination angle [radians].
Notes
Calculates the solar declination angle \(\delta\) using
\[\delta = 0.409 \cdot \cos\left( \frac{2\pi \cdot (\text{D} - 173)}{365} \right)\]where \(\text{D}\) is the day of the year, \(0.409\) is the approximate Earth’s axial tilt in radians (23.45°), and \(173\) is the approximate day of the summer solstice, which acts as the phase shift for the cosine wave.
- compute_solar_elevation(t, dt, tstart, solar_declination)[source]#
Compute solar elevation angle (sine of elevation).
- Parameters:
t (
Array) – current time step index [-].dt (
float) – time step duration [s].solar_declination (
Array) – solar declination angle [radians] fromcompute_solar_declination().
- Returns:
Sine of the solar elevation angle [-].
Notes
First, the latitude \(\phi\), longitude \(\lambda\), and time of day \(t\) are converted to radians with
\[\phi_{\text{rad}} = \frac{2\pi \cdot \text{lat}}{360},\]\[\lambda_{\text{rad}} = \frac{2\pi \cdot \text{lon}}{360},\]\[t_{\text{rad}} = \frac{2\pi \cdot (t \cdot dt + t_{\text{start}} \cdot 3600)}{86400}.\]The sine of the solar elevation is then calculated as
\[\sin(\alpha) = \sin(\phi_{\text{rad}})\sin(\delta) - \cos(\phi_{\text{rad}})\cos(\delta) \cos(t_{\text{rad}} + \lambda_{\text{rad}}),\]where \(\delta\) is the solar declination. The result is clipped at a minimum value of 0.0001 to represent night-time and avoid mathematical instability in subsequent calculations.
- compute_air_temperature(surf_pressure, h_abl, theta)[source]#
Compute air temperature at reference level using potential temperature.
- Parameters:
surf_pressure (
Array) – surface pressure [Pa].h_abl (
Array) – atmospheric boundary layer height [m].theta (
Array) – potential temperature [K].
- Returns:
Air temperature at the reference level [K].
Notes
The calculation is a two-step process:
First, the pressure at a reference level \(P_{\text{ref}}\) is estimated from the surface pressure \(P_{\text{surf}}\) using the simplified hydrostatic approximation
\[P_{\text{ref}} = P_{\text{surf}} - 0.1 \cdot h_{\text{ABL}} \cdot \rho \cdot g,\]where \(h_{\text{ABL}}\) is the atmospheric boundary layer (ABL) height, \(\rho\) is air density, and \(g\) is gravity.
Second, the potential temperature \(\theta\) is converted to the actual air temperature \(T_{\text{air}}\) at the reference level using Poisson’s equation (for an adiabatic process)
\[T_{\text{air}} = \theta\left( \frac{P_{\text{ref}}}{P_{\text{surf}}} \right) ^{\kappa},\]where the exponent \(\kappa = R_d / c_p\) is the ratio of the gas constant for dry air \(R_d\) to the specific heat capacity of air \(c_p\).
- compute_atmospheric_transmission(solar_elevation)[source]#
Compute atmospheric transmission coefficient for solar rad.
- Parameters:
solar_elevation (
Array) – sine of the solar elevation angle [-].- Returns:
Atmospheric transmission coefficient [-].
Notes
This is a simplified empirical parameterization (linear model) for atmospheric transmission (\(\tau\)).
A clear-sky transmission \(\tau_{\text{clear}}\) is calculated based on the solar elevation \(\sin(\alpha)\) as
\[\tau_{\text{clear}} = 0.6 + 0.2 \cdot \sin(\alpha).\]A cloud reduction factor \(f_{\text{cloud}}\) is calculated based on the cloud cover \(\text{cc}\) as
\[f_{\text{cloud}} = 1.0 - 0.4 \cdot \text{cc}.\]The final transmission is then the product of these two factors, giving
\[\tau = \tau_{\text{clear}} \cdot f_{\text{cloud}}.\]
- compute_rad_components(solar_elevation, atmospheric_transmission, air_temp, alpha, surf_temp)[source]#
Compute all rad components and update attributes.
- Parameters:
solar_elevation (
Array) – sine of the solar elevation angle [-].atmospheric_transmission (
Array) – atmospheric transmission coefficient [-].air_temp (
Array) – air temperature [K].alpha (
Array) – surface albedo [-].surf_temp (
Array) – surface temperature [K].
- Returns:
A tuple containing net rad, incoming shortwave rad, outgoing shortwave rad, incoming longwave rad and outgoing longwave rad [W/m^2].
Notes
This function calculates the four components of the surface rad budget and the resulting net rad.
Shortwave rad:
Incoming shortwave \(SW_{\text{in}}\) is the solar constant \(S\) attenuated by the atmos and projected onto the surface, given by
\[SW_{\text{in}} = S \cdot \tau \cdot \sin(\alpha),\]where \(\tau\) is the atmospheric transmission and \(\sin(\alpha)\) is the sine of the solar elevation.
Outgoing shortwave \(SW_{\text{out}}\) is the fraction of incoming rad reflected by the surface (albedo, \(\alpha\)), given by
\[SW_{\text{out}} = \alpha \cdot SW_{\text{in}}.\]
Longwave rad:
Both longwave components are calculated using the Stefan-Boltzmann law \(E = \epsilon \sigma T^4\).
Incoming longwave \(LW_{\text{in}}\) is the rad from the atmos, which is treated as a grey body with an emissivity \(\epsilon_{\text{atm}} = 0.8\), given by
\[LW_{\text{in}} = 0.8 \cdot \sigma \cdot T_{\text{air}}^4,\]where \(\sigma\) is the Stefan-Boltzmann constant const.bolz.
Outgoing longwave \(LW_{\text{out}}\) is the rad from the surface, assuming an emissivity of 1.0, given by
\[LW_{\text{out}} = \sigma \cdot T_{\text{surf}}^4.\]
Net rad:
Finally, the net rad \(R_{\text{net}}\) is given by the balance
\[R_{\text{net}} = (SW_{\text{in}} - SW_{\text{out}}) + (LW_{\text{in}} - LW_{\text{out}}).\]