exo_k.two_stream.two_stream_lmdz

Created in Jan 2021

@author: jeremy leconte

Module Contents

exo_k.two_stream.two_stream_lmdz.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_lmdz.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_lmdz.solve_2stream(source, dtau, omega0, g_asym, mu0=0.5, flux_top_dw=0.0, alb_surf=0.0, flux_at_level=False)[source]

Based on gfluxi in LMDZ code ##———————————————————————– ## THIS SUBROUTINE TAKES THE OPTICAL CONSTANTS AND BOUNDARY CONDITIONS ## FOR THE INFRARED FLUX AT ONE WAVELENGTH AND SOLVES FOR THE FLUXES AT ## THE LEVELS. THIS VERSION IS SET UP TO WORK WITH LAYER OPTICAL DEPTHS ## MEASURED FROM THE TOP OF EACH LAYER. THE TOP OF EACH LAYER HAS ## OPTICAL DEPTH ZERO. IN THIS SUB LEVEL N IS ABOVE LAYER N. THAT IS LAYER N ## HAS LEVEL N ON TOP AND LEVEL N+1 ON BOTTOM. OPTICAL DEPTH INCREASES ## FROM TOP TO BOTTOM. SEE C.P. MCKAY, TGM NOTES. ## THE TRI-DIAGONAL MATRIX SOLVER IS DSOLVER AND IS DOUBLE PRECISION SO MANY ## VARIABLES ARE PASSED AS SINGLE THEN BECOME DOUBLE IN DSOLVER ## ## NLL = NUMBER OF LEVELS (NLAYERS + 1) MUST BE LESS THAT NL (101) ## TLEV(L_LEVELS) = ARRAY OF TEMPERATURES AT GCM LEVELS ## WAVEN = WAVELENGTH FOR THE COMPUTATION ## DW = WAVENUMBER INTERVAL ## dtau(NLAYER) = ARRAY OPTICAL DEPTH OF THE LAYERS ## omega0(NLEVEL) = SINGLE SCATTERING ALBEDO ## g_asym(NLEVEL) = ASYMMETRY FACTORS, 0=ISOTROPIC ## mu0 = AVERAGE ANGLE, MUST BE EQUAL TO 0.5 IN IR ## alb_surf = SURFACE REFLECTANCE ## BTOP = UPPER BOUNDARY CONDITION ON IR INTENSITY (NOT FLUX) ## BSURF = SURFACE EMISSION = (1-RSFI)*PLANCK, INTENSITY (NOT FLUX) ## FP(NLEVEL) = UPWARD FLUX AT LEVELS ## FM(NLEVEL) = DOWNWARD FLUX AT LEVELS ## FMIDP(NLAYER) = UPWARD FLUX AT LAYER MIDPOINTS ## FMIDM(NLAYER) = DOWNWARD FLUX AT LAYER MIDPOINTS ##———————————————————————–

exo_k.two_stream.two_stream_lmdz.DSOLVER(NL, GAMA, CP, CM, CPM1, CMM1, E1, E2, E3, E4, BTOP, BSURF, alb_surf)[source]

# GCM2.0 Feb 2003 # # DOUBLE PRECISION VERSION OF SOLVER

#********************************************************* #* THIS SUBROUTINE SOLVES FOR THE COEFFICIENTS OF THE * #* TWO STREAM SOLUTION FOR GENERAL BOUNDARY CONDITIONS * #* NO ASSUMPTION OF THE DEPENDENCE ON OPTICAL DEPTH OF * #* C-PLUS OR C-MINUS HAS BEEN MADE. * #* NL = NUMBER OF LAYERS IN THE MODEL * #* CP = C-PLUS EVALUATED AT TAO=0 (TOP) * #* CM = C-MINUS EVALUATED AT TAO=0 (TOP) * #* CPM1 = C-PLUS EVALUATED AT TAOSTAR (BOTTOM) * #* CMM1 = C-MINUS EVALUATED AT TAOSTAR (BOTTOM) * #* EP = EXP(LAMDA*dtau) * #* EM = 1/EP * #* E1 = EP + GAMA EM * # E2 = EP - GAMA EM * # E3 = GAMA*EP + EM * #* E4 = GAMA*EP - EM * #* BTOP = THE DIFFUSE RADIATION INTO THE MODEL AT TOP * #* BSURF = THE DIFFUSE RADIATION INTO THE MODEL AT * #* THE BOTTOM: INCLUDES EMMISION AND REFLECTION * #* OF THE UNATTENUATED PORTION OF THE DIRECT * #* BEAM. BSTAR+alb_surf*FO*EXP(-TAOSTAR/U0) * #* alb_surf = REFLECTIVITY OF THE SURFACE * #* XK1 = COEFFICIENT OF THE POSITIVE EXP TERM * #* XK2 = COEFFICIENT OF THE NEGATIVE EXP TERM * #*********************************************************

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

! GCM2.0 Feb 2003

! DOUBLE PRECISION VERSION OF TRIDGL

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)

!======================================================================!