exo_k.two_stream.two_stream_toon

Created in Jan 2021

@author: jeremy leconte

Module Contents

exo_k.two_stream.two_stream_toon.solve_2stream_nu_xsec(source_nu, dtau_nu, omega0_nu, g_asym_nu, flux_top_dw_nu, alb_surf_nu, mu0=0.5, flux_at_level=False)[source]

Deals with the spectral axis

exo_k.two_stream.two_stream_toon.solve_2stream_nu_corrk(source_nu, dtau_nu, omega0_nu, g_asym_nu, flux_top_dw_nu, alb_surf_nu, mu0=0.5, flux_at_level=False)[source]

Deals with the spectral axis

exo_k.two_stream.two_stream_toon.solve_2stream(source, dtau, omega0, g_asym, mu0=0.5, flux_top_dw=0.0, alb_surf=0.0, flux_at_level=False)[source]

After Toon et al. (JGR, 1989). Equation number refer to this article.

emis_surf=1.-alb_surf

As we only consider hemispheric mean or quadrature, mu1==mu0

Parameters:
  • source (array, np.ndarray) – pi*B (Planck function) at each of the Nlay+1 level interfaces of the model (top to bottom). Thanks to the pi factor it can be compared to the incoming flux.

  • dtau (array, np.ndarray) – optical depth of each of the Nlay model layers.

  • omega0 (float or array) – single scattering albedo of each layer

  • g_asym (float or array) – asymmetry factor (g in Toon et al.)

  • mu0 (float) – 1./2. yields hemispheric mean approx 1./sqrt(3) yields quadrature

  • flux_top_dw (float) – Incoming diffuse flux at the upper boundary

  • alb_surf (float) – Surface albedo. Emissivity is assumed to be 1.-alb_surf

  • flux_at_level (bool, optional) – if flux_at_level is True, fluxes are calculated at the level surfaces. If False, fluxes are computed at the middle of the layers. The top of atmosphere flux is always computed at the top of the uppermost layer (1st level).

exo_k.two_stream.two_stream_toon._gammas_toon(omega0, g_asym, mu0=0.5)[source]

mu0=0.5 yields hemispheric mean

Parameters:
  • omega0 (float or array) – single scattering albedo of each layer

  • g_asym (float or array) – asymmetry factor (g in Toon et al.)

  • mu0 (float) – 1./2. yields hemisperic mean approx 1./sqrt(3) yields quadrature

Returns:

gamma1, gamma2: floats or arrays

gammas defined in Table 1 of Toon et al.

exo_k.two_stream.two_stream_toon.matrix_toon_tridiag(Nlay, source, dtau, gam_1, gam_2, mu1, flux_top_dw, alb_surf, flux_at_level)[source]
Returns:

flux_net: array, np.ndarray

Net flux at the bottom of the Nlay layers.

exo_k.two_stream.two_stream_toon.lambda_toon(gam_1, gam_2)[source]

lambda from eq 21 of Toon et al.

exo_k.two_stream.two_stream_toon.lambda_GAMMA(gam_1, gam_2)[source]

lambda and GAMMA from eq 21 and 22 of Toon et al. For GAMMA, the positive alterative is used (center in eq 22)

exo_k.two_stream.two_stream_toon.c_planck(source, dtau, gam_1, gam_2, mu1)[source]

c_up/dw is for c+/- whithout direct beam scattering. _top is for tau equal 0 (top of the layer) _bot is for tau=dtau (bottom of the layer) removed a pi factor because source is pi*B

exo_k.two_stream.two_stream_toon.c_planck_mid(source, dtau, gam_1, gam_2, mu1)[source]

c_up/dw is for c+/- whithout direct beam scattering. These are computed at the middle of the layer, i.e. at tau=dtau/2. removed a pi factor because source is pi*B

exo_k.two_stream.two_stream_toon.e_i_toon(dtau, gam_1, gam_2)[source]

e_i factors defined in eq 44.

exo_k.two_stream.two_stream_toon.mid_factor_toon(dtau, gam_1, gam_2)[source]

Factors to recover the flux at mid layer.

exo_k.two_stream.two_stream_toon.DTRIDGL(L, AF, BF, CF, DF)[source]

DIMENSION AF(L),BF(L),CF(L),DF(L),XK(L) DIMENSION AS(2*L),DS(2*L)

!* THIS SUBROUTINE SOLVES A SYSTEM OF TRIDIAGIONAL MATRIX !* EQUATIONS. THE FORM OF THE EQUATIONS ARE: !* A(I)*X(I-1) + B(I)*X(I) + C(I)*X(I+1) = D(I) !======================================================================!

exo_k.two_stream.two_stream_toon.matrix_toon(Nlay, source, dtau, gam_1, gam_2, mu1, flux_top_dw, alb_surf)[source]
Returns:

flux_net: array, np.ndarray

Net flux at the bottom of the Nlay layers.