[38] | 1 | SUBROUTINE callsedim(ngrid,nlay, ptimestep, |
---|
[358] | 2 | & pplev,zlev, pt, rdust, rice, |
---|
| 3 | & rsedcloud,rhocloud, |
---|
[38] | 4 | & pq, pdqfi, pdqsed,pdqs_sed,nq) |
---|
| 5 | IMPLICIT NONE |
---|
| 6 | |
---|
| 7 | c======================================================================= |
---|
| 8 | c Sedimentation of the Martian aerosols |
---|
| 9 | c depending on their density and radius |
---|
| 10 | c |
---|
| 11 | c F.Forget 1999 |
---|
| 12 | c |
---|
| 13 | c Modified by J.-B. Madeleine 2010: Now includes the doubleq |
---|
| 14 | c technique in order to have only one call to callsedim in |
---|
| 15 | c physiq.F. |
---|
| 16 | c |
---|
| 17 | c======================================================================= |
---|
| 18 | |
---|
| 19 | c----------------------------------------------------------------------- |
---|
| 20 | c declarations: |
---|
| 21 | c ------------- |
---|
| 22 | |
---|
| 23 | #include "dimensions.h" |
---|
| 24 | #include "dimphys.h" |
---|
| 25 | #include "comcstfi.h" |
---|
| 26 | #include "tracer.h" |
---|
| 27 | #include "callkeys.h" |
---|
| 28 | |
---|
| 29 | c |
---|
| 30 | c arguments: |
---|
| 31 | c ---------- |
---|
| 32 | |
---|
| 33 | INTEGER ngrid ! number of horizontal grid points |
---|
| 34 | INTEGER nlay ! number of atmospheric layers |
---|
| 35 | REAL ptimestep ! physics time step (s) |
---|
| 36 | REAL pplev(ngrid,nlay+1) ! pressure at inter-layers (Pa) |
---|
| 37 | REAL pt(ngrid,nlay) ! temperature at mid-layer (K) |
---|
| 38 | REAL zlev(ngrid,nlay+1) ! altitude at layer boundaries |
---|
| 39 | c Aerosol radius provided by the water ice microphysical scheme: |
---|
| 40 | REAL rdust(ngrid,nlay) ! Dust geometric mean radius (m) |
---|
| 41 | REAL rice(ngrid,nlay) ! Ice geometric mean radius (m) |
---|
| 42 | |
---|
| 43 | c Traceurs : |
---|
| 44 | integer nq ! number of tracers |
---|
| 45 | real pq(ngrid,nlay,nq) ! tracers (kg/kg) |
---|
| 46 | real pdqfi(ngrid,nlay,nq) ! tendency before sedimentation (kg/kg.s-1) |
---|
| 47 | real pdqsed(ngrid,nlay,nq) ! tendency due to sedimentation (kg/kg.s-1) |
---|
| 48 | real pdqs_sed(ngrid,nq) ! flux at surface (kg.m-2.s-1) |
---|
| 49 | |
---|
| 50 | c local: |
---|
| 51 | c ------ |
---|
| 52 | |
---|
| 53 | REAL CBRT |
---|
| 54 | EXTERNAL CBRT |
---|
| 55 | |
---|
| 56 | INTEGER l,ig, iq |
---|
| 57 | |
---|
| 58 | real zqi(ngridmx,nlayermx,nqmx) ! to locally store tracers |
---|
| 59 | real masse (ngridmx,nlayermx) ! Layer mass (kg.m-2) |
---|
| 60 | real epaisseur (ngridmx,nlayermx) ! Layer thickness (m) |
---|
| 61 | real wq(ngridmx,nlayermx+1) ! displaced tracer mass (kg.m-2) |
---|
[358] | 62 | real r0(ngridmx,nlayermx) ! geometric mean radius used for |
---|
| 63 | ! sedimentation (m) |
---|
| 64 | real r0dust(ngridmx,nlayermx) ! geometric mean radius used for |
---|
| 65 | ! dust (m) |
---|
| 66 | real r0ccn(ngridmx,nlayermx) ! geometric mean radius used for |
---|
| 67 | ! CCNs (m) |
---|
[38] | 68 | c Sedimentation radius of water ice |
---|
[358] | 69 | real rsedcloud(ngridmx,nlayermx) |
---|
| 70 | c Cloud density (kg.m-3) |
---|
| 71 | real rhocloud(ngridmx,nlayermx) |
---|
[38] | 72 | |
---|
[358] | 73 | |
---|
[38] | 74 | c Discrete size distributions (doubleq) |
---|
| 75 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 76 | c 1) Parameters used to represent the changes in fall |
---|
| 77 | c velocity as a function of particle size; |
---|
| 78 | integer nr,ir |
---|
| 79 | parameter (nr=12) !(nr=7) ! number of bins |
---|
| 80 | real rd(nr),qr(ngridmx,nlayermx,nr) |
---|
| 81 | real rdi(nr+1) ! extreme and intermediate radii |
---|
| 82 | real Sq(ngridmx,nlayermx) |
---|
| 83 | real rdmin,rdmax,rdimin,rdimax |
---|
| 84 | data rdmin/1.e-8/ !/1.e-7/ |
---|
| 85 | data rdmax/30.e-6/ |
---|
| 86 | data rdimin/1.e-10/ |
---|
| 87 | data rdimax/1e-4/ |
---|
| 88 | save rd, rdi |
---|
| 89 | |
---|
| 90 | c 2) Second size distribution for the log-normal integration |
---|
| 91 | c (the mass mixing ratio is computed for each radius) |
---|
| 92 | |
---|
| 93 | integer ninter, iint |
---|
| 94 | parameter (ninter=4) ! nombre de point entre chaque rayon rdi |
---|
| 95 | real rr(ninter,nr) |
---|
| 96 | save rr |
---|
| 97 | integer radpower |
---|
[358] | 98 | real sigma0 |
---|
[38] | 99 | |
---|
| 100 | c 3) Other local variables used in doubleq |
---|
| 101 | |
---|
| 102 | INTEGER idust_mass ! index of tracer containing dust mass |
---|
| 103 | ! mix. ratio |
---|
| 104 | INTEGER idust_number ! index of tracer containing dust number |
---|
| 105 | ! mix. ratio |
---|
[358] | 106 | INTEGER iccn_mass ! index of tracer containing CCN mass |
---|
| 107 | ! mix. ratio |
---|
| 108 | INTEGER iccn_number ! index of tracer containing CCN number |
---|
| 109 | ! mix. ratio |
---|
[38] | 110 | SAVE idust_mass,idust_number |
---|
[358] | 111 | SAVE iccn_mass,iccn_number |
---|
[38] | 112 | |
---|
| 113 | c Firstcall: |
---|
| 114 | |
---|
| 115 | LOGICAL firstcall |
---|
| 116 | SAVE firstcall |
---|
| 117 | DATA firstcall/.true./ |
---|
| 118 | |
---|
| 119 | c ** un petit test de coherence |
---|
| 120 | c -------------------------- |
---|
| 121 | |
---|
| 122 | IF (firstcall) THEN |
---|
| 123 | IF(ngrid.NE.ngridmx) THEN |
---|
| 124 | PRINT*,'STOP dans callsedim' |
---|
| 125 | PRINT*,'probleme de dimensions :' |
---|
| 126 | PRINT*,'ngrid =',ngrid |
---|
| 127 | PRINT*,'ngridmx =',ngridmx |
---|
| 128 | STOP |
---|
| 129 | ENDIF |
---|
| 130 | |
---|
| 131 | c Doubleq: initialization |
---|
| 132 | IF (doubleq) THEN |
---|
| 133 | do ir=1,nr |
---|
| 134 | rd(ir)= rdmin*(rdmax/rdmin)**(float(ir-1)/float(nr-1)) |
---|
| 135 | end do |
---|
| 136 | rdi(1)=rdimin |
---|
| 137 | do ir=2,nr |
---|
| 138 | rdi(ir)= sqrt(rd(ir-1)*rd(ir)) |
---|
| 139 | end do |
---|
| 140 | rdi(nr+1)=rdimax |
---|
| 141 | |
---|
| 142 | do ir=1,nr |
---|
| 143 | do iint=1,ninter |
---|
| 144 | rr(iint,ir)= |
---|
| 145 | & rdi(ir)* |
---|
| 146 | & (rdi(ir+1)/rdi(ir))**(float(iint-1)/float(ninter-1)) |
---|
| 147 | c write(*,*) rr(iint,ir) |
---|
| 148 | end do |
---|
| 149 | end do |
---|
| 150 | |
---|
| 151 | ! identify tracers corresponding to mass mixing ratio and |
---|
| 152 | ! number mixing ratio |
---|
| 153 | idust_mass=0 ! dummy initialization |
---|
| 154 | idust_number=0 ! dummy initialization |
---|
| 155 | |
---|
| 156 | do iq=1,nq |
---|
| 157 | if (noms(iq).eq."dust_mass") then |
---|
| 158 | idust_mass=iq |
---|
| 159 | endif |
---|
| 160 | if (noms(iq).eq."dust_number") then |
---|
| 161 | idust_number=iq |
---|
| 162 | endif |
---|
| 163 | enddo |
---|
| 164 | |
---|
| 165 | ! check that we did find the tracers |
---|
| 166 | if ((idust_mass.eq.0).or.(idust_number.eq.0)) then |
---|
| 167 | write(*,*) 'callsedim: error! could not identify' |
---|
| 168 | write(*,*) ' tracers for dust mass and number mixing' |
---|
| 169 | write(*,*) ' ratio and doubleq is activated!' |
---|
| 170 | stop |
---|
| 171 | endif |
---|
| 172 | ENDIF !of if (doubleq) |
---|
| 173 | |
---|
[358] | 174 | IF (scavenging) THEN |
---|
| 175 | iccn_mass=0 |
---|
| 176 | iccn_number=0 |
---|
| 177 | do iq=1,nq |
---|
| 178 | if (noms(iq).eq."ccn_mass") then |
---|
| 179 | iccn_mass=iq |
---|
| 180 | endif |
---|
| 181 | if (noms(iq).eq."ccn_number") then |
---|
| 182 | iccn_number=iq |
---|
| 183 | endif |
---|
| 184 | enddo |
---|
| 185 | ! check that we did find the tracers |
---|
| 186 | if ((iccn_mass.eq.0).or.(iccn_number.eq.0)) then |
---|
| 187 | write(*,*) 'callsedim: error! could not identify' |
---|
| 188 | write(*,*) ' tracers for ccn mass and number mixing' |
---|
| 189 | write(*,*) ' ratio and scavenging is activated!' |
---|
| 190 | stop |
---|
| 191 | endif |
---|
| 192 | ENDIF !of if (scavenging) |
---|
| 193 | |
---|
[38] | 194 | IF (water) THEN |
---|
| 195 | write(*,*) "water_param nueff Sedimentation:", nuice_sed |
---|
| 196 | IF (activice) THEN |
---|
| 197 | write(*,*) "water_param nueff Radiative:", nuice_ref |
---|
| 198 | ENDIF |
---|
| 199 | ENDIF |
---|
| 200 | |
---|
| 201 | firstcall=.false. |
---|
| 202 | ENDIF ! of IF (firstcall) |
---|
| 203 | |
---|
| 204 | c----------------------------------------------------------------------- |
---|
| 205 | c 1. Initialization |
---|
| 206 | c ----------------- |
---|
| 207 | |
---|
| 208 | zqi(1:ngrid,1:nlay,1:nqmx) = 0. |
---|
| 209 | c Updating the mass mixing ratio with the tendencies coming |
---|
| 210 | c from other parameterizations: |
---|
| 211 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 212 | |
---|
| 213 | do iq=1,nq |
---|
| 214 | do l=1,nlay |
---|
| 215 | do ig=1,ngrid |
---|
| 216 | zqi(ig,l,iq)=pq(ig,l,iq)+pdqfi(ig,l,iq)*ptimestep |
---|
| 217 | enddo |
---|
| 218 | enddo |
---|
| 219 | enddo |
---|
| 220 | |
---|
| 221 | c Computing the different layer properties |
---|
| 222 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 223 | c Mass (kg.m-2), thickness(m), crossing time (s) etc. |
---|
| 224 | |
---|
| 225 | do l=1,nlay |
---|
| 226 | do ig=1, ngrid |
---|
| 227 | masse(ig,l)=(pplev(ig,l) - pplev(ig,l+1)) /g |
---|
| 228 | epaisseur(ig,l)= zlev(ig,l+1) - zlev(ig,l) |
---|
| 229 | end do |
---|
| 230 | end do |
---|
| 231 | |
---|
| 232 | c ================================================================= |
---|
[358] | 233 | c Compute the geometric mean radius used for sedimentation |
---|
| 234 | |
---|
| 235 | if (doubleq) then |
---|
| 236 | do l=1,nlay |
---|
| 237 | do ig=1, ngrid |
---|
| 238 | r0dust(ig,l) = |
---|
| 239 | & CBRT(r3n_q*zqi(ig,l,idust_mass)/ |
---|
| 240 | & max(zqi(ig,l,idust_number),0.01)) |
---|
| 241 | r0dust(ig,l)=min(max(r0dust(ig,l),1.e-10),500.e-6) |
---|
| 242 | end do |
---|
| 243 | end do |
---|
| 244 | endif |
---|
| 245 | if (scavenging) then |
---|
| 246 | do l=1,nlay |
---|
| 247 | do ig=1, ngrid |
---|
| 248 | r0ccn(ig,l) = rsedcloud(ig,l)/(1.+nuice_sed)**4.5 |
---|
| 249 | end do |
---|
| 250 | end do |
---|
| 251 | endif |
---|
| 252 | |
---|
| 253 | c ================================================================= |
---|
[38] | 254 | do iq=1,nq |
---|
| 255 | if(radius(iq).gt.1.e-9) then ! no sedim for gaz |
---|
| 256 | |
---|
| 257 | c ----------------------------------------------------------------- |
---|
| 258 | c DOUBLEQ CASE |
---|
| 259 | c ----------------------------------------------------------------- |
---|
[358] | 260 | if ((doubleq.and. |
---|
[38] | 261 | & ((iq.eq.idust_mass).or. |
---|
[358] | 262 | & (iq.eq.idust_number))).or. |
---|
| 263 | & (scavenging.and. |
---|
| 264 | & ((iq.eq.iccn_mass).or. |
---|
| 265 | & (iq.eq.iccn_number)))) then |
---|
[38] | 266 | |
---|
| 267 | c Computing size distribution: |
---|
| 268 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 269 | |
---|
[358] | 270 | if ((iq.eq.idust_mass).or.(iq.eq.idust_number)) then |
---|
| 271 | do l=1,nlay |
---|
| 272 | do ig=1, ngrid |
---|
| 273 | r0(ig,l)=r0dust(ig,l) |
---|
| 274 | end do |
---|
[38] | 275 | end do |
---|
[358] | 276 | sigma0 = varian |
---|
| 277 | else |
---|
| 278 | do l=1,nlay |
---|
| 279 | do ig=1, ngrid |
---|
| 280 | r0(ig,l)=r0ccn(ig,l) |
---|
| 281 | end do |
---|
| 282 | end do |
---|
| 283 | sigma0 = sqrt(log(1.+nuice_sed)) |
---|
| 284 | endif |
---|
[38] | 285 | |
---|
| 286 | c Computing mass mixing ratio for each particle size |
---|
| 287 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[358] | 288 | IF ((iq.EQ.idust_mass).or.(iq.EQ.iccn_mass)) then |
---|
[38] | 289 | radpower = 2 |
---|
| 290 | ELSE |
---|
| 291 | radpower = -1 |
---|
| 292 | ENDIF |
---|
| 293 | Sq(1:ngrid,1:nlay) = 0. |
---|
| 294 | do ir=1,nr |
---|
| 295 | do l=1,nlay |
---|
| 296 | do ig=1,ngrid |
---|
| 297 | c **************** |
---|
| 298 | c Size distribution integration |
---|
| 299 | c (Trapezoid Integration Method) |
---|
| 300 | qr(ig,l,ir)=0.5*(rr(2,ir)-rr(1,ir))* |
---|
| 301 | & (rr(1,ir)**radpower)* |
---|
[358] | 302 | & exp(-(log(rr(1,ir)/r0(ig,l)))**2/(2*sigma0**2)) |
---|
[38] | 303 | do iint=2,ninter-1 |
---|
| 304 | qr(ig,l,ir)=qr(ig,l,ir) + |
---|
| 305 | & 0.5*(rr(iint+1,ir)-rr(iint-1,ir))* |
---|
| 306 | & (rr(iint,ir)**radpower)* |
---|
| 307 | & exp(-(log(rr(iint,ir)/r0(ig,l)))**2/ |
---|
[358] | 308 | & (2*sigma0**2)) |
---|
[38] | 309 | end do |
---|
| 310 | qr(ig,l,ir)=qr(ig,l,ir) + |
---|
| 311 | & 0.5*(rr(ninter,ir)-rr(ninter-1,ir))* |
---|
| 312 | & (rr(ninter,ir)**radpower)* |
---|
| 313 | & exp(-(log(rr(ninter,ir)/r0(ig,l)))**2/ |
---|
[358] | 314 | & (2*sigma0**2)) |
---|
[38] | 315 | |
---|
| 316 | c **************** old method (not recommended!) |
---|
| 317 | c qr(ig,l,ir)=(rd(ir)**(5-3*iq))* |
---|
[358] | 318 | c & exp( -(log(rd(ir)/r0(ig,l)))**2 / (2*sigma0**2) ) |
---|
[38] | 319 | c ****************************** |
---|
| 320 | |
---|
| 321 | Sq(ig,l)=Sq(ig,l)+qr(ig,l,ir) |
---|
| 322 | enddo |
---|
| 323 | enddo |
---|
| 324 | enddo |
---|
| 325 | |
---|
| 326 | do ir=1,nr |
---|
| 327 | do l=1,nlay |
---|
| 328 | do ig=1,ngrid |
---|
| 329 | qr(ig,l,ir) = zqi(ig,l,iq)*qr(ig,l,ir)/Sq(ig,l) |
---|
| 330 | enddo |
---|
| 331 | enddo |
---|
| 332 | enddo |
---|
| 333 | |
---|
| 334 | c Computing sedimentation for each tracer |
---|
| 335 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 336 | |
---|
| 337 | zqi(1:ngrid,1:nlay,iq) = 0. |
---|
| 338 | pdqs_sed(1:ngrid,iq) = 0. |
---|
| 339 | |
---|
| 340 | do ir=1,nr |
---|
[358] | 341 | IF ((iq.EQ.idust_mass).or.(iq.EQ.idust_number)) then |
---|
| 342 | call newsedim(ngrid,nlay,1,1,ptimestep, |
---|
| 343 | & pplev,masse,epaisseur,pt,rd(ir),rho_dust,qr(1,1,ir), |
---|
| 344 | & wq,0.5) |
---|
| 345 | ELSE |
---|
| 346 | call newsedim(ngrid,nlay,1,ngrid*nlay,ptimestep, |
---|
| 347 | & pplev,masse,epaisseur,pt,rd(ir),rhocloud,qr(1,1,ir), |
---|
| 348 | & wq,1.0) |
---|
| 349 | ENDIF |
---|
[38] | 350 | |
---|
| 351 | c Tendencies |
---|
| 352 | c ~~~~~~~~~~ |
---|
| 353 | do ig=1,ngrid |
---|
| 354 | pdqs_sed(ig,iq) = pdqs_sed(ig,iq) |
---|
| 355 | & + wq(ig,1)/ptimestep |
---|
| 356 | end do |
---|
| 357 | DO l = 1, nlay |
---|
| 358 | DO ig=1,ngrid |
---|
| 359 | zqi(ig,l,iq)=zqi(ig,l,iq)+qr(ig,l,ir) |
---|
| 360 | ENDDO |
---|
| 361 | ENDDO |
---|
| 362 | enddo ! of do ir=1,nr |
---|
| 363 | c ----------------------------------------------------------------- |
---|
| 364 | c WATER CYCLE CASE |
---|
| 365 | c ----------------------------------------------------------------- |
---|
| 366 | else if (water.and.(iq.eq.igcm_h2o_ice)) then |
---|
[358] | 367 | if (microphys) then |
---|
| 368 | call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay,ptimestep, |
---|
| 369 | & pplev,masse,epaisseur,pt,rsedcloud,rhocloud,zqi(1,1,iq), |
---|
| 370 | & wq,1.0) |
---|
| 371 | else |
---|
| 372 | call newsedim(ngrid,nlay,ngrid*nlay,1,ptimestep, |
---|
| 373 | & pplev,masse,epaisseur,pt,rsedcloud,rho_q(iq),zqi(1,1,iq), |
---|
| 374 | & wq,1.0) |
---|
| 375 | endif ! of if (microphys) |
---|
[38] | 376 | c Tendencies |
---|
| 377 | c ~~~~~~~~~~ |
---|
| 378 | do ig=1,ngrid |
---|
| 379 | pdqs_sed(ig,iq)=wq(ig,1)/ptimestep |
---|
| 380 | end do |
---|
| 381 | c ----------------------------------------------------------------- |
---|
| 382 | c GENERAL CASE |
---|
| 383 | c ----------------------------------------------------------------- |
---|
| 384 | else |
---|
[358] | 385 | call newsedim(ngrid,nlay,1,1,ptimestep, |
---|
[38] | 386 | & pplev,masse,epaisseur,pt,radius(iq),rho_q(iq), |
---|
| 387 | & zqi(1,1,iq),wq,1.0) |
---|
| 388 | c Tendencies |
---|
| 389 | c ~~~~~~~~~~ |
---|
| 390 | do ig=1,ngrid |
---|
| 391 | pdqs_sed(ig,iq)=wq(ig,1)/ptimestep |
---|
| 392 | end do |
---|
| 393 | endif ! of if doubleq and if water |
---|
| 394 | c ----------------------------------------------------------------- |
---|
| 395 | |
---|
[358] | 396 | c Compute the final tendency: |
---|
| 397 | c --------------------------- |
---|
[38] | 398 | DO l = 1, nlay |
---|
| 399 | DO ig=1,ngrid |
---|
| 400 | pdqsed(ig,l,iq)=(zqi(ig,l,iq)- |
---|
| 401 | $ (pq(ig,l,iq) + pdqfi(ig,l,iq)*ptimestep))/ptimestep |
---|
| 402 | ENDDO |
---|
| 403 | ENDDO |
---|
| 404 | |
---|
| 405 | endif ! of if(radius(iq).gt.1.e-9) |
---|
| 406 | c ================================================================= |
---|
| 407 | enddo ! of do iq=1,nq |
---|
| 408 | |
---|
[358] | 409 | c Update the dust particle size "rdust" |
---|
| 410 | c ------------------------------------- |
---|
| 411 | DO l = 1, nlay |
---|
| 412 | DO ig=1,ngrid |
---|
| 413 | rdust(ig,l)= |
---|
| 414 | & CBRT(r3n_q*zqi(ig,l,idust_mass)/ |
---|
| 415 | & max(zqi(ig,l,idust_number),0.01)) |
---|
| 416 | rdust(ig,l)=min(max(rdust(ig,l),1.e-10),500.e-6) |
---|
| 417 | ENDDO |
---|
| 418 | ENDDO |
---|
| 419 | |
---|
[38] | 420 | RETURN |
---|
| 421 | END |
---|
| 422 | |
---|