Daynight#

class abcmodel.atmos.daynight.ActiveBLState(is_night, mixed, sbl)[source]#

Bases: AbstractState

Wrapper combining daytime convective mixed layer and nighttime stable boundary layer.

The is_night flag determines which sub-state drives the dynamics.

is_night: Array#
mixed: BulkState#
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 night active_bl.sbl (stable boundary layer) takes over. The residual preserves 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:
Returns:

The initial atmosphere state.

statistics(state, t)[source]#

Update diagnostic statistics for the active boundary layer.

run(state)[source]#
warmup(radmodel, landmodel, state, t, dt, tstart)[source]#

Warmup the atmos by running it for a few timesteps.

integrate(state, dt)[source]#

Integrate the active boundary layer forward in time.