[1989] | 1 | SUBROUTINE SWNI & |
---|
| 2 | & ( KIDIA , KFDIA , KLON , KLEV , KAER , KNU,& |
---|
| 3 | & PAER , PAKI , PALBD , PALBP, PCG , PCLD, PCLEAR,& |
---|
| 4 | & PDSIG , POMEGA, POZ , PRMU , PSEC , PTAU,& |
---|
| 5 | & PUD , PWV , PQS,& |
---|
| 6 | & PFDOWN, PFUP , PCDOWN, PCUP , PSUDU2, PDIFF , PDIRF, & |
---|
| 7 | !++MODIFCODE |
---|
| 8 | & LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST ) |
---|
| 9 | !--MODIFCODE |
---|
| 10 | |
---|
| 11 | !**** *SWNI* - SHORTWAVE RADIATION, NEAR-INFRARED SPECTRAL INTERVALS |
---|
| 12 | |
---|
| 13 | ! PURPOSE. |
---|
| 14 | ! -------- |
---|
| 15 | |
---|
| 16 | ! COMPUTES THE SHORTWAVE RADIATION FLUXES IN THE NEAR-INFRARED |
---|
| 17 | ! SPECTRAL INTERVALS FOLLOWING FOUQUART AND BONNEL (1980). |
---|
| 18 | |
---|
| 19 | !** INTERFACE. |
---|
| 20 | ! ---------- |
---|
| 21 | |
---|
| 22 | ! *SWNI* IS CALLED FROM *SW*. |
---|
| 23 | |
---|
| 24 | ! IMPLICIT ARGUMENTS : |
---|
| 25 | ! -------------------- |
---|
| 26 | |
---|
| 27 | ! ==== INPUTS === |
---|
| 28 | ! ==== OUTPUTS === |
---|
| 29 | |
---|
| 30 | ! METHOD. |
---|
| 31 | ! ------- |
---|
| 32 | |
---|
| 33 | ! 1. COMPUTES REFLECTIVITY/TRANSMISSIVITY CORRESPONDING TO |
---|
| 34 | ! CONTINUUM SCATTERING |
---|
| 35 | ! 2. COMPUTES REFLECTIVITY/TRANSMISSIVITY CORRESPONDING FOR |
---|
| 36 | ! A GREY MOLECULAR ABSORPTION |
---|
| 37 | ! 3. LAPLACE TRANSFORM ON THE PREVIOUS TO GET EFFECTIVE AMOUNTS |
---|
| 38 | ! OF ABSORBERS |
---|
| 39 | ! 4. APPLY H2O AND U.M.G. TRANSMISSION FUNCTIONS |
---|
| 40 | ! 5. MULTIPLY BY OZONE TRANSMISSION FUNCTION |
---|
| 41 | |
---|
| 42 | ! EXTERNALS. |
---|
| 43 | ! ---------- |
---|
| 44 | |
---|
| 45 | ! *SWCLR*, *SWR*, *SWDE*, *SWTT* |
---|
| 46 | |
---|
| 47 | ! REFERENCE. |
---|
| 48 | ! ---------- |
---|
| 49 | |
---|
| 50 | ! SEE RADIATION'S PART OF THE ECMWF RESEARCH DEPARTMENT |
---|
| 51 | ! DOCUMENTATION, AND FOUQUART AND BONNEL (1980) |
---|
| 52 | |
---|
| 53 | ! AUTHOR. |
---|
| 54 | ! ------- |
---|
| 55 | ! JEAN-JACQUES MORCRETTE *ECMWF* |
---|
| 56 | |
---|
| 57 | ! MODIFICATIONS. |
---|
| 58 | ! -------------- |
---|
| 59 | ! ORIGINAL : 89-07-14 |
---|
| 60 | ! 94-11-15 J.-J. MORCRETTE DIRECT/DIFFUSE ALBEDO |
---|
| 61 | ! 95-12-07 J.-J. MORCRETTE NEAR-INFRARED SW |
---|
| 62 | ! 990128 JJMorcrette Sunshine duration |
---|
| 63 | ! 99-05-25 JJMorcrette Revised aerosols |
---|
| 64 | ! 03-03-17 JJMorcrette Sunshine duration (correction) |
---|
| 65 | ! 03-10-10 Deborah Salmond and Marta Janiskova Optimisation |
---|
| 66 | ! M.Hamrud 01-Oct-2003 CY28 Cleaning |
---|
| 67 | ! 04-11-18 Y.Seity : add 2 arguments for AROME extern. surface |
---|
| 68 | ! Y.Seity 05-10-10 : add add 3 optional arg. for dust SW properties |
---|
| 69 | ! Y.Seity 06-09-09 : add modset from O.Thouron (MesoNH) under NOVLP tests |
---|
| 70 | ! ------------------------------------------------------------------ |
---|
| 71 | |
---|
| 72 | USE PARKIND1 ,ONLY : JPIM ,JPRB |
---|
| 73 | USE YOMHOOK ,ONLY : LHOOK, DR_HOOK |
---|
| 74 | |
---|
| 75 | USE YOESW , ONLY : RRAY ,RSUN ,RSWCE ,RSWCP |
---|
| 76 | !++MODIFCODE |
---|
| 77 | !USE YOERAD , ONLY : NSW ,NOVLP |
---|
| 78 | ! NSW mis dans .def MPL 20140211 |
---|
| 79 | USE YOERAD , ONLY : NOVLP |
---|
| 80 | !--MODIFCODE |
---|
| 81 | USE YOERDU , ONLY : REPLOG ,REPSCQ ,REPSC |
---|
[5133] | 82 | USE lmdz_writefield_phy, ONLY: writefield_phy |
---|
[5154] | 83 | USE lmdz_clesphys |
---|
[1989] | 84 | |
---|
| 85 | IMPLICIT NONE |
---|
| 86 | |
---|
| 87 | character*1 str1 |
---|
| 88 | INTEGER(KIND=JPIM),INTENT(IN) :: KLON |
---|
| 89 | INTEGER(KIND=JPIM),INTENT(IN) :: KLEV |
---|
| 90 | INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA |
---|
| 91 | INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA |
---|
| 92 | INTEGER(KIND=JPIM),INTENT(IN) :: KAER |
---|
| 93 | INTEGER(KIND=JPIM),INTENT(IN) :: KNU |
---|
| 94 | REAL(KIND=JPRB) ,INTENT(IN) :: PAER(KLON,6,KLEV) |
---|
| 95 | REAL(KIND=JPRB) ,INTENT(IN) :: PAKI(KLON,2,NSW) |
---|
| 96 | REAL(KIND=JPRB) ,INTENT(IN) :: PALBD(KLON,NSW) |
---|
| 97 | REAL(KIND=JPRB) ,INTENT(IN) :: PALBP(KLON,NSW) |
---|
| 98 | REAL(KIND=JPRB) ,INTENT(IN) :: PCG(KLON,NSW,KLEV) |
---|
| 99 | REAL(KIND=JPRB) ,INTENT(IN) :: PCLD(KLON,KLEV) |
---|
| 100 | REAL(KIND=JPRB) ,INTENT(IN) :: PCLEAR(KLON) |
---|
| 101 | REAL(KIND=JPRB) ,INTENT(IN) :: PDSIG(KLON,KLEV) |
---|
| 102 | REAL(KIND=JPRB) ,INTENT(IN) :: POMEGA(KLON,NSW,KLEV) |
---|
| 103 | REAL(KIND=JPRB) ,INTENT(IN) :: POZ(KLON,KLEV) |
---|
| 104 | REAL(KIND=JPRB) ,INTENT(IN) :: PRMU(KLON) |
---|
| 105 | REAL(KIND=JPRB) ,INTENT(IN) :: PSEC(KLON) |
---|
| 106 | REAL(KIND=JPRB) ,INTENT(IN) :: PTAU(KLON,NSW,KLEV) |
---|
| 107 | REAL(KIND=JPRB) ,INTENT(IN) :: PUD(KLON,5,KLEV+1) |
---|
| 108 | REAL(KIND=JPRB) ,INTENT(IN) :: PWV(KLON,KLEV) |
---|
| 109 | REAL(KIND=JPRB) ,INTENT(IN) :: PQS(KLON,KLEV) |
---|
| 110 | !++MODIFCODE |
---|
| 111 | LOGICAL ,INTENT(IN) :: LRDUST |
---|
| 112 | REAL(KIND=JPRB) ,INTENT(IN) :: PPIZA_DST(KLON,KLEV) |
---|
| 113 | REAL(KIND=JPRB) ,INTENT(IN) :: PCGA_DST(KLON,KLEV) |
---|
| 114 | REAL(KIND=JPRB) ,INTENT(IN) :: PTAUREL_DST(KLON,KLEV) |
---|
| 115 | !--MODIFCODE |
---|
| 116 | REAL(KIND=JPRB) ,INTENT(OUT) :: PFDOWN(KLON,KLEV+1) |
---|
| 117 | REAL(KIND=JPRB) ,INTENT(OUT) :: PFUP(KLON,KLEV+1) |
---|
| 118 | REAL(KIND=JPRB) ,INTENT(OUT) :: PCDOWN(KLON,KLEV+1) |
---|
| 119 | REAL(KIND=JPRB) ,INTENT(OUT) :: PCUP(KLON,KLEV+1) |
---|
| 120 | REAL(KIND=JPRB) ,INTENT(OUT) :: PSUDU2(KLON) |
---|
| 121 | REAL(KIND=JPRB) ,INTENT(OUT) :: PDIFF(KLON,KLEV) |
---|
| 122 | REAL(KIND=JPRB) ,INTENT(OUT) :: PDIRF(KLON,KLEV) |
---|
| 123 | !#include "yoeaer.h" |
---|
| 124 | ! ------------------------------------------------------------------ |
---|
| 125 | |
---|
| 126 | !* 0.1 ARGUMENTS |
---|
| 127 | ! --------- |
---|
| 128 | |
---|
| 129 | ! ------------------------------------------------------------------ |
---|
| 130 | |
---|
| 131 | ! ------------ |
---|
| 132 | |
---|
| 133 | INTEGER(KIND=JPIM) :: IIND2(2), IIND3(6) |
---|
| 134 | REAL(KIND=JPRB) :: ZCGAZ(KLON,KLEV) , ZDIFF(KLON) , ZDIRF(KLON)& |
---|
| 135 | & , ZFD(KLON,KLEV+1) , ZFU(KLON,KLEV+1) & |
---|
| 136 | & , ZG(KLON) , ZGG(KLON) |
---|
| 137 | REAL(KIND=JPRB) :: ZPIZAZ(KLON,KLEV)& |
---|
| 138 | & , ZRAYL(KLON) , ZRAY1(KLON,KLEV+1) , ZRAY2(KLON,KLEV+1)& |
---|
| 139 | & , ZREF(KLON) , ZREFZ(KLON,2,KLEV+1)& |
---|
| 140 | & , ZRE1(KLON) , ZRE2(KLON)& |
---|
| 141 | & , ZRJ(KLON,6,KLEV+1), ZRJ0(KLON,6,KLEV+1)& |
---|
| 142 | & , ZRK(KLON,6,KLEV+1), ZRK0(KLON,6,KLEV+1)& |
---|
| 143 | & , ZRL(KLON,8)& |
---|
| 144 | & , ZRMUE(KLON,KLEV+1), ZRMU0(KLON,KLEV+1) , ZRMUZ(KLON)& |
---|
| 145 | & , ZRNEB(KLON) , ZRUEF(KLON,8) , ZR1(KLON) & |
---|
| 146 | & , ZR2(KLON,2) , ZR3(KLON,6) , ZR4(KLON,2)& |
---|
| 147 | & , ZR21(KLON) , ZR22(KLON) |
---|
| 148 | REAL(KIND=JPRB) :: ZS(KLON)& |
---|
| 149 | & , ZTAUAZ(KLON,KLEV) , ZTO1(KLON) , ZTR(KLON,2,KLEV+1)& |
---|
| 150 | & , ZTRA1(KLON,KLEV+1), ZTRA2(KLON,KLEV+1)& |
---|
| 151 | & , ZTRCLD(KLON) , ZTRCLR(KLON)& |
---|
| 152 | & , ZTR1(KLON) , ZTR2(KLON)& |
---|
| 153 | & , ZW(KLON) , ZW1(KLON) , ZW2(KLON,2)& |
---|
| 154 | & , ZW3(KLON,6) , ZW4(KLON,2) , ZW5(KLON,2) |
---|
| 155 | |
---|
| 156 | INTEGER(KIND=JPIM) :: IABS, IKL, IKM1, JABS, JAJ, JAJP, JK, JKKI,& |
---|
| 157 | & JKKP4, JKL, JKLP1, JKM1, JL, JN, JN2J, JREF |
---|
| 158 | |
---|
| 159 | REAL(KIND=JPRB) :: ZAA, ZBB, ZCNEB, ZRE11, ZRKI, ZRMUM1, ZWH2O, ZCHKG, ZCHKS |
---|
| 160 | REAL(KIND=JPRB) :: ZRR,ZRRJ,ZRRK |
---|
| 161 | REAL(KIND=JPRB) :: ZHOOK_HANDLE |
---|
| 162 | !++MODIF_CODE |
---|
| 163 | REAL(KIND=JPRB) :: ZB_ODI(KLON) |
---|
| 164 | !--MODIF_CODE |
---|
| 165 | LOGICAL :: LLDEBUG |
---|
| 166 | |
---|
| 167 | #include "swclr.intfb.h" |
---|
| 168 | #include "swde.intfb.h" |
---|
| 169 | #include "swr.intfb.h" |
---|
| 170 | #include "swtt.intfb.h" |
---|
| 171 | #include "swtt1.intfb.h" |
---|
| 172 | |
---|
| 173 | LLDEBUG=.FALSE. |
---|
| 174 | |
---|
| 175 | IF(LLDEBUG) THEN |
---|
| 176 | write(str1,'(i1)') knu |
---|
| 177 | ! call writefield_phy("sw_zcduvs"//str1,zcduvs,klev+1) |
---|
| 178 | ENDIF |
---|
| 179 | |
---|
| 180 | ! ------------------------------------------------------------------ |
---|
| 181 | |
---|
| 182 | !* 1. NEAR-INFRARED SPECTRAL INTERVAL (0.68-4.00 MICRON) |
---|
| 183 | ! -------------------------------------------------- |
---|
| 184 | |
---|
| 185 | !* 1.1 OPTICAL THICKNESS FOR RAYLEIGH SCATTERING |
---|
| 186 | ! ----------------------------------------- |
---|
| 187 | |
---|
| 188 | IF (LHOOK) CALL DR_HOOK('SWNI',0,ZHOOK_HANDLE) |
---|
| 189 | DO JL = KIDIA,KFDIA |
---|
| 190 | ZRMUM1 = 1.0_JPRB - PRMU(JL) |
---|
| 191 | ZRAYL(JL) = RRAY(KNU,1) + ZRMUM1 * (RRAY(KNU,2) + ZRMUM1 & |
---|
| 192 | & * (RRAY(KNU,3) + ZRMUM1 * (RRAY(KNU,4) + ZRMUM1 & |
---|
| 193 | & * (RRAY(KNU,5) + ZRMUM1 * RRAY(KNU,6) )))) |
---|
| 194 | ZRAYL(JL) = MAX (ZRAYL(JL), 0.0_JPRB) |
---|
| 195 | ENDDO |
---|
| 196 | |
---|
| 197 | ! ------------------------------------------------------------------ |
---|
| 198 | |
---|
| 199 | !* 2. CONTINUUM SCATTERING CALCULATIONS |
---|
| 200 | ! --------------------------------- |
---|
| 201 | |
---|
| 202 | !* 2.1 CLEAR-SKY FRACTION OF THE COLUMN |
---|
| 203 | ! -------------------------------- |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | !++MODIFCODE |
---|
| 207 | CALL SWCLR & |
---|
| 208 | &( KIDIA , KFDIA , KLON , KLEV , KAER , KNU & |
---|
| 209 | &, PAER , PALBP , PDSIG , ZRAYL, PSEC & |
---|
| 210 | &, ZCGAZ , ZPIZAZ, ZRAY1 , ZRAY2, ZREFZ, ZRJ0 & |
---|
| 211 | &, ZRK0 , ZRMU0 , ZTAUAZ, ZTRA1, ZTRA2, ZTRCLR & |
---|
| 212 | &, LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST & |
---|
| 213 | &) |
---|
| 214 | !--MODIFCODE |
---|
| 215 | |
---|
| 216 | !* 2.2 CLOUDY FRACTION OF THE COLUMN |
---|
| 217 | ! ----------------------------- |
---|
| 218 | |
---|
| 219 | CALL SWR & |
---|
| 220 | & ( KIDIA , KFDIA , KLON , KLEV , KNU,& |
---|
| 221 | & PALBD , PCG , PCLD , POMEGA, PSEC , PTAU,& |
---|
| 222 | & ZCGAZ , ZPIZAZ, ZRAY1, ZRAY2 , ZREFZ, ZRJ , ZRK, ZRMUE,& |
---|
| 223 | & ZTAUAZ, ZTRA1 , ZTRA2, ZTRCLD & |
---|
| 224 | & ) |
---|
| 225 | |
---|
| 226 | ! ------------------------------------------------------------------ |
---|
| 227 | |
---|
| 228 | !* 3. SCATTERING CALCULATIONS WITH GREY MOLECULAR ABSORPTION |
---|
| 229 | ! ------------------------------------------------------ |
---|
| 230 | |
---|
| 231 | JN = 2 |
---|
| 232 | |
---|
| 233 | DO JABS=1,2 |
---|
| 234 | |
---|
| 235 | !* 3.1 SURFACE CONDITIONS |
---|
| 236 | ! ------------------ |
---|
| 237 | |
---|
| 238 | DO JL = KIDIA,KFDIA |
---|
| 239 | ZREFZ(JL,2,1) = PALBD(JL,KNU) |
---|
| 240 | ZREFZ(JL,1,1) = PALBD(JL,KNU) |
---|
| 241 | ENDDO |
---|
| 242 | |
---|
| 243 | !* 3.2 INTRODUCING CLOUD EFFECTS |
---|
| 244 | ! ------------------------- |
---|
| 245 | |
---|
| 246 | DO JK = 2 , KLEV+1 |
---|
| 247 | JKM1 = JK - 1 |
---|
| 248 | IKL=KLEV+1-JKM1 |
---|
| 249 | DO JL = KIDIA,KFDIA |
---|
| 250 | ZRNEB(JL) = PCLD(JL,JKM1) |
---|
| 251 | IF (JABS == 1.AND. ZRNEB(JL) > REPSC ) THEN |
---|
| 252 | ZWH2O=MAX(PWV(JL,IKL),REPSCQ) |
---|
| 253 | ZCNEB=MAX(REPSC ,MIN(ZRNEB(JL),1.0_JPRB-REPSC )) |
---|
| 254 | ZBB=PUD(JL,JABS,JKM1)*PQS(JL,IKL)/ZWH2O |
---|
| 255 | ZAA=MAX((PUD(JL,JABS,JKM1)-ZCNEB*ZBB)/(1.0_JPRB-ZCNEB),REPSCQ) |
---|
| 256 | ELSE |
---|
| 257 | ZAA=PUD(JL,JABS,JKM1) |
---|
| 258 | ZBB=ZAA |
---|
| 259 | ZCNEB=0.0_JPRB |
---|
| 260 | ZWH2O=MAX(PWV(JL,IKL),REPSCQ) |
---|
| 261 | ENDIF |
---|
| 262 | |
---|
| 263 | ! ZEXP1=-ZRKI * ZAA * 1.66_JPRB |
---|
| 264 | ! ZEXP2=-ZRKI * ZAA / ZRMUE(JL,JK) |
---|
| 265 | ! IF ( ZEXP1 > _ZERO_ .OR. ZEXP2 > _ZERO_ & |
---|
| 266 | ! & .OR. ZEXP1 < -700._JPRB .OR. ZEXP2 < -700._JPRB ) THEN |
---|
| 267 | ! WRITE (NULOUT,'(" SWNI 3.2 : JK=",I4," JL=",I4," JABS=",I4,,8E13.6)') & |
---|
| 268 | ! & JK,JL,JABS,ZAA,ZBB,ZRKI,ZCNEB,ZWH2O,ZRMUE(JL,JK),ZEXP1,ZEXP2 |
---|
| 269 | ! END IF |
---|
| 270 | |
---|
| 271 | ZRKI = PAKI(JL,JABS,KNU) |
---|
| 272 | ! ZS(JL) = EXP(-ZRKI * ZAA * 1.66_JPRB) |
---|
| 273 | ! ZG(JL) = EXP(-ZRKI * ZAA / ZRMUE(JL,JK) ) |
---|
| 274 | |
---|
| 275 | ZCHKS = MIN( 200._JPRB, ZRKI * ZAA * 1.66_JPRB ) |
---|
| 276 | ZCHKG = MIN( 200._JPRB, ZRKI * ZAA / ZRMUE(JL,JK)) |
---|
| 277 | ZS(JL) = EXP( - ZCHKS ) |
---|
| 278 | ZG(JL) = EXP( - ZCHKG ) |
---|
| 279 | |
---|
| 280 | ZTR1(JL) = 0.0_JPRB |
---|
| 281 | ZRE1(JL) = 0.0_JPRB |
---|
| 282 | ZTR2(JL) = 0.0_JPRB |
---|
| 283 | ZRE2(JL) = 0.0_JPRB |
---|
| 284 | |
---|
| 285 | !++MODIFCODE |
---|
| 286 | IF (NOVLP >= 5)THEN !MESONH VERSION |
---|
| 287 | ZW(JL) =PCG(JL,KNU,JKM1)*PCG(JL,KNU,JKM1) |
---|
| 288 | ZTO1(JL) = PTAU(JL,KNU,JKM1)*(1-(POMEGA(JL,KNU,JKM1)*ZW(JL))) |
---|
| 289 | ZW(JL) =POMEGA(JL,KNU,JKM1)*(1-ZW(JL))/(1-(POMEGA(JL,KNU,JKM1)*ZW(JL))) |
---|
| 290 | ZGG(JL) =PCG(JL,KNU,JKM1)/(1+PCG(JL,KNU,JKM1)) |
---|
| 291 | ZGG(JL)=ZTO1(JL)*ZW(JL)*ZGG(JL)+ZTAUAZ(JL,JKM1)*ZPIZAZ(JL,JKM1)*ZCGAZ(JL,JKM1) |
---|
| 292 | ZGG(JL)=ZGG(JL)/(ZTO1(JL)*ZW(JL)+ZTAUAZ(JL,JKM1)*ZPIZAZ(JL,JKM1)) |
---|
| 293 | ZB_ODI(JL)=ZTO1(JL) / ZW(JL)& |
---|
| 294 | &+ ZTAUAZ(JL,JKM1) / ZPIZAZ(JL,JKM1)& |
---|
| 295 | !if g=0 tau/w=tau'/w' |
---|
| 296 | &+ ZBB * ZRKI |
---|
| 297 | ZB_ODI(JL)=(1/( (ZTO1(JL) / ZW(JL))& |
---|
| 298 | &+ (ZTAUAZ(JL,JKM1) / ZPIZAZ(JL,JKM1)) ))-(1/ZB_ODI(JL)) |
---|
| 299 | ZB_ODI(JL)=((ZTO1(JL) + ZTAUAZ(JL,JKM1))**2)*ZB_ODI(JL) |
---|
| 300 | ZW(JL)=ZTO1(JL)*ZW(JL)+ZTAUAZ(JL,JKM1)*ZPIZAZ(JL,JKM1)-ZB_ODI(JL) |
---|
| 301 | ZTO1(JL) = ZTO1(JL) + ZTAUAZ(JL,JKM1) |
---|
| 302 | ZW(JL)=ZW(JL)/ZTO1(JL) |
---|
| 303 | ELSE !ECMWF VERSION |
---|
| 304 | ZW(JL)= POMEGA(JL,KNU,JKM1) |
---|
| 305 | ZTO1(JL) = PTAU(JL,KNU,JKM1) / ZW(JL)& |
---|
| 306 | & + ZTAUAZ(JL,JKM1) / ZPIZAZ(JL,JKM1)& |
---|
| 307 | & + ZBB * ZRKI |
---|
| 308 | ZR21(JL) = PTAU(JL,KNU,JKM1) + ZTAUAZ(JL,JKM1) |
---|
| 309 | ZR22(JL) = PTAU(JL,KNU,JKM1) / ZR21(JL) |
---|
| 310 | ZGG(JL) = ZR22(JL) * PCG(JL,KNU,JKM1)& |
---|
| 311 | & + (1.0_JPRB - ZR22(JL)) * ZCGAZ(JL,JKM1) |
---|
| 312 | ZW(JL) = ZR21(JL) / ZTO1(JL) |
---|
| 313 | ENDIF |
---|
| 314 | !--MODIFCODE |
---|
| 315 | ZREF(JL) = ZREFZ(JL,1,JKM1) |
---|
| 316 | ZRMUZ(JL) = ZRMUE(JL,JK) |
---|
| 317 | ENDDO |
---|
| 318 | |
---|
| 319 | CALL SWDE ( KIDIA, KFDIA, KLON,& |
---|
| 320 | & ZGG , ZREF , ZRMUZ, ZTO1, ZW,& |
---|
| 321 | & ZRE1 , ZRE2 , ZTR1 , ZTR2 ) |
---|
| 322 | |
---|
| 323 | DO JL = KIDIA,KFDIA |
---|
| 324 | |
---|
| 325 | ZRR=1.0_JPRB/(1.0_JPRB-ZRAY2(JL,JKM1)*ZREFZ(JL,1,JKM1)) |
---|
| 326 | ZREFZ(JL,2,JK) = (1.0_JPRB-ZRNEB(JL)) * (ZRAY1(JL,JKM1)& |
---|
| 327 | & + ZREFZ(JL,2,JKM1) * ZTRA1(JL,JKM1)& |
---|
| 328 | & * ZTRA2(JL,JKM1) ) * ZG(JL) * ZS(JL)& |
---|
| 329 | & + ZRNEB(JL) * ZRE1(JL) |
---|
| 330 | |
---|
| 331 | ZTR(JL,2,JKM1)=ZRNEB(JL)*ZTR1(JL)& |
---|
| 332 | & + (ZTRA1(JL,JKM1)) * ZG(JL) * (1.0_JPRB-ZRNEB(JL)) |
---|
| 333 | |
---|
| 334 | ZREFZ(JL,1,JK)=(1.0_JPRB-ZRNEB(JL))*(ZRAY1(JL,JKM1)& |
---|
| 335 | & +ZREFZ(JL,1,JKM1)*ZTRA1(JL,JKM1)*ZTRA2(JL,JKM1)& |
---|
| 336 | & *ZRR ) & |
---|
| 337 | & *ZG(JL)*ZS(JL)& |
---|
| 338 | & + ZRNEB(JL) * ZRE2(JL) |
---|
| 339 | |
---|
| 340 | ZTR(JL,1,JKM1)= ZRNEB(JL) * ZTR2(JL)& |
---|
| 341 | & + (ZTRA1(JL,JKM1) & |
---|
| 342 | & *ZRR ) & |
---|
| 343 | & * ZG(JL) * (1.0_JPRB -ZRNEB(JL)) |
---|
| 344 | |
---|
| 345 | ENDDO |
---|
| 346 | ENDDO |
---|
| 347 | |
---|
| 348 | !* 3.3 REFLECT./TRANSMISSIVITY BETWEEN SURFACE AND LEVEL |
---|
| 349 | ! ------------------------------------------------- |
---|
| 350 | |
---|
| 351 | DO JREF=1,2 |
---|
| 352 | |
---|
| 353 | JN = JN + 1 |
---|
| 354 | |
---|
| 355 | DO JL = KIDIA,KFDIA |
---|
| 356 | ZRJ(JL,JN,KLEV+1) = 1.0_JPRB |
---|
| 357 | ZRK(JL,JN,KLEV+1) = ZREFZ(JL,JREF,KLEV+1) |
---|
| 358 | ENDDO |
---|
| 359 | |
---|
| 360 | DO JK = 1 , KLEV |
---|
| 361 | JKL = KLEV+1 - JK |
---|
| 362 | JKLP1 = JKL + 1 |
---|
| 363 | DO JL = KIDIA,KFDIA |
---|
| 364 | ZRE11 = ZRJ(JL,JN,JKLP1) * ZTR(JL,JREF,JKL) |
---|
| 365 | ZRJ(JL,JN,JKL) = ZRE11 |
---|
| 366 | ZRK(JL,JN,JKL) = ZRE11 * ZREFZ(JL,JREF,JKL) |
---|
| 367 | ENDDO |
---|
| 368 | ENDDO |
---|
| 369 | ENDDO |
---|
| 370 | ENDDO |
---|
| 371 | |
---|
| 372 | ! ------------------------------------------------------------------ |
---|
| 373 | |
---|
| 374 | !* 4. INVERT GREY AND CONTINUUM FLUXES |
---|
| 375 | ! -------------------------------- |
---|
| 376 | |
---|
| 377 | !* 4.1 UPWARD (ZRK) AND DOWNWARD (ZRJ) PSEUDO-FLUXES |
---|
| 378 | ! --------------------------------------------- |
---|
| 379 | |
---|
| 380 | DO JK = 1 , KLEV+1 |
---|
| 381 | DO JAJ = 1 , 5 , 2 |
---|
| 382 | JAJP = JAJ + 1 |
---|
| 383 | DO JL = KIDIA,KFDIA |
---|
| 384 | ZRJ(JL,JAJ,JK)= ZRJ(JL,JAJ,JK) - ZRJ(JL,JAJP,JK) |
---|
| 385 | ZRK(JL,JAJ,JK)= ZRK(JL,JAJ,JK) - ZRK(JL,JAJP,JK) |
---|
| 386 | ZRJ(JL,JAJ,JK)= MAX( ZRJ(JL,JAJ,JK) , REPLOG ) |
---|
| 387 | ZRK(JL,JAJ,JK)= MAX( ZRK(JL,JAJ,JK) , REPLOG ) |
---|
| 388 | ENDDO |
---|
| 389 | ENDDO |
---|
| 390 | ENDDO |
---|
| 391 | |
---|
| 392 | DO JK = 1 , KLEV+1 |
---|
| 393 | DO JAJ = 2 , 6 , 2 |
---|
| 394 | DO JL = KIDIA,KFDIA |
---|
| 395 | ZRJ(JL,JAJ,JK)= MAX( ZRJ(JL,JAJ,JK) , REPLOG ) |
---|
| 396 | ZRK(JL,JAJ,JK)= MAX( ZRK(JL,JAJ,JK) , REPLOG ) |
---|
| 397 | ENDDO |
---|
| 398 | ENDDO |
---|
| 399 | ENDDO |
---|
| 400 | |
---|
| 401 | !* 4.2 EFFECTIVE ABSORBER AMOUNTS BY INVERSE LAPLACE |
---|
| 402 | ! --------------------------------------------- |
---|
| 403 | |
---|
| 404 | DO JK = 1 , KLEV+1 |
---|
| 405 | JKKI = 1 |
---|
| 406 | DO JAJ = 1 , 2 |
---|
| 407 | IIND2(1)=JAJ |
---|
| 408 | IIND2(2)=JAJ |
---|
| 409 | DO JN = 1 , 2 |
---|
| 410 | JN2J = JN + 2 * JAJ |
---|
| 411 | JKKP4 = JKKI + 4 |
---|
| 412 | |
---|
| 413 | !* 4.2.1 EFFECTIVE ABSORBER AMOUNTS |
---|
| 414 | ! -------------------------- |
---|
| 415 | |
---|
| 416 | DO JL = KIDIA,KFDIA |
---|
| 417 | ZRR=1.0_JPRB/PAKI(JL,JAJ,KNU) |
---|
| 418 | ZRRJ=ZRJ(JL,JN,JK) / ZRJ(JL,JN2J,JK) |
---|
| 419 | ZRRK=ZRK(JL,JN,JK) / ZRK(JL,JN2J,JK) |
---|
[2401] | 420 | ! ZW2(JL,1) = LOG( ZRRJ ) * ZRR |
---|
| 421 | ! ZW2(JL,2) = LOG( ZRRK ) * ZRR |
---|
| 422 | !--correction Olivier Boucher based on ECMWF code |
---|
| 423 | ZW2(JL,1) = LOG( MAX(1.0_JPRB,ZRRJ) ) * ZRR |
---|
| 424 | ZW2(JL,2) = LOG( MAX(1.0_JPRB,ZRRK) ) * ZRR |
---|
[1989] | 425 | ENDDO |
---|
| 426 | |
---|
| 427 | !* 4.2.2 TRANSMISSION FUNCTION |
---|
| 428 | ! --------------------- |
---|
| 429 | |
---|
| 430 | CALL SWTT1 ( KIDIA,KFDIA,KLON, KNU, 2, IIND2,& |
---|
| 431 | & ZW2,& |
---|
| 432 | & ZR2 ) |
---|
| 433 | |
---|
| 434 | DO JL = KIDIA,KFDIA |
---|
| 435 | ZRL(JL,JKKI) = ZR2(JL,1) |
---|
| 436 | ZRUEF(JL,JKKI) = ZW2(JL,1) |
---|
| 437 | ZRL(JL,JKKP4) = ZR2(JL,2) |
---|
| 438 | ZRUEF(JL,JKKP4) = ZW2(JL,2) |
---|
| 439 | ENDDO |
---|
| 440 | |
---|
| 441 | JKKI=JKKI+1 |
---|
| 442 | ENDDO |
---|
| 443 | ENDDO |
---|
| 444 | |
---|
| 445 | !* 4.3 UPWARD AND DOWNWARD FLUXES WITH H2O AND UMG ABSORPTION |
---|
| 446 | ! ------------------------------------------------------ |
---|
| 447 | |
---|
| 448 | DO JL = KIDIA,KFDIA |
---|
| 449 | PFDOWN(JL,JK) = ZRJ(JL,1,JK) * ZRL(JL,1) * ZRL(JL,3)& |
---|
| 450 | & + ZRJ(JL,2,JK) * ZRL(JL,2) * ZRL(JL,4) |
---|
| 451 | PFUP(JL,JK) = ZRK(JL,1,JK) * ZRL(JL,5) * ZRL(JL,7)& |
---|
| 452 | & + ZRK(JL,2,JK) * ZRL(JL,6) * ZRL(JL,8) |
---|
| 453 | ENDDO |
---|
| 454 | ! WRITE(*,'("---> Dans SWNI: ZRK1 ZRK2 ",2E12.5)') ZRK(1,1,JK),ZRK(1,2,JK) |
---|
| 455 | ! WRITE(*,'("ZRK1 ZRL5 ZRL7 ",3E12.5)') ZRK(1,1,JK),ZRL(1,5),ZRL(1,7) |
---|
| 456 | ! WRITE(*,'("ZRK2 ZRL6 ZRL8 ",3E12.5)') ZRK(1,2,JK),ZRL(1,6),ZRL(1,8) |
---|
| 457 | ENDDO |
---|
| 458 | |
---|
| 459 | ! ------------------------------------------------------------------ |
---|
| 460 | |
---|
| 461 | !* 5. MOLECULAR ABSORPTION ON CLEAR-SKY FLUXES |
---|
| 462 | ! ---------------------------------------- |
---|
| 463 | |
---|
| 464 | !* 5.1 DOWNWARD FLUXES |
---|
| 465 | ! --------------- |
---|
| 466 | |
---|
| 467 | JAJ = 2 |
---|
| 468 | IIND3(1)=1 |
---|
| 469 | IIND3(2)=2 |
---|
| 470 | IIND3(3)=3 |
---|
| 471 | IIND3(4)=1 |
---|
| 472 | IIND3(5)=2 |
---|
| 473 | IIND3(6)=3 |
---|
| 474 | |
---|
| 475 | DO JL = KIDIA,KFDIA |
---|
| 476 | ZW3(JL,1)=0.0_JPRB |
---|
| 477 | ZW3(JL,2)=0.0_JPRB |
---|
| 478 | ZW3(JL,3)=0.0_JPRB |
---|
| 479 | ZW3(JL,4)=0.0_JPRB |
---|
| 480 | ZW3(JL,5)=0.0_JPRB |
---|
| 481 | ZW3(JL,6)=0.0_JPRB |
---|
| 482 | |
---|
| 483 | ZW4(JL,1)=0.0_JPRB |
---|
| 484 | ZW5(JL,1)=0.0_JPRB |
---|
| 485 | ZR4(JL,1)=1.0_JPRB |
---|
| 486 | ZW4(JL,2)=0.0_JPRB |
---|
| 487 | ZW5(JL,2)=0.0_JPRB |
---|
| 488 | ZR4(JL,2)=1.0_JPRB |
---|
| 489 | ZFD(JL,KLEV+1)= ZRJ0(JL,JAJ,KLEV+1) |
---|
| 490 | ENDDO |
---|
| 491 | DO JK = 1 , KLEV |
---|
| 492 | IKL = KLEV+1-JK |
---|
| 493 | DO JL = KIDIA,KFDIA |
---|
| 494 | ZRR=1.0_JPRB/ZRMU0(JL,IKL) |
---|
| 495 | ZW3(JL,1)=ZW3(JL,1)+PUD(JL,1,IKL)*ZRR |
---|
| 496 | ZW3(JL,2)=ZW3(JL,2)+PUD(JL,2,IKL)*ZRR |
---|
| 497 | ZW3(JL,3)=ZW3(JL,3)+POZ(JL, IKL)*ZRR |
---|
| 498 | ZW4(JL,1)=ZW4(JL,1)+PUD(JL,4,IKL)*ZRR |
---|
| 499 | ZW5(JL,1)=ZW5(JL,1)+PUD(JL,5,IKL)*ZRR |
---|
| 500 | |
---|
| 501 | ZRR=1.0_JPRB/ZRMUE(JL,IKL) |
---|
| 502 | ZW3(JL,4)=ZW3(JL,4)+PUD(JL,1,IKL)*ZRR |
---|
| 503 | ZW3(JL,5)=ZW3(JL,5)+PUD(JL,2,IKL)*ZRR |
---|
| 504 | ZW3(JL,6)=ZW3(JL,6)+POZ(JL, IKL)*ZRR |
---|
| 505 | ZW4(JL,2)=ZW4(JL,2)+PUD(JL,4,IKL)*ZRR |
---|
| 506 | ZW5(JL,2)=ZW5(JL,2)+PUD(JL,5,IKL)*ZRR |
---|
| 507 | ENDDO |
---|
| 508 | |
---|
| 509 | CALL SWTT1 ( KIDIA,KFDIA,KLON, KNU, 6, IIND3,& |
---|
| 510 | & ZW3,& |
---|
| 511 | & ZR3 ) |
---|
| 512 | |
---|
| 513 | DO JL = KIDIA,KFDIA |
---|
| 514 | ZR4(JL,1) = EXP(-RSWCE(KNU)*ZW4(JL,1)-RSWCP(KNU)*ZW5(JL,1)) |
---|
| 515 | ZR4(JL,2) = EXP(-RSWCE(KNU)*ZW4(JL,2)-RSWCP(KNU)*ZW5(JL,2)) |
---|
| 516 | ZFD(JL,IKL) = ZR3(JL,1)*ZR3(JL,2)*ZR3(JL,3)*ZR4(JL,1)* ZRJ0(JL,JAJ,IKL) |
---|
| 517 | ENDDO |
---|
| 518 | ENDDO |
---|
| 519 | IF(LLDEBUG) THEN |
---|
| 520 | call writefield_phy('swni_zfd'//str1,ZFD,KLEV+1) |
---|
| 521 | call writefield_phy('swni_zrj0'//str1,ZRJ0(:,jaj,:),KLEV+1) |
---|
| 522 | ENDIF |
---|
| 523 | |
---|
| 524 | DO JL=KIDIA,KFDIA |
---|
| 525 | ZDIFF(JL) = ZR3(JL,4)*ZR3(JL,5)*ZR3(JL,6)*ZR4(JL,2)*ZTRCLD(JL) |
---|
| 526 | ZDIRF(JL) = ZR3(JL,1)*ZR3(JL,2)*ZR3(JL,3)*ZR4(JL,1)*ZTRCLR(JL) |
---|
| 527 | PSUDU2(JL) = ((1.0_JPRB-PCLEAR(JL)) * ZDIFF(JL)& |
---|
| 528 | & +PCLEAR(JL) * ZDIRF(JL)) * RSUN(KNU) |
---|
| 529 | ENDDO |
---|
| 530 | |
---|
| 531 | !* 5.2 UPWARD FLUXES |
---|
| 532 | ! ------------- |
---|
| 533 | |
---|
| 534 | DO JL = KIDIA,KFDIA |
---|
| 535 | ZFU(JL,1) = ZFD(JL,1)*PALBP(JL,KNU) |
---|
| 536 | ENDDO |
---|
| 537 | |
---|
| 538 | DO JK = 2 , KLEV+1 |
---|
| 539 | IKM1=JK-1 |
---|
| 540 | DO JL = KIDIA,KFDIA |
---|
| 541 | ZW3(JL,1)=ZW3(JL,1)+PUD(JL,1,IKM1)*1.66_JPRB |
---|
| 542 | ZW3(JL,2)=ZW3(JL,2)+PUD(JL,2,IKM1)*1.66_JPRB |
---|
| 543 | ZW3(JL,3)=ZW3(JL,3)+POZ(JL, IKM1)*1.66_JPRB |
---|
| 544 | ZW4(JL,1)=ZW4(JL,1)+PUD(JL,4,IKM1)*1.66_JPRB |
---|
| 545 | ZW5(JL,1)=ZW5(JL,1)+PUD(JL,5,IKM1)*1.66_JPRB |
---|
| 546 | ENDDO |
---|
| 547 | |
---|
| 548 | CALL SWTT1 ( KIDIA,KFDIA,KLON, KNU, 3, IIND3,& |
---|
| 549 | & ZW3,& |
---|
| 550 | & ZR3 ) |
---|
| 551 | |
---|
| 552 | DO JL = KIDIA,KFDIA |
---|
| 553 | ZR4(JL,1) = EXP(-RSWCE(KNU)*ZW4(JL,1)-RSWCP(KNU)*ZW5(JL,1)) |
---|
| 554 | ZFU(JL,JK) = ZR3(JL,1)*ZR3(JL,2)*ZR3(JL,3)*ZR4(JL,1)* ZRK0(JL,JAJ,JK) |
---|
| 555 | ENDDO |
---|
| 556 | ENDDO |
---|
| 557 | |
---|
| 558 | ! ------------------------------------------------------------------ |
---|
| 559 | |
---|
| 560 | !* 6. INTRODUCTION OF OZONE AND H2O CONTINUUM ABSORPTION |
---|
| 561 | ! -------------------------------------------------- |
---|
| 562 | |
---|
| 563 | IABS=3 |
---|
| 564 | |
---|
| 565 | !* 6.1 DOWNWARD FLUXES |
---|
| 566 | ! --------------- |
---|
| 567 | |
---|
| 568 | DO JL = KIDIA,KFDIA |
---|
| 569 | ZW1(JL)=0.0_JPRB |
---|
| 570 | ZW4(JL,1)=0.0_JPRB |
---|
| 571 | ZW5(JL,1)=0.0_JPRB |
---|
| 572 | ZR1(JL)=0.0_JPRB |
---|
| 573 | PFDOWN(JL,KLEV+1) = ((1.0_JPRB-PCLEAR(JL))*PFDOWN(JL,KLEV+1)& |
---|
| 574 | & + PCLEAR(JL) * ZFD(JL,KLEV+1)) * RSUN(KNU) |
---|
| 575 | PCDOWN(JL,KLEV+1) = ZFD(JL,KLEV+1) * RSUN(KNU) |
---|
| 576 | ENDDO |
---|
| 577 | |
---|
| 578 | DO JK = 1 , KLEV |
---|
| 579 | IKL=KLEV+1-JK |
---|
| 580 | DO JL = KIDIA,KFDIA |
---|
| 581 | ZRR=1.0_JPRB/ZRMUE(JL,IKL) |
---|
| 582 | ZW1(JL) = ZW1(JL)+POZ(JL, IKL) * ZRR |
---|
| 583 | ZW4(JL,1) = ZW4(JL,1)+PUD(JL,4,IKL) * ZRR |
---|
| 584 | ZW5(JL,1) = ZW5(JL,1)+PUD(JL,5,IKL) * ZRR |
---|
| 585 | ZR4(JL,1) = EXP(-RSWCE(KNU)*ZW4(JL,1)-RSWCP(KNU)*ZW5(JL,1)) |
---|
| 586 | ENDDO |
---|
| 587 | |
---|
| 588 | CALL SWTT ( KIDIA,KFDIA,KLON, KNU, IABS, ZW1, ZR1 ) |
---|
| 589 | |
---|
| 590 | DO JL = KIDIA,KFDIA |
---|
| 591 | PDIFF(JL,IKL)=ZR1(JL)*ZR4(JL,1)*PFDOWN(JL,IKL)*RSUN(KNU)*(1.0_JPRB-PCLEAR(JL)) |
---|
| 592 | PDIRF(JL,IKL)=ZFD(JL,IKL)*RSUN(KNU)* PCLEAR(JL) |
---|
| 593 | PFDOWN(JL,IKL) = ((1.0_JPRB-PCLEAR(JL))*ZR1(JL)*ZR4(JL,1)*PFDOWN(JL,IKL)& |
---|
| 594 | & +PCLEAR(JL)*ZFD(JL,IKL)) * RSUN(KNU) |
---|
| 595 | PCDOWN(JL,IKL) = ZFD(JL,IKL) * RSUN(KNU) |
---|
| 596 | ENDDO |
---|
| 597 | ENDDO |
---|
| 598 | |
---|
| 599 | !* 6.2 UPWARD FLUXES |
---|
| 600 | ! ------------- |
---|
| 601 | |
---|
| 602 | DO JL = KIDIA,KFDIA |
---|
| 603 | PFUP(JL,1) = ((1.0_JPRB-PCLEAR(JL))*ZR1(JL)*ZR4(JL,1) * PFUP(JL,1)& |
---|
| 604 | & +PCLEAR(JL)*ZFU(JL,1)) * RSUN(KNU) |
---|
| 605 | PCUP(JL,1) = ZFU(JL,1) * RSUN(KNU) |
---|
| 606 | ENDDO |
---|
| 607 | |
---|
| 608 | DO JK = 2 , KLEV+1 |
---|
| 609 | IKM1=JK-1 |
---|
| 610 | DO JL = KIDIA,KFDIA |
---|
| 611 | ZW1(JL) = ZW1(JL)+POZ(JL ,IKM1)*1.66_JPRB |
---|
| 612 | ZW4(JL,1) = ZW4(JL,1)+PUD(JL,4,IKM1)*1.66_JPRB |
---|
| 613 | ZW5(JL,1) = ZW5(JL,1)+PUD(JL,5,IKM1)*1.66_JPRB |
---|
| 614 | ZR4(JL,1) = EXP(-RSWCE(KNU)*ZW4(JL,1)-RSWCP(KNU)*ZW5(JL,1)) |
---|
| 615 | ENDDO |
---|
| 616 | |
---|
| 617 | CALL SWTT ( KIDIA,KFDIA,KLON, KNU, IABS, ZW1, ZR1 ) |
---|
| 618 | |
---|
| 619 | DO JL = KIDIA,KFDIA |
---|
| 620 | PFUP(JL,JK) = ((1.0_JPRB-PCLEAR(JL))*ZR1(JL)*ZR4(JL,1) * PFUP(JL,JK)& |
---|
| 621 | & +PCLEAR(JL)*ZFU(JL,JK)) * RSUN(KNU) |
---|
| 622 | PCUP(JL,JK) = ZFU(JL,JK) * RSUN(KNU) |
---|
| 623 | ENDDO |
---|
| 624 | ENDDO |
---|
| 625 | |
---|
| 626 | IF(LLDEBUG) THEN |
---|
| 627 | call writefield_phy('swni_zfd_fin'//str1,ZFD,KLEV+1) |
---|
| 628 | call writefield_phy('swni_pcdown'//str1,PCDOWN,KLEV+1) |
---|
| 629 | ENDIF |
---|
| 630 | ! ------------------------------------------------------------------ |
---|
| 631 | |
---|
| 632 | IF (LHOOK) CALL DR_HOOK('SWNI',1,ZHOOK_HANDLE) |
---|
| 633 | END SUBROUTINE SWNI |
---|