1 MODULE module_uoc_dustwd
4 !----------------------------------------------------------------------------
5 ! Dust wet deposition module of the University of Cologne, Germany.
6 ! Dust wet deposition scheme developed by E Jung (2004, PhD Thesis).
7 ! Implementation into WRF and modifications by C Frick, 2014 (claudia.frick@uni-koeln.de)
8 ! 2014-2015, updates and modifications, Martina Klose (mklose@uni-koeln.de)
9 !----------------------------------------------------------------------------
11 USE module_state_description ! num_chem, p_qr, ...
12 USE module_model_constants ! rhowater in kg/m3
13 USE physconst ! rair, ...
14 USE module_data_gocart_dust
18 subroutine uoc_dustwd_driver(precr,chem,p_phy,t_phy, &
19 ids,ide, jds,jde, kds,kde, &
20 ims,ime, jms,jme, kms,kme, &
21 its,ite, jts,jte, kts,kte, &
29 dustwdload_1, dustwdload_2, &
30 dustwdload_3, dustwdload_4, &
36 INTEGER :: debug_level
37 CHARACTER*(100) :: text
39 real :: dustold ! help variable
41 integer :: d, i, j, k, l ! loop
43 integer, parameter :: nbins=5 ! number of dust bins
44 integer, parameter :: nbinsa=5 ! number of dust bins
45 integer :: bins(nbinsa) ! dust bin numbers in chem
46 ! real, dimension(nbins) :: dbin ! max. dimension of dust in the bin
47 ! data dbin/2.5,5.,10.,20./ ! size cut diameter (um) - from qf03
48 real, dimension(nbins) :: dbinm ! mean dimension of dust (um) in the bin
49 real, dimension(nbins) :: dbinmm ! mean dimension of dust (m) in the bin
50 ! data dbinm/1.25,3.75,7.5,15./ ! mean size cut diameter (um)
52 real :: conver9, converi9 ! transformation ug/kg-dryair to kg/kg-dryair and vice versa
53 real :: conver6, converi6 ! transformation um to m and vice versa
55 real :: wt ! terminal fall velocity of dust in the bin (m/s)
57 real :: rmin, rmax ! minimum/maximum raindrop diameter (m)
59 integer, parameter :: nrbins=30 ! number of raindrop bins
60 real, dimension(nrbins) :: raind ! raindrop diameter in the middle of the raindrop bin (m)
61 real, dimension(nrbins+1) :: rend ! raindrop diameter at the end of the raindrop bin (m)
62 real, dimension(nrbins) :: dsd_rn ! raindrop size distribution
63 real, dimension(nrbins) :: vt ! raindrop terminal fall velocity (m/s)
64 real :: z ! help parameter for the determination of the rain bins
66 real :: visca ! (dynamic) viscosity of air (g/cm s)
67 real :: tw, viscw ! temperature of water (C) and (dynamic) viscosity of water (g/cm s)
69 real :: colece ! collection efficiency
71 real :: scrate, scavn ! scavanging rate (1/s)
72 real :: delR, delv, rnflx, carea ! help parameter for the determination of the scavanging rate
73 real :: tair, pair ! current air temperature and pressure
74 real :: rhoair ! dry air density (kg/m3) - rhoair=pa/(Ra*Ta)
76 INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, & ! domain grid
77 ims,ime, jms,jme, kms,kme, &
78 its,ite, jts,jte, kts,kte
80 REAL, INTENT(IN) :: dtstepc, & ! time step (s)
83 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
85 ! precr - rain precipitation rate at all levels (kg/m2 s)
87 REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), &
89 ! chem(i,k,j,p_dust_?) - dust mixing ratio for bin np_dust_? (ug/kg-dryair)
91 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), &
92 INTENT(IN) :: p_phy, t_phy
93 ! pressure (Pa) and temperature (K)
95 real, dimension( ims:ime, kms:kme, jms:jme ) :: rnrate
96 ! precipitation rate (mm/h) - rnrate=precr/3600 using rhowater (1l = 1kg)
98 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT) :: &
99 dustwd_1, dustwd_2, dustwd_3, dustwd_4, dustwd_5
100 ! loss in dust mixing ratio due to wet deposition (ug/kg-dryair) (current time step)
102 REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ) :: wdbins
103 ! loss in dust mixing ratio due to wet deposition - help variable (ug/kg-dryair)
105 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
106 dustwdload_1, dustwdload_2, dustwdload_3, dustwdload_4, dustwdload_5
107 ! loss in dustload due to wet deposition (ug/m2) (current time step)
109 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
110 wetdep_1, wetdep_2, wetdep_3, wetdep_4, wetdep_5
111 ! loss in dust mixing ratio due to wet deposition in one coulmn for all size bins (ug/m2/s)
113 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: alt, dz8w
114 ! altitude = 1/rhoair (kg/m3) & vertical grid-spacing delta-z / dz between full levels (m)
118 dbinm(:) = 2.0d0*reff_dust(:)
120 CALL get_wrf_debug_level(debug_level)
123 rmax = 5800.*1.e-6 ! minimum/maximum raindrop diameter (m)
125 conver6 = 1.e-6 ! transformation um to m
126 converi6 = 1.e6 ! transformation m to um
128 conver9 = 1.e-9 ! transformation ug/kg-dryair to kg/kg-dryair
129 converi9 = 1.e9 ! transformation kg/kg-dryair to ug/kg-dryair
131 bins(1)=p_dust_1 ! dust bin number in chem
132 bins(2)=p_dust_2 ! dust bin number in chem
133 bins(3)=p_dust_3 ! dust bin number in chem
134 bins(4)=p_dust_4 ! dust bin number in chem
135 bins(5)=p_dust_5 ! dust bin number in chem
137 dustwd_1(its:ite,kts:kte,jts:jte) = 0.
138 dustwd_2(its:ite,kts:kte,jts:jte) = 0.
139 dustwd_3(its:ite,kts:kte,jts:jte) = 0.
140 dustwd_4(its:ite,kts:kte,jts:jte) = 0.
141 dustwd_5(its:ite,kts:kte,jts:jte) = 0.
142 wetdep_1(its:ite,jts:jte) = 0.
143 wetdep_2(its:ite,jts:jte) = 0.
144 wetdep_3(its:ite,jts:jte) = 0.
145 wetdep_4(its:ite,jts:jte) = 0.
146 wetdep_5(its:ite,jts:jte) = 0.
147 dustwdload_1(its:ite,jts:jte) = 0.
148 dustwdload_2(its:ite,jts:jte) = 0.
149 dustwdload_3(its:ite,jts:jte) = 0.
150 dustwdload_4(its:ite,jts:jte) = 0.
151 dustwdload_5(its:ite,jts:jte) = 0.
153 wdbins(its:ite,kts:kte,jts:jte,1)=dustwd_1(its:ite,kts:kte,jts:jte) ! dust dust loss in dust bin 1
154 wdbins(its:ite,kts:kte,jts:jte,2)=dustwd_2(its:ite,kts:kte,jts:jte) ! dust dust loss in dust bin 2
155 wdbins(its:ite,kts:kte,jts:jte,3)=dustwd_3(its:ite,kts:kte,jts:jte) ! dust dust loss in dust bin 3
156 wdbins(its:ite,kts:kte,jts:jte,4)=dustwd_4(its:ite,kts:kte,jts:jte) ! dust dust loss in dust bin 4
157 wdbins(its:ite,kts:kte,jts:jte,5)=dustwd_5(its:ite,kts:kte,jts:jte) ! dust dust loss in dust bin 5
159 rnrate = precr*3600. ! precipitation rate (mm/h) - rnrate=precr*3600 using rhowater
161 dbinmm = dbinm*conver6 ! mean dimension of dust (m) in the bin
163 tw=0 ! water temperature (C)
164 call dviscw(tw,viscw) ! determine water (dynamic) viscosity viscw
168 z = alog10(rmin*converi6)+(alog10(rmax*converi6)-alog10(rmin*converi6))*real(l-1)/real(nrbins)
169 rend(l) = real(int(10.**z))*conver6
172 z = (alog10(rend(l)*converi6)+alog10(rend(l+1)*converi6))*0.5
173 raind(l) = real(int(10.**z))*conver6
175 ! bin 1 bin 2 bin nrbin
176 ! |--------------|------------!-------------!--------------|
177 ! rend(1) rend(2) rend(3) rend(nrbin+1)
178 ! raind(1) raind(2) raind(nrbin)
184 if ( precr(i,k,j).gt.0.) then ! precipitation exists
186 call dsd_rain(rnrate(i,k,j),raind,nrbins,dsd_rn,3) ! 3 = Gamma Distribution
190 rhoair = pair/(rair*tair) ! dry air density (kg/m3) - rhoair=pa/(Ra*Ta)
192 call dvisca(tair,visca)
195 call fallv(raind(l),tair,pair,rhoair,visca,vt(l))
198 do d=1,nbins ! d = dust bins // dust classes
200 if ( chem(i,k,j,bins(d)).gt.0.) then ! dust exists
202 call w_t(wt,dbinmm(d),den_dust(d),rhoair)
207 ! calculate collection efficiency for each dust bin (already in this loop) by each rain bin (already in this loop)
208 call coleff(dbinmm(d),raind(l),den_dust(d),pair,tair,wt,vt(l),rhoair,visca,viscw,colece)
209 ! calculate scavanging rate
210 delR = (rend(l+1)-rend(l))*1.e2 ! cm
211 delv = (vt(l)-wt)*1.e2 ! cm/s
212 delv = amax1(delv,0.)
213 rnflx = dsd_rn(l)*delv
214 carea = pi*0.25*(raind(l)*1.e2+dbinmm(d)*1.e2)**2.
215 scavn = scavn+carea*colece*rnflx*delR
219 dustold = chem(i,k,j,bins(d))
220 chem(i,k,j,bins(d))=chem(i,k,j,bins(d))-max(0.,chem(i,k,j,bins(d))*scrate*dtstepc)
221 chem(i,k,j,bins(d))=max(chem(i,k,j,bins(d)),epsilc)
222 wdbins(i,k,j,d)=max(epsilc,dustold-chem(i,k,j,bins(d)))
227 ! mklose: fifths size bin is used now, hence the following is not needed:
228 ! dustold = chem(i,k,j,bins(5))
229 ! chem(i,k,j,bins(5))=chem(i,k,j,bins(1))+chem(i,k,j,bins(2))+chem(i,k,j,bins(3))+chem(i,k,j,bins(4))
230 ! chem(i,k,j,bins(5))=max(chem(i,k,j,bins(5)),epsilc)
231 ! wdbins(i,k,j,5)=max(epsilc,dustold-chem(i,k,j,bins(5)))
242 dustwdload_1(i,j)= max(epsilc,dustwdload_1(i,j) + wdbins(i,k,j,1)/alt(i,k,j) * dz8w(i,k,j))
243 dustwdload_2(i,j)= max(epsilc,dustwdload_2(i,j) + wdbins(i,k,j,2)/alt(i,k,j) * dz8w(i,k,j))
244 dustwdload_3(i,j)= max(epsilc,dustwdload_3(i,j) + wdbins(i,k,j,3)/alt(i,k,j) * dz8w(i,k,j))
245 dustwdload_4(i,j)= max(epsilc,dustwdload_4(i,j) + wdbins(i,k,j,4)/alt(i,k,j) * dz8w(i,k,j))
246 dustwdload_5(i,j)= max(epsilc,dustwdload_5(i,j) + wdbins(i,k,j,5)/alt(i,k,j) * dz8w(i,k,j))
247 dustwd_1(i,k,j)=max(epsilc,wdbins(i,k,j,1))
248 dustwd_2(i,k,j)=max(epsilc,wdbins(i,k,j,2))
249 dustwd_3(i,k,j)=max(epsilc,wdbins(i,k,j,3))
250 dustwd_4(i,k,j)=max(epsilc,wdbins(i,k,j,4))
251 dustwd_5(i,k,j)=max(epsilc,wdbins(i,k,j,5))
253 wetdep_1(i,j)= max(epsilc,wdbins(i,kts,j,1)/alt(i,kts,j) * dz8w(i,kts,j) / dtstepc)
254 wetdep_2(i,j)= max(epsilc,wdbins(i,kts,j,2)/alt(i,kts,j) * dz8w(i,kts,j) / dtstepc)
255 wetdep_3(i,j)= max(epsilc,wdbins(i,kts,j,3)/alt(i,kts,j) * dz8w(i,kts,j) / dtstepc)
256 wetdep_4(i,j)= max(epsilc,wdbins(i,kts,j,4)/alt(i,kts,j) * dz8w(i,kts,j) / dtstepc)
257 wetdep_5(i,j)= max(epsilc,wdbins(i,kts,j,5)/alt(i,kts,j) * dz8w(i,kts,j) / dtstepc)
262 end subroutine uoc_dustwd_driver
265 !=======================================================================
266 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
267 ! - further updates M. Klose
269 subroutine coleff(d,rain,prho,p,t,pv,rv,arho,visca,viscw,ecolec)
271 ! the program to calculate collection efficiency
272 ! it is based on Slinn's empirical equation(1983)
273 ! and theoretical collision efficiencies by
274 ! Mason(1971), Klett and Davis (1973) and Beard and Ochs (1984)
278 real, intent (in) :: d ! particle diameter in m
279 real, intent (in) :: rain ! raindrio diameter in m
280 real(8), intent (in) :: prho ! particle density in kg/m3
281 real, intent (in) :: p ! atmosphere pressure in Pa
282 real, intent (in) :: t ! atmospheric temperature in K
283 real, intent (in) :: pv ! dust fall velocity in m/s
284 real, intent (in) :: rv ! rain fall velocity in m/s
285 real, intent (in) :: arho ! rair density in kg/m3
286 real, intent (in) :: visca, viscw
290 real, intent (out) :: ecolec
296 real(8) :: E_im,E_in,E_br
297 real :: dd, raind, rhop, pr, ta, vp, vs, rhoa
299 CHARACTER*(100) :: text
300 integer :: debug_level
302 data rhow/1/ ! raindrop density g/cm^3
304 CALL get_wrf_debug_level(debug_level)
306 dd = d*1.e6 ! m to um
307 raind = rain*1.e6 ! m to um
308 rhop = prho*1.e-3 ! kg/m3 to g/cm3
309 pr = p*1.e-2 ! Pa to mb or hPa
310 ta = t-273.15 ! K to C
311 vp = pv*1.e2 ! m/s to cm/s
312 vs = rv*1.e2 ! m/s to cm/s
313 rhoa = arho*1.e-3 ! kg/m3 to g/cm3
315 !=======================================================================
319 call eslinn(raind,dd,pr,ta,rhop,vp,vs,rhoa,visca,viscw,ecol)
320 elseif(dd.gt.2 .and. dd.le.40) then
321 call eimpact(rhop,dd,raind,ecol)
322 elseif(dd.gt.40) then
329 end subroutine coleff
330 !****************************************************************
333 !****************************************************************
334 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
335 ! - further updates M. Klose
337 ! xlambda is set fix instead of calculated - cfrick
339 subroutine eslinn(dr,dp,pair,tair,rhop,vp,vs,rhoa,visca,viscw,eslin)
343 real, intent (in) :: dp ! particle diameter in um
344 real, intent (in) :: dr ! raindrio diameter in um
345 real, intent (in) :: rhop ! particle density in g/cm3
346 real, intent (in) :: pair ! atmosphere pressure in hPa
347 real, intent (in) :: tair ! atmospheric temperature in C
348 real, intent (in) :: vp ! dust fall velocity in cm/s
349 real, intent (in) :: vs ! rain fall velocity in cm/s
350 real, intent (in) :: rhoa ! rair density in g/cm3
351 real, intent (in) :: visca, viscw
355 real, intent (out) :: eslin
359 CHARACTER*(100) :: text
360 integer :: debug_level
368 drc=dr*1.e-4 ! rain diameter in cm
369 dpc=dp*1.e-4 ! particle diameter in cm
375 xk=1.381e-16 ! Boltzmann constant (g cm2/s2)/K
378 ! xlambda=xk*(ta+273.15)/(pi*sqrt(2.0)*prs*xd*xd)
381 ren=0.5*drc*vs*rhoa/visca ! reynolds number
382 sstar=(1.2+alog(1+ren)/12)/(1+alog(1+ren)) ! S*
384 xlambda=0.0651*1.e-4 ! mean free path of air in cm
385 cc=1+(2*xlambda/dpc)*(1.257+0.4*exp(-1.1*dpc/(2*xlambda))) ! Cunningham's correction for small particles
387 tau=dpc**2*rhop*cc/(18*visca)
388 stn=2*tau*(vs-vp)/drc ! Stokes number
389 diff=(xk*(ta+273.15)*cc)/(3*pi*visca*dpc)
390 scn=visca/(diff*rhoa) ! Schmidt number
392 pen=ren*scn ! peclet number
396 E_br=4*(1+0.4*sqrt(ren)*scn**(1.0/3.0)+0.16*sqrt(ren)*sqrt(scn))/pen
400 E_in=4*phi*(1/omg+(1+2*sqrt(ren))*phi)
404 if(stn.ge.sstar) then
405 E_im=((stn-sstar)/(stn-sstar+2.0/3.0))**1.5
411 end subroutine eslinn
412 !=======================================================================
414 !*******************************************************************************
415 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
416 ! - further updates M. Klose
418 subroutine eimpact(rhop,dp,raind,e_im)
420 USE module_data_uoc_wd ! mklose [17122014]: renamed from we_ematrix
422 integer, parameter :: lp=17, lr=17
424 ! include 'we_ematrix.dat'
428 real, intent (in) :: dp ! particle diameter in um
429 real, intent (in) :: raind ! raindrio diameter in um
430 real, intent (in) :: rhop ! particle density in g/cm3
434 real, intent (out) :: e_im
445 CHARACTER*(100) :: text
446 integer :: debug_level
448 CALL get_wrf_debug_level(debug_level)
450 ! rr, rp : radiuse of raindrop, dust particle in um
451 ! edata : dataset of composite collection efficiency
452 !===============================================================================
454 if(raind.lt.100 .or. raind.gt.6000) then
455 text = 'raindrop diameter out of range'
456 text=trim(trim(text)//" - ERROR - UoC dust wet deposition")
457 call wrf_debug (debug_level,text)
459 if(dp.lt.2 .or. dp.gt.40) then
460 text = 'particle diameter out of range'
461 text=trim(trim(text)//" - ERROR - UoC dust wet deposition")
462 call wrf_debug (debug_level,text)
465 ! radius of raindrop, dust particle
471 ! calculate e_r(1:lp) corresponding to dustr(1:lp) for rr
476 if(rr.ge.rainwd(j)) jj=j
479 text = 'error in raindrop radius'
480 text=trim(trim(text)//" - ERROR - UoC dust wet deposition")
481 call wrf_debug (debug_level,text)
483 if(rr.gt.rainwd(jj)) then
492 call intrpl(lr,log(rainwd),ee,lrp1,log(u),enew)
494 elseif(rr.eq.rainwd(jj)) then
499 ! interpolate e_d for rp from e_r
504 if(dustwd(i).le.1) then
506 elseif(dustwd(i).gt.1 .and. dustwd(i).lt.3.98) then
507 f(i)=(1-rmax)*(dustwd(i)-3.98)**2/(1-3.98)**2+rmax
508 elseif(dustwd(i).ge.3.98) then
520 if(rp.ge.dustwd(i)) ii=i
523 text = 'wrong particle radius'
524 text=trim(trim(text)//" - ERROR - UoC dust wet deposition")
525 call wrf_debug (debug_level,text)
527 if(rp.gt.dustwd(ii)) then
536 call intrpl(lp,dustwd,e_c,lpp1,v,dnew)
538 elseif(rp.eq.dustwd(ii)) then
545 end subroutine eimpact
546 !=======================================================================
548 !***********************************************************************
549 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
550 ! - further updates M. Klose
552 subroutine dvisca(tair,dvisc)
554 ! tair : air temperature in K
555 ! visca : dynamic viscosity of air in g/cm/s
557 integer, parameter :: l=9, n=1
559 real, dimension(l) :: ta, visca
560 real, dimension(l) :: x, y
561 real, dimension(n) :: u, v
563 data ta/-173,-73,0,20,25,27,127,227,327/
564 data visca/0.71e-4,1.33e-4,1.72e-4,1.797e-4,1.818e-4, &
565 & 1.86e-4,2.31e-4,2.71e-4,3.08e-4/
567 ! values from crc handbook of chemistry and physics
576 call intrpl(l,x,y,n,u,v)
581 end subroutine dvisca
583 !************************************************************
585 !************************************************************
586 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
587 ! - further updates M. Klose
589 subroutine dviscw(twt,dvisc)
591 integer, parameter :: l=11, n=1
593 real, dimension(l) :: tw, viscw
594 real, dimension(l) :: x, y
595 real, dimension(l) :: u, v
597 data tw/0,10,20,30,40,50,60,70,80,90,100/
598 data viscw/1.7930e-2,1.3070e-2,1.002e-2,0.7977e-2,0.6532e-2, &
599 & 0.5470e-2,0.4665e-2,0.404e-2,0.3544e-2,0.3145e-2, &
602 ! tw : water temperature in degree C
604 ! dynamic viscosity of water in g/cm/s
605 ! values from crc handbook of chemistry and physics
606 ! properties of water in the range 0 - 100c
615 call intrpl(l,x,y,n,u,v)
620 end subroutine dviscw
622 !*******************************************************************************
624 !************************************************************
625 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
626 ! - further updates by M. Klose, 2015
628 subroutine intrpl(l,x,y,n,u,v)
629 !************************************************************
630 ! algorithm appeared in comm. acm, vol. 15, no. 10,
633 ! interpolation of a single-valued function
634 ! this subroutine interpolates, from values of the function
635 ! given as ordinates of input data points in an x-y plane
636 ! and for a given set of x values (abscissas), the values of
637 ! a single-valued function y = y(x).
638 ! the input parameters are
639 ! l = number of input data points
640 ! (must be 2 or greater)
641 ! x = array of dimension l storing the x values
642 ! (abscissas) of input data points
643 ! (in ascending order)
644 ! y = array of dimension l storing the y values
645 ! (ordinates) of input data points
646 ! n = number of points at which interpolation of the
647 ! y value (ordinate) is desired
648 ! (must be 1 or greater)
649 ! u = array of dimension n storing the x values
650 ! (abscissas) of desired points
651 ! the output parameter is
652 ! v = array of dimension n where the interpolated y
653 ! values (ordinates) are to be displayed
654 ! declaration statements
655 integer, intent(in) :: l, n
656 real, dimension(l) :: x, y
657 real, dimension(n) :: u, v
658 equivalence (p0,x3),(q0,y3),(q1,t3)
659 real :: m1,m2,m3,m4,m5
660 equivalence (uk,dx),(imn,x2,a1,m1),(imx,x5,a5,m5), &
661 & (j,sw,sa),(y2,w2,w4,q2),(y5,w3,q3)
662 real :: a1, a2, a3, a4, a5
663 integer :: debug_level
664 CALL get_wrf_debug_level(debug_level)
665 ! preliminary processing
672 if(lm2.lt.0) go to 90
675 if(x(i-1)-x(i)) 11,95,96
681 ! routine to locate the desired point
682 20 if(lm2.eq.0) go to 27
683 if(uk.ge.x(l0)) go to 26
684 if(uk.lt.x(1)) go to 25
688 if(uk.ge.x(i)) go to 23
692 24 if(imx.gt.imn) go to 21
701 30 if(i.eq.ipv) go to 70
703 ! routines to pick up necessary x and y values and
704 ! to estimate them if necessary
714 if(lm2.eq.0) go to 43
725 if(j.eq.2) m2=m3+m3-m4
731 45 if(j.le.3) go to 46
736 47 if(j.ge.lm1) go to 48
741 ! numerical differentiation
742 50 if(i.eq.lp1) go to 52
746 if(sw.ne.0.0) go to 51
750 51 t3=(w2*m2+w3*m3)/sw
755 if(sw.ne.0.0) go to 53
759 53 t4=(w3*m3+w4*m4)/sw
760 if(i.ne.lp1) go to 60
763 t4=0.5*(m4+m5-a2*(a2-a3)*(m2-m3)/(sa*sa))
771 t3=0.5*(m1+m2-a4*(a3-a4)*(m3-m4)/(sa*sa))
776 ! determination of the coefficients
777 60 q2=(2.0*(m3-t3)+m3-t4)/a3
778 q3=(-m3-m3+t3+t4)/(a3*a3)
779 ! computation of the polynomial
781 80 v(k)=q0+dx*(q1+dx*(q2+dx*q3))
784 90 call wrf_debug (debug_level,'error 90 in subroutine intrpl - ERROR - UoC dust wet deposition') !write (6,2090)
786 91 call wrf_debug (debug_level,'error 91 in subroutine intrpl - ERROR - UoC dust wet deposition') !write (6,2091)
788 95 call wrf_debug (debug_level,'error 95 in subroutine intrpl - ERROR - UoC dust wet deposition') !write (6,2095)
790 96 call wrf_debug (debug_level,'error 96 in subroutine intrpl - ERROR - UoC dust wet deposition') !write (6,2096)
791 97 call wrf_debug (debug_level,'error 97 in subroutine intrpl - ERROR - UoC dust wet depositionk') !write (6,2097) i,x(i)
792 99 call wrf_debug (debug_level,'error 98 in subroutine intrpl - ERROR - UoC dust wet deposition') !write (6,2099) l0,n0
795 ! 2090 format(1x/22h *** l = 1 or less./)
796 ! 2091 format(1x/22h *** n = 0 or less./)
797 ! 2095 format(1x/27h *** identical x values./)
798 ! 2096 format(1x/33h *** x values out of sequence./)
799 ! 2097 format(6h i =,i7,10x,6hx(i) =,e12.3)
800 ! 2099 format(6h l =,i7,10x,3hn =,i7/&
801 ! & 36h error detected in routine intrpl)
802 end subroutine intrpl
803 !************************************************************
805 !=======================================================================
806 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
807 ! - further updates M. Klose
809 subroutine fallv(d,t,p,rhoair,visc,vt)
810 !=======================================================================
811 ! the program to calculate the termincal velocity of raindrop
812 ! this is based on Beard (1976)
815 ! ta : temperature in K
816 ! dropd : raindrop diameter in m
819 ! vt : terminal velocity in m/s
820 !=======================================================================
822 real :: gg, pr0, t0, visc0, rhow, rhoa, dp, dl, cl, csc, vt, ta, dropd, pr
823 real :: a0, a1, a2, a3, a4, a5, a6
824 real :: b0, b1, b2, b3, b4, b5
825 real :: c1, c2, dan, x, vy, rey, c3, bon, phn, rhoair, p, t, d
827 CHARACTER*(100) :: text
828 integer :: debug_level
829 CALL get_wrf_debug_level(debug_level)
831 ! compute surface tension
832 ! sig : the surface tension in mN/m
834 dropd = d*1.e6 ! m to um
835 ta = t-273.15 ! K to C
836 pr = p*1.e-2 ! Pa to hPa (mb)
843 visc0=1.818e-4 ! g/cm/sec
846 rhoa = rhoair*1.e-3 ! kg/m3 to g/cm3
848 ! compute the terminal velocity
853 dl=dropd*1.e-4 ! diameter in cm
855 c1=(rhow-rhoa)*gg/(18*visc)
856 cl=6.62e-6*(visc/visc0)*(pr0/pr)*sqrt((ta+273.15)/t0) !cm
862 vt=vt*1.e-2 ! cm/s to m/s
864 elseif(dp.ge.19. .and. dp.lt.1070.) then
874 c2=4*rhoa*(rhow-rhoa)*gg/(3*visc*visc)
877 vy=a0+a1*x+a2*x**2+a3*x**3+a4*x**4+a5*x**5+a6*x**6
879 vt=visc*rey/(rhoa*dl)
880 vt=vt*1.e-2 ! cm/s to m/s
882 elseif(dp.ge.1070. .and. dp.le.7000.) then
891 c3=4*(rhow-rhoa)*gg/(3*sig)
892 bon=c3*dl*dl ! Bond Number
893 phn=sig**3*rhoa**2/(visc**4*gg*(rhow-rhoa)) ! Physical Property Number
895 y=alog(bon*phn**(1.0/6.0))
896 vy=b0+b1*y+b2*y**2+b3*y**3+b4*y**4+b5*y**5
897 rey=phn**(1.0/6.0)*exp(vy)
898 vt=visc*rey/(rhoa*dl)
899 vt=vt*1.e-2 ! cm/s to m/s
905 !=======================================================================
907 !=======================================================================
908 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
909 ! - further updates, M. Klose
911 subroutine sfctens(temp,sig)
913 ! temp : temperature in K
914 ! sig : surface tension in mN/m or dyne/cm
915 integer, parameter :: n=14
916 real, dimension(n) :: t, sfctn
917 data t/0,5,10,15,18,20,25,30,40,50,60,70,80,100/
918 data sfctn/75.6,74.9,74.22,73.49,73.05,72.75,71.97,71.18,69.56, &
919 & 67.91,66.18,64.4,62.6,58.9/
925 ta=max(temp-273.15,0.0)
929 if(ta.ge.t(i) .and. ta.lt.t(i+1)) then
945 & (sfctn(kk+1)-sfctn(kk))*(ta-t(kk))/(t(kk+1)-t(kk))
948 & (sfctn(kk)-sfctn(kk-1))*(ta-t(kk))/(t(kk)-t(kk-1))
952 end subroutine sfctens
953 !***********************************************************************
955 !***********************************************************************
956 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
957 ! - further updates M. Klose
959 subroutine dsd_rain(rnrate,raind,nrbin,dsd_rn,ldsd)
962 real, intent(in) :: raind(nrbin), rnrate ! in m and mm/h
963 integer, intent(in) :: ldsd, nrbin
965 real :: dsd_mp(nrbin)
966 real :: dsd_ss(nrbin)
967 real :: dsd_wt(nrbin)
968 real :: dsd_fl(nrbin)
971 real :: pi, dr, wc, d0, dcm, const, dumm
973 real, intent(out) :: dsd_rn(nrbin)
974 !.......................................................................
979 dr=raind(nk)*1.e3 ! m to mm
983 ! Marshall-Palmer(1948)
984 dsd_mp(nk)=8.e3*exp(-4.1*dr*rnrate**(-0.21)) ! 1/m^3/mm
985 dsd_mp(nk)=dsd_mp(nk)*1.e-5 ! 1/cm^3/cm
986 dsd_rn(nk)=dsd_mp(nk)
988 elseif(ldsd.eq.2) then
990 ! Sekhon and Srivastava
991 dsd_ss(nk)=0.07*rnrate**0.37*exp(-3.8*dr/rnrate**0.14) ! cm^(-3) cm^(-1)
992 dsd_rn(nk)=dsd_ss(nk)
994 elseif(ldsd.eq.3) then
996 ! Willis-Tattelman(1989)
997 wc=0.062*rnrate**0.913 ! water content in g/m^3
998 d0=0.1571*wc**0.1681 ! median volume diameter in cm
999 ng=512.85*wc*1.e-6/d0**4*d0**(-2.16)
1000 dcm=dr*0.1 ! diameter in cm
1001 dsd_wt(nk)=ng*dcm**2.16*exp(-5.5880*dcm/d0) ! #/cm^3/cm
1002 dsd_rn(nk)=dsd_wt(nk)
1004 elseif(ldsd.eq.4) then
1006 ! Feingold-Levin(1986)
1008 const=sqrt(2*pi)*alog(1.43)
1009 nt=172*rnrate**0.22 ! 1/m^3
1010 dg=0.72*rnrate**0.21
1011 dumm=0.5*alog(dr/dg)**2/alog(1.43)**2
1012 dsd_fl(nk)=nt/const/dr*exp(-dumm) ! 1/m^3/mm
1013 dsd_fl(nk)=dsd_fl(nk)*1.e-5 ! 1/cm^3/cm
1014 dsd_rn(nk)=dsd_fl(nk)
1021 end subroutine dsd_rain
1023 !***********************************************************************
1026 !***********************************************************************
1027 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
1028 ! - further updates M. Klose
1030 subroutine w_p(d,rho,wt)
1032 ! Yaping Shao 28-07-92
1034 ! Calculate Terminal velocity for spherical grain
1035 ! wt : terminal velocity [m/s]
1036 ! d : particle diameter [m]
1037 ! rho : particle density [kg/m3]
1039 ! Parameter specifications
1041 IMPLICIT NONE ! cfrick
1043 REAL, INTENT(OUT) :: wt
1045 REAL :: rden, err, test, x, xl, xh
1046 REAL :: f, fm, fl, fh
1048 real, intent(in) :: rho, d
1051 REAL, PARAMETER :: visc=1.5E-05
1052 INTEGER :: debug_level
1054 CHARACTER*(100) :: text
1056 ! VARIABLE X IS WT, FUNCTION F IS: CD(RE)*WT**2 - 4*D*G*RDEN/3
1059 CALL get_wrf_debug_level(debug_level)
1061 rden=rho ! particle density
1062 lambda=0.0651*1.e-6 ! mean free path of air
1063 cc=1+(2*lambda/d)*(1.257+0.4*exp(-1.1*d/(2*lambda))) ! Cunningham's correction for small particles
1070 fl = CDSPH(wt*d/visc)*wt**2/cc - 4.0*d*g*rden/3.0
1073 fh = CDSPH(wt*d/visc)*wt**2/cc - 4.0*d*g*rden/3.0
1075 IF (fh*fl.GT.0) call wrf_debug (debug_level,'w_t: F(XL), F(XH) HAVE SAME SIGN - ERROR - UoC dust wet deposition')
1076 IF (fh-fl.EQ.0) call wrf_debug (debug_level,'w_t: F(XL) = F(XH) - ERROR - UoC dust wet deposition')
1079 IF (fh.LT.fl) isign=-1
1087 f = CDSPH(wt*d/visc)*wt**2/cc - 4.0*d*g*rden/3.0
1089 IF (fm.GT.fh.OR.fm.LT.fl) call wrf_debug (debug_level,'w_t: F(X) NON-MONOTONIC - ERROR - UoC dust wet deposition')
1095 test=ABS(xh-xl)/ABS(x)
1096 IF (test.LT.ABS(err)) then
1100 call wrf_debug (debug_level,'w_t: NO SOLUTION IN 100 LOOPS - ERROR - UoC dust wet deposition')
1103 !***************************************************************
1106 !***********************************************************************
1107 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
1108 ! - further updates M. Klose
1110 SUBROUTINE w_t (wt, dmm, rhop, rhoa)
1112 ! Yaping Shao 28-07-92
1114 ! Calculate Terminal velocity for spherical grain
1115 ! wt : terminal velocity [m/s]
1116 ! dmm: particle diameter in [m]
1117 ! rhop: particle density [kg/m3]
1118 ! rhoa: air density [kg/m3]
1120 ! Parameter specifications
1122 ! include Cunningham's correction - Claudia Frick 24-04-2014
1124 REAL(8), INTENT(IN) :: rhop
1125 REAL, INTENT(IN) :: rhoa
1128 REAL :: RDEN, D, ERR, TEST, X, XL, XH
1129 REAL :: F, FM, FL, FH
1130 REAL, PARAMETER :: VISC=1.5E-05
1133 CHARACTER*(100) :: text
1138 ! VARIABLE X IS WT, FUNCTION F IS: CD(RE)*WT**2 - 4*D*G*RDEN/3
1141 RDEN=rhop/rhoa ! = sigma
1142 lambda=0.0651*1.e-6 ! mean free path of air
1143 cc=1+(2*lambda/D)*(1.257+0.4*exp(-1.1*D/(2*lambda))) ! Cunningham's correction for small particles
1149 FL = CDSPH(WT*D/VISC)*WT**2/cc - 4.0*D*G*RDEN/3.0
1151 FH = CDSPH(WT*D/VISC)*WT**2/cc - 4.0*D*G*RDEN/3.0
1152 IF (FH*FL.GT.0) call wrf_debug (debug_level,'w_t: F(XL), F(XH) HAVE SAME SIGN - ERROR - UoC dust wet deposition')
1153 IF (FH-FL.EQ.0) call wrf_debug (debug_level,'w_t: F(XL) = F(XH) - ERROR - UoC dust wet deposition')
1155 IF (FH.LT.FL) ISIGN=-1
1161 F = CDSPH(WT*D/VISC)*WT**2/cc - 4.0*D*G*RDEN/3.0
1163 IF (FM.GT.FH.OR.FM.LT.FL) call wrf_debug (debug_level,'w_t: F(X) NON-MONOTONIC - ERROR - UoC dust wet deposition')
1169 TEST=ABS(XH-XL)/ABS(X)
1170 IF (TEST.LT.ABS(ERR)) then
1174 call wrf_debug (debug_level,'w_t: NO SOLUTION IN 100 LOOPS - ERROR - UoC dust wet deposition')
1177 !***************************************************************
1180 !---------------------------------------------------------------
1181 ! CEMSYS5 - smaller modifications by cfrick for WRF implementation
1182 real FUNCTION CDSPH(RE)
1185 ! ADAPTED 10-OCT-89 (NO ISTOKE, NO CRASH FOR RE>50000)
1186 ! CALCULATES DRAG COEFFICIENT CD FOR A SPHERE, AS A FUNCTION OF
1187 ! REYNOLDS NUMBER RE, WHERE:
1188 ! DRAG FORCE = (RHO * PI * D**2 * U**2) / 8
1189 ! RE = U * D / VISCOSITY
1190 ! (D = SPHERE DIAMETER, U = VELOCITY, RHO = FLUID DENSITY)
1191 ! ALGORITHM FROM MORSI AND ALEXANDER (1972, JFM 55, 193-208), CHECKED
1192 ! AGAINST THEIR TABLE FOR CD(SPHERE).
1193 ! FOR RE > 50000, SET CDSPH = 0.48802, THE VALUE AT RE=50000=5*10**4.
1194 ! THIS IS OK TO RE=3*10**5 (APPROX), BEYOND WHICH DRAG CRISIS OCCURS
1195 ! AND SETS CDSPH TO ABOUT 0.1.
1197 IMPLICIT NONE ! cfrick
1203 STOP 'CDSPH: RE.LE.0'
1204 ELSE IF (RE.LE.0.1) THEN
1206 ELSE IF (RE.LE.1) THEN
1207 CDSPH = 22.73/RE + 0.0903/RE**2 + 3.69
1208 ELSE IF (RE.LE.10) THEN
1209 CDSPH = 29.1667/RE - 3.8889/RE**2 + 1.222
1210 ELSE IF (RE.LE.100) THEN
1211 CDSPH = 46.5/RE - 116.67/RE**2 + 0.6167
1212 ELSE IF (RE.LE.1000) THEN
1213 CDSPH = 98.33/RE - 2778/RE**2 + 0.3644
1214 ELSE IF (RE.LE.5000) THEN
1215 CDSPH = 148.62/RE - 47500/RE**2 + 0.357
1216 ELSE IF (RE.LE.10000) THEN
1217 CDSPH = -490.546/RE + 578700/RE**2 + 0.46
1218 ELSE IF (RE.LE.50000) THEN
1219 CDSPH = -1662.5/RE + 5416700/RE**2 + 0.5191
1225 !--------------------------------------------------------------------
1228 END MODULE module_uoc_dustwd