:py:mod:`exo_k.two_stream.two_stream_toon` ========================================== .. py:module:: exo_k.two_stream.two_stream_toon .. autoapi-nested-parse:: Created in Jan 2021 @author: jeremy leconte Module Contents --------------- .. py:function:: 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) Deals with the spectral axis .. py:function:: 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) Deals with the spectral axis .. py:function:: solve_2stream(source, dtau, omega0, g_asym, mu0=0.5, flux_top_dw=0.0, alb_surf=0.0, flux_at_level=False) 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 :param source: 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. :type source: :class:`array`, :class:`np.ndarray` :param dtau: optical depth of each of the Nlay model layers. :type dtau: :class:`array`, :class:`np.ndarray` :param omega0: single scattering albedo of each layer :type omega0: :class:`float` or :class:`array` :param g_asym: asymmetry factor (g in Toon et al.) :type g_asym: :class:`float` or :class:`array` :param mu0: 1./2. yields hemispheric mean approx 1./sqrt(3) yields quadrature :type mu0: :class:`float` :param flux_top_dw: Incoming diffuse flux at the upper boundary :type flux_top_dw: :class:`float` :param alb_surf: Surface albedo. Emissivity is assumed to be 1.-alb_surf :type alb_surf: :class:`float` :param flux_at_level: 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). :type flux_at_level: :class:`bool`, *optional* .. py:function:: _gammas_toon(omega0, g_asym, mu0=0.5) mu0=0.5 yields hemispheric mean :param omega0: single scattering albedo of each layer :type omega0: :class:`float` or :class:`array` :param g_asym: asymmetry factor (g in Toon et al.) :type g_asym: :class:`float` or :class:`array` :param mu0: 1./2. yields hemisperic mean approx 1./sqrt(3) yields quadrature :type mu0: :class:`float` :returns: gamma1, gamma2: floats or arrays gammas defined in Table 1 of Toon et al. .. py:function:: matrix_toon_tridiag(Nlay, source, dtau, gam_1, gam_2, mu1, flux_top_dw, alb_surf, flux_at_level) :returns: flux_net: array, np.ndarray Net flux at the bottom of the Nlay layers. .. py:function:: lambda_toon(gam_1, gam_2) lambda from eq 21 of Toon et al. .. py:function:: lambda_GAMMA(gam_1, gam_2) lambda and GAMMA from eq 21 and 22 of Toon et al. For GAMMA, the positive alterative is used (center in eq 22) .. py:function:: c_planck(source, dtau, gam_1, gam_2, mu1) 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 .. py:function:: c_planck_mid(source, dtau, gam_1, gam_2, mu1) 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 .. py:function:: e_i_toon(dtau, gam_1, gam_2) e_i factors defined in eq 44. .. py:function:: mid_factor_toon(dtau, gam_1, gam_2) Factors to recover the flux at mid layer. .. py:function:: DTRIDGL(L, AF, BF, CF, DF) 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) !======================================================================! .. py:function:: matrix_toon(Nlay, source, dtau, gam_1, gam_2, mu1, flux_top_dw, alb_surf) :returns: flux_net: array, np.ndarray Net flux at the bottom of the Nlay layers.