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