--- trunk/libf/phylmd/Radlwsw/radlwsw.f90 2013/02/18 16:33:12 69 +++ trunk/phylmd/Radlwsw/radlwsw.f 2018/02/05 10:39:38 254 @@ -4,92 +4,92 @@ contains - SUBROUTINE radlwsw(dist, rmu0, fract, paprs, pplay, 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, & - ok_aie, tau_ae, piz_ae, cg_ae, topswad, solswad, cldtaupi, topswai, & - solswai) + SUBROUTINE radlwsw(dist, mu0, fract, paprs, play, tsol, albedo, 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, topswad, & + solswad) - ! From LMDZ4/libf/phylmd/radlwsw.F, version 1.4 2005/06/06 13:16:33 + ! 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 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 + ! ATTENTION: swad has to be interpreted in the following manner: + ! not ok_ade zero + ! ok_ade aerosol direct forcing is F_{AD} = topsw - topswad + USE clesphys, ONLY: solaire USE dimphy, ONLY: klev, klon - USE clesphys, ONLY: bug_ozone, solaire - USE suphec_m, ONLY: rg + use lw_m, only: lw USE raddim, ONLY: kdlon - USE yoethf_m, ONLY: rvtmp2 + USE suphec_m, ONLY: rg use sw_m, only: sw - - ! Arguments: + USE yoethf_m, ONLY: rvtmp2 + + real, intent(in):: dist ! distance astronomique terre-soleil + real, intent(in):: mu0(klon) ! cosinus de l'angle zenithal + real, intent(in):: fract(klon) ! duree d'ensoleillement normalisee + real, intent(in):: paprs(klon, klev+1) ! pression a inter-couche (Pa) + real, intent(in):: play(klon, klev) ! pression au milieu de couche (Pa) + real, intent(in):: tsol(klon) ! temperature du sol (en K) + real, intent(in):: albedo(klon) ! albedo du sol (entre 0 et 1) + real, intent(in):: t(klon, klev) ! temperature (K) + real, intent(in):: q(klon, klev) ! vapeur d'eau (en kg/kg) - real rmu0(klon), fract(klon), dist - ! dist-----input-R- distance astronomique terre-soleil - ! rmu0-----input-R- cosinus de l'angle zenithal - ! fract----input-R- duree d'ensoleillement normalisee - - real, intent(in):: paprs(klon, klev+1) - ! paprs----input-R- pression a inter-couche (Pa) - real, intent(in):: pplay(klon, klev) - ! pplay----input-R- pression au milieu de couche (Pa) - real albedo(klon), alblw(klon), tsol(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) - ! cldemi---input-R- emissivite des nuages dans l'IR (entre 0 et 1) + ! column-density of ozone in a layer, in kilo-Dobsons + + real, intent(in):: cldfra(klon, klev) ! fraction nuageuse (entre 0 et 1) - real cldtaupd(klon, klev) - ! input-R- epaisseur optique des nuages dans le visible (present-day value) + real, intent(in):: cldemi(klon, klev) + ! emissivite des nuages dans l'IR (entre 0 et 1) + + real, intent(in):: cldtaupd(klon, klev) + ! epaisseur optique des nuages dans le visible (present-day value) real, intent(out):: heat(klon, klev) ! échauffement atmosphérique (visible) (K/jour) - real cool(klon, klev) - ! cool-----output-R- refroidissement dans l'IR (K/jour) - real heat0(klon, klev), cool0(klon, klev) - real radsol(klon), topsw(klon) - ! radsol---output-R- bilan radiatif net au sol (W/m**2) (+ vers le bas) - ! topsw----output-R- flux solaire net au sommet de l'atm. + real, intent(out):: heat0(klon, klev) ! chauffage solaire ciel clair + real, intent(out):: cool(klon, klev) ! refroidissement dans l'IR (K/jour) + + real, intent(out):: cool0(klon, klev) + ! refroidissement infrarouge ciel clair + + real, intent(out):: radsol(klon) + ! bilan radiatif net au sol (W/m**2) (+ vers le bas) + + real, intent(out):: albpla(klon) ! albedo planetaire (entre 0 et 1) + real, intent(out):: topsw(klon) ! flux solaire net au sommet de l'atm. real, intent(out):: toplw(klon) ! rayonnement infrarouge montant au sommet de l'atmosphère - real solsw(klon), sollw(klon), albpla(klon) - ! solsw----output-R- flux solaire net a la surface - ! sollw----output-R- ray. IR montant a la surface - ! albpla---output-R- albedo planetaire (entre 0 et 1) - real topsw0(klon), solsw0(klon), sollw0(klon) + real, intent(out):: solsw(klon) ! flux solaire net à la surface + + real, intent(out):: sollw(klon) + ! rayonnement infrarouge montant à la surface + + real, intent(out):: sollwdown(klon) + real, intent(out):: topsw0(klon) real, intent(out):: toplw0(klon) - real sollwdown(klon) - !IM output 3D + real, intent(out):: solsw0(klon), sollw0(klon) + REAL, intent(out):: lwdn0(klon, klev+1), lwdn(klon, klev+1) + REAL, intent(out):: lwup0(klon, klev+1), lwup(klon, klev+1) + REAL, intent(out):: swdn0(klon, klev+1), swdn(klon, klev+1) + REAL, intent(out):: swup0(klon, klev+1), swup(klon, klev+1) + + logical, intent(in):: ok_ade ! apply the Aerosol Direct Effect + + real, intent(out):: topswad(klon), solswad(klon) + ! aerosol direct forcing at TOA and surface + ! rayonnement solaire net absorb\'e + + ! Local: + DOUBLE PRECISION ZFSUP(KDLON, KLEV+1) DOUBLE PRECISION ZFSDN(KDLON, KLEV+1) DOUBLE PRECISION ZFSUP0(KDLON, KLEV+1) @@ -101,10 +101,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) @@ -112,8 +109,9 @@ DOUBLE PRECISION PPSOL(kdlon), PDP(kdlon, klev) DOUBLE PRECISION PTL(kdlon, klev+1), PPMB(kdlon, klev+1) DOUBLE PRECISION PTAVE(kdlon, klev) - DOUBLE PRECISION PWV(kdlon, klev), PQS(kdlon, klev), POZON(kdlon, klev) - DOUBLE PRECISION PAER(kdlon, klev, 5) + DOUBLE PRECISION PWV(kdlon, klev), PQS(kdlon, klev) + DOUBLE PRECISION POZON(kdlon, klev) ! mass fraction of ozone + DOUBLE PRECISION PAER(kdlon, klev, 5) ! AEROSOLS' OPTICAL THICKNESS DOUBLE PRECISION PCLDLD(kdlon, klev) DOUBLE PRECISION PCLDLU(kdlon, klev) DOUBLE PRECISION PCLDSW(kdlon, klev) @@ -121,7 +119,7 @@ DOUBLE PRECISION POMEGA(kdlon, 2, klev) DOUBLE PRECISION PCG(kdlon, 2, klev) - DOUBLE PRECISION zfract(kdlon), zrmu0(kdlon), zdist + DOUBLE PRECISION zfract(kdlon), zrmu0(kdlon) DOUBLE PRECISION zheat(kdlon, klev), zcool(kdlon, klev) DOUBLE PRECISION zheat0(kdlon, klev), zcool0(kdlon, klev) @@ -132,91 +130,43 @@ 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 - ! 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 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) - - 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 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 - - 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 - - DOUBLE PRECISION POMEGAA(kdlon, 2, klev) ! dito for single scatt albedo - DOUBLE PRECISION ztopswad(kdlon), zsolswad(kdlon) - ! Aerosol direct forcing at TOAand surface + ! Aerosol direct forcing at TOA and surface - DOUBLE PRECISION ztopswai(kdlon), zsolswai(kdlon) ! dito, indirect + real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 !---------------------------------------------------------------------- - tauae = 0. - pizae = 0. - cgae = 0. - nb_gr = klon / kdlon IF (nb_gr * kdlon /= klon) THEN PRINT *, "kdlon mauvais :", klon, kdlon, nb_gr stop 1 ENDIF - + heat = 0. cool = 0. heat0 = 0. cool0 = 0. - zdist = dist - PSCT = solaire / zdist / zdist + PSCT = solaire / dist**2 loop_iof: DO iof = 0, klon - kdlon, kdlon DO i = 1, kdlon zfract(i) = fract(iof+i) - zrmu0(i) = rmu0(iof+i) + zrmu0(i) = mu0(iof+i) PALBD(i, 1) = albedo(iof+i) - PALBD(i, 2) = alblw(iof+i) + PALBD(i, 2) = albedo(iof+i) PALBP(i, 1) = albedo(iof+i) - PALBP(i, 2) = alblw(iof+i) + PALBP(i, 2) = albedo(iof+i) ! cf. JLD pour etre en accord avec ORCHIDEE il faut mettre ! PEMIS(i) = 0.96 - PEMIS(i) = 1.0 + PEMIS(i) = 1. 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_alpha2 = 1.0 - zx_alpha1 + zx_alpha1 = (paprs(iof+i, 1)-play(iof+i, 2)) & + / (play(iof+i, 1)-play(iof+i, 2)) + zx_alpha2 = 1. - 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) PDT0(i) = tsol(iof+i) - PTL(i, 1) @@ -230,78 +180,45 @@ DO i = 1, kdlon PDP(i, k) = paprs(iof+i, k)-paprs(iof+i, k+1) PTAVE(i, k) = t(iof+i, k) - PWV(i, k) = MAX (q(iof+i, k), 1.0e-12) + PWV(i, k) = MAX (q(iof+i, k), 1e-12) PQS(i, k) = PWV(i, k) - ! wo: cm.atm (epaisseur en cm dans la situation standard) - ! POZON: kg/kg - IF (bug_ozone) then - POZON(i, k) = MAX(wo(iof+i, k), 1.0e-12)*RG/46.6968 & - /(paprs(iof+i, k)-paprs(iof+i, k+1)) & - *(paprs(iof+i, 1)/101325.0) - ELSE - ! le calcul qui suit est maintenant fait dans ozonecm (MPL) - POZON(i, k) = wo(i, k) - ENDIF + POZON(i, k) = wo(iof+i, k) * RG * dobson_u * 1e3 & + / (paprs(iof+i, k) - paprs(iof+i, k+1)) PCLDLD(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k) PCLDLU(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k) PCLDSW(i, k) = cldfra(iof+i, k) - PTAU(i, 1, k) = MAX(cldtaupi(iof+i, k), 1.0e-05) + PTAU(i, 1, k) = MAX(cldtaupd(iof+i, k), 1e-05) ! (1e-12 serait instable) - PTAU(i, 2, k) = MAX(cldtaupi(iof+i, k), 1.0e-05) + PTAU(i, 2, k) = MAX(cldtaupd(iof+i, k), 1e-05) ! (pour 32-bit machines) - POMEGA(i, 1, k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAU(i, 1, k)) + POMEGA(i, 1, k) = 0.9999 - 5e-04 * EXP(-0.5 * PTAU(i, 1, k)) POMEGA(i, 2, k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAU(i, 2, k)) PCG(i, 1, k) = 0.865 PCG(i, 2, k) = 0.910 - - ! Introduced for aerosol indirect forcings. The - ! following values use the cloud optical thickness - ! calculated from present-day aerosol concentrations - ! whereas the quantities without the "A" at the end are - ! for pre-industial (natural-only) aerosol concentrations - PTAUA(i, 1, k) = MAX(cldtaupd(iof+i, k), 1.0e-05) - ! (1e-12 serait instable) - PTAUA(i, 2, k) = MAX(cldtaupd(iof+i, k), 1.0e-05) - ! (pour 32-bit machines) - POMEGAA(i, 1, k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAUA(i, 1, k)) - POMEGAA(i, 2, k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAUA(i, 2, k)) - !jq-end ENDDO ENDDO DO k = 1, klev+1 DO i = 1, kdlon - PPMB(i, k) = paprs(iof+i, k)/100.0 + PPMB(i, k) = paprs(iof+i, k)/100. ENDDO ENDDO DO kk = 1, 5 DO k = 1, klev DO i = 1, kdlon - PAER(i, k, kk) = 1.0E-15 + PAER(i, k, kk) = 1E-15 ENDDO ENDDO ENDDO - DO k = 1, klev - DO i = 1, kdlon - tauae(i, k, 1) = tau_ae(iof+i, k, 1) - pizae(i, k, 1) = piz_ae(iof+i, k, 1) - cgae(i, k, 1) =cg_ae(iof+i, k, 1) - tauae(i, k, 2) = tau_ae(iof+i, k, 2) - pizae(i, k, 2) = piz_ae(iof+i, k, 2) - cgae(i, k, 2) =cg_ae(iof+i, k, 2) - ENDDO - ENDDO - - CALL LW(PPMB, PDP, PPSOL, PDT0, PEMIS, PTL, PTAVE, PWV, POZON, PAER, & - PCLDLD, PCLDLU, PVIEW, zcool, zcool0, ztoplw, zsollw, ztoplw0, & - zsollw0, zsollwdown, ZFLUP, ZFLDN, ZFLUP0, ZFLDN0) + CALL LW(PPMB, PDP, PDT0, PEMIS, PTL, PTAVE, PWV, POZON, PAER, PCLDLD, & + PCLDLU, PVIEW, zcool, zcool0, ztoplw, zsollw, ztoplw0, zsollw0, & + zsollwdown, ZFLUP, ZFLDN, ZFLUP0, ZFLDN0) CALL SW(PSCT, zrmu0, zfract, PPMB, PDP, PPSOL, PALBD, PALBP, PTAVE, & - PWV, PQS, POZON, PAER, PCLDSW, PTAU, POMEGA, PCG, zheat, zheat0, & + PWV, PQS, POZON, PCLDSW, PTAU, POMEGA, PCG, zheat, zheat0, & zalbpla, ztopsw, zsolsw, ztopsw0, zsolsw0, ZFSUP, ZFSDN, ZFSUP0, & - ZFSDN0, tauae, pizae, cgae, PTAUA, POMEGAA, ztopswad, zsolswad, & - ztopswai, zsolswai, ok_ade, ok_aie) + ZFSDN0, ztopswad, zsolswad, ok_ade) DO i = 1, kdlon radsol(iof+i) = zsolsw(i) + zsollw(i) @@ -339,19 +256,8 @@ ENDDO ELSE DO i = 1, kdlon - topswad(iof+i) = 0.0 - solswad(iof+i) = 0.0 - ENDDO - ENDIF - IF (ok_aie) THEN - DO i = 1, kdlon - topswai(iof+i) = ztopswai(i) - solswai(iof+i) = zsolswai(i) - ENDDO - ELSE - DO i = 1, kdlon - topswai(iof+i) = 0.0 - solswai(iof+i) = 0.0 + topswad(iof+i) = 0. + solswad(iof+i) = 0. ENDDO ENDIF