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

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

REAL functions and a lot of REAL constants provided with KIND-attribute,
some small bugfixes

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