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

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

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

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