--- trunk/libf/phylmd/Radlwsw/radlwsw.f90 2012/07/26 14:37:37 62 +++ trunk/phylmd/Radlwsw/radlwsw.f 2014/03/05 14:57:53 82 @@ -4,7 +4,7 @@ contains - SUBROUTINE radlwsw(dist, rmu0, fract, paprs, pplay, tsol, albedo, alblw, & + SUBROUTINE radlwsw(dist, rmu0, fract, paprs, play, tsol, albedo, alblw, & t, q, wo, cldfra, cldemi, cldtaupd, heat, heat0, cool, cool0, radsol, & albpla, topsw, toplw, solsw, sollw, sollwdown, topsw0, toplw0, solsw0, & sollw0, lwdn0, lwdn, lwup0, lwup, swdn0, swdn, swup0, swup, ok_ade, & @@ -12,83 +12,129 @@ solswai) ! From LMDZ4/libf/phylmd/radlwsw.F, version 1.4 2005/06/06 13:16:33 - ! Author: Z. X. Li (LMD/CNRS) date: 1996/07/19 - ! Objet : interface entre le modèle et les rayonnements - ! Rayonnements solaire et infrarouge + ! Author: Z. X. Li (LMD/CNRS) + ! Date: 1996/07/19 + + ! Objet : interface entre le modèle et les rayonnements solaire et + ! infrarouge + + ! ATTENTION: swai and swad have to be interpreted in the following manner: + + ! not ok_ade and not ok_aie + ! both are zero + + ! ok_ade and not ok_aie + ! aerosol direct forcing is F_{AD} = topsw - topswad + ! indirect is zero + + ! not ok_ade and ok_aie + ! aerosol indirect forcing is F_{AI} = topsw - topswai + ! direct is zero + + ! ok_ade and ok_aie + ! aerosol indirect forcing is F_{AI} = topsw - topswai + ! aerosol direct forcing is F_{AD} = topswai - topswad - USE dimphy, ONLY: klev, klon USE clesphys, ONLY: bug_ozone, solaire - USE suphec_m, ONLY: rg + USE dimphy, ONLY: klev, klon + use lw_m, only: lw USE raddim, ONLY: kdlon - USE yoethf_m, ONLY: rvtmp2 + USE suphec_m, ONLY: rg use sw_m, only: sw + USE yoethf_m, ONLY: rvtmp2 ! Arguments: + + real dist, rmu0(klon), fract(klon) ! dist-----input-R- distance astronomique terre-soleil ! rmu0-----input-R- cosinus de l'angle zenithal ! fract----input-R- duree d'ensoleillement normalisee - ! co2_ppm--input-R- concentration du gaz carbonique (en ppm) - ! solaire--input-R- constante solaire (W/m**2) + + real, intent(in):: paprs(klon, klev+1) ! paprs----input-R- pression a inter-couche (Pa) - ! pplay----input-R- pression au milieu de couche (Pa) - ! tsol-----input-R- temperature du sol (en K) + real, intent(in):: play(klon, klev) + ! play----input-R- pression au milieu de couche (Pa) + real tsol(klon), albedo(klon), alblw(klon) ! albedo---input-R- albedo du sol (entre 0 et 1) + ! tsol-----input-R- temperature du sol (en K) + real, intent(in):: t(klon, klev) ! t--------input-R- temperature (K) + real q(klon, klev) ! q--------input-R- vapeur d'eau (en kg/kg) + real, intent(in):: wo(klon, klev) ! wo-------input-R- contenu en ozone (en kg/kg) correction MPL 100505 + real cldfra(klon, klev), cldemi(klon, klev) ! cldfra---input-R- fraction nuageuse (entre 0 et 1) - ! cldtaupd---input-R- epaisseur optique des nuages dans le visible (present-day value) ! cldemi---input-R- emissivite des nuages dans l'IR (entre 0 et 1) - ! tau_ae, piz_ae, cg_ae-input-R- aerosol optical properties (calculated in aeropt.F) - ! cldtaupi-input-R- epaisseur optique des nuages dans le visible - ! calculated for pre-industrial (pi) aerosol concentrations, i.e. with smaller - ! droplet concentration, thus larger droplets, thus generally cdltaupi cldtaupd - ! it is needed for the diagnostics of the aerosol indirect radiative forcing + real cldtaupd(klon, klev) + ! input-R- epaisseur optique des nuages dans le visible (present-day value) + + real, intent(out):: heat(klon, klev) + ! échauffement atmosphérique (visible) (K/jour) + + real heat0(klon, klev) + real cool(klon, klev) ! cool-----output-R- refroidissement dans l'IR (K/jour) + real cool0(klon, klev) + real radsol(klon) ! radsol---output-R- bilan radiatif net au sol (W/m**2) (+ vers le bas) + real albpla(klon) ! albpla---output-R- albedo planetaire (entre 0 et 1) + real topsw(klon) ! topsw----output-R- flux solaire net au sommet de l'atm. - ! solsw----output-R- flux solaire net a la surface - ! sollw----output-R- ray. IR montant a la surface - ! solswad---output-R- ray. solaire net absorbe a la surface (aerosol dir) - ! topswad---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol dir) - ! solswai---output-R- ray. solaire net absorbe a la surface (aerosol ind) - ! topswai---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol ind) - ! ATTENTION: swai and swad have to be interpreted in the following manner: - ! ok_ade = F & ok_aie = F -both are zero - ! ok_ade = T & ok_aie = F -aerosol direct forcing is F_{AD} = topsw-topswad - ! indirect is zero - ! ok_ade = F & ok_aie = T -aerosol indirect forcing is F_{AI} = topsw-topswai - ! direct is zero - ! ok_ade = T & ok_aie = T -aerosol indirect forcing is F_{AI} = topsw-topswai - ! aerosol direct forcing is F_{AD} = topswai-topswad + real, intent(out):: toplw(klon) + ! rayonnement infrarouge montant au sommet de l'atmosphère - real rmu0(klon), fract(klon), dist + real, intent(out):: solsw(klon) ! flux solaire net à la surface - real, intent(in):: paprs(klon, klev+1) - real, intent(in):: pplay(klon, klev) - real albedo(klon), alblw(klon), tsol(klon) - real, intent(in):: t(klon, klev) - real q(klon, klev) - real, intent(in):: wo(klon, klev) - real cldfra(klon, klev), cldemi(klon, klev), cldtaupd(klon, klev) + real, intent(out):: sollw(klon) + ! rayonnement infrarouge montant à la surface - real, intent(out):: heat(klon, klev) - ! échauffement atmosphérique (visible) (K/jour) + real, intent(out):: sollwdown(klon) + real topsw0(klon) + real, intent(out):: toplw0(klon) + real solsw0(klon), sollw0(klon) + !IM output 3D: SWup, SWdn, LWup, LWdn + REAL lwdn0(klon, klev+1), lwdn(klon, klev+1) + REAL lwup0(klon, klev+1), lwup(klon, klev+1) + REAL swdn0(klon, klev+1), swdn(klon, klev+1) + REAL swup0(klon, klev+1), swup(klon, klev+1) - real cool(klon, klev) - real heat0(klon, klev), cool0(klon, klev) - real radsol(klon), topsw(klon) + logical ok_ade, ok_aie + ! switches whether to use aerosol direct (indirect) effects or not + ! ok_ade---input-L- apply the Aerosol Direct Effect or not? + ! ok_aie---input-L- apply the Aerosol Indirect Effect or not? - real, intent(out):: toplw(klon) - ! rayonnement infrarouge montant au sommet de l'atmosphère + real tau_ae(klon, klev, 2), piz_ae(klon, klev, 2), cg_ae(klon, klev, 2) + ! input-R- aerosol optical properties (calculated in aeropt.F) + + real topswad(klon), solswad(klon) + ! output: aerosol direct forcing at TOA and surface + ! topswad---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol dir) + ! solswad---output-R- ray. solaire net absorbe a la surface (aerosol dir) + + real cldtaupi(klon, klev) + ! cloud optical thickness for pre-industrial aerosol concentrations + ! (i.e. with a smaller droplet concentration and thus larger droplet radii) + ! -input-R- epaisseur optique des nuages dans le visible + ! calculated for pre-industrial (pi) aerosol concentrations, + ! i.e. with smaller droplet concentration, thus larger droplets, + ! thus generally cdltaupi cldtaupd it is needed for the + ! diagnostics of the aerosol indirect radiative forcing + + real topswai(klon), solswai(klon) + ! output: aerosol indirect forcing atTOA and surface + ! topswai---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol ind) + ! solswai---output-R- ray. solaire net absorbe a la surface (aerosol ind) + + ! Local: + + double precision tauae(kdlon, klev, 2) ! aer opt properties + double precision pizae(kdlon, klev, 2) + double precision cgae(kdlon, klev, 2) - real solsw(klon), sollw(klon), albpla(klon) - real topsw0(klon), solsw0(klon), sollw0(klon) - real, intent(out):: toplw0(klon) - real sollwdown(klon) !IM output 3D DOUBLE PRECISION ZFSUP(KDLON, KLEV+1) DOUBLE PRECISION ZFSDN(KDLON, KLEV+1) @@ -101,10 +147,7 @@ DOUBLE PRECISION ZFLDN0(KDLON, KLEV+1) DOUBLE PRECISION zx_alpha1, zx_alpha2 - INTEGER k, kk, i, iof, nb_gr - EXTERNAL lw - DOUBLE PRECISION PSCT DOUBLE PRECISION PALBD(kdlon, 2), PALBP(kdlon, 2) @@ -132,36 +175,9 @@ DOUBLE PRECISION ztopsw0(kdlon), ztoplw0(kdlon) DOUBLE PRECISION zsolsw0(kdlon), zsollw0(kdlon) DOUBLE PRECISION zznormcp - !IM output 3D: SWup, SWdn, LWup, LWdn - REAL swdn(klon, klev+1), swdn0(klon, klev+1) - REAL swup(klon, klev+1), swup0(klon, klev+1) - REAL lwdn(klon, klev+1), lwdn0(klon, klev+1) - REAL lwup(klon, klev+1), lwup0(klon, klev+1) !jq the following quantities are needed for the aerosol radiative forcings - real topswad(klon), solswad(klon) - ! output: aerosol direct forcing at TOA and surface - - real topswai(klon), solswai(klon) - ! output: aerosol indirect forcing atTOA and surface - - real tau_ae(klon, klev, 2), piz_ae(klon, klev, 2), cg_ae(klon, klev, 2) - ! aerosol optical properties (see aeropt.F) - - real cldtaupi(klon, klev) - ! cloud optical thickness for pre-industrial aerosol concentrations - ! (i.e., with a smaller droplet concentrationand thus larger droplet radii) - - logical ok_ade, ok_aie - ! switches whether to use aerosol direct (indirect) effects or not - ! ok_ade---input-L- apply the Aerosol Direct Effect or not? - ! ok_aie---input-L- apply the Aerosol Indirect Effect or not? - - double precision tauae(kdlon, klev, 2) ! aer opt properties - double precision pizae(kdlon, klev, 2) - double precision cgae(kdlon, klev, 2) - DOUBLE PRECISION PTAUA(kdlon, 2, klev) ! present-day value of cloud opt thickness (PTAU is pre-industrial ! value), local use @@ -205,8 +221,8 @@ PEMIS(i) = 1.0 PVIEW(i) = 1.66 PPSOL(i) = paprs(iof+i, 1) - zx_alpha1 = (paprs(iof+i, 1)-pplay(iof+i, 2)) & - / (pplay(iof+i, 1)-pplay(iof+i, 2)) + zx_alpha1 = (paprs(iof+i, 1)-play(iof+i, 2)) & + / (play(iof+i, 1)-play(iof+i, 2)) zx_alpha2 = 1.0 - zx_alpha1 PTL(i, 1) = t(iof+i, 1) * zx_alpha1 + t(iof+i, 2) * zx_alpha2 PTL(i, klev+1) = t(iof+i, klev)