/[lmdze]/trunk/Sources/phylmd/Radlwsw/radlwsw.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/Radlwsw/radlwsw.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/libf/phylmd/Radlwsw/radlwsw.f90 revision 62 by guez, Thu Jul 26 14:37:37 2012 UTC trunk/Sources/phylmd/Radlwsw/radlwsw.f revision 212 by guez, Thu Jan 12 12:31:31 2017 UTC
# Line 4  module radlwsw_m Line 4  module radlwsw_m
4    
5  contains  contains
6    
7    SUBROUTINE radlwsw(dist, rmu0, fract, paprs, pplay, tsol, albedo, alblw, &    SUBROUTINE radlwsw(dist, mu0, fract, paprs, play, tsol, albedo, t, q, wo, &
8         t, q, wo, cldfra, cldemi, cldtaupd, heat, heat0, cool, cool0, radsol, &         cldfra, cldemi, cldtaupd, heat, heat0, cool, cool0, radsol, albpla, &
9         albpla, topsw, toplw, solsw, sollw, sollwdown, topsw0, toplw0, solsw0, &         topsw, toplw, solsw, sollw, sollwdown, topsw0, toplw0, solsw0, sollw0, &
10         sollw0, lwdn0, lwdn, lwup0, lwup, swdn0, swdn, swup0, swup, ok_ade, &         lwdn0, lwdn, lwup0, lwup, swdn0, swdn, swup0, swup, ok_ade, ok_aie, &
11         ok_aie, tau_ae, piz_ae, cg_ae, topswad, solswad, cldtaupi, topswai, &         tau_ae, piz_ae, cg_ae, topswad, solswad, cldtaupi, topswai, solswai)
        solswai)  
12    
13      ! 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
14      ! Author: Z. X. Li (LMD/CNRS) date: 1996/07/19      ! Author: Z. X. Li (LMD/CNRS)
15      ! Objet : interface entre le modèle et les rayonnements      ! Date: 1996/07/19
     ! Rayonnements solaire et infrarouge  
16    
17        ! Objet : interface entre le modèle et les rayonnements solaire et
18        ! infrarouge
19    
20        ! ATTENTION: swai and swad have to be interpreted in the following manner:
21    
22        ! not ok_ade and not ok_aie
23        ! both are zero
24    
25        ! ok_ade and not ok_aie
26        ! aerosol direct forcing is F_{AD} = topsw - topswad
27        ! indirect is zero
28    
29        ! not ok_ade and ok_aie
30        ! aerosol indirect forcing is F_{AI} = topsw - topswai
31        ! direct is zero
32    
33        ! ok_ade and ok_aie
34        ! aerosol indirect forcing is F_{AI} = topsw - topswai
35        ! aerosol direct forcing is F_{AD} = topswai - topswad
36    
37        USE clesphys, ONLY: solaire
38      USE dimphy, ONLY: klev, klon      USE dimphy, ONLY: klev, klon
39      USE clesphys, ONLY: bug_ozone, solaire      use lw_m, only: lw
     USE suphec_m, ONLY: rg  
40      USE raddim, ONLY: kdlon      USE raddim, ONLY: kdlon
41      USE yoethf_m, ONLY: rvtmp2      USE suphec_m, ONLY: rg
42      use sw_m, only: sw      use sw_m, only: sw
43        USE yoethf_m, ONLY: rvtmp2
44                    
45      ! Arguments:      real, intent(in):: dist ! distance astronomique terre-soleil
46      ! dist-----input-R- distance astronomique terre-soleil      real, intent(in):: mu0(klon) ! cosinus de l'angle zenithal
47      ! rmu0-----input-R- cosinus de l'angle zenithal      real, intent(in):: fract(klon) ! duree d'ensoleillement normalisee
48      ! fract----input-R- duree d'ensoleillement normalisee      real, intent(in):: paprs(klon, klev+1) ! pression a inter-couche (Pa)
49      ! co2_ppm--input-R- concentration du gaz carbonique (en ppm)      real, intent(in):: play(klon, klev) ! pression au milieu de couche (Pa)
50      ! solaire--input-R- constante solaire (W/m**2)      real, intent(in):: tsol(klon) ! temperature du sol (en K)
51      ! paprs----input-R- pression a inter-couche (Pa)      real, intent(in):: albedo(klon) ! albedo du sol (entre 0 et 1)
52      ! pplay----input-R- pression au milieu de couche (Pa)      real, intent(in):: t(klon, klev) ! temperature (K)
53      ! tsol-----input-R- temperature du sol (en K)      real, intent(in):: q(klon, klev) ! vapeur d'eau (en kg/kg)
     ! albedo---input-R- albedo du sol (entre 0 et 1)  
     ! t--------input-R- temperature (K)  
     ! q--------input-R- vapeur d'eau (en kg/kg)  
     ! wo-------input-R- contenu en ozone (en kg/kg) correction MPL 100505  
     ! 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        
   
     ! cool-----output-R- refroidissement dans l'IR (K/jour)  
     ! radsol---output-R- bilan radiatif net au sol (W/m**2) (+ vers le bas)  
     ! albpla---output-R- albedo planetaire (entre 0 et 1)  
     ! 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)  
54    
     ! 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 rmu0(klon), fract(klon), dist  
   
     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)  
55      real, intent(in):: wo(klon, klev)      real, intent(in):: wo(klon, klev)
56      real cldfra(klon, klev), cldemi(klon, klev), cldtaupd(klon, klev)      ! column-density of ozone in a layer, in kilo-Dobsons
57    
58        real, intent(in):: cldfra(klon, klev) ! fraction nuageuse (entre 0 et 1)
59    
60        real, intent(in):: cldemi(klon, klev)
61        ! emissivite des nuages dans l'IR (entre 0 et 1)
62    
63        real, intent(in):: cldtaupd(klon, klev)
64        ! epaisseur optique des nuages dans le visible (present-day value)
65    
66      real, intent(out):: heat(klon, klev)      real, intent(out):: heat(klon, klev)
67      ! échauffement atmosphérique (visible) (K/jour)      ! échauffement atmosphérique (visible) (K/jour)
68    
69      real cool(klon, klev)      real, intent(out):: heat0(klon, klev)
70      real heat0(klon, klev), cool0(klon, klev)      real, intent(out):: cool(klon, klev) ! refroidissement dans l'IR (K/jour)
71      real radsol(klon), topsw(klon)      real, intent(out):: cool0(klon, klev)
72    
73        real, intent(out):: radsol(klon)
74        ! bilan radiatif net au sol (W/m**2) (+ vers le bas)
75    
76        real, intent(out):: albpla(klon) ! albedo planetaire (entre 0 et 1)
77        real, intent(out):: topsw(klon) ! flux solaire net au sommet de l'atm.
78    
79      real, intent(out):: toplw(klon)      real, intent(out):: toplw(klon)
80      ! rayonnement infrarouge montant au sommet de l'atmosphère      ! rayonnement infrarouge montant au sommet de l'atmosphère
81    
82      real solsw(klon), sollw(klon), albpla(klon)      real, intent(out):: solsw(klon) ! flux solaire net à la surface
83      real topsw0(klon), solsw0(klon), sollw0(klon)  
84        real, intent(out):: sollw(klon)
85        ! rayonnement infrarouge montant à la surface
86    
87        real, intent(out):: sollwdown(klon)
88        real, intent(out):: topsw0(klon)
89      real, intent(out):: toplw0(klon)      real, intent(out):: toplw0(klon)
90      real sollwdown(klon)      real, intent(out):: solsw0(klon), sollw0(klon)
91      !IM output 3D      REAL, intent(out):: lwdn0(klon, klev+1), lwdn(klon, klev+1)
92        REAL, intent(out):: lwup0(klon, klev+1), lwup(klon, klev+1)
93        REAL, intent(out):: swdn0(klon, klev+1), swdn(klon, klev+1)
94        REAL, intent(out):: swup0(klon, klev+1), swup(klon, klev+1)
95    
96        logical, intent(in):: ok_ade ! apply the Aerosol Direct Effect
97        logical, intent(in):: ok_aie ! apply the Aerosol Indirect Effect
98    
99        ! aerosol optical properties (calculated in aeropt.F):
100        real, intent(in):: tau_ae(klon, klev, 2), piz_ae(klon, klev, 2)
101        real, intent(in):: cg_ae(klon, klev, 2)
102    
103        real, intent(out):: topswad(klon), solswad(klon)
104        ! aerosol direct forcing at TOA and surface
105        ! ray. solaire net absorbe
106        
107        real, intent(in):: cldtaupi(klon, klev)
108        ! cloud visible optical thickness for pre-industrial aerosol concentrations
109        ! i.e. with smaller droplet concentration, thus larger droplets,
110        ! thus generally cdltaupi cldtaupd it is needed for the
111        ! diagnostics of the aerosol indirect radiative forcing
112    
113        real, intent(out):: topswai(klon), solswai(klon)
114        ! aerosol indirect forcing at TOA and surface
115        ! ray. solaire net absorbe
116    
117        ! Local:
118    
119        double precision tauae(kdlon, klev, 2) ! aer opt properties
120        double precision pizae(kdlon, klev, 2)
121        double precision cgae(kdlon, klev, 2)
122    
123      DOUBLE PRECISION ZFSUP(KDLON, KLEV+1)      DOUBLE PRECISION ZFSUP(KDLON, KLEV+1)
124      DOUBLE PRECISION ZFSDN(KDLON, KLEV+1)      DOUBLE PRECISION ZFSDN(KDLON, KLEV+1)
125      DOUBLE PRECISION ZFSUP0(KDLON, KLEV+1)      DOUBLE PRECISION ZFSUP0(KDLON, KLEV+1)
# Line 101  contains Line 131  contains
131      DOUBLE PRECISION ZFLDN0(KDLON, KLEV+1)      DOUBLE PRECISION ZFLDN0(KDLON, KLEV+1)
132    
133      DOUBLE PRECISION zx_alpha1, zx_alpha2      DOUBLE PRECISION zx_alpha1, zx_alpha2
   
134      INTEGER k, kk, i, iof, nb_gr      INTEGER k, kk, i, iof, nb_gr
     EXTERNAL lw  
   
135      DOUBLE PRECISION PSCT      DOUBLE PRECISION PSCT
136    
137      DOUBLE PRECISION PALBD(kdlon, 2), PALBP(kdlon, 2)      DOUBLE PRECISION PALBD(kdlon, 2), PALBP(kdlon, 2)
# Line 112  contains Line 139  contains
139      DOUBLE PRECISION PPSOL(kdlon), PDP(kdlon, klev)      DOUBLE PRECISION PPSOL(kdlon), PDP(kdlon, klev)
140      DOUBLE PRECISION PTL(kdlon, klev+1), PPMB(kdlon, klev+1)      DOUBLE PRECISION PTL(kdlon, klev+1), PPMB(kdlon, klev+1)
141      DOUBLE PRECISION PTAVE(kdlon, klev)      DOUBLE PRECISION PTAVE(kdlon, klev)
142      DOUBLE PRECISION PWV(kdlon, klev), PQS(kdlon, klev), POZON(kdlon, klev)      DOUBLE PRECISION PWV(kdlon, klev), PQS(kdlon, klev)
143      DOUBLE PRECISION PAER(kdlon, klev, 5)      DOUBLE PRECISION POZON(kdlon, klev) ! mass fraction of ozone
144        DOUBLE PRECISION PAER(kdlon, klev, 5) ! AEROSOLS' OPTICAL THICKNESS
145      DOUBLE PRECISION PCLDLD(kdlon, klev)      DOUBLE PRECISION PCLDLD(kdlon, klev)
146      DOUBLE PRECISION PCLDLU(kdlon, klev)      DOUBLE PRECISION PCLDLU(kdlon, klev)
147      DOUBLE PRECISION PCLDSW(kdlon, klev)      DOUBLE PRECISION PCLDSW(kdlon, klev)
# Line 121  contains Line 149  contains
149      DOUBLE PRECISION POMEGA(kdlon, 2, klev)      DOUBLE PRECISION POMEGA(kdlon, 2, klev)
150      DOUBLE PRECISION PCG(kdlon, 2, klev)      DOUBLE PRECISION PCG(kdlon, 2, klev)
151    
152      DOUBLE PRECISION zfract(kdlon), zrmu0(kdlon), zdist      DOUBLE PRECISION zfract(kdlon), zrmu0(kdlon)
153    
154      DOUBLE PRECISION zheat(kdlon, klev), zcool(kdlon, klev)      DOUBLE PRECISION zheat(kdlon, klev), zcool(kdlon, klev)
155      DOUBLE PRECISION zheat0(kdlon, klev), zcool0(kdlon, klev)      DOUBLE PRECISION zheat0(kdlon, klev), zcool0(kdlon, klev)
# Line 132  contains Line 160  contains
160      DOUBLE PRECISION ztopsw0(kdlon), ztoplw0(kdlon)      DOUBLE PRECISION ztopsw0(kdlon), ztoplw0(kdlon)
161      DOUBLE PRECISION zsolsw0(kdlon), zsollw0(kdlon)      DOUBLE PRECISION zsolsw0(kdlon), zsollw0(kdlon)
162      DOUBLE PRECISION zznormcp      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)  
163    
164      !jq the following quantities are needed for the aerosol radiative forcings      !jq the following quantities are needed for the aerosol radiative forcings
165    
     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)  
   
166      DOUBLE PRECISION PTAUA(kdlon, 2, klev)      DOUBLE PRECISION PTAUA(kdlon, 2, klev)
167      ! present-day value of cloud opt thickness (PTAU is pre-industrial      ! present-day value of cloud opt thickness (PTAU is pre-industrial
168      ! value), local use      ! value), local use
# Line 172  contains Line 173  contains
173      ! Aerosol direct forcing at TOAand surface      ! Aerosol direct forcing at TOAand surface
174    
175      DOUBLE PRECISION ztopswai(kdlon), zsolswai(kdlon) ! dito, indirect      DOUBLE PRECISION ztopswai(kdlon), zsolswai(kdlon) ! dito, indirect
176        real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
177    
178      !----------------------------------------------------------------------      !----------------------------------------------------------------------
179    
# Line 189  contains Line 191  contains
191      cool = 0.      cool = 0.
192      heat0 = 0.      heat0 = 0.
193      cool0 = 0.      cool0 = 0.
194      zdist = dist      PSCT = solaire / dist**2
     PSCT = solaire / zdist / zdist  
195    
196      loop_iof: DO iof = 0, klon - kdlon, kdlon      loop_iof: DO iof = 0, klon - kdlon, kdlon
197         DO i = 1, kdlon         DO i = 1, kdlon
198            zfract(i) = fract(iof+i)            zfract(i) = fract(iof+i)
199            zrmu0(i) = rmu0(iof+i)            zrmu0(i) = mu0(iof+i)
200            PALBD(i, 1) = albedo(iof+i)            PALBD(i, 1) = albedo(iof+i)
201            PALBD(i, 2) = alblw(iof+i)            PALBD(i, 2) = albedo(iof+i)
202            PALBP(i, 1) = albedo(iof+i)            PALBP(i, 1) = albedo(iof+i)
203            PALBP(i, 2) = alblw(iof+i)            PALBP(i, 2) = albedo(iof+i)
204            ! cf. JLD pour etre en accord avec ORCHIDEE il faut mettre            ! cf. JLD pour etre en accord avec ORCHIDEE il faut mettre
205            ! PEMIS(i) = 0.96            ! PEMIS(i) = 0.96
206            PEMIS(i) = 1.0            PEMIS(i) = 1.0
207            PVIEW(i) = 1.66            PVIEW(i) = 1.66
208            PPSOL(i) = paprs(iof+i, 1)            PPSOL(i) = paprs(iof+i, 1)
209            zx_alpha1 = (paprs(iof+i, 1)-pplay(iof+i, 2))  &            zx_alpha1 = (paprs(iof+i, 1)-play(iof+i, 2))  &
210                 / (pplay(iof+i, 1)-pplay(iof+i, 2))                 / (play(iof+i, 1)-play(iof+i, 2))
211            zx_alpha2 = 1.0 - zx_alpha1            zx_alpha2 = 1.0 - zx_alpha1
212            PTL(i, 1) = t(iof+i, 1) * zx_alpha1 + t(iof+i, 2) * zx_alpha2            PTL(i, 1) = t(iof+i, 1) * zx_alpha1 + t(iof+i, 2) * zx_alpha2
213            PTL(i, klev+1) = t(iof+i, klev)            PTL(i, klev+1) = t(iof+i, klev)
# Line 223  contains Line 224  contains
224               PTAVE(i, k) = t(iof+i, k)               PTAVE(i, k) = t(iof+i, k)
225               PWV(i, k) = MAX (q(iof+i, k), 1.0e-12)               PWV(i, k) = MAX (q(iof+i, k), 1.0e-12)
226               PQS(i, k) = PWV(i, k)               PQS(i, k) = PWV(i, k)
227               ! wo:    cm.atm (epaisseur en cm dans la situation standard)               POZON(i, k) = wo(iof+i, k) * RG * dobson_u * 1e3 &
228               ! POZON: kg/kg                    / (paprs(iof+i, k) - paprs(iof+i, k+1))
              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  
229               PCLDLD(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k)               PCLDLD(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k)
230               PCLDLU(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k)               PCLDLU(i, k) = cldfra(iof+i, k)*cldemi(iof+i, k)
231               PCLDSW(i, k) = cldfra(iof+i, k)               PCLDSW(i, k) = cldfra(iof+i, k)
# Line 285  contains Line 278  contains
278            ENDDO            ENDDO
279         ENDDO         ENDDO
280    
281         CALL LW(PPMB, PDP, PPSOL, PDT0, PEMIS, PTL, PTAVE, PWV, POZON, PAER, &         CALL LW(PPMB, PDP, PDT0, PEMIS, PTL, PTAVE, PWV, POZON, PAER, PCLDLD, &
282              PCLDLD, PCLDLU, PVIEW, zcool, zcool0, ztoplw, zsollw, ztoplw0, &              PCLDLU, PVIEW, zcool, zcool0, ztoplw, zsollw, ztoplw0, zsollw0, &
283              zsollw0, zsollwdown, ZFLUP, ZFLDN, ZFLUP0, ZFLDN0)              zsollwdown, ZFLUP, ZFLDN, ZFLUP0, ZFLDN0)
284         CALL SW(PSCT, zrmu0, zfract, PPMB, PDP, PPSOL, PALBD, PALBP, PTAVE, &         CALL SW(PSCT, zrmu0, zfract, PPMB, PDP, PPSOL, PALBD, PALBP, PTAVE, &
285              PWV, PQS, POZON, PAER, PCLDSW, PTAU, POMEGA, PCG, zheat, zheat0, &              PWV, PQS, POZON, PCLDSW, PTAU, POMEGA, PCG, zheat, zheat0, &
286              zalbpla, ztopsw, zsolsw, ztopsw0, zsolsw0, ZFSUP, ZFSDN, ZFSUP0, &              zalbpla, ztopsw, zsolsw, ztopsw0, zsolsw0, ZFSUP, ZFSDN, ZFSUP0, &
287              ZFSDN0, tauae, pizae, cgae, PTAUA, POMEGAA, ztopswad, zsolswad, &              ZFSDN0, tauae, pizae, cgae, PTAUA, POMEGAA, ztopswad, zsolswad, &
288              ztopswai, zsolswai, ok_ade, ok_aie)              ztopswai, zsolswai, ok_ade, ok_aie)

Legend:
Removed from v.62  
changed lines
  Added in v.212

  ViewVC Help
Powered by ViewVC 1.1.21