Changes in / [6985a98:d9f0585] in flexpart.git
- Files:
-
- 3 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
options/SPECIES/spec_overview
- Property mode changed from 100755 to 100644
-
src/advance.f90
r94735e2 ra652cd5 117 117 real :: usigold,vsigold,wsigold,r,rs 118 118 real :: uold,vold,wold,vdepo(maxspec) 119 real :: h1(2)120 119 !real uprof(nzmax),vprof(nzmax),wprof(nzmax) 121 120 !real usigprof(nzmax),vsigprof(nzmax),wsigprof(nzmax) … … 224 223 225 224 226 ! Determine the lower left corner and its distance to the current position227 !*************************************************************************228 229 ddx=xt-real(ix)230 ddy=yt-real(jy)231 rddx=1.-ddx232 rddy=1.-ddy233 p1=rddx*rddy234 p2=ddx*rddy235 p3=rddx*ddy236 p4=ddx*ddy237 238 ! Calculate variables for time interpolation239 !*******************************************240 241 dt1=real(itime-memtime(1))242 dt2=real(memtime(2)-itime)243 dtt=1./(dt1+dt2)244 245 225 ! Compute maximum mixing height around particle position 246 226 !******************************************************* … … 249 229 if (ngrid.le.0) then 250 230 do k=1,2 251 mind=memind(k) ! eso: compatibility with 3-field version 252 if (interpolhmix) then 253 h1(k)=p1*hmix(ix ,jy ,1,mind) & 254 + p2*hmix(ixp,jy ,1,mind) & 255 + p3*hmix(ix ,jyp,1,mind) & 256 + p4*hmix(ixp,jyp,1,mind) 257 else 258 do j=jy,jyp 259 do i=ix,ixp 260 if (hmix(i,j,1,mind).gt.h) h=hmix(i,j,1,mind) 261 end do 262 end do 263 endif 231 mind=memind(k) ! eso: compatibility with 3-field version 232 do j=jy,jyp 233 do i=ix,ixp 234 if (hmix(i,j,1,mind).gt.h) h=hmix(i,j,1,mind) 235 end do 236 end do 264 237 end do 265 238 tropop=tropopause(nix,njy,1,1) … … 276 249 endif 277 250 278 if (interpolhmix) h=(h1(1)*dt2+h1(2)*dt1)*dtt279 251 zeta=zt/h 280 252 … … 474 446 endif 475 447 476 if (turboff) then477 !sec switch off turbulence478 up=0.0479 vp=0.0480 wp=0.0481 delz=0.482 endif483 484 448 !**************************************************** 485 449 ! Compute turbulent vertical displacement of particle … … 683 647 endif 684 648 685 if (turboff) then686 !sec switch off turbulence687 ux=0.0688 vy=0.0689 wp=0.0690 endif691 649 692 650 ! If particle represents only a single species, add gravitational settling -
src/com_mod.f90
r5888298 rc8fc724 577 577 real :: dxoutn,dyoutn,outlon0n,outlat0n,xoutshiftn,youtshiftn 578 578 !real outheight(maxzgrid),outheighthalf(maxzgrid) 579 580 579 logical :: DEP,DRYDEP,DRYDEPSPEC(maxspec),WETDEP,WETDEPSPEC(maxspec),& 581 580 & OHREA,ASSSPEC 582 logical :: DRYBKDEP,WETBKDEP583 581 584 582 ! numxgrid,numygrid number of grid points in x,y-direction … … 600 598 ! OHREA .true., if OH reaction is switched on 601 599 ! ASSSPEC .true., if there are two species asscoiated 602 ! DRYBKDEP,WETBKDEP .true., for bkwd runs, where mass deposited and source regions is calculated - either for dry or for wet deposition603 600 ! (i.e. transfer of mass between these two occurs 604 601 … … 671 668 real, allocatable, dimension(:) :: ztra1 672 669 real, allocatable, dimension(:,:) :: xmass1 673 real, allocatable, dimension(:,:) :: xscav_frac1674 670 675 671 ! eso: Moved from timemanager … … 692 688 ! xtra1,ytra1,ztra1 spatial positions of the particles 693 689 ! xmass1 [kg] particle masses 694 ! xscav_frac1 fraction of particle masse which has been scavenged at receptor 695 690 696 691 697 692 … … 755 750 integer :: mpi_mode=0 ! .gt. 0 if running MPI version 756 751 logical :: lroot=.true. ! true if serial version, or if MPI .and. root process 757 758 logical :: usekernel=.false. ! true if the output kernel shall be switched on759 logical :: interpolhmix=.false. ! true if the hmix shall be interpolated760 logical :: turboff=.false. ! true if the turbulence shall be switched off761 762 752 763 753 contains -
src/conccalc.f90
r9287c01 r4c64400 21 21 22 22 subroutine conccalc(itime,weight) 23 ! 23 ! i i 24 24 !***************************************************************************** 25 25 ! * … … 59 59 real :: xl,yl,wx,wy,w 60 60 real,parameter :: factor=.596831, hxmax=6.0, hymax=4.0, hzmax=150. 61 ! integer xscav_count 61 62 62 63 63 ! For forward simulations, make a loop over the number of species; … … 65 65 ! releasepoints 66 66 !*************************************************************************** 67 ! xscav_count=0 67 68 68 do i=1,numpart 69 69 if (itra1(i).ne.itime) goto 20 … … 76 76 33 continue 77 77 78 ! if (xscav_frac1(i,1).lt.0) xscav_count=xscav_count+1 79 78 80 79 ! For special runs, interpolate the air density to the particle position 81 80 !************************************************************************ … … 173 172 if (yl.lt.0.) jy=jy-1 174 173 174 ! if (i.eq.10000) write(*,*) itime,xtra1(i),ytra1(i),ztra1(i),xl,yl 175 175 176 176 … … 183 183 if (lnokernel.or.(itage.lt.10800).or.(xl.lt.0.5).or.(yl.lt.0.5).or. & 184 184 (xl.gt.real(numxgrid-1)-0.5).or. & 185 (yl.gt.real(numygrid-1)-0.5)) )then ! no kernel, direct attribution to grid cell185 (yl.gt.real(numygrid-1)-0.5)) then ! no kernel, direct attribution to grid cell 186 186 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & 187 187 (jy.le.numygrid-1)) then 188 if (DRYBKDEP.or.WETBKDEP) then 189 do ks=1,nspec 190 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 191 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 192 xmass1(i,ks)/rhoi*weight*max(xscav_frac1(i,ks),0.0) 193 end do 194 else 195 do ks=1,nspec 196 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 188 do ks=1,nspec 189 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 197 190 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 198 191 xmass1(i,ks)/rhoi*weight 199 end do 200 endif 201 endif 202 203 else ! attribution via uniform kernel 192 end do 193 endif 194 195 else ! attribution via uniform kernel 204 196 205 197 ddx=xl-real(ix) ! distance to left cell border … … 228 220 if ((jy.ge.0).and.(jy.le.numygrid-1)) then 229 221 w=wx*wy 230 if (DRYBKDEP.or.WETBKDEP) then 231 do ks=1,nspec 232 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 233 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 234 xmass1(i,ks)/rhoi*w*weight*max(xscav_frac1(i,ks),0.0) 235 end do 236 else 237 do ks=1,nspec 238 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 222 do ks=1,nspec 223 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 239 224 gridunc(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 240 225 xmass1(i,ks)/rhoi*weight*w 241 end do 242 endif 226 end do 243 227 endif 244 228 245 229 if ((jyp.ge.0).and.(jyp.le.numygrid-1)) then 246 230 w=wx*(1.-wy) 247 if (DRYBKDEP.or.WETBKDEP) then 248 do ks=1,nspec 249 gridunc(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 250 gridunc(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 251 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 252 end do 253 else 254 do ks=1,nspec 255 gridunc(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 231 do ks=1,nspec 232 gridunc(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 256 233 gridunc(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 257 234 xmass1(i,ks)/rhoi*weight*w 258 end do 259 endif 260 endif 261 endif !ix ge 0 235 end do 236 endif 237 endif 262 238 263 239 … … 265 241 if ((jyp.ge.0).and.(jyp.le.numygrid-1)) then 266 242 w=(1.-wx)*(1.-wy) 267 if (DRYBKDEP.or.WETBKDEP) then 268 do ks=1,nspec 269 gridunc(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 270 gridunc(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 271 xmass1(i,ks)/rhoi*w*weight*max(xscav_frac1(i,ks),0.0) 272 end do 273 else 274 do ks=1,nspec 275 gridunc(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 243 do ks=1,nspec 244 gridunc(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 276 245 gridunc(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 277 246 xmass1(i,ks)/rhoi*weight*w 278 end do 279 endif 247 end do 280 248 endif 281 249 282 250 if ((jy.ge.0).and.(jy.le.numygrid-1)) then 283 251 w=(1.-wx)*wy 284 if (DRYBKDEP.or.WETBKDEP) then 285 do ks=1,nspec 286 gridunc(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 287 gridunc(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 288 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 289 end do 290 else 291 do ks=1,nspec 292 gridunc(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 252 do ks=1,nspec 253 gridunc(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 293 254 gridunc(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 294 255 xmass1(i,ks)/rhoi*weight*w 295 end do 296 endif 297 endif 298 endif !ixp ge 0 299 endif 256 end do 257 endif 258 endif 259 endif 260 261 300 262 301 263 !************************************ … … 320 282 if ((itage.lt.10800).or.(xl.lt.0.5).or.(yl.lt.0.5).or. & 321 283 (xl.gt.real(numxgridn-1)-0.5).or. & 322 (yl.gt.real(numygridn-1)-0.5) .or.(.not.usekernel)) then ! no kernel, direct attribution to grid cell284 (yl.gt.real(numygridn-1)-0.5)) then ! no kernel, direct attribution to grid cell 323 285 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgridn-1).and. & 324 286 (jy.le.numygridn-1)) then 325 if (DRYBKDEP.or.WETBKDEP) then 326 do ks=1,nspec 327 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 328 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 329 xmass1(i,ks)/rhoi*weight*max(xscav_frac1(i,ks),0.0) 330 end do 331 else 332 do ks=1,nspec 333 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 287 do ks=1,nspec 288 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 334 289 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 335 290 xmass1(i,ks)/rhoi*weight 336 end do 337 endif 291 end do 338 292 endif 339 293 … … 365 319 if ((jy.ge.0).and.(jy.le.numygridn-1)) then 366 320 w=wx*wy 367 if (DRYBKDEP.or.WETBKDEP) then 368 do ks=1,nspec 369 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 370 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 371 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 372 end do 373 else 374 do ks=1,nspec 375 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 321 do ks=1,nspec 322 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)= & 376 323 griduncn(ix,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 377 324 xmass1(i,ks)/rhoi*weight*w 378 end do 379 endif 325 end do 380 326 endif 381 327 382 328 if ((jyp.ge.0).and.(jyp.le.numygridn-1)) then 383 329 w=wx*(1.-wy) 384 if (DRYBKDEP.or.WETBKDEP) then 385 do ks=1,nspec 386 griduncn(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 387 griduncn(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 388 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 389 end do 390 else 391 do ks=1,nspec 392 griduncn(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 330 do ks=1,nspec 331 griduncn(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 393 332 griduncn(ix,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 394 333 xmass1(i,ks)/rhoi*weight*w 395 end do 396 endif 334 end do 397 335 endif 398 336 endif … … 402 340 if ((jyp.ge.0).and.(jyp.le.numygridn-1)) then 403 341 w=(1.-wx)*(1.-wy) 404 if (DRYBKDEP.or.WETBKDEP) then 405 do ks=1,nspec 406 griduncn(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 407 griduncn(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 408 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 409 end do 410 else 411 do ks=1,nspec 412 griduncn(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 342 do ks=1,nspec 343 griduncn(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)= & 413 344 griduncn(ixp,jyp,kz,ks,nrelpointer,nclass(i),nage)+ & 414 345 xmass1(i,ks)/rhoi*weight*w 415 end do 416 endif 346 end do 417 347 endif 418 348 419 349 if ((jy.ge.0).and.(jy.le.numygridn-1)) then 420 350 w=(1.-wx)*wy 421 if (DRYBKDEP.or.WETBKDEP) then 422 do ks=1,nspec 423 griduncn(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 424 griduncn(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 425 xmass1(i,ks)/rhoi*weight*w*max(xscav_frac1(i,ks),0.0) 426 end do 427 else 428 do ks=1,nspec 429 griduncn(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 351 do ks=1,nspec 352 griduncn(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)= & 430 353 griduncn(ixp,jy,kz,ks,nrelpointer,nclass(i),nage)+ & 431 354 xmass1(i,ks)/rhoi*weight*w 432 end do 433 endif 355 end do 434 356 endif 435 357 endif 436 358 endif 359 437 360 endif 438 361 endif 439 362 20 continue 440 363 end do 441 ! write(*,*) 'xscav count:',xscav_count442 364 443 365 !*********************************************************************** -
src/concoutput.f90
r16b61a5 r16b61a5 246 246 247 247 write(anspec,'(i3.3)') ks 248 249 if (DRYBKDEP.or.WETBKDEP) then !scavdep output 250 if (DRYBKDEP) & 251 open(unitoutgrid,file=path(2)(1:length(2))//'grid_drydep_'//adate// & 248 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 249 if (ldirect.eq.1) then 250 open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// & 251 atime//'_'//anspec,form='unformatted') 252 else 253 open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// & 254 atime//'_'//anspec,form='unformatted') 255 endif 256 write(unitoutgrid) itime 257 endif 258 259 if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio 260 open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// & 252 261 atime//'_'//anspec,form='unformatted') 253 if (WETBKDEP) & 254 open(unitoutgrid,file=path(2)(1:length(2))//'grid_wetdep_'//adate// & 255 atime//'_'//anspec,form='unformatted') 256 write(unitoutgrid) itime 257 else 258 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 259 if (ldirect.eq.1) then 260 open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// & 261 atime//'_'//anspec,form='unformatted') 262 else 263 open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// & 264 atime//'_'//anspec,form='unformatted') 265 endif 266 write(unitoutgrid) itime 267 endif 268 if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio 269 open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// & 270 atime//'_'//anspec,form='unformatted') 271 write(unitoutgridppt) itime 272 endif 273 endif ! if deposition output 262 263 write(unitoutgridppt) itime 264 endif 274 265 275 266 do kp=1,maxpointspec_act … … 351 342 ! Concentration output 352 343 !********************* 353 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5) .or.(iout.eq.6)) then344 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 354 345 355 346 ! Wet deposition -
src/drydepokernel.f90
r1c0d5e6 r4c64400 102 102 if ((abs(deposit(ks)).gt.0).and.DRYDEPSPEC(ks)) then 103 103 104 if (.not.usekernel) then 105 drygridunc(ix,jy,ks,kp,nunc,nage)= & 106 drygridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks) 107 else 108 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & 104 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & 109 105 (jy.le.numygrid-1)) then 110 w=wx*wy 111 drygridunc(ix,jy,ks,kp,nunc,nage)= & 112 drygridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w 113 endif 106 w=wx*wy 107 drygridunc(ix,jy,ks,kp,nunc,nage)= & 108 drygridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w 109 continue 110 endif 114 111 115 112 if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgrid-1).and. & 116 113 (jyp.le.numygrid-1)) then 117 114 w=(1.-wx)*(1.-wy) 118 115 drygridunc(ixp,jyp,ks,kp,nunc,nage)= & 119 116 drygridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w 120 117 endif 121 118 122 119 if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgrid-1).and. & 123 120 (jy.le.numygrid-1)) then 124 121 w=(1.-wx)*wy 125 122 drygridunc(ixp,jy,ks,kp,nunc,nage)= & 126 123 drygridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w 127 124 endif 128 125 129 126 if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgrid-1).and. & 130 127 (jyp.le.numygrid-1)) then 131 128 w=wx*(1.-wy) 132 129 drygridunc(ix,jyp,ks,kp,nunc,nage)= & 133 130 drygridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w 134 131 endif 135 132 136 endif ! kernel 137 endif ! deposit>0 133 endif 138 134 139 135 end do -
src/ecmwf_mod.f90
r842074e r62e65c7 43 43 44 44 ! integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !ECMWF new 45 integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 46 ! integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 0.5 47 integer,parameter :: nxshift=359 48 ! integer,parameter :: nxshift=718 45 integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 46 integer,parameter :: nxshift=359 49 47 ! integer,parameter :: nxshift=0 50 48 -
src/getfields.f90
rd1a8707 r8a65cb0 138 138 40 indmin=indj 139 139 140 if (WETBKDEP) then141 call writeprecip(itime,memind(1))142 endif143 144 140 else 145 141 … … 173 169 60 indmin=indj 174 170 175 if (WETBKDEP) then176 call writeprecip(itime,memind(1))177 endif178 179 171 endif 180 172 -
src/interpol_rain.f90
rc7e771d r8a65cb0 21 21 22 22 subroutine interpol_rain(yy1,yy2,yy3,nxmax,nymax,nzmax,nx, & 23 ny, iwftouse,xt,yt,level,itime1,itime2,itime,yint1,yint2,yint3)23 ny,memind,xt,yt,level,itime1,itime2,itime,yint1,yint2,yint3) 24 24 ! i i i i i i i 25 25 !i i i i i i i i o o o … … 77 77 real :: ddx,ddy,rddx,rddy,dt1,dt2,dt,y1(2),y2(2),y3(2) 78 78 real :: xt,yt,yint1,yint2,yint3,p1,p2,p3,p4 79 integer :: iwftouse80 79 81 80 … … 114 113 !*********************** 115 114 116 !do m=1,2117 indexh= iwftouse115 do m=1,2 116 indexh=memind(m) 118 117 119 y1(1)=p1*yy1(ix ,jy ,level,indexh) & 118 119 y1(m)=p1*yy1(ix ,jy ,level,indexh) & 120 120 + p2*yy1(ixp,jy ,level,indexh) & 121 121 + p3*yy1(ix ,jyp,level,indexh) & 122 122 + p4*yy1(ixp,jyp,level,indexh) 123 y2( 1)=p1*yy2(ix ,jy ,level,indexh) &123 y2(m)=p1*yy2(ix ,jy ,level,indexh) & 124 124 + p2*yy2(ixp,jy ,level,indexh) & 125 125 + p3*yy2(ix ,jyp,level,indexh) & 126 126 + p4*yy2(ixp,jyp,level,indexh) 127 y3( 1)=p1*yy3(ix ,jy ,level,indexh) &127 y3(m)=p1*yy3(ix ,jy ,level,indexh) & 128 128 + p2*yy3(ixp,jy ,level,indexh) & 129 129 + p3*yy3(ix ,jyp,level,indexh) & 130 130 + p4*yy3(ixp,jyp,level,indexh) 131 !end do131 end do 132 132 133 133 134 134 !************************************ 135 ! 2.) Temporal interpolation (linear) - skip to be consistent with clouds135 ! 2.) Temporal interpolation (linear) 136 136 !************************************ 137 137 138 !dt1=real(itime-itime1)139 !dt2=real(itime2-itime)140 !dt=dt1+dt2138 dt1=real(itime-itime1) 139 dt2=real(itime2-itime) 140 dt=dt1+dt2 141 141 142 !yint1=(y1(1)*dt2+y1(2)*dt1)/dt143 !yint2=(y2(1)*dt2+y2(2)*dt1)/dt144 !yint3=(y3(1)*dt2+y3(2)*dt1)/dt142 yint1=(y1(1)*dt2+y1(2)*dt1)/dt 143 yint2=(y2(1)*dt2+y2(2)*dt1)/dt 144 yint3=(y3(1)*dt2+y3(2)*dt1)/dt 145 145 146 yint1=y1(1)147 yint2=y2(1)148 yint3=y3(1)149 146 150 147 end subroutine interpol_rain -
src/interpol_vdep.f90
r5844866 re200b7a 54 54 55 55 ! a) Bilinear horizontal interpolation 56 ! write(*,*) 'interpol: ',dt1,dt2,dtt,lsynctime,ix,jy 56 57 57 do m=1,2 58 58 indexh=memind(m) -
src/makefile
rd1a8707 r4c64400 68 68 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff # -fopenmp 69 69 70 FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER) #-Warray-bounds -fcheck=all# -march=native70 FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER) # -march=native 71 71 72 72 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Wall -fdump-core $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -Warray-bounds -fcheck=all … … 144 144 advance.o initialize.o \ 145 145 writeheader.o writeheader_txt.o \ 146 writeprecip.o \147 146 writeheader_surf.o assignland.o\ 148 147 part0.o gethourlyOH.o\ … … 153 152 erf.o readavailable.o \ 154 153 ew.o readreleases.o \ 155 readdepo.o get_vdep_prob.o \ 156 get_wetscav.o \ 154 readdepo.o \ 157 155 psim.o outgrid_init.o \ 158 156 outgrid_init_nest.o \ … … 273 271 274 272 ## DEPENDENCIES 275 get_vdep_prob.o: cmapf_mod.o com_mod.o hanna_mod.o interpol_mod.o par_mod.o \276 point_mod.o random_mod.o277 273 advance.o: cmapf_mod.o com_mod.o hanna_mod.o interpol_mod.o par_mod.o \ 278 274 point_mod.o random_mod.o … … 428 424 verttransform_gfs.o: cmapf_mod.o com_mod.o par_mod.o 429 425 verttransform_nests.o: com_mod.o par_mod.o 430 get_wetscav.o: com_mod.o par_mod.o point_mod.o431 426 wetdepo.o: com_mod.o par_mod.o point_mod.o 432 427 wetdepokernel.o: com_mod.o par_mod.o unc_mod.o 433 428 wetdepokernel_nest.o: com_mod.o par_mod.o unc_mod.o 434 429 writeheader.o: com_mod.o outg_mod.o par_mod.o point_mod.o 435 writeprecip.o: com_mod.o par_mod.o point_mod.o436 430 writeheader_nest.o: com_mod.o outg_mod.o par_mod.o point_mod.o 437 431 writeheader_nest_surf.o: com_mod.o outg_mod.o par_mod.o point_mod.o -
src/par_mod.f90
rd1a8707 r4c64400 194 194 integer,parameter :: maxpart=10000000 195 195 integer,parameter :: maxspec=4 196 197 196 real,parameter :: minmass=0.0001 198 197 … … 259 258 integer,parameter :: unitlsm=1, unitsurfdata=1, unitland=1, unitwesely=1 260 259 integer,parameter :: unitOH=1 261 integer,parameter :: unitdates=94, unitheader=90,unitheader_txt=100, unitshortpart=95 , unitprecip=101260 integer,parameter :: unitdates=94, unitheader=90,unitheader_txt=100, unitshortpart=95 262 261 integer,parameter :: unitboundcond=89 263 262 integer,parameter :: unittmp=101 -
src/readcommand.f90
r8ee24a5 r4c64400 298 298 !Af 1 = mass units 299 299 !Af 2 = mass mixing ratio units 300 ! 3 = wet deposition in outputfield301 ! 4 = dry deposition in outputfield302 300 303 301 if ( ldirect .eq. 1 ) then ! FWD-Run … … 322 320 endif 323 321 !Af set release-switch 324 WETBKDEP=.false. 325 DRYBKDEP=.false. 326 select case (ind_receptor) 327 case (1) ! 1 .. concentration at receptor 322 if (ind_receptor .eq. 1) then !mass 328 323 ind_rel = 1 329 case (2) ! 2 .. mixing ratio at receptor324 else ! mass mix 330 325 ind_rel = 0 331 case (3) ! 3 .. wet deposition in outputfield 332 ind_rel = 3 333 write(*,*) ' #### FLEXPART WET DEPOSITION BACKWARD MODE #### ' 334 write(*,*) ' #### Releaseheight is forced to 0 - 20km #### ' 335 write(*,*) ' #### Release is performed above ground lev #### ' 336 WETBKDEP=.true. 337 allocate(xscav_frac1(maxpart,maxspec)) 338 case (4) ! 4 .. dry deposition in outputfield 339 ind_rel = 4 340 write(*,*) ' #### FLEXPART DRY DEPOSITION BACKWARD MODE #### ' 341 write(*,*) ' #### Releaseheight is forced to 0 - 2*href #### ' 342 write(*,*) ' #### Release is performed above ground lev #### ' 343 DRYBKDEP=.true. 344 allocate(xscav_frac1(maxpart,maxspec)) 345 end select 326 endif 346 327 endif 347 328 … … 405 386 !********************************************************************** 406 387 407 if ((iout.lt.1).or.(iout.gt. 6)) then388 if ((iout.lt.1).or.(iout.gt.5)) then 408 389 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 409 write(*,*) ' #### IOUT MUST BE 1, 2, 3, 4 OR 5 FOR#### '390 write(*,*) ' #### IOUT MUST BE 1, 2, 3, 4, OR 5 FOR #### ' 410 391 write(*,*) ' #### STANDARD FLEXPART OUTPUT OR 9 - 13 #### ' 411 392 write(*,*) ' #### FOR NETCDF OUTPUT #### ' -
src/readreleases.f90
rc8fc724 rc8fc724 521 521 endif 522 522 523 ! If FLEXPART is run for backward deposition force zpoint524 !*********************************************************************525 if (WETBKDEP) then526 zpoint1(numpoint)=0.527 zpoint2(numpoint)=20000.528 kindz(numpoint)=1529 endif530 if (DRYBKDEP) then531 zpoint1(numpoint)=0.532 zpoint2(numpoint)=2.*href533 kindz(numpoint)=1534 endif535 536 537 523 ! Check whether x coordinates of release point are within model domain 538 524 !********************************************************************* -
src/releaseparticles.f90
r75a4ded r8a65cb0 176 176 ! scaled. Adjust the mass per particle by the species-dependent time correction factor 177 177 ! divided by the species-average one 178 ! for the scavenging calculation the mass needs to be multiplied with rho of the particle layer and179 ! divided by the sum of rho of all particles.180 178 !***************************************************************************** 181 179 do k=1,nspec 182 180 xmass1(ipart,k)=xmass(i,k)/real(npart(i)) & 183 181 *timecorrect(k)/average_timecorrect 184 if (DRYBKDEP.or.WETBKDEP) then ! if there is no scavenging in wetdepo it will be set to 0 185 ! if ( henry(k).gt.0 .or. & 186 ! crain_aero(k).gt.0. .or. csnow_aero(k).gt.0. .or. & 187 ! ccn_aero(k).gt.0. .or. in_aero(k).gt.0. ) then 188 xscav_frac1(ipart,k)=-1. 189 endif 182 ! write (*,*) 'xmass1: ',xmass1(ipart,k),ipart,k 190 183 ! Assign certain properties to particle 191 184 !************************************** … … 209 202 210 203 ztra1(ipart)=zpoint1(i)+ran1(idummy)*zaux 204 211 205 ! Interpolation of topography and density 212 206 !**************************************** … … 336 330 !Af ind_rel is defined in readcommand.f 337 331 338 if ( (ind_rel .eq. 1).or.(ind_rel .eq. 3).or.(ind_rel .eq. 4)) then332 if (ind_rel .eq. 1) then 339 333 340 334 ! Interpolate the air density … … 381 375 endif 382 376 377 383 378 numpart=max(numpart,ipart) 384 379 goto 34 ! Storage space has been found, stop searching 385 380 endif 386 end do ! i=1:numpoint381 end do 387 382 if (ipart.gt.maxpart) goto 996 388 383 389 384 34 minpart=ipart+1 390 end do ! ipart=minpart,maxpart391 endif ! j=1,numrel385 end do 386 endif 392 387 end do 393 388 -
src/timemanager.f90
rd1a8707 r18adf60 105 105 ! integer :: ksp 106 106 integer :: loutnext,loutstart,loutend 107 integer :: ix,jy,ldeltat,itage,nage ,idummy107 integer :: ix,jy,ldeltat,itage,nage 108 108 integer :: i_nan=0,ii_nan,total_nan_intl=0 !added by mc to check instability in CBL scheme 109 real :: outnum,weight,prob _rec(maxspec),prob(maxspec),decfact,wetscav(maxspec)109 real :: outnum,weight,prob(maxspec),decfact 110 110 ! real :: uap(maxpart),ucp(maxpart),uzp(maxpart) 111 111 ! real :: us(maxpart),vs(maxpart),ws(maxpart) … … 114 114 real(dep_prec) :: drydeposit(maxspec),wetgridtotalunc,drygridtotalunc 115 115 real :: xold,yold,zold,xmassfract 116 real :: grfraction(3)117 116 real, parameter :: e_inv = 1.0/exp(1.0) 118 119 117 !double precision xm(maxspec,maxpointspec_act), 120 118 ! + xm_depw(maxspec,maxpointspec_act), … … 147 145 !CGZ-lifetime: set lifetime to 0 148 146 149 if (.not.usekernel) write(*,*) 'Not using the kernel'150 if (turboff) write(*,*) 'Turbulence switched off'151 152 147 write(*,46) float(itime)/3600,itime,numpart 153 148 … … 546 541 zold=ztra1(j) 547 542 548 549 ! RECEPTOR: dry/wet depovel550 !****************************551 ! Before the particle is moved552 ! the calculation of the scavenged mass shall only be done once after release553 ! xscav_frac1 was initialised with a negative value554 555 if (DRYBKDEP) then556 do ks=1,nspec557 if ((xscav_frac1(j,ks).lt.0)) then558 call get_vdep_prob(itime,xtra1(j),ytra1(j),ztra1(j),prob_rec)559 if (DRYDEPSPEC(ks)) then ! dry deposition560 xscav_frac1(j,ks)=prob_rec(ks)561 else562 xmass1(j,ks)=0.563 xscav_frac1(j,ks)=0.564 endif565 endif566 enddo567 endif568 569 if (WETBKDEP) then570 do ks=1,nspec571 if ((xscav_frac1(j,ks).lt.0)) then572 call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy,wetscav)573 if (wetscav(ks).gt.0) then574 xscav_frac1(j,ks)=wetscav(ks)* &575 (zpoint2(npoint(j))-zpoint1(npoint(j)))*grfraction(1)576 else577 xmass1(j,ks)=0.578 xscav_frac1(j,ks)=0.579 endif580 endif581 enddo582 endif583 584 543 ! Integrate Lagevin equation for lsynctime seconds 585 544 !************************************************* 586 545 587 if (verbosity.gt.0) then588 if (j.eq.1) then589 write (*,*) 'timemanager> call advance'590 endif591 endif592 593 546 call advance(itime,npoint(j),idt(j),uap(j),ucp(j),uzp(j), & 594 547 us(j),vs(j),ws(j),nstop,xtra1(j),ytra1(j),ztra1(j),prob, & 595 548 cbt(j)) 596 ! write (*,*) 'advance: ',prob(1),xmass1(j,1),ztra1(j)597 549 598 550 ! Calculate the gross fluxes across layer interfaces -
src/verttransform.f90
r6481010 r341f4b7 91 91 92 92 logical :: init = .true. 93 logical :: init_w = .false.94 logical :: init_r = .false.95 96 93 97 94 !ZHG SEP 2014 tests … … 106 103 ! CHARACTER(LEN=3) :: aspec 107 104 ! integer :: virr=0 108 !real :: tot_cloud_h109 !real :: dbg_height(nzmax)105 real :: tot_cloud_h 106 real :: dbg_height(nzmax) 110 107 !ZHG 111 108 … … 126 123 if (init) then 127 124 128 129 if (init_r) then130 131 open(333,file='heights.txt', &132 form='formatted')133 do kz=1,nuvz134 read(333,*) height(kz)135 end do136 close(333)137 write(*,*) 'height read'138 else139 140 141 125 ! Search for a point with high surface pressure (i.e. not above significant topography) 142 126 ! Then, use this point to construct a reference z profile, to be used at all times … … 177 161 end do 178 162 179 if (init_w) then180 open(333,file='heights.txt', &181 form='formatted')182 do kz=1,nuvz183 write(333,*) height(kz)184 end do185 close(333)186 endif187 188 endif ! init189 163 190 164 ! Determine highest levels that can be within PBL … … 204 178 init=.false. 205 179 206 !dbg_height = height180 dbg_height = height 207 181 208 182 endif … … 624 598 convp=convprec(ix,jy,1,n) 625 599 prec=lsp+convp 626 !tot_cloud_h=0600 tot_cloud_h=0 627 601 ! Find clouds in the vertical 628 602 do kz=1, nz-1 !go from top to bottom … … 630 604 ! assuming rho is in kg/m3 and hz in m gives: kg/kg * kg/m3 *m3/kg /m = m2/m3 631 605 clw(ix,jy,kz,n)=(clwc(ix,jy,kz,n)*rho(ix,jy,kz,n))*(height(kz+1)-height(kz)) 632 !tot_cloud_h=tot_cloud_h+(height(kz+1)-height(kz))606 tot_cloud_h=tot_cloud_h+(height(kz+1)-height(kz)) 633 607 634 608 ! icloud_stats(ix,jy,4,n)= icloud_stats(ix,jy,4,n)+clw(ix,jy,kz,n) ! Column cloud water [m3/m3] -
src/wetdepo.f90
rc8fc724 rc8fc724 42 42 ! * 43 43 ! Variables: * 44 ! cc [0-1] total cloud cover * 45 ! convp [mm/h] convective precipitation rate * 46 ! grfraction [0-1] fraction of grid, for which precipitation occurs * 44 47 ! ix,jy indices of output grid cell for each particle * 45 48 ! itime [s] actual simulation time [s] * 46 49 ! jpart particle index * 47 50 ! ldeltat [s] interval since radioactive decay was computed * 51 ! lfr, cfr area fraction covered by precipitation for large scale * 52 ! and convective precipitation (dependent on prec. rate) * 48 53 ! loutnext [s] time for which gridded deposition is next output * 49 54 ! loutstep [s] interval at which gridded deposition is output * 55 ! lsp [mm/h] large scale precipitation rate * 50 56 ! ltsample [s] interval over which mass is deposited * 57 ! prec [mm/h] precipitation rate in subgrid, where precipitation occurs* 51 58 ! wetdeposit mass that is wet deposited * 52 59 ! wetgrid accumulated deposited mass on output grid * … … 64 71 65 72 integer :: jpart,itime,ltsample,loutnext,ldeltat,i,j,ix,jy 66 integer :: itage,nage,il,interp_time, n 73 integer :: ngrid,itage,nage,hz,il,interp_time, n 74 integer(kind=1) :: clouds_v 67 75 integer :: ks, kp 68 integer(selected_int_kind(16)), dimension(nspec) :: blc_count, inc_count 69 real :: grfraction(3),wetscav 76 ! integer :: n1,n2, icbot,ictop, indcloud !TEST 77 real :: S_i, act_temp, cl, cle ! in cloud scavenging 78 real :: clouds_h ! cloud height for the specific grid point 79 real :: xtn,ytn,lsp,convp,cc,grfraction(3),prec(3),wetscav,totprec 70 80 real :: wetdeposit(maxspec),restmass 71 81 real,parameter :: smallnum = tiny(0.0) ! smallest number that can be handled 82 !save lfr,cfr 83 84 real, parameter :: lfr(5) = (/ 0.5,0.65,0.8,0.9,0.95/) 85 real, parameter :: cfr(5) = (/ 0.4,0.55,0.7,0.8,0.9 /) 86 87 !ZHG aerosol below-cloud scavenging removal polynomial constants for rain and snow 88 real, parameter :: bclr(6) = (/274.35758, 332839.59273, 226656.57259, 58005.91340, 6588.38582, 0.244984/) !rain (Laakso et al 2003) 89 real, parameter :: bcls(6) = (/22.7, 0.0, 0.0, 1321.0, 381.0, 0.0/) !now (Kyro et al 2009) 90 real :: frac_act, liq_frac, dquer_m 91 92 integer(selected_int_kind(16)), dimension(nspec) :: blc_count, inc_count 93 real :: Si_dummy, wetscav_dummy 94 logical :: readclouds_this_nest 95 72 96 73 97 ! Compute interval since radioactive decay of deposited mass was computed … … 95 119 endif 96 120 97 ! Determine age class of the particle - nage is used for the kernel 121 ! Determine age class of the particle 122 itage=abs(itra1(jpart)-itramem(jpart)) 123 do nage=1,nageclass 124 if (itage.lt.lage(nage)) goto 33 125 end do 126 33 continue 127 128 129 ! Determine which nesting level to be used 130 !***************************************** 131 132 ngrid=0 133 do j=numbnests,1,-1 134 if ((xtra1(jpart).gt.xln(j)).and.(xtra1(jpart).lt.xrn(j)).and. & 135 (ytra1(jpart).gt.yln(j)).and.(ytra1(jpart).lt.yrn(j))) then 136 ngrid=j 137 goto 23 138 endif 139 end do 140 23 continue 141 142 143 ! Determine nested grid coordinates 144 !********************************** 145 readclouds_this_nest=.false. 146 147 if (ngrid.gt.0) then 148 xtn=(xtra1(jpart)-xln(ngrid))*xresoln(ngrid) 149 ytn=(ytra1(jpart)-yln(ngrid))*yresoln(ngrid) 150 ix=int(xtn) 151 jy=int(ytn) 152 if (readclouds_nest(ngrid)) readclouds_this_nest=.true. 153 else 154 ix=int(xtra1(jpart)) 155 jy=int(ytra1(jpart)) 156 endif 157 158 159 ! Interpolate large scale precipitation, convective precipitation and 160 ! total cloud cover 161 ! Note that interpolated time refers to itime-0.5*ltsample [PS] 162 !******************************************************************** 163 interp_time=nint(itime-0.5*ltsample) 164 165 if (ngrid.eq.0) then 166 call interpol_rain(lsprec,convprec,tcc,nxmax,nymax, & 167 1,nx,ny,memind,real(xtra1(jpart)),real(ytra1(jpart)),1, & 168 memtime(1),memtime(2),interp_time,lsp,convp,cc) 169 else 170 call interpol_rain_nests(lsprecn,convprecn,tccn, & 171 nxmaxn,nymaxn,1,maxnests,ngrid,nxn,nyn,memind,xtn,ytn,1, & 172 memtime(1),memtime(2),interp_time,lsp,convp,cc) 173 endif 174 175 ! If total precipitation is less than 0.01 mm/h - no scavenging occurs 176 if ((lsp.lt.0.01).and.(convp.lt.0.01)) goto 20 177 178 ! get the level were the actual particle is in 179 do il=2,nz 180 if (height(il).gt.ztra1(jpart)) then 181 hz=il-1 182 ! goto 26 183 exit 184 endif 185 end do 186 !26 continue 187 188 n=memind(2) 189 if (abs(memtime(1)-interp_time).lt.abs(memtime(2)-interp_time)) & 190 n=memind(1) 191 192 if (ngrid.eq.0) then 193 clouds_v=clouds(ix,jy,hz,n) 194 clouds_h=cloudsh(ix,jy,n) 195 else 196 clouds_v=cloudsn(ix,jy,hz,n,ngrid) 197 clouds_h=cloudshn(ix,jy,n,ngrid) 198 endif 199 200 ! if there is no precipitation or the particle is above the clouds no 201 ! scavenging is done 202 203 if (clouds_v.le.1) goto 20 204 205 ! 1) Parameterization of the the area fraction of the grid cell where the 206 ! precipitation occurs: the absolute limit is the total cloud cover, but 207 ! for low precipitation rates, an even smaller fraction of the grid cell 208 ! is used. Large scale precipitation occurs over larger areas than 209 ! convective precipitation. 210 !************************************************************************** 211 212 if (lsp.gt.20.) then 213 i=5 214 else if (lsp.gt.8.) then 215 i=4 216 else if (lsp.gt.3.) then 217 i=3 218 else if (lsp.gt.1.) then 219 i=2 220 else 221 i=1 222 endif 223 224 if (convp.gt.20.) then 225 j=5 226 else if (convp.gt.8.) then 227 j=4 228 else if (convp.gt.3.) then 229 j=3 230 else if (convp.gt.1.) then 231 j=2 232 else 233 j=1 234 endif 235 236 237 !ZHG oct 2014 : Calculated for 1) both 2) lsp 3) convp 238 ! Tentatively differentiate the grfraction for lsp and convp for treating differently the two forms 239 ! for now they are treated the same 240 grfraction(1)=max(0.05,cc*(lsp*lfr(i)+convp*cfr(j))/(lsp+convp)) 241 grfraction(2)=max(0.05,cc*(lfr(i))) 242 grfraction(3)=max(0.05,cc*(cfr(j))) 243 244 245 ! 2) Computation of precipitation rate in sub-grid cell 246 !****************************************************** 247 prec(1)=(lsp+convp)/grfraction(1) 248 prec(2)=(lsp)/grfraction(2) 249 prec(3)=(convp)/grfraction(3) 250 251 252 ! 3) Computation of scavenging coefficients for all species 253 ! Computation of wet deposition 254 !********************************************************** 255 256 do ks=1,nspec ! loop over species 257 wetdeposit(ks)=0. 258 wetscav=0. 259 260 ! Cycle loop if wet deposition for the species is off 261 if (WETDEPSPEC(ks).eqv..false.) cycle 262 263 if (ngrid.gt.0) then 264 act_temp=ttn(ix,jy,hz,n,ngrid) 265 else 266 act_temp=tt(ix,jy,hz,n) 267 endif 268 269 270 !*********************** 271 ! BELOW CLOUD SCAVENGING 272 !*********************** 273 if (clouds_v.ge.4) then !below cloud 274 275 ! For gas: if positive below-cloud parameters (A or B), and dquer<=0 98 276 !****************************************************************** 99 itage=abs(itra1(jpart)-itramem(jpart)) 100 do nage=1,nageclass 101 if (itage.lt.lage(nage)) goto 33 102 end do 103 33 continue 104 105 do ks=1,nspec ! loop over species 106 107 if (WETDEPSPEC(ks).eqv..false.) cycle 277 if ((dquer(ks).le.0.).and.(weta_gas(ks).gt.0..or.wetb_gas(ks).gt.0.)) then 278 ! if (weta(ks).gt.0. .or. wetb(ks).gt.0.) then 279 blc_count(ks)=blc_count(ks)+1 280 wetscav=weta_gas(ks)*prec(1)**wetb_gas(ks) 281 282 ! For aerosols: if positive below-cloud parameters (Crain/Csnow or B), and dquer>0 283 !********************************************************************************* 284 else if ((dquer(ks).gt.0.).and.(crain_aero(ks).gt.0..or.csnow_aero(ks).gt.0.)) then 285 blc_count(ks)=blc_count(ks)+1 286 287 !NIK 17.02.2015 288 ! For the calculation here particle size needs to be in meter and not um as dquer is 289 ! changed in readreleases 290 ! For particles larger than 10 um use the largest size defined in the parameterizations (10um) 291 dquer_m=min(10.,dquer(ks))/1000000. !conversion from um to m 292 293 ! Rain: 294 if (act_temp .ge. 273. .and. crain_aero(ks).gt.0.) then 295 296 ! ZHG 2014 : Particle RAIN scavenging coefficient based on Laakso et al 2003, 297 ! the below-cloud scavenging (rain efficienty) parameter Crain (=crain_aero) from SPECIES file 298 wetscav=crain_aero(ks)*10**(bclr(1)+(bclr(2)*(log10(dquer_m))**(-4))+ & 299 & (bclr(3)*(log10(dquer_m))**(-3))+ (bclr(4)*(log10(dquer_m))**(-2))+& 300 &(bclr(5)*(log10(dquer_m))**(-1))+bclr(6)* (prec(1))**(0.5)) 301 302 ! Snow: 303 elseif (act_temp .lt. 273. .and. csnow_aero(ks).gt.0.) then 304 ! ZHG 2014 : Particle SNOW scavenging coefficient based on Kyro et al 2009, 305 ! the below-cloud scavenging (Snow efficiency) parameter Csnow (=csnow_aero) from SPECIES file 306 wetscav=csnow_aero(ks)*10**(bcls(1)+(bcls(2)*(log10(dquer_m))**(-4))+& 307 &(bcls(3)*(log10(dquer_m))**(-3))+ (bcls(4)*(log10(dquer_m))**(-2))+& 308 &(bcls(5)*(log10(dquer_m))**(-1))+ bcls(6)* (prec(1))**(0.5)) 309 310 endif 311 312 ! write(*,*) 'bl-cloud, act_temp=',act_temp, ',prec=',prec(1),',wetscav=', wetscav, ', jpart=',jpart 313 314 endif ! gas or particle 315 ! endif ! positive below-cloud scavenging parameters given in Species file 316 endif !end BELOW 317 318 !******************** 319 ! IN CLOUD SCAVENGING 320 !******************** 321 if (clouds_v.lt.4) then ! In-cloud 322 ! NIK 13 may 2015: only do incloud if positive in-cloud scavenging parameters are 323 ! given in species file, or if gas and positive Henry's constant 324 if ((ccn_aero(ks).gt.0. .or. in_aero(ks).gt.0.).or.(henry(ks).gt.0.and.dquer(ks).le.0)) then 325 inc_count(ks)=inc_count(ks)+1 326 ! if negative coefficients (turned off) set to zero for use in equation 327 if (ccn_aero(ks).lt.0.) ccn_aero(ks)=0. 328 if (in_aero(ks).lt.0.) in_aero(ks)=0. 329 330 !ZHG 2015 Cloud liquid & ice water (CLWC+CIWC) from ECMWF 331 ! nested fields 332 if (ngrid.gt.0.and.readclouds_this_nest) then 333 cl=ctwcn(ix,jy,n,ngrid)*(grfraction(1)/cc) 334 else if (ngrid.eq.0.and.readclouds) then 335 cl=ctwc(ix,jy,n)*(grfraction(1)/cc) 336 else !parameterize cloudwater m2/m3 337 !ZHG updated parameterization of cloud water to better reproduce the values coming from ECMWF 338 cl=1.6E-6*prec(1)**0.36 339 endif 340 341 !ZHG: Calculate the partition between liquid and water phase water. 342 if (act_temp .le. 253.) then 343 liq_frac=0 344 else if (act_temp .ge. 273.) then 345 liq_frac=1 346 else 347 liq_frac =((act_temp-273.)/(273.-253.))**2. 348 end if 349 ! ZHG: Calculate the aerosol partition based on cloud phase and Ai and Bi 350 frac_act = liq_frac*ccn_aero(ks) +(1-liq_frac)*in_aero(ks) 351 352 !ZHG Use the activated fraction and the liqid water to calculate the washout 353 354 ! AEROSOL 355 !******** 356 if (dquer(ks).gt.0.) then 357 S_i= frac_act/cl 358 359 ! GAS 360 !**** 361 else 362 363 cle=(1-cl)/(henry(ks)*(r_air/3500.)*act_temp)+cl 364 !REPLACE to switch old/ new scheme 365 ! S_i=frac_act/cle 366 S_i=1/cle 367 endif ! gas or particle 368 369 ! scavenging coefficient based on Hertel et al 1995 - using the S_i for either gas or aerosol 370 !OLD 371 if ((readclouds.and.ngrid.eq.0).or.(readclouds_this_nest.and.ngrid.gt.0)) then 372 wetscav=incloud_ratio*S_i*(prec(1)/3.6E6) 373 else 374 wetscav=incloud_ratio*S_i*(prec(1)/3.6E6)/clouds_h 375 endif 376 377 378 endif ! positive in-cloud scavenging parameters given in Species file 379 endif !incloud 380 !END ZHG TEST 108 381 109 382 !************************************************** 110 383 ! CALCULATE DEPOSITION 111 384 !************************************************** 112 ! wetscav=0. 113 114 ! write(*,*) ks,dquer(ks), crain_aero(ks),csnow_aero(ks) 115 ! if (((dquer(ks).le.0.).and.(weta_gas(ks).gt.0..or.wetb_gas(ks).gt.0.)) & 116 ! .or. & 117 ! ((dquer(ks).gt.0.).and.(crain_aero(ks).gt.0..or.csnow_aero(ks).gt.0.).or. & 118 ! (ccn_aero(ks).gt0) .or. (in_aero(ks).gt.0) .or. (henry(ks).gt.0))) then 119 120 call get_wetscav(itime,ltsample,loutnext,jpart,ks,grfraction,inc_count,blc_count,wetscav) 121 385 ! if (wetscav.le.0) write (*,*) 'neg, or 0 wetscav!' 386 ! + ,wetscav,cle,cl,act_temp,prec,clouds_h,clouds_v 122 387 123 388 if (wetscav.gt.0.) then 124 389 wetdeposit(ks)=xmass1(jpart,ks)* & 125 390 (1.-exp(-wetscav*abs(ltsample)))*grfraction(1) ! wet deposition 391 !write(*,*) 'MASS DEPOSITED: PREC, WETSCAV, WETSCAVP', prec(1), wetdeposit(ks), xmass1(jpart,ks)* & 392 ! (1.-exp(-wetscav_dummy*abs(ltsample)))*grfraction(1), clouds_v 393 394 126 395 else ! if no scavenging 127 396 wetdeposit(ks)=0. 128 397 endif 129 398 130 399 restmass = xmass1(jpart,ks)-wetdeposit(ks) 131 400 if (ioutputforeachrelease.eq.1) then … … 148 417 endif 149 418 150 ! endif ! no deposition 151 end do ! loop overspecies419 420 end do !all species 152 421 153 422 ! Sabine Eckhardt, June 2008 create deposition runs only for forward runs -
src/wetdepokernel.f90
r1c0d5e6 r4c64400 95 95 do ks=1,nspec 96 96 97 if (.not.usekernel) then 98 wetgridunc(ix,jy,ks,kp,nunc,nage)= & 99 wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks) 100 else 101 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & 97 if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & 102 98 (jy.le.numygrid-1)) then 103 99 w=wx*wy 104 100 wetgridunc(ix,jy,ks,kp,nunc,nage)= & 105 101 wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w 106 102 endif 107 103 108 104 if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgrid-1).and. & 109 105 (jyp.le.numygrid-1)) then 110 106 w=(1.-wx)*(1.-wy) 111 107 wetgridunc(ixp,jyp,ks,kp,nunc,nage)= & 112 108 wetgridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w 113 109 endif 114 110 115 111 if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgrid-1).and. & 116 112 (jy.le.numygrid-1)) then 117 113 w=(1.-wx)*wy 118 114 wetgridunc(ixp,jy,ks,kp,nunc,nage)= & 119 115 wetgridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w 120 116 endif 121 117 122 118 if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgrid-1).and. & 123 119 (jyp.le.numygrid-1)) then 124 120 w=wx*(1.-wy) 125 121 wetgridunc(ix,jyp,ks,kp,nunc,nage)= & 126 122 wetgridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w 127 endif 128 endif 123 endif 129 124 end do 130 125 end if
Note: See TracChangeset
for help on using the changeset viewer.