Daynight#
- class abcmodel.atmos.daynight.ActiveBLState(is_night, mixed, sbl)[source]#
Bases:
AbstractStateWrapper combining daytime convective mixed layer and nighttime stable boundary layer.
The
is_nightflag determines which sub-state drives the dynamics.- is_night: Array#
- sbl: ZilitinkevichState#
- class abcmodel.atmos.daynight.DayAndNightAtmosphereState(surface, active_bl, residual, clouds)[source]#
Bases:
AbstractAtmosphereState,Generic[SurfT,CloudT]Atmosphere state with day/night switching.
During daytime the
active_bl.mixed(convective mixed layer) is active; at nightactive_bl.sbl(stable boundary layer) takes over. Theresidualpreserves the daytime mixed-layer properties aloft overnight.- surface: SurfT#
- active_bl: ActiveBLState#
- residual: FrozenResidualState#
- clouds: CloudT#
- property ra: Array#
Aerodynamic resistance [s/m].
- property thetasurf: Array#
Surface potential temperature [K].
- property ustar: Array#
Friction velocity [m/s].
- property uw: Array#
Zonal momentum flux [m²/s²].
- property vw: Array#
Meridional momentum flux [m²/s²].
- property is_night: Array#
- property theta: Array#
Potential temperature [K].
- property q: Array#
Specific humidity [kg/kg].
- property co2: Array#
CO2 concentration [ppmv].
- property surf_pressure: Array#
Surface pressure [Pa].
- property u: Array#
Zonal wind speed [m/s].
- property v: Array#
Meridional wind speed [m/s].
- property h_abl: Array#
Boundary layer height [m].
- property wstar: Array#
Convective velocity scale [m/s].
- property thetav: Array#
Mixed-layer virtual potential temperature [K].
- property top_T: Array#
Temperature at top of mixed layer [K].
- property top_p: Array#
Pressure at top of mixed layer [Pa].
- property wthetav: Array#
Virtual potential temperature flux at surface [K m/s].
- property wqe: Array#
Entrainment moisture flux [kg/kg m/s].
- property dq: Array#
Specific humidity jump at h [kg/kg].
- property dz_h: Array#
Transition layer thickness [m].
- property deltaCO2: Array#
CO2 jump at h [ppm].
- property wCO2e: Array#
Entrainment CO2 flux [mgC/m²/s].
- property cc_mf: Array#
Cloud core mass flux [kg/kg/s].
- property cc_qf: Array#
Cloud core moisture flux [kg/kg/s].
- property wCO2M: Array#
Cloud core CO2 mass flux [mgC/m²/s].
- property cc_frac: Array#
Cloud core fraction [-].
- class abcmodel.atmos.daynight.DayAndNightAtmosphereModel(surface_layer, mixed_layer, sbl_layer, residual_layer, clouds)[source]#
Bases:
AbstractAtmosphereModel[DayAndNightAtmosphereState]Atmosphere model with day/night switching.
Wraps a surface-layer model, a convective mixed-layer model (day), a stable boundary-layer model (night), a residual-layer container, and a cloud model. At sunset the mixed layer is copied to the residual layer; at sunrise the mixed layer starts from the SBL height.
- init_state(surface, mixed, sbl, residual, clouds, is_night=False)[source]#
Initialize the model state.
- Parameters:
surface (
TypeVar(SurfT, bound=AbstractSurfaceLayerState)) – Initial surface-layer state.mixed (
BulkState) – Initial convective mixed-layer state.sbl (
ZilitinkevichState) – Initial stable boundary-layer state.residual (
FrozenResidualState) – Initial residual-layer state.clouds (
TypeVar(CloudT, bound=AbstractCloudState)) – Initial cloud state.is_night (
bool) – Whether the model starts at night. DefaultFalse.
- Returns:
The initial atmosphere state.