Fluxes

RRTMGP.Fluxes.FluxLWType
FluxLW{FT, FTA2D}

Upward, downward and net longwave fluxes at each level.

Fields

  • flux_up: Upward flux [W/m²] (ncol, nlev).
  • flux_dn: Downward flux [W/m²] (ncol, nlev).
  • flux_net: Net flux [W/m²] (ncol, nlev).
source
RRTMGP.Fluxes.FluxSWType
FluxSW{FT, FTA2D}

Upward, downward and net shortwave fluxes at each level.

Fields

  • flux_up: Upward flux [W/m²] (ncol, nlev).
  • flux_dn: Downward flux [W/m²] (ncol, nlev).
  • flux_net: Net flux [W/m²] (ncol, nlev).
  • flux_dn_dir: Direct downward flux [W/m²] (ncol, nlev).
source
RRTMGP.Fluxes.FluxPresentationType
FluxPresentation{FTA2D, FD}

Host-facing (nlev, ncol) copies of a broadband flux set, filled by update_presentation! from the column-first (ncol, nlev) compute buffers at the end of every update_lw_fluxes!/update_sw_fluxes! (and hence of update_fluxes!). The Layer-2 flux getters return plain domain-masked views of these arrays, so the getter contract (materializable with Array, broadcastable, reducible — also on the GPU, where lazily transposed views of the compute buffers would fall outside the wrapper types CUDA.jl dispatches on) holds without per-getter laziness.

Fields

  • flux_up: upward flux [W/m²] (nlev, ncol).
  • flux_dn: downward flux [W/m²] (nlev, ncol).
  • flux_net: net flux [W/m²] (nlev, ncol).
  • flux_dn_dir: direct downward flux [W/m²] (nlev, ncol), or nothing (longwave).
source
RRTMGP.Fluxes.update_presentation!Function
update_presentation!(pres::FluxPresentation, flux::AbstractFlux)

Fill the (nlev, ncol) presentation arrays from the (ncol, nlev)-indexed compute buffers of flux (the direct beam only when present). On the GPU this is a transposing copy; on the CPU, the compute buffers' physical parents already have the presentation layout, so it is a plain copyto!.

source
RRTMGP.Fluxes.transpose_into!Function
transpose_into!(dest, src)

Copy the 2D array src into dest with the two dimensions swapped (dest[i, j] = src[j, i]). Device arrays use a single broadcast kernel; host arrays use explicit loops, since broadcasts with a permuted-wrapper operand allocate a few bytes on Julia ≤ 1.11, tripping the zero-allocation tests.

source
RRTMGP.Fluxes.set_flux_to_zero!Function
set_flux_to_zero!(flux::FluxLW{FT}, gcol::Int, nlev::Int) where {FT<:AbstractFloat}
set_flux_to_zero!(flux::FluxLW{FT}, gcol::Int) where {FT<:AbstractFloat}

Set longwave flux for column gcol to zero across nlev levels.

source
set_flux_to_zero!(flux::FluxSW{FT}, gcol::Int, nlev::Int) where {FT<:AbstractFloat}
set_flux_to_zero!(flux::FluxSW{FT}, gcol::Int) where {FT<:AbstractFloat}

Set shortwave flux for column gcol to zero across nlev levels.

source
RRTMGP.Fluxes.compute_net_flux!Function
compute_net_flux!(flux::AbstractFlux, gcol, nlev)
compute_net_flux!(flux::AbstractFlux, gcol)

Compute the net flux for column gcol across nlev levels:

flux.flux_net = flux.flux_up - flux.flux_dn

source