source: palm/trunk/SOURCE/lpm_collision_kernels.f90 @ 1321

Last change on this file since 1321 was 1321, checked in by raasch, 10 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 40.8 KB
RevLine 
[828]1 MODULE lpm_collision_kernels_mod
[790]2
[1036]3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
[1310]17! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]18!--------------------------------------------------------------------------------!
19!
[790]20! Current revisions:
21! -----------------
[1321]22!
23! Former revisions:
24! -----------------
25! $Id: lpm_collision_kernels.f90 1321 2014-03-20 09:40:40Z raasch $
26!
27! 1320 2014-03-20 08:40:49Z
[1320]28! ONLY-attribute added to USE-statements,
29! kind-parameters added to all INTEGER and REAL declaration statements,
30! kinds are defined in new module kinds,
31! revision history before 2012 removed,
32! comment fields (!:) to be used for variable explanations added to
33! all variable declaration statements
[1008]34!
[1093]35! 1092 2013-02-02 11:24:22Z raasch
36! unused variables removed
37!
[1072]38! 1071 2012-11-29 16:54:55Z franke
39! Bugfix: collision efficiencies for Hall kernel should not be < 1.0E-20
40!
[1037]41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
[1008]44! 1007 2012-09-19 14:30:36Z franke
[1007]45! converted all units to SI units and replaced some parameters by corresponding
46! PALM parameters
47! Bugfix: factor in calculation of enhancement factor for collision efficencies
48! changed from 10. to 1.0
[829]49!
[850]50! 849 2012-03-15 10:35:09Z raasch
51! routine collision_efficiency_rogers added (moved from former advec_particles
52! to here)
53!
[836]54! 835 2012-02-22 11:21:19Z raasch $
55! Bugfix: array diss can be used only in case of Wang kernel
56!
[829]57! 828 2012-02-21 12:00:36Z raasch
[828]58! code has been completely reformatted, routine colker renamed
59! recalculate_kernel,
60! routine init_kernels added, radius is now communicated to the collision
61! routines by array radclass
[790]62!
[828]63! Bugfix: transformation factor for dissipation changed from 1E5 to 1E4
64!
[826]65! 825 2012-02-19 03:03:44Z raasch
66! routine renamed from wang_kernel to lpm_collision_kernels,
67! turbulence_effects on collision replaced by wang_kernel
68!
[791]69! 790 2011-11-29 03:11:20Z raasch
70! initial revision
[790]71!
72! Description:
73! ------------
[828]74! This module calculates collision efficiencies either due to pure gravitational
75! effects (Hall kernel, see Hall, 1980: J. Atmos. Sci., 2486-2507) or
76! including the effects of (SGS) turbulence (Wang kernel, see Wang and
77! Grabowski, 2009: Atmos. Sci. Lett., 10, 1-8). The original code has been
78! provided by L.-P. Wang but is substantially reformatted and speed optimized
79! here.
80!
81! ATTENTION:
82! Physical quantities (like g, densities, etc.) used in this module still
83! have to be adjusted to those values used in the main PALM code.
84! Also, quantities in CGS-units should be converted to SI-units eventually.
[790]85!------------------------------------------------------------------------------!
86
[1320]87    USE constants,                                                             &
88        ONLY:  pi
89       
90    USE kinds
91
92    USE particle_attributes,                                                   &
93        ONLY:  collision_kernel, dissipation_classes, particles, radius_classes
94
[828]95    USE pegrid
[790]96
[828]97
[790]98    IMPLICIT NONE
99
100    PRIVATE
101
[849]102    PUBLIC  ckernel, collision_efficiency_rogers, init_kernels, &
[1007]103            rclass_lbound, rclass_ubound, recalculate_kernel
[790]104
[1320]105    REAL(wp) ::  epsilon       !:
106    REAL(wp) ::  eps2          !:
107    REAL(wp) ::  rclass_lbound !:
108    REAL(wp) ::  rclass_ubound !:
109    REAL(wp) ::  urms          !:
110    REAL(wp) ::  urms2         !:
[790]111
[1320]112    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  epsclass !:
113    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  radclass !:
114    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  winf     !:
115   
116    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ec       !:
117    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ecf      !:
118    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  gck      !:
119    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hkernel  !:
120    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hwratio  !:
121   
122    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE   ::  ckernel !:
[792]123
[828]124    SAVE
[792]125
[790]126!
127!-- Public interfaces
[849]128    INTERFACE collision_efficiency_rogers
129       MODULE PROCEDURE collision_efficiency_rogers
130    END INTERFACE collision_efficiency_rogers
131
[828]132    INTERFACE init_kernels
133       MODULE PROCEDURE init_kernels
134    END INTERFACE init_kernels
[790]135
[828]136    INTERFACE recalculate_kernel
137       MODULE PROCEDURE recalculate_kernel
138    END INTERFACE recalculate_kernel
[790]139
140
[828]141    CONTAINS
[790]142
[792]143
[828]144    SUBROUTINE init_kernels
145!------------------------------------------------------------------------------!
146! Initialization of the collision efficiency matrix with fixed radius and
147! dissipation classes, calculated at simulation start only.
148!------------------------------------------------------------------------------!
[792]149
[828]150       IMPLICIT NONE
[792]151
[1320]152       INTEGER(iwp) ::  i !:
153       INTEGER(iwp) ::  j !:
154       INTEGER(iwp) ::  k !:
[790]155
[828]156
157!
158!--    Calculate collision efficiencies for fixed radius- and dissipation
159!--    classes
160       IF ( collision_kernel(6:9) == 'fast' )  THEN
161
162          ALLOCATE( ckernel(1:radius_classes,1:radius_classes,               &
163                    0:dissipation_classes), epsclass(1:dissipation_classes), &
164                    radclass(1:radius_classes) )
165
166!
167!--       Calculate the radius class bounds with logarithmic distances
168!--       in the interval [1.0E-6, 2.0E-4] m
169          rclass_lbound = LOG( 1.0E-6 )
170          rclass_ubound = LOG( 2.0E-4 )
171          radclass(1)   = 1.0E-6
172          DO  i = 2, radius_classes
173             radclass(i) = EXP( rclass_lbound +                                &
174                                ( rclass_ubound - rclass_lbound ) * ( i-1.0 ) /&
175                                ( radius_classes - 1.0 ) )
176!             IF ( myid == 0 )  THEN
177!                PRINT*, 'i=', i, ' r = ', radclass(i)*1.0E6
178!             ENDIF
179          ENDDO
180
181!
[1007]182!--       Set the class bounds for dissipation in interval [0.0, 0.1] m**2/s**3
[828]183          DO  i = 1, dissipation_classes
[1007]184             epsclass(i) = 0.1 * REAL( i ) / dissipation_classes
[828]185!             IF ( myid == 0 )  THEN
186!                PRINT*, 'i=', i, ' eps = ', epsclass(i)
187!             ENDIF
188          ENDDO
189!
190!--       Calculate collision efficiencies of the Wang/ayala kernel
191          ALLOCATE( ec(1:radius_classes,1:radius_classes),  &
192                    ecf(1:radius_classes,1:radius_classes), &
193                    gck(1:radius_classes,1:radius_classes), &
194                    winf(1:radius_classes) )
195
196          DO  k = 1, dissipation_classes
197
198             epsilon = epsclass(k)
[1007]199             urms    = 2.02 * ( epsilon / 0.04 )**( 1.0 / 3.0 )
[828]200
201             CALL turbsd
202             CALL turb_enhance_eff
203             CALL effic
204
205             DO  j = 1, radius_classes
206                DO  i = 1, radius_classes
207                   ckernel(i,j,k) = ec(i,j) * gck(i,j) * ecf(i,j)
208                ENDDO
209             ENDDO
210
211          ENDDO
212
213!
214!--       Calculate collision efficiencies of the Hall kernel
215          ALLOCATE( hkernel(1:radius_classes,1:radius_classes), &
216                    hwratio(1:radius_classes,1:radius_classes) )
217
218          CALL fallg
219          CALL effic
220
221          DO  j = 1, radius_classes
222             DO  i =  1, radius_classes
223                hkernel(i,j) = pi * ( radclass(j) + radclass(i) )**2 &
224                                  * ec(i,j) * ABS( winf(j) - winf(i) )
225                ckernel(i,j,0) = hkernel(i,j)  ! hall kernel stored on index 0
226              ENDDO
227          ENDDO
228
229!
230!--       Test output of efficiencies
231          IF ( j == -1 )  THEN
232
233             PRINT*, '*** Hall kernel'
[1007]234             WRITE ( *,'(5X,20(F4.0,1X))' ) ( radclass(i)*1.0E6, &
235                                              i = 1,radius_classes )
[828]236             DO  j = 1, radius_classes
[1007]237                WRITE ( *,'(F4.0,1X,20(F8.4,1X))' ) radclass(j),  &
238                                          ( hkernel(i,j), i = 1,radius_classes )
[828]239             ENDDO
240
241             DO  k = 1, dissipation_classes
242                DO  i = 1, radius_classes
243                   DO  j = 1, radius_classes
244                      IF ( hkernel(i,j) == 0.0 )  THEN
245                         hwratio(i,j) = 9999999.9
246                      ELSE
247                         hwratio(i,j) = ckernel(i,j,k) / hkernel(i,j)
248                      ENDIF
249                   ENDDO
250                ENDDO
251
252                PRINT*, '*** epsilon = ', epsclass(k)
[1007]253                WRITE ( *,'(5X,20(F4.0,1X))' ) ( radclass(i)*1.0E6, &
254                                                 i = 1,radius_classes )
[828]255                DO  j = 1, radius_classes
[1007]256!                   WRITE ( *,'(F4.0,1X,20(F4.2,1X))' ) radclass(j)*1.0E6, &
257!                                       ( ckernel(i,j,k), i = 1,radius_classes )
258                   WRITE ( *,'(F4.0,1X,20(F8.4,1X))' ) radclass(j)*1.0E6, &
259                                          ( hwratio(i,j), i = 1,radius_classes )
[828]260                ENDDO
261             ENDDO
262
263          ENDIF
264
265          DEALLOCATE( ec, ecf, epsclass, gck, hkernel, winf )
266
267       ELSEIF( collision_kernel == 'hall'  .OR.  collision_kernel == 'wang' ) &
268       THEN
269!
270!--       Initial settings for Hall- and Wang-Kernel
271!--       To be done: move here parts from turbsd, fallg, ecoll, etc.
272       ENDIF
273
274    END SUBROUTINE init_kernels
275
276
[790]277!------------------------------------------------------------------------------!
[828]278! Calculation of collision kernels during each timestep and for each grid box
[790]279!------------------------------------------------------------------------------!
[828]280    SUBROUTINE recalculate_kernel( i1, j1, k1 )
[790]281
[1320]282       USE arrays_3d,                                                          &
283           ONLY:  diss
[790]284
[1320]285       USE particle_attributes,                                                &
286           ONLY:  prt_count, prt_start_index, radius_classes, wang_kernel
287
[790]288       IMPLICIT NONE
289
[1320]290       INTEGER(iwp) ::  i      !:
291       INTEGER(iwp) ::  i1     !:
292       INTEGER(iwp) ::  j      !:
293       INTEGER(iwp) ::  j1     !:
294       INTEGER(iwp) ::  k1     !:
295       INTEGER(iwp) ::  pend   !:
296       INTEGER(iwp) ::  pstart !:
[790]297
298
[828]299       pstart = prt_start_index(k1,j1,i1)
300       pend   = prt_start_index(k1,j1,i1) + prt_count(k1,j1,i1) - 1
301       radius_classes = prt_count(k1,j1,i1)
[792]302
[828]303       ALLOCATE( ec(1:radius_classes,1:radius_classes), &
304                 radclass(1:radius_classes), winf(1:radius_classes) )
[790]305
[828]306!
[1007]307!--    Store particle radii on the radclass array
308       radclass(1:radius_classes) = particles(pstart:pend)%radius
[790]309
[835]310       IF ( wang_kernel )  THEN
[1007]311          epsilon = diss(k1,j1,i1)   ! dissipation rate in m**2/s**3
[835]312       ELSE
313          epsilon = 0.0
314       ENDIF
[1007]315       urms    = 2.02 * ( epsilon / 0.04 )**( 0.33333333333 )
[790]316
[1007]317       IF ( wang_kernel  .AND.  epsilon > 1.0E-7 )  THEN
[828]318!
319!--       Call routines to calculate efficiencies for the Wang kernel
320          ALLOCATE( gck(1:radius_classes,1:radius_classes), &
321                    ecf(1:radius_classes,1:radius_classes) )
[790]322
[828]323          CALL turbsd
324          CALL turb_enhance_eff
325          CALL effic
[790]326
[828]327          DO  j = 1, radius_classes
328             DO  i =  1, radius_classes
329                ckernel(pstart+i-1,pstart+j-1,1) = ec(i,j) * gck(i,j) * ecf(i,j)
[790]330             ENDDO
[828]331          ENDDO
[790]332
[828]333          DEALLOCATE( gck, ecf )
[790]334
335       ELSE
[828]336!
337!--       Call routines to calculate efficiencies for the Hall kernel
[790]338          CALL fallg
339          CALL effic
340
[828]341          DO  j = 1, radius_classes
342             DO  i =  1, radius_classes
343                ckernel(pstart+i-1,pstart+j-1,1) = pi *                       &
344                                          ( radclass(j) + radclass(i) )**2    &
345                                          * ec(i,j) * ABS( winf(j) - winf(i) )
[790]346             ENDDO
347          ENDDO
348
349       ENDIF
350
[828]351       DEALLOCATE( ec, radclass, winf )
[790]352
[828]353    END SUBROUTINE recalculate_kernel
[790]354
[828]355
[790]356!------------------------------------------------------------------------------!
[828]357! Calculation of gck
358! This is from Aayala 2008b, page 37ff.
359! Necessary input parameters: water density, radii of droplets, air density,
360! air viscosity, turbulent dissipation rate, taylor microscale reynolds number,
361! gravitational acceleration  --> to be replaced by PALM parameters
[790]362!------------------------------------------------------------------------------!
[792]363    SUBROUTINE turbsd
[799]364
[1320]365       USE control_parameters,                                                 &
366           ONLY:  g, molecular_viscosity
367   
368       USE particle_attributes,                                                &
369           ONLY:  radius_classes
[790]370
371       IMPLICIT NONE
[1320]372       
373       LOGICAL, SAVE ::  first = .TRUE. !:
[790]374
[1320]375       INTEGER(iwp) ::  i     !:
376       INTEGER(iwp) ::  j     !:
[790]377
[1320]378       REAL(wp) ::  ao        !:
379       REAL(wp) ::  ao_gr     !:
380       REAL(wp) ::  bbb       !:
381       REAL(wp) ::  be        !:
382       REAL(wp) ::  b1        !:
383       REAL(wp) ::  b2        !:
384       REAL(wp) ::  ccc       !:
385       REAL(wp) ::  c1        !:
386       REAL(wp) ::  c1_gr     !:
387       REAL(wp) ::  c2        !:
388       REAL(wp) ::  d1        !:
389       REAL(wp) ::  d2        !:
390       REAL(wp) ::  eta       !:
391       REAL(wp) ::  e1        !:
392       REAL(wp) ::  e2        !:
393       REAL(wp) ::  fao_gr    !:
394       REAL(wp) ::  fr        !:
395       REAL(wp) ::  grfin     !:
396       REAL(wp) ::  lambda    !:
397       REAL(wp) ::  lambda_re !:
398       REAL(wp) ::  lf        !:
399       REAL(wp) ::  rc        !:
400       REAL(wp) ::  rrp       !:
401       REAL(wp) ::  sst       !:
402       REAL(wp) ::  tauk      !:
403       REAL(wp) ::  tl        !:
404       REAL(wp) ::  t2        !:
405       REAL(wp) ::  tt        !:
406       REAL(wp) ::  t1        !:
407       REAL(wp) ::  vk        !:
408       REAL(wp) ::  vrms1xy   !:
409       REAL(wp) ::  vrms2xy   !:
410       REAL(wp) ::  v1        !:
411       REAL(wp) ::  v1v2xy    !:
412       REAL(wp) ::  v1xysq    !:
413       REAL(wp) ::  v2        !:
414       REAL(wp) ::  v2xysq    !:
415       REAL(wp) ::  wrfin     !:
416       REAL(wp) ::  wrgrav2   !:
417       REAL(wp) ::  wrtur2xy  !:
418       REAL(wp) ::  xx        !:
419       REAL(wp) ::  yy        !:
420       REAL(wp) ::  z         !:
[790]421
[1320]422       REAL(wp), DIMENSION(1:radius_classes) ::  st  !:
423       REAL(wp), DIMENSION(1:radius_classes) ::  tau !:
424       
[799]425!
[828]426!--    Initial assignment of constants
[799]427       IF ( first )  THEN
[790]428
[799]429          first = .FALSE.
[790]430
[1007]431       ENDIF
[790]432
[1007]433       lambda    = urms * SQRT( 15.0 * molecular_viscosity / epsilon )    ! in m
434       lambda_re = urms**2 * SQRT( 15.0 / epsilon / molecular_viscosity )
[828]435       tl        = urms**2 / epsilon                       ! in s
[1007]436       lf        = 0.5 * urms**3 / epsilon                 ! in m
437       tauk      = SQRT( molecular_viscosity / epsilon )                  ! in s
438       eta       = ( molecular_viscosity**3 / epsilon )**0.25             ! in m
439       vk        = eta / tauk
[790]440
[828]441       ao = ( 11.0 + 7.0 * lambda_re ) / ( 205.0 + lambda_re )
442       tt = SQRT( 2.0 * lambda_re / ( SQRT( 15.0 ) * ao ) ) * tauk   ! in s
[799]443
[1007]444       CALL fallg    ! gives winf in m/s
[790]445
[828]446       DO  i = 1, radius_classes
[1007]447          tau(i) = winf(i) / g    ! in s
[828]448          st(i)  = tau(i) / tauk
[790]449       ENDDO
450
[828]451!
452!--    Calculate wr (from Aayala 2008b, page 38f)
453       z   = tt / tl
454       be  = SQRT( 2.0 ) * lambda / lf
455       bbb = SQRT( 1.0 - 2.0 * be**2 )
456       d1  = ( 1.0 + bbb ) / ( 2.0 * bbb )
[1007]457       e1  = lf * ( 1.0 + bbb ) * 0.5   ! in m
[828]458       d2  = ( 1.0 - bbb ) * 0.5 / bbb
[1007]459       e2  = lf * ( 1.0 - bbb ) * 0.5   ! in m
[828]460       ccc = SQRT( 1.0 - 2.0 * z**2 )
461       b1  = ( 1.0 + ccc ) * 0.5 / ccc
462       c1  = tl * ( 1.0 + ccc ) * 0.5   ! in s
463       b2  = ( 1.0 - ccc ) * 0.5 / ccc
464       c2  = tl * ( 1.0 - ccc ) * 0.5   ! in s
[790]465
[828]466       DO  i = 1, radius_classes
[790]467
[1007]468          v1 = winf(i)        ! in m/s
[828]469          t1 = tau(i)         ! in s
[790]470
[828]471          DO  j = 1, i
[1007]472             rrp = radclass(i) + radclass(j)
473             v2  = winf(j)                                 ! in m/s
[828]474             t2  = tau(j)                                  ! in s
[790]475
[1007]476             v1xysq  = b1 * d1 * phi_w(c1,e1,v1,t1) - b1 * d2 * phi_w(c1,e2,v1,t1) &
477                     - b2 * d1 * phi_w(c2,e1,v1,t1) + b2 * d2 * phi_w(c2,e2,v1,t1)
478             v1xysq  = v1xysq * urms**2 / t1                ! in m**2/s**2
479             vrms1xy = SQRT( v1xysq )                       ! in m/s
[790]480
[1007]481             v2xysq  = b1 * d1 * phi_w(c1,e1,v2,t2) - b1 * d2 * phi_w(c1,e2,v2,t2) &
482                     - b2 * d1 * phi_w(c2,e1,v2,t2) + b2 * d2 * phi_w(c2,e2,v2,t2)
483             v2xysq  = v2xysq * urms**2 / t2                ! in m**2/s**2
484             vrms2xy = SQRT( v2xysq )                       ! in m/s
[790]485
[828]486             IF ( winf(i) >= winf(j) )  THEN
[799]487                v1 = winf(i)
[790]488                t1 = tau(i)
[799]489                v2 = winf(j)
[790]490                t2 = tau(j)
491             ELSE
[799]492                v1 = winf(j)
[790]493                t1 = tau(j)
[799]494                v2 = winf(i)
[790]495                t2 = tau(i)
496             ENDIF
497
[828]498             v1v2xy   =  b1 * d1 * zhi(c1,e1,v1,t1,v2,t2) - &
499                         b1 * d2 * zhi(c1,e2,v1,t1,v2,t2) - &
500                         b2 * d1 * zhi(c2,e1,v1,t1,v2,t2) + &
501                         b2 * d2* zhi(c2,e2,v1,t1,v2,t2)
502             fr       = d1 * EXP( -rrp / e1 ) - d2 * EXP( -rrp / e2 )
[1007]503             v1v2xy   = v1v2xy * fr * urms**2 / tau(i) / tau(j)  ! in m**2/s**2
504             wrtur2xy = vrms1xy**2 + vrms2xy**2 - 2.0 * v1v2xy   ! in m**2/s**2
[828]505             IF ( wrtur2xy < 0.0 )  wrtur2xy = 0.0
506             wrgrav2  = pi / 8.0 * ( winf(j) - winf(i) )**2
[1007]507             wrfin    = SQRT( ( 2.0 / pi ) * ( wrtur2xy + wrgrav2) )   ! in m/s
[790]508
[828]509!
510!--          Calculate gr
511             IF ( st(j) > st(i) )  THEN
512                sst = st(j)
[790]513             ELSE
[828]514                sst = st(i)
[790]515             ENDIF
516
[828]517             xx = -0.1988 * sst**4 + 1.5275 * sst**3 - 4.2942 * sst**2 + &
518                   5.3406 * sst
519             IF ( xx < 0.0 )  xx = 0.0
520             yy = 0.1886 * EXP( 20.306 / lambda_re )
[790]521
[1007]522             c1_gr  =  xx / ( g / vk * tauk )**yy
[790]523
[1007]524             ao_gr  = ao + ( pi / 8.0) * ( g / vk * tauk )**2
[828]525             fao_gr = 20.115 * SQRT( ao_gr / lambda_re )
526             rc     = SQRT( fao_gr * ABS( st(j) - st(i) ) ) * eta   ! in cm
[790]527
[828]528             grfin  = ( ( eta**2 + rc**2 ) / ( rrp**2 + rc**2) )**( c1_gr*0.5 )
529             IF ( grfin < 1.0 )  grfin = 1.0
[790]530
[828]531             gck(i,j) = 2.0 * pi * rrp**2 * wrfin * grfin           ! in cm**3/s
[790]532             gck(j,i) = gck(i,j)
533
534          ENDDO
535       ENDDO
536
[828]537    END SUBROUTINE turbsd
[790]538
[828]539
[790]540!------------------------------------------------------------------------------!
[1007]541! phi_w as a function
[790]542!------------------------------------------------------------------------------!
[1320]543    REAL(wp) FUNCTION phi_w( a, b, vsett, tau0 )
[790]544
545       IMPLICIT NONE
546
[1320]547       REAL(wp) ::  a     !:
548       REAL(wp) ::  aa1   !:
549       REAL(wp) ::  b     !:
550       REAL(wp) ::  tau0  !:
551       REAL(wp) ::  vsett !:
[790]552
[828]553       aa1 = 1.0 / tau0 + 1.0 / a + vsett / b
[1007]554       phi_w = 1.0 / aa1  - 0.5 * vsett / b / aa1**2  ! in s
[790]555
[1007]556    END FUNCTION phi_w
[792]557
[790]558
559!------------------------------------------------------------------------------!
[1007]560! zhi as a function
[790]561!------------------------------------------------------------------------------!
[1320]562    REAL(wp) FUNCTION zhi( a, b, vsett1, tau1, vsett2, tau2 )
[790]563
564       IMPLICIT NONE
565
[1320]566       REAL(wp) ::  a      !:
567       REAL(wp) ::  aa1    !:
568       REAL(wp) ::  aa2    !:
569       REAL(wp) ::  aa3    !:
570       REAL(wp) ::  aa4    !:
571       REAL(wp) ::  aa5    !:
572       REAL(wp) ::  aa6    !:
573       REAL(wp) ::  b      !:
574       REAL(wp) ::  tau1   !:
575       REAL(wp) ::  tau2   !:
576       REAL(wp) ::  vsett1 !:
577       REAL(wp) ::  vsett2 !:
[790]578
[828]579       aa1 = vsett2 / b - 1.0 / tau2 - 1.0 / a
580       aa2 = vsett1 / b + 1.0 / tau1 + 1.0 / a
581       aa3 = ( vsett1 - vsett2 ) / b + 1.0 / tau1 + 1.0 / tau2
582       aa4 = ( vsett2 / b )**2 - ( 1.0 / tau2 + 1.0 / a )**2
583       aa5 = vsett2 / b + 1.0 / tau2 + 1.0 / a
584       aa6 = 1.0 / tau1 - 1.0 / a + ( 1.0 / tau2 + 1.0 / a) * vsett1 / vsett2
585       zhi = (1.0 / aa1 - 1.0 / aa2 ) * ( vsett1 - vsett2 ) * 0.5 / b / aa3**2 &
586           + (4.0 / aa4 - 1.0 / aa5**2 - 1.0 / aa1**2 ) * vsett2 * 0.5 / b /aa6&
587           + (2.0 * ( b / aa2 - b / aa1 ) - vsett1 / aa2**2 + vsett2 / aa1**2 )&
588           * 0.5 / b / aa3      ! in s**2
[799]589
[828]590    END FUNCTION zhi
[790]591
[828]592
[790]593!------------------------------------------------------------------------------!
[1007]594! Calculation of terminal velocity winf following Equations 10-138 to 10-145
595! from (Pruppacher and Klett, 1997)
[790]596!------------------------------------------------------------------------------!
[828]597    SUBROUTINE fallg
[1320]598 
599       USE cloud_parameters,                                                   &
600           ONLY:  rho_l
601   
602       USE control_parameters,                                                 &
603           ONLY:  g
[790]604
[1320]605       USE particle_attributes,                                                &
606           ONLY:  radius_classes
[790]607
[1320]608
[828]609       IMPLICIT NONE
[790]610
[1320]611       INTEGER(iwp) ::  i !:
612       INTEGER(iwp) ::  j !:
[790]613
[1320]614       LOGICAL, SAVE ::  first = .TRUE. !:
[790]615
[1320]616       REAL(wp), SAVE ::  cunh  !:
617       REAL(wp), SAVE ::  eta   !:
618       REAL(wp), SAVE ::  phy   !:
619       REAL(wp), SAVE ::  py    !:
620       REAL(wp), SAVE ::  rho_a !:
621       REAL(wp), SAVE ::  sigma !:
622       REAL(wp), SAVE ::  stb   !:
623       REAL(wp), SAVE ::  stok  !:
624       REAL(wp), SAVE ::  xlamb !:
[790]625
[1320]626       REAL(wp) ::  bond        !:
627       REAL(wp) ::  x           !:
628       REAL(wp) ::  xrey        !:
629       REAL(wp) ::  y           !:
[799]630
[1320]631       REAL(wp), DIMENSION(1:7), SAVE  ::  b !:
632       REAL(wp), DIMENSION(1:6), SAVE  ::  c !:
[799]633
634!
[828]635!--    Initial assignment of constants
636       IF ( first )  THEN
[799]637
[828]638          first = .FALSE.
639          b = (/  -0.318657E1,  0.992696E0, -0.153193E-2, -0.987059E-3, &
640                 -0.578878E-3, 0.855176E-4, -0.327815E-5 /)
641          c = (/  -0.500015E1,  0.523778E1,  -0.204914E1,   0.475294E0, &
642                 -0.542819E-1, 0.238449E-2 /)
[790]643
[1007]644!
645!--       Parameter values for p = 1013,25 hPa and T = 293,15 K
646          eta   = 1.818E-5         ! in kg/(m s)
647          xlamb = 6.6E-8           ! in m
648          rho_a = 1.204            ! in kg/m**3
649          cunh  = 1.26 * xlamb     ! in m
650          sigma = 0.07363          ! in kg/s**2
651          stok  = 2.0  * g * ( rho_l - rho_a ) / ( 9.0 * eta ) ! in 1/(m s)
652          stb   = 32.0 * rho_a * ( rho_l - rho_a) * g / (3.0 * eta * eta)
653          phy   = sigma**3 * rho_a**2 / ( eta**4 * g * ( rho_l - rho_a ) )
[828]654          py    = phy**( 1.0 / 6.0 )
[790]655
[828]656       ENDIF
[790]657
[828]658       DO  j = 1, radius_classes
[790]659
[1007]660          IF ( radclass(j) <= 1.0E-5 ) THEN
[799]661
[1007]662             winf(j) = stok * ( radclass(j)**2 + cunh * radclass(j) )
[790]663
[1007]664          ELSEIF ( radclass(j) > 1.0E-5  .AND.  radclass(j) <= 5.35E-4 )  THEN
[790]665
[828]666             x = LOG( stb * radclass(j)**3 )
667             y = 0.0
[790]668
[828]669             DO  i = 1, 7
670                y = y + b(i) * x**(i-1)
671             ENDDO
[1007]672!
673!--          Note: this Eq. is wrong in (Pruppacher and Klett, 1997, p. 418)
674!--          for correct version see (Beard, 1976)
675             xrey = ( 1.0 + cunh / radclass(j) ) * EXP( y ) 
[790]676
[1007]677             winf(j) = xrey * eta / ( 2.0 * rho_a * radclass(j) )
[790]678
[1007]679          ELSEIF ( radclass(j) > 5.35E-4 )  THEN
[790]680
[1007]681             IF ( radclass(j) > 0.0035 )  THEN
682                bond = g * ( rho_l - rho_a ) * 0.0035**2 / sigma
[828]683             ELSE
[1007]684               bond = g * ( rho_l - rho_a ) * radclass(j)**2 / sigma
[828]685             ENDIF
[790]686
[828]687             x = LOG( 16.0 * bond * py / 3.0 )
688             y = 0.0
[790]689
[828]690             DO  i = 1, 6
691                y = y + c(i) * x**(i-1)
692             ENDDO
[790]693
[828]694             xrey = py * EXP( y )
[790]695
[1007]696             IF ( radclass(j) > 0.0035 )  THEN
697                winf(j) = xrey * eta / ( 2.0 * rho_a * 0.0035 )
[828]698             ELSE
[1007]699                winf(j) = xrey * eta / ( 2.0 * rho_a * radclass(j) )
[828]700             ENDIF
[790]701
[828]702          ENDIF
[790]703
[828]704       ENDDO
[790]705
[828]706    END SUBROUTINE fallg
[790]707
[828]708
[790]709!------------------------------------------------------------------------------!
[1071]710! Calculation of collision efficiencies for the Hall kernel
[790]711!------------------------------------------------------------------------------!
[828]712    SUBROUTINE effic
[1320]713 
714       USE particle_attributes,                                                &
715           ONLY:  radius_classes
[790]716
[828]717       IMPLICIT NONE
[790]718
[1320]719       INTEGER(iwp) ::  i  !:
720       INTEGER(iwp) ::  iq !:
721       INTEGER(iwp) ::  ir !:
722       INTEGER(iwp) ::  j  !:
723       INTEGER(iwp) ::  k  !:
[790]724
[1320]725       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  ira !:
[790]726
[1320]727       LOGICAL, SAVE ::  first = .TRUE. !:
[790]728
[1320]729       REAL(wp) ::  ek              !:
730       REAL(wp) ::  particle_radius !:
731       REAL(wp) ::  pp              !:
732       REAL(wp) ::  qq              !:
733       REAL(wp) ::  rq              !:
[790]734
[1320]735       REAL(wp), DIMENSION(1:21), SAVE ::  rat        !:
736       
737       REAL(wp), DIMENSION(1:15), SAVE ::  r0         !:
738       
739       REAL(wp), DIMENSION(1:15,1:21), SAVE ::  ecoll !:
[790]740
[792]741!
[828]742!--    Initial assignment of constants
743       IF ( first )  THEN
[790]744
[792]745         first = .FALSE.
[828]746         r0  = (/ 6.0, 8.0, 10.0, 15.0, 20.0, 25.0, 30.0, 40.0, 50.0, 60., &
747                  70.0, 100.0, 150.0, 200.0, 300.0 /)
748         rat = (/ 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, &
749                  0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, &
750                  1.00 /)
[790]751
[828]752         ecoll(:,1) = (/0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, &
753                        0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001/)
754         ecoll(:,2) = (/0.003, 0.003, 0.003, 0.004, 0.005, 0.005, 0.005, &
755                        0.010, 0.100, 0.050, 0.200, 0.500, 0.770, 0.870, 0.970/)
756         ecoll(:,3) = (/0.007, 0.007, 0.007, 0.008, 0.009, 0.010, 0.010, &
757                        0.070, 0.400, 0.430, 0.580, 0.790, 0.930, 0.960, 1.000/)
758         ecoll(:,4) = (/0.009, 0.009, 0.009, 0.012, 0.015, 0.010, 0.020, &
759                        0.280, 0.600, 0.640, 0.750, 0.910, 0.970, 0.980, 1.000/)
760         ecoll(:,5) = (/0.014, 0.014, 0.014, 0.015, 0.016, 0.030, 0.060, &
761                        0.500, 0.700, 0.770, 0.840, 0.950, 0.970, 1.000, 1.000/)
762         ecoll(:,6) = (/0.017, 0.017, 0.017, 0.020, 0.022, 0.060, 0.100, &
763                        0.620, 0.780, 0.840, 0.880, 0.950, 1.000, 1.000, 1.000/)
764         ecoll(:,7) = (/0.030, 0.030, 0.024, 0.022, 0.032, 0.062, 0.200, &
765                        0.680, 0.830, 0.870, 0.900, 0.950, 1.000, 1.000, 1.000/)
766         ecoll(:,8) = (/0.025, 0.025, 0.025, 0.036, 0.043, 0.130, 0.270, &
767                        0.740, 0.860, 0.890, 0.920, 1.000, 1.000, 1.000, 1.000/)
768         ecoll(:,9) = (/0.027, 0.027, 0.027, 0.040, 0.052, 0.200, 0.400, &
769                        0.780, 0.880, 0.900, 0.940, 1.000, 1.000, 1.000, 1.000/)
770         ecoll(:,10)= (/0.030, 0.030, 0.030, 0.047, 0.064, 0.250, 0.500, &
771                        0.800, 0.900, 0.910, 0.950, 1.000, 1.000, 1.000, 1.000/)
772         ecoll(:,11)= (/0.040, 0.040, 0.033, 0.037, 0.068, 0.240, 0.550, &
773                        0.800, 0.900, 0.910, 0.950, 1.000, 1.000, 1.000, 1.000/)
774         ecoll(:,12)= (/0.035, 0.035, 0.035, 0.055, 0.079, 0.290, 0.580, &
775                        0.800, 0.900, 0.910, 0.950, 1.000, 1.000, 1.000, 1.000/)
776         ecoll(:,13)= (/0.037, 0.037, 0.037, 0.062, 0.082, 0.290, 0.590, &
777                        0.780, 0.900, 0.910, 0.950, 1.000, 1.000, 1.000, 1.000/)
778         ecoll(:,14)= (/0.037, 0.037, 0.037, 0.060, 0.080, 0.290, 0.580, &
779                        0.770, 0.890, 0.910, 0.950, 1.000, 1.000, 1.000, 1.000/)
780         ecoll(:,15)= (/0.037, 0.037, 0.037, 0.041, 0.075, 0.250, 0.540, &
781                        0.760, 0.880, 0.920, 0.950, 1.000, 1.000, 1.000, 1.000/)
782         ecoll(:,16)= (/0.037, 0.037, 0.037, 0.052, 0.067, 0.250, 0.510, &
783                        0.770, 0.880, 0.930, 0.970, 1.000, 1.000, 1.000, 1.000/)
784         ecoll(:,17)= (/0.037, 0.037, 0.037, 0.047, 0.057, 0.250, 0.490, &
785                        0.770, 0.890, 0.950, 1.000, 1.000, 1.000, 1.000, 1.000/)
786         ecoll(:,18)= (/0.036, 0.036, 0.036, 0.042, 0.048, 0.230, 0.470, &
787                        0.780, 0.920, 1.000, 1.020, 1.020, 1.020, 1.020, 1.020/)
788         ecoll(:,19)= (/0.040, 0.040, 0.035, 0.033, 0.040, 0.112, 0.450, &
789                        0.790, 1.010, 1.030, 1.040, 1.040, 1.040, 1.040, 1.040/)
790         ecoll(:,20)= (/0.033, 0.033, 0.033, 0.033, 0.033, 0.119, 0.470, &
791                        0.950, 1.300, 1.700, 2.300, 2.300, 2.300, 2.300, 2.300/)
792         ecoll(:,21)= (/0.027, 0.027, 0.027, 0.027, 0.027, 0.125, 0.520, &
793                        1.400, 2.300, 3.000, 4.000, 4.000, 4.000, 4.000, 4.000/)
794       ENDIF
[790]795
[792]796!
[828]797!--    Calculate the radius class index of particles with respect to array r
[1007]798!--    Radius has to be in µm
[828]799       ALLOCATE( ira(1:radius_classes) )
800       DO  j = 1, radius_classes
[1007]801          particle_radius = radclass(j) * 1.0E6
[828]802          DO  k = 1, 15
803             IF ( particle_radius < r0(k) )  THEN
804                ira(j) = k
805                EXIT
806             ENDIF
807          ENDDO
808          IF ( particle_radius >= r0(15) )  ira(j) = 16
809       ENDDO
[790]810
[792]811!
[828]812!--    Two-dimensional linear interpolation of the collision efficiency.
813!--    Radius has to be in µm
814       DO  j = 1, radius_classes
815          DO  i = 1, j
[792]816
[828]817             ir = ira(j)
818             rq = radclass(i) / radclass(j)
819             iq = INT( rq * 20 ) + 1
820             iq = MAX( iq , 2)
[792]821
[828]822             IF ( ir < 16 )  THEN
823                IF ( ir >= 2 )  THEN
[1007]824                   pp = ( ( radclass(j) * 1.0E06 ) - r0(ir-1) ) / &
[828]825                        ( r0(ir) - r0(ir-1) )
826                   qq = ( rq- rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
827                   ec(j,i) = ( 1.0-pp ) * ( 1.0-qq ) * ecoll(ir-1,iq-1)  &
828                             + pp * ( 1.0-qq ) * ecoll(ir,iq-1)          &
829                             + qq * ( 1.0-pp ) * ecoll(ir-1,iq)          &
830                             + pp * qq * ecoll(ir,iq)
831                ELSE
832                   qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
833                   ec(j,i) = (1.0-qq) * ecoll(1,iq-1) + qq * ecoll(1,iq)
834                ENDIF
835             ELSE
836                qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
837                ek = ( 1.0 - qq ) * ecoll(15,iq-1) + qq * ecoll(15,iq)
838                ec(j,i) = MIN( ek, 1.0 )
[1071]839             ENDIF
[792]840
[1071]841             IF ( ec(j,i) < 1.0E-20 )  ec(j,i) = 0.0
842
[828]843             ec(i,j) = ec(j,i)
[792]844
[828]845          ENDDO
846       ENDDO
[792]847
[828]848       DEALLOCATE( ira )
[792]849
[828]850    END SUBROUTINE effic
[792]851
852
[790]853!------------------------------------------------------------------------------!
[828]854! Calculation of enhancement factor for collision efficencies due to turbulence
[790]855!------------------------------------------------------------------------------!
[828]856    SUBROUTINE turb_enhance_eff
[790]857
[1320]858       USE particle_attributes,                                                &
859           ONLY:  radius_classes
[790]860
[828]861       IMPLICIT NONE
[790]862
[1320]863       INTEGER(iwp) :: i  !:
864       INTEGER(iwp) :: iq !:
865       INTEGER(iwp) :: ir !:
866       INTEGER(iwp) :: j  !:
867       INTEGER(iwp) :: k  !:
868       INTEGER(iwp) :: kk !:
[790]869
[1320]870       INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  ira !:
871       
872       LOGICAL, SAVE ::  first = .TRUE. !:
[790]873
[1320]874       REAL(wp) ::  particle_radius !:
875       REAL(wp) ::  pp              !:
876       REAL(wp) ::  qq              !:
877       REAL(wp) ::  rq              !:
878       REAL(wp) ::  y1              !:
879       REAL(wp) ::  y2              !:
880       REAL(wp) ::  y3              !:
[790]881
[1320]882       REAL(wp), DIMENSION(1:11), SAVE ::  rat           !:
883       
884       REAL(wp), DIMENSION(1:7), SAVE  ::  r0            !:
885       
886       REAL(wp), DIMENSION(1:7,1:11), SAVE ::  ecoll_100 !:
887       REAL(wp), DIMENSION(1:7,1:11), SAVE ::  ecoll_400 !:
[799]888
889!
[828]890!--    Initial assignment of constants
891       IF ( first )  THEN
[799]892
[828]893          first = .FALSE.
[799]894
[828]895          r0  = (/ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 100.0 /)
896          rat = (/ 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 /)
897!
[1007]898!--       for 100 cm**2/s**3
[828]899          ecoll_100(:,1) = (/1.74,  1.74,  1.773, 1.49,  1.207,  1.207,  1.0 /)
900          ecoll_100(:,2) = (/1.46,  1.46,  1.421, 1.245, 1.069,  1.069,  1.0 /)
901          ecoll_100(:,3) = (/1.32,  1.32,  1.245, 1.123, 1.000,  1.000,  1.0 /)
902          ecoll_100(:,4) = (/1.250, 1.250, 1.148, 1.087, 1.025,  1.025,  1.0 /)
903          ecoll_100(:,5) = (/1.186, 1.186, 1.066, 1.060, 1.056,  1.056,  1.0 /)
904          ecoll_100(:,6) = (/1.045, 1.045, 1.000, 1.014, 1.028,  1.028,  1.0 /)
905          ecoll_100(:,7) = (/1.070, 1.070, 1.030, 1.038, 1.046,  1.046,  1.0 /)
906          ecoll_100(:,8) = (/1.000, 1.000, 1.054, 1.042, 1.029,  1.029,  1.0 /)
907          ecoll_100(:,9) = (/1.223, 1.223, 1.117, 1.069, 1.021,  1.021,  1.0 /)
908          ecoll_100(:,10)= (/1.570, 1.570, 1.244, 1.166, 1.088,  1.088,  1.0 /)
909          ecoll_100(:,11)= (/20.3,  20.3,  14.6 , 8.61,  2.60,   2.60 ,  1.0 /)
910!
[1007]911!--       for 400 cm**2/s**3
[828]912          ecoll_400(:,1) = (/4.976, 4.976,  3.593, 2.519, 1.445,  1.445,  1.0 /)
913          ecoll_400(:,2) = (/2.984, 2.984,  2.181, 1.691, 1.201,  1.201,  1.0 /)
914          ecoll_400(:,3) = (/1.988, 1.988,  1.475, 1.313, 1.150,  1.150,  1.0 /)
915          ecoll_400(:,4) = (/1.490, 1.490,  1.187, 1.156, 1.126,  1.126,  1.0 /)
916          ecoll_400(:,5) = (/1.249, 1.249,  1.088, 1.090, 1.092,  1.092,  1.0 /)
917          ecoll_400(:,6) = (/1.139, 1.139,  1.130, 1.091, 1.051,  1.051,  1.0 /)
918          ecoll_400(:,7) = (/1.220, 1.220,  1.190, 1.138, 1.086,  1.086,  1.0 /)
919          ecoll_400(:,8) = (/1.325, 1.325,  1.267, 1.165, 1.063,  1.063,  1.0 /)
920          ecoll_400(:,9) = (/1.716, 1.716,  1.345, 1.223, 1.100,  1.100,  1.0 /)
921          ecoll_400(:,10)= (/3.788, 3.788,  1.501, 1.311, 1.120,  1.120,  1.0 /)
922          ecoll_400(:,11)= (/36.52, 36.52,  19.16, 22.80,  26.0,   26.0,  1.0 /)
[799]923
[828]924       ENDIF
[790]925
[828]926!
927!--    Calculate the radius class index of particles with respect to array r0
[1007]928!--    Radius has to be in µm
[828]929       ALLOCATE( ira(1:radius_classes) )
[790]930
[828]931       DO  j = 1, radius_classes
[1007]932          particle_radius = radclass(j) * 1.0E6
[828]933          DO  k = 1, 7
934             IF ( particle_radius < r0(k) )  THEN
935                ira(j) = k
936                EXIT
937             ENDIF
938          ENDDO
939          IF ( particle_radius >= r0(7) )  ira(j) = 8
940       ENDDO
[799]941
942!
[828]943!--    Two-dimensional linear interpolation of the collision efficiencies
[1007]944!--    Radius has to be in µm
[828]945       DO  j =  1, radius_classes
946          DO  i = 1, j
[799]947
[828]948             ir = ira(j)
949             rq = radclass(i) / radclass(j)
[799]950
[828]951             DO  kk = 2, 11
952                IF ( rq <= rat(kk) )  THEN
953                   iq = kk
954                   EXIT
955                ENDIF
956             ENDDO
[790]957
[1007]958             y1 = 0.0001      ! for 0 m**2/s**3
959
[828]960             IF ( ir < 8 )  THEN
961                IF ( ir >= 2 )  THEN
[1007]962                   pp = ( radclass(j)*1.0E6 - r0(ir-1) ) / ( r0(ir) - r0(ir-1) )
[828]963                   qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
964                   y2 = ( 1.0-pp ) * ( 1.0-qq ) * ecoll_100(ir-1,iq-1) +  &
965                                pp * ( 1.0-qq ) * ecoll_100(ir,iq-1)   +  &
[1007]966                                qq * ( 1.0-pp ) * ecoll_100(ir-1,iq)   +  &
[828]967                                pp * qq         * ecoll_100(ir,iq)
968                   y3 = ( 1.0-pp ) * ( 1.0-qq ) * ecoll_400(ir-1,iq-1) +  &
969                                pp * ( 1.0-qq ) * ecoll_400(ir,iq-1)   +  &
970                                qq * ( 1.0-pp ) * ecoll_400(ir-1,iq)   +  &
971                                pp * qq         * ecoll_400(ir,iq)
972                ELSE
973                   qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
974                   y2 = ( 1.0-qq ) * ecoll_100(1,iq-1) + qq * ecoll_100(1,iq)
975                   y3 = ( 1.0-qq ) * ecoll_400(1,iq-1) + qq * ecoll_400(1,iq)
976                ENDIF
977             ELSE
978                qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) )
979                y2 = ( 1.0-qq ) * ecoll_100(7,iq-1) + qq * ecoll_100(7,iq)
980                y3 = ( 1.0-qq ) * ecoll_400(7,iq-1) + qq * ecoll_400(7,iq)
981             ENDIF
982!
[1007]983!--          Linear interpolation of dissipation rate in m**2/s**3
984             IF ( epsilon <= 0.01 )  THEN
985                ecf(j,i) = ( epsilon - 0.01 ) / (   0.0 - 0.01 ) * y1 &
986                         + ( epsilon -   0.0 ) / ( 0.01 -   0.0 ) * y2
987             ELSEIF ( epsilon <= 0.06 )  THEN
988                ecf(j,i) = ( epsilon - 0.04 ) / ( 0.01 - 0.04 ) * y2 &
989                         + ( epsilon - 0.01 ) / ( 0.04 - 0.01 ) * y3
[828]990             ELSE
[1007]991                ecf(j,i) = (   0.06 - 0.04 ) / ( 0.01 - 0.04 ) * y2 &
992                         + (   0.06 - 0.01 ) / ( 0.04 - 0.01 ) * y3
[828]993             ENDIF
[790]994
[828]995             IF ( ecf(j,i) < 1.0 )  ecf(j,i) = 1.0
[790]996
[828]997             ecf(i,j) = ecf(j,i)
[790]998
[828]999          ENDDO
1000       ENDDO
[790]1001
[828]1002    END SUBROUTINE turb_enhance_eff
[790]1003
[849]1004
1005
1006    SUBROUTINE collision_efficiency_rogers( mean_r, r, e)
1007!------------------------------------------------------------------------------!
1008! Collision efficiencies from table 8.2 in Rogers and Yau (1989, 3rd edition).
1009! Values are calculated from table by bilinear interpolation.
1010!------------------------------------------------------------------------------!
1011
1012       IMPLICIT NONE
1013
[1320]1014       INTEGER(iwp)  ::  i !:
1015       INTEGER(iwp)  ::  j !:
1016       INTEGER(iwp)  ::  k !:
[849]1017
[1320]1018       LOGICAL, SAVE ::  first = .TRUE. !:
[849]1019
[1320]1020       REAL(wp)      ::  aa      !:
1021       REAL(wp)      ::  bb      !:
1022       REAL(wp)      ::  cc      !:
1023       REAL(wp)      ::  dd      !:
1024       REAL(wp)      ::  dx      !:
1025       REAL(wp)      ::  dy      !:
1026       REAL(wp)      ::  e       !:
1027       REAL(wp)      ::  gg      !:
1028       REAL(wp)      ::  mean_r  !:
1029       REAL(wp)      ::  mean_rm !:
1030       REAL(wp)      ::  r       !:
1031       REAL(wp)      ::  rm      !:
1032       REAL(wp)      ::  x       !:
1033       REAL(wp)      ::  y       !:
1034 
1035       REAL(wp), DIMENSION(1:9), SAVE      ::  collected_r = 0.0 !:
1036       
1037       REAL(wp), DIMENSION(1:19), SAVE     ::  collector_r = 0.0 !:
1038       
1039       REAL(wp), DIMENSION(1:9,1:19), SAVE ::  ef = 0.0          !:
[849]1040
1041       mean_rm = mean_r * 1.0E06
1042       rm      = r      * 1.0E06
1043
1044       IF ( first )  THEN
1045
1046          collected_r = (/ 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 15.0, 20.0, 25.0 /)
1047          collector_r = (/ 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 100.0,  &
1048                           150.0, 200.0, 300.0, 400.0, 500.0, 600.0, 1000.0, &
1049                           1400.0, 1800.0, 2400.0, 3000.0 /)
1050
1051          ef(:,1) = (/0.017, 0.027, 0.037, 0.052, 0.052, 0.052, 0.052, 0.0, &
1052                      0.0 /)
1053          ef(:,2) = (/0.001, 0.016, 0.027, 0.060, 0.12, 0.17, 0.17, 0.17, 0.0 /)
1054          ef(:,3) = (/0.001, 0.001, 0.02,  0.13,  0.28, 0.37, 0.54, 0.55, 0.47/)
1055          ef(:,4) = (/0.001, 0.001, 0.02,  0.23,  0.4,  0.55, 0.7,  0.75, 0.75/)
1056          ef(:,5) = (/0.01,  0.01,  0.03,  0.3,   0.4,  0.58, 0.73, 0.75, 0.79/)
1057          ef(:,6) = (/0.01,  0.01,  0.13,  0.38,  0.57, 0.68, 0.80, 0.86, 0.91/)
1058          ef(:,7) = (/0.01,  0.085, 0.23,  0.52,  0.68, 0.76, 0.86, 0.92, 0.95/)
1059          ef(:,8) = (/0.01,  0.14,  0.32,  0.60,  0.73, 0.81, 0.90, 0.94, 0.96/)
1060          ef(:,9) = (/0.025, 0.25,  0.43,  0.66,  0.78, 0.83, 0.92, 0.95, 0.96/)
1061          ef(:,10)= (/0.039, 0.3,   0.46,  0.69,  0.81, 0.87, 0.93, 0.95, 0.96/)
1062          ef(:,11)= (/0.095, 0.33,  0.51,  0.72,  0.82, 0.87, 0.93, 0.96, 0.97/)
1063          ef(:,12)= (/0.098, 0.36,  0.51,  0.73,  0.83, 0.88, 0.93, 0.96, 0.97/)
1064          ef(:,13)= (/0.1,   0.36,  0.52,  0.74,  0.83, 0.88, 0.93, 0.96, 0.97/)
1065          ef(:,14)= (/0.17,  0.4,   0.54,  0.72,  0.83, 0.88, 0.94, 0.98, 1.0 /)
1066          ef(:,15)= (/0.15,  0.37,  0.52,  0.74,  0.82, 0.88, 0.94, 0.98, 1.0 /)
1067          ef(:,16)= (/0.11,  0.34,  0.49,  0.71,  0.83, 0.88, 0.94, 0.95, 1.0 /)
1068          ef(:,17)= (/0.08,  0.29,  0.45,  0.68,  0.8,  0.86, 0.96, 0.94, 1.0 /)
1069          ef(:,18)= (/0.04,  0.22,  0.39,  0.62,  0.75, 0.83, 0.92, 0.96, 1.0 /)
1070          ef(:,19)= (/0.02,  0.16,  0.33,  0.55,  0.71, 0.81, 0.90, 0.94, 1.0 /)
1071
1072       ENDIF
1073
1074       DO  k = 1, 8
1075          IF ( collected_r(k) <= mean_rm )  i = k
1076       ENDDO
1077
1078       DO  k = 1, 18
1079          IF ( collector_r(k) <= rm )  j = k
1080       ENDDO
1081
1082       IF ( rm < 10.0 )  THEN
1083          e = 0.0
1084       ELSEIF ( mean_rm < 2.0 )  THEN
1085          e = 0.001
1086       ELSEIF ( mean_rm >= 25.0 )  THEN
1087          IF( j <= 2 )  e = 0.0
1088          IF( j == 3 )  e = 0.47
1089          IF( j == 4 )  e = 0.8
1090          IF( j == 5 )  e = 0.9
1091          IF( j >=6  )  e = 1.0
1092       ELSEIF ( rm >= 3000.0 )  THEN
1093          IF( i == 1 )  e = 0.02
1094          IF( i == 2 )  e = 0.16
1095          IF( i == 3 )  e = 0.33
1096          IF( i == 4 )  e = 0.55
1097          IF( i == 5 )  e = 0.71
1098          IF( i == 6 )  e = 0.81
1099          IF( i == 7 )  e = 0.90
1100          IF( i >= 8 )  e = 0.94
1101       ELSE
1102          x  = mean_rm - collected_r(i)
1103          y  = rm - collector_r(j)
1104          dx = collected_r(i+1) - collected_r(i)
1105          dy = collector_r(j+1) - collector_r(j)
1106          aa = x**2 + y**2
1107          bb = ( dx - x )**2 + y**2
1108          cc = x**2 + ( dy - y )**2
1109          dd = ( dx - x )**2 + ( dy - y )**2
1110          gg = aa + bb + cc + dd
1111
1112          e = ( (gg-aa)*ef(i,j) + (gg-bb)*ef(i+1,j) + (gg-cc)*ef(i,j+1) + &
1113                (gg-dd)*ef(i+1,j+1) ) / (3.0*gg)
1114       ENDIF
1115
1116    END SUBROUTINE collision_efficiency_rogers
1117
[825]1118 END MODULE lpm_collision_kernels_mod
Note: See TracBrowser for help on using the repository browser.