source: palm/trunk/SOURCE/lpm_init.f90 @ 2316

Last change on this file since 2316 was 2312, checked in by hoffmann, 7 years ago

various improvements of the LCM

  • Property svn:keywords set to Id
File size: 44.1 KB
Line 
1!> @file lpm_init.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! 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-2017 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: lpm_init.f90 2312 2017-07-14 20:26:51Z maronga $
27! Extended particle data type. Aerosol initialization improved.
28!
29! 2305 2017-07-06 11:18:47Z hoffmann
30! Improved calculation of particle IDs.
31!
32! 2274 2017-06-09 13:27:48Z Giersch
33!  Changed error messages
34!
35! 2265 2017-06-08 16:58:28Z schwenkel
36! Unused variables removed.
37!
38! 2263 2017-06-08 14:59:01Z schwenkel
39! Implemented splitting and merging algorithm
40!
41! 2233 2017-05-30 18:08:54Z suehring
42!
43! 2232 2017-05-30 17:47:52Z suehring
44! Adjustments according to new topography realization
45!
46!
47! 2223 2017-05-15 16:38:09Z suehring
48! Add check for particle release at model top
49!
50! 2182 2017-03-17 14:27:40Z schwenkel
51! Added parameters for simplified particle initialization.
52!
53! 2122 2017-01-18 12:22:54Z hoffmann
54! Improved initialization of equilibrium aerosol radii
55! Calculation of particle ID
56!
57! 2000 2016-08-20 18:09:15Z knoop
58! Forced header and separation lines into 80 columns
59!
60! 2016-06-09 16:25:25Z suehring
61! Bugfix in determining initial particle height and grid index in case of
62! seed_follows_topography.
63! Bugfix concerning random positions, ensure that particles do not move more
64! than one grid length.
65! Bugfix logarithmic interpolation.
66! Initial setting of sgs_wf_part.
67!
68! 1890 2016-04-22 08:52:11Z hoffmann
69! Initialization of aerosol equilibrium radius not possible in supersaturated
70! environments. Therefore, a maximum supersaturation of -1 % is assumed during
71! initialization.
72!
73! 1873 2016-04-18 14:50:06Z maronga
74! Module renamed (removed _mod
75!
76! 1871 2016-04-15 11:46:09Z hoffmann
77! Initialization of aerosols added.
78!
79! 1850 2016-04-08 13:29:27Z maronga
80! Module renamed
81!
82! 1831 2016-04-07 13:15:51Z hoffmann
83! curvature_solution_effects moved to particle_attributes
84!
85! 1822 2016-04-07 07:49:42Z hoffmann
86! Unused variables removed.
87!
88! 1783 2016-03-06 18:36:17Z raasch
89! netcdf module added
90!
91! 1725 2015-11-17 13:01:51Z hoffmann
92! Bugfix: Processor-dependent seed for random function is generated before it is
93! used.
94!
95! 1691 2015-10-26 16:17:44Z maronga
96! Renamed prandtl_layer to constant_flux_layer.
97!
98! 1685 2015-10-08 07:32:13Z raasch
99! bugfix concerning vertical index offset in case of ocean
100!
101! 1682 2015-10-07 23:56:08Z knoop
102! Code annotations made doxygen readable
103!
104! 1575 2015-03-27 09:56:27Z raasch
105! initial vertical particle position is allowed to follow the topography
106!
107! 1359 2014-04-11 17:15:14Z hoffmann
108! New particle structure integrated.
109! Kind definition added to all floating point numbers.
110! lpm_init changed form a subroutine to a module.
111!
112! 1327 2014-03-21 11:00:16Z raasch
113! -netcdf_output
114!
115! 1322 2014-03-20 16:38:49Z raasch
116! REAL functions provided with KIND-attribute
117!
118! 1320 2014-03-20 08:40:49Z raasch
119! ONLY-attribute added to USE-statements,
120! kind-parameters added to all INTEGER and REAL declaration statements,
121! kinds are defined in new module kinds,
122! revision history before 2012 removed,
123! comment fields (!:) to be used for variable explanations added to
124! all variable declaration statements
125! bugfix: #if defined( __parallel ) added
126!
127! 1314 2014-03-14 18:25:17Z suehring
128! Vertical logarithmic interpolation of horizontal particle speed for particles
129! between roughness height and first vertical grid level.
130!
131! 1092 2013-02-02 11:24:22Z raasch
132! unused variables removed
133!
134! 1036 2012-10-22 13:43:42Z raasch
135! code put under GPL (PALM 3.9)
136!
137! 849 2012-03-15 10:35:09Z raasch
138! routine renamed: init_particles -> lpm_init
139! de_dx, de_dy, de_dz are allocated here (instead of automatic arrays in
140! advec_particles),
141! sort_particles renamed lpm_sort_arrays, user_init_particles renamed lpm_init
142!
143! 828 2012-02-21 12:00:36Z raasch
144! call of init_kernels, particle feature color renamed class
145!
146! 824 2012-02-17 09:09:57Z raasch
147! particle attributes speed_x|y|z_sgs renamed rvar1|2|3,
148! array particles implemented as pointer
149!
150! 667 2010-12-23 12:06:00Z suehring/gryschka
151! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng for allocation
152! of arrays.
153!
154! Revision 1.1  1999/11/25 16:22:38  raasch
155! Initial revision
156!
157!
158! Description:
159! ------------
160!> This routine initializes a set of particles and their attributes (position,
161!> radius, ..) which are used by the Lagrangian particle model (see lpm).
162!------------------------------------------------------------------------------!
163 MODULE lpm_init_mod
164
165    USE, INTRINSIC ::  ISO_C_BINDING
166
167    USE arrays_3d,                                                             &
168        ONLY:  de_dx, de_dy, de_dz, zu, zw
169
170    USE control_parameters,                                                    &
171        ONLY:  cloud_droplets, constant_flux_layer, current_timestep_number,   &
172               dt_3d, dz, initializing_actions, message_string, ocean,         &
173               simulated_time
174
175    USE grid_variables,                                                        &
176        ONLY:  ddx, dx, ddy, dy
177
178    USE indices,                                                               &
179        ONLY:  nx, nxl, nxlg, nxrg, nxr, ny, nyn, nys, nyng, nysg, nz, nzb,    &
180               nzb_max, nzt, wall_flags_0
181
182    USE kinds
183
184    USE lpm_collision_kernels_mod,                                             &
185        ONLY:  init_kernels
186
187    USE netcdf_interface,                                                      &
188        ONLY:  netcdf_data_format
189
190    USE particle_attributes,                                                   &
191        ONLY:   alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,        &
192                block_offset, block_offset_def, collision_kernel,              &
193                curvature_solution_effects, density_ratio, grid_particles,     &
194                isf,i_splitting_mode, initial_weighting_factor, ibc_par_b,     &
195                ibc_par_lr, ibc_par_ns, ibc_par_t, iran_part, log_z_z0,        &
196                max_number_of_particle_groups, min_nr_particle,                &
197                number_concentration,                                          &
198                number_particles_per_gridbox,  number_of_particles,            &
199                number_of_particle_groups, number_of_sublayers,                &
200                offset_ocean_nzt, offset_ocean_nzt_m1,                         &
201                particles, particle_advection_start, particle_groups,          &
202                particle_groups_type, particles_per_point,                     &
203                particle_type, pdx, pdy, pdz,  prt_count, psb, psl, psn, psr,  &
204                pss, pst, radius, random_start_position,                       &
205                read_particles_from_restartfile, seed_follows_topography,      &
206                sgs_wf_part, sort_count, splitting_function, splitting_mode,   &
207                total_number_of_particles, use_sgs_for_particles,              &
208                write_particle_statistics, zero_particle, z0_av_global
209
210    USE pegrid
211
212    USE random_function_mod,                                                   &
213        ONLY:  random_function
214
215    USE surface_mod,                                                           &
216        ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
217
218    IMPLICIT NONE
219
220    PRIVATE
221
222    INTEGER(iwp), PARAMETER         :: PHASE_INIT    = 1  !<
223    INTEGER(iwp), PARAMETER, PUBLIC :: PHASE_RELEASE = 2  !<
224
225    INTERFACE lpm_init
226       MODULE PROCEDURE lpm_init
227    END INTERFACE lpm_init
228
229    INTERFACE lpm_create_particle
230       MODULE PROCEDURE lpm_create_particle
231    END INTERFACE lpm_create_particle
232
233    PUBLIC lpm_init, lpm_create_particle
234
235 CONTAINS
236
237!------------------------------------------------------------------------------!
238! Description:
239! ------------
240!> @todo Missing subroutine description.
241!------------------------------------------------------------------------------!
242 SUBROUTINE lpm_init
243
244    USE lpm_collision_kernels_mod,                                             &
245        ONLY:  init_kernels
246
247    IMPLICIT NONE
248
249    INTEGER(iwp) ::  i                           !<
250    INTEGER(iwp) ::  j                           !<
251    INTEGER(iwp) ::  k                           !<
252
253    REAL(wp) ::  div                             !<
254    REAL(wp) ::  height_int                      !<
255    REAL(wp) ::  height_p                        !<
256    REAL(wp) ::  z_p                             !<
257    REAL(wp) ::  z0_av_local                     !<
258
259
260!
261!-- In case of oceans runs, the vertical index calculations need an offset,
262!-- because otherwise the k indices will become negative
263    IF ( ocean )  THEN
264       offset_ocean_nzt    = nzt
265       offset_ocean_nzt_m1 = nzt - 1
266    ENDIF
267
268!
269!-- Define block offsets for dividing a gridcell in 8 sub cells
270
271    block_offset(0) = block_offset_def (-1,-1,-1)
272    block_offset(1) = block_offset_def (-1,-1, 0)
273    block_offset(2) = block_offset_def (-1, 0,-1)
274    block_offset(3) = block_offset_def (-1, 0, 0)
275    block_offset(4) = block_offset_def ( 0,-1,-1)
276    block_offset(5) = block_offset_def ( 0,-1, 0)
277    block_offset(6) = block_offset_def ( 0, 0,-1)
278    block_offset(7) = block_offset_def ( 0, 0, 0)
279!
280!-- Check the number of particle groups.
281    IF ( number_of_particle_groups > max_number_of_particle_groups )  THEN
282       WRITE( message_string, * ) 'max_number_of_particle_groups =',      &
283                                  max_number_of_particle_groups ,         &
284                                  '&number_of_particle_groups reset to ', &
285                                  max_number_of_particle_groups
286       CALL message( 'lpm_init', 'PA0213', 0, 1, 0, 6, 0 )
287       number_of_particle_groups = max_number_of_particle_groups
288    ENDIF
289!
290!-- Check if downward-facing walls exist. This case, reflection boundary
291!-- conditions (as well as subgrid-scale velocities) may do not work
292!-- propably (not realized so far).
293    IF ( surf_def_h(1)%ns >= 1 )  THEN
294       WRITE( message_string, * ) 'Overhanging topography do not work '// &
295                                  'with particles'
296       CALL message( 'lpm_init', 'PA0212', 0, 1, 0, 6, 0 )
297
298    ENDIF
299
300!
301!-- Set default start positions, if necessary
302    IF ( psl(1) == 9999999.9_wp )  psl(1) = -0.5_wp * dx
303    IF ( psr(1) == 9999999.9_wp )  psr(1) = ( nx + 0.5_wp ) * dx
304    IF ( pss(1) == 9999999.9_wp )  pss(1) = -0.5_wp * dy
305    IF ( psn(1) == 9999999.9_wp )  psn(1) = ( ny + 0.5_wp ) * dy
306    IF ( psb(1) == 9999999.9_wp )  psb(1) = zu(nz/2)
307    IF ( pst(1) == 9999999.9_wp )  pst(1) = psb(1)
308
309    IF ( pdx(1) == 9999999.9_wp  .OR.  pdx(1) == 0.0_wp )  pdx(1) = dx
310    IF ( pdy(1) == 9999999.9_wp  .OR.  pdy(1) == 0.0_wp )  pdy(1) = dy
311    IF ( pdz(1) == 9999999.9_wp  .OR.  pdz(1) == 0.0_wp )  pdz(1) = zu(2) - zu(1)
312
313!
314!-- If number_particles_per_gridbox is set, the parametres pdx, pdy and pdz are
315!-- calculated diagnostically. Therfore an isotropic distribution is prescribed.
316    IF ( number_particles_per_gridbox /= -1 .AND.   &
317         number_particles_per_gridbox >= 1 )    THEN
318       pdx(1) = (( dx * dy * ( zu(2) - zu(1) ) ) /  &
319             REAL(number_particles_per_gridbox))**0.3333333_wp
320!
321!--    Ensure a smooth value (two significant digits) of distance between
322!--    particles (pdx, pdy, pdz).
323       div = 1000.0_wp
324       DO  WHILE ( pdx(1) < div )
325          div = div / 10.0_wp
326       ENDDO
327       pdx(1) = NINT( pdx(1) * 100.0_wp / div ) * div / 100.0_wp
328       pdy(1) = pdx(1)
329       pdz(1) = pdx(1)
330
331    ENDIF
332
333    DO  j = 2, number_of_particle_groups
334       IF ( psl(j) == 9999999.9_wp )  psl(j) = psl(j-1)
335       IF ( psr(j) == 9999999.9_wp )  psr(j) = psr(j-1)
336       IF ( pss(j) == 9999999.9_wp )  pss(j) = pss(j-1)
337       IF ( psn(j) == 9999999.9_wp )  psn(j) = psn(j-1)
338       IF ( psb(j) == 9999999.9_wp )  psb(j) = psb(j-1)
339       IF ( pst(j) == 9999999.9_wp )  pst(j) = pst(j-1)
340       IF ( pdx(j) == 9999999.9_wp  .OR.  pdx(j) == 0.0_wp )  pdx(j) = pdx(j-1)
341       IF ( pdy(j) == 9999999.9_wp  .OR.  pdy(j) == 0.0_wp )  pdy(j) = pdy(j-1)
342       IF ( pdz(j) == 9999999.9_wp  .OR.  pdz(j) == 0.0_wp )  pdz(j) = pdz(j-1)
343    ENDDO
344
345!
346!-- Allocate arrays required for calculating particle SGS velocities.
347!-- Initialize prefactor required for stoachastic Weil equation.
348    IF ( use_sgs_for_particles  .AND.  .NOT. cloud_droplets )  THEN
349       ALLOCATE( de_dx(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
350                 de_dy(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
351                 de_dz(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
352
353       sgs_wf_part = 1.0_wp / 3.0_wp
354    ENDIF
355
356!
357!-- Allocate array required for logarithmic vertical interpolation of
358!-- horizontal particle velocities between the surface and the first vertical
359!-- grid level. In order to avoid repeated CPU cost-intensive CALLS of
360!-- intrinsic FORTRAN procedure LOG(z/z0), LOG(z/z0) is precalculated for
361!-- several heights. Splitting into 20 sublayers turned out to be sufficient.
362!-- To obtain exact height levels of particles, linear interpolation is applied
363!-- (see lpm_advec.f90).
364    IF ( constant_flux_layer )  THEN
365
366       ALLOCATE ( log_z_z0(0:number_of_sublayers) )
367       z_p = zu(nzb+1) - zw(nzb)
368
369!
370!--    Calculate horizontal mean value of z0 used for logartihmic
371!--    interpolation. Note: this is not exact for heterogeneous z0.
372!--    However, sensitivity studies showed that the effect is
373!--    negligible.
374       z0_av_local  = SUM( surf_def_h(0)%z0 ) + SUM( surf_lsm_h%z0 ) +         &
375                      SUM( surf_usm_h%z0 )
376       z0_av_global = 0.0_wp
377
378#if defined( __parallel )
379       CALL MPI_ALLREDUCE(z0_av_local, z0_av_global, 1, MPI_REAL, MPI_SUM, &
380                          comm2d, ierr )
381#else
382       z0_av_global = z0_av_local
383#endif
384
385       z0_av_global = z0_av_global  / ( ( ny + 1 ) * ( nx + 1 ) )
386!
387!--    Horizontal wind speed is zero below and at z0
388       log_z_z0(0) = 0.0_wp
389!
390!--    Calculate vertical depth of the sublayers
391       height_int  = ( z_p - z0_av_global ) / REAL( number_of_sublayers, KIND=wp )
392!
393!--    Precalculate LOG(z/z0)
394       height_p    = z0_av_global
395       DO  k = 1, number_of_sublayers
396
397          height_p    = height_p + height_int
398          log_z_z0(k) = LOG( height_p / z0_av_global )
399
400       ENDDO
401
402    ENDIF
403
404!
405!-- Check boundary condition and set internal variables
406    SELECT CASE ( bc_par_b )
407
408       CASE ( 'absorb' )
409          ibc_par_b = 1
410
411       CASE ( 'reflect' )
412          ibc_par_b = 2
413
414       CASE DEFAULT
415          WRITE( message_string, * )  'unknown boundary condition ',   &
416                                       'bc_par_b = "', TRIM( bc_par_b ), '"'
417          CALL message( 'lpm_init', 'PA0217', 1, 2, 0, 6, 0 )
418
419    END SELECT
420    SELECT CASE ( bc_par_t )
421
422       CASE ( 'absorb' )
423          ibc_par_t = 1
424
425       CASE ( 'reflect' )
426          ibc_par_t = 2
427
428       CASE DEFAULT
429          WRITE( message_string, * ) 'unknown boundary condition ',   &
430                                     'bc_par_t = "', TRIM( bc_par_t ), '"'
431          CALL message( 'lpm_init', 'PA0218', 1, 2, 0, 6, 0 )
432
433    END SELECT
434    SELECT CASE ( bc_par_lr )
435
436       CASE ( 'cyclic' )
437          ibc_par_lr = 0
438
439       CASE ( 'absorb' )
440          ibc_par_lr = 1
441
442       CASE ( 'reflect' )
443          ibc_par_lr = 2
444
445       CASE DEFAULT
446          WRITE( message_string, * ) 'unknown boundary condition ',   &
447                                     'bc_par_lr = "', TRIM( bc_par_lr ), '"'
448          CALL message( 'lpm_init', 'PA0219', 1, 2, 0, 6, 0 )
449
450    END SELECT
451    SELECT CASE ( bc_par_ns )
452
453       CASE ( 'cyclic' )
454          ibc_par_ns = 0
455
456       CASE ( 'absorb' )
457          ibc_par_ns = 1
458
459       CASE ( 'reflect' )
460          ibc_par_ns = 2
461
462       CASE DEFAULT
463          WRITE( message_string, * ) 'unknown boundary condition ',   &
464                                     'bc_par_ns = "', TRIM( bc_par_ns ), '"'
465          CALL message( 'lpm_init', 'PA0220', 1, 2, 0, 6, 0 )
466
467    END SELECT
468    SELECT CASE ( splitting_mode )
469
470       CASE ( 'const' )
471          i_splitting_mode = 1
472
473       CASE ( 'cl_av' )
474          i_splitting_mode = 2
475
476       CASE ( 'gb_av' )
477          i_splitting_mode = 3
478
479       CASE DEFAULT
480          WRITE( message_string, * )  'unknown splitting condition ',   &
481                                       'splitting_mode = "', TRIM( splitting_mode ), '"'
482          CALL message( 'lpm_init', 'PA0146', 1, 2, 0, 6, 0 )
483
484    END SELECT
485    SELECT CASE ( splitting_function )
486
487       CASE ( 'gamma' )
488          isf = 1
489
490       CASE ( 'log' )
491          isf = 2
492
493       CASE ( 'exp' )
494          isf = 3
495
496       CASE DEFAULT
497          WRITE( message_string, * )  'unknown splitting function ',   &
498                                       'splitting_function = "', TRIM( splitting_function ), '"'
499          CALL message( 'lpm_init', 'PA0147', 1, 2, 0, 6, 0 )
500
501    END SELECT
502
503
504!
505!-- Initialize collision kernels
506    IF ( collision_kernel /= 'none' )  CALL init_kernels
507
508!
509!-- For the first model run of a possible job chain initialize the
510!-- particles, otherwise read the particle data from restart file.
511    IF ( TRIM( initializing_actions ) == 'read_restart_data'  &
512         .AND.  read_particles_from_restartfile )  THEN
513
514       CALL lpm_read_restart_file
515
516    ELSE
517
518!
519!--    Allocate particle arrays and set attributes of the initial set of
520!--    particles, which can be also periodically released at later times.
521       ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
522                 grid_particles(nzb+1:nzt,nys:nyn,nxl:nxr) )
523
524       number_of_particles         = 0
525
526       sort_count = 0
527       prt_count  = 0
528
529!
530!--    initialize counter for particle IDs
531       grid_particles%id_counter = 1
532
533!
534!--    Initialize all particles with dummy values (otherwise errors may
535!--    occur within restart runs). The reason for this is still not clear
536!--    and may be presumably caused by errors in the respective user-interface.
537       zero_particle = particle_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp,  &
538                                      0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp,  &
539                                      0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp,  &
540                                      0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp,  &
541                                      0, 0, 0_idp, .FALSE., -1 )
542
543       particle_groups = particle_groups_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp )
544
545!
546!--    Set values for the density ratio and radius for all particle
547!--    groups, if necessary
548       IF ( density_ratio(1) == 9999999.9_wp )  density_ratio(1) = 0.0_wp
549       IF ( radius(1)        == 9999999.9_wp )  radius(1) = 0.0_wp
550       DO  i = 2, number_of_particle_groups
551          IF ( density_ratio(i) == 9999999.9_wp )  THEN
552             density_ratio(i) = density_ratio(i-1)
553          ENDIF
554          IF ( radius(i) == 9999999.9_wp )  radius(i) = radius(i-1)
555       ENDDO
556
557       DO  i = 1, number_of_particle_groups
558          IF ( density_ratio(i) /= 0.0_wp  .AND.  radius(i) == 0 )  THEN
559             WRITE( message_string, * ) 'particle group #', i, 'has a', &
560                                        'density ratio /= 0 but radius = 0'
561             CALL message( 'lpm_init', 'PA0215', 1, 2, 0, 6, 0 )
562          ENDIF
563          particle_groups(i)%density_ratio = density_ratio(i)
564          particle_groups(i)%radius        = radius(i)
565       ENDDO
566
567!
568!--    Set a seed value for the random number generator to be exclusively
569!--    used for the particle code. The generated random numbers should be
570!--    different on the different PEs.
571       iran_part = iran_part + myid
572
573       CALL lpm_create_particle (PHASE_INIT)
574!
575!--    User modification of initial particles
576       CALL user_lpm_init
577
578!
579!--    Open file for statistical informations about particle conditions
580       IF ( write_particle_statistics )  THEN
581          CALL check_open( 80 )
582          WRITE ( 80, 8000 )  current_timestep_number, simulated_time,         &
583                              number_of_particles
584          CALL close_file( 80 )
585       ENDIF
586
587    ENDIF
588
589!
590!-- To avoid programm abort, assign particles array to the local version of
591!-- first grid cell
592    number_of_particles = prt_count(nzb+1,nys,nxl)
593    particles => grid_particles(nzb+1,nys,nxl)%particles(1:number_of_particles)
594!
595!-- Formats
5968000 FORMAT (I6,1X,F7.2,4X,I10,71X,I10)
597
598 END SUBROUTINE lpm_init
599
600!------------------------------------------------------------------------------!
601! Description:
602! ------------
603!> @todo Missing subroutine description.
604!------------------------------------------------------------------------------!
605 SUBROUTINE lpm_create_particle (phase)
606
607    USE lpm_exchange_horiz_mod,                                                &
608        ONLY: lpm_exchange_horiz, lpm_move_particle, realloc_particles_array
609
610    USE lpm_pack_arrays_mod,                                                   &
611        ONLY: lpm_pack_all_arrays
612
613    USE particle_attributes,                                                   &
614        ONLY: deleted_particles
615
616    IMPLICIT  NONE
617
618    INTEGER(iwp)               ::  alloc_size  !< relative increase of allocated memory for particles
619    INTEGER(iwp)               ::  i           !< loop variable ( particle groups )
620    INTEGER(iwp)               ::  ip          !< index variable along x
621    INTEGER(iwp)               ::  j           !< loop variable ( particles per point )
622    INTEGER(iwp)               ::  jp          !< index variable along y
623    INTEGER(iwp)               ::  k           !< index variable along z
624    INTEGER(iwp)               ::  k_surf      !< index of surface grid point
625    INTEGER(iwp)               ::  kp          !< index variable along z
626    INTEGER(iwp)               ::  loop_stride !< loop variable for initialization
627    INTEGER(iwp)               ::  n           !< loop variable ( number of particles )
628    INTEGER(iwp)               ::  new_size    !< new size of allocated memory for particles
629
630    INTEGER(iwp), INTENT(IN)   ::  phase       !< mode of inititialization
631
632    INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  local_count !< start address of new particle
633    INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  local_start !< start address of new particle
634
635    LOGICAL                    ::  first_stride !< flag for initialization
636
637    REAL(wp)                   ::  pos_x      !< increment for particle position in x
638    REAL(wp)                   ::  pos_y      !< increment for particle position in y
639    REAL(wp)                   ::  pos_z      !< increment for particle position in z
640    REAL(wp)                   ::  rand_contr !< dummy argument for random position
641
642    TYPE(particle_type),TARGET ::  tmp_particle !< temporary particle used for initialization
643
644!
645!-- Calculate particle positions and store particle attributes, if
646!-- particle is situated on this PE
647    DO  loop_stride = 1, 2
648       first_stride = (loop_stride == 1)
649       IF ( first_stride )   THEN
650          local_count = 0           ! count number of particles
651       ELSE
652          local_count = prt_count   ! Start address of new particles
653       ENDIF
654
655!
656!--    Calculate initial_weighting_factor diagnostically
657       IF ( number_concentration /= -1.0_wp .AND. number_concentration > 0.0_wp ) THEN
658          initial_weighting_factor =  number_concentration * 1.0E6_wp *             &
659                                      pdx(1) * pdy(1) * pdz(1)
660       END IF
661
662       n = 0
663       DO  i = 1, number_of_particle_groups
664
665          pos_z = psb(i)
666
667          DO WHILE ( pos_z <= pst(i) )
668
669             IF ( pos_z >= 0.0_wp  .AND.  pos_z < zw(nzt) )  THEN
670
671
672                pos_y = pss(i)
673
674                DO WHILE ( pos_y <= psn(i) )
675
676                   IF ( pos_y >= ( nys - 0.5_wp ) * dy  .AND.                  &
677                        pos_y <  ( nyn + 0.5_wp ) * dy )  THEN
678
679                      pos_x = psl(i)
680
681               xloop: DO WHILE ( pos_x <= psr(i) )
682
683                         IF ( pos_x >= ( nxl - 0.5_wp ) * dx  .AND.            &
684                              pos_x <  ( nxr + 0.5_wp ) * dx )  THEN
685
686                            DO  j = 1, particles_per_point
687
688
689                               n = n + 1
690                               tmp_particle%x             = pos_x
691                               tmp_particle%y             = pos_y
692                               tmp_particle%z             = pos_z
693                               tmp_particle%age           = 0.0_wp
694                               tmp_particle%age_m         = 0.0_wp
695                               tmp_particle%dt_sum        = 0.0_wp
696                               tmp_particle%e_m           = 0.0_wp
697                               tmp_particle%rvar1         = 0.0_wp
698                               tmp_particle%rvar2         = 0.0_wp
699                               tmp_particle%rvar3         = 0.0_wp
700                               tmp_particle%speed_x       = 0.0_wp
701                               tmp_particle%speed_y       = 0.0_wp
702                               tmp_particle%speed_z       = 0.0_wp
703                               tmp_particle%origin_x      = pos_x
704                               tmp_particle%origin_y      = pos_y
705                               tmp_particle%origin_z      = pos_z
706                               IF ( curvature_solution_effects )  THEN
707                                  tmp_particle%aux1      = 0.0_wp    ! dry aerosol radius
708                                  tmp_particle%aux2      = dt_3d     ! last Rosenbrock timestep
709                               ELSE
710                                  tmp_particle%aux1      = 0.0_wp    ! free to use
711                                  tmp_particle%aux2      = 0.0_wp    ! free to use
712                               ENDIF
713                               tmp_particle%radius        = particle_groups(i)%radius
714                               tmp_particle%weight_factor = initial_weighting_factor
715                               tmp_particle%class         = 1
716                               tmp_particle%group         = i
717                               tmp_particle%id            = 0_idp
718                               tmp_particle%particle_mask = .TRUE.
719                               tmp_particle%block_nr      = -1
720!
721!--                            Determine the grid indices of the particle position
722                               ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx
723                               jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy
724                               kp = tmp_particle%z / dz + 1 + offset_ocean_nzt
725!
726!--                            Determine surface level. Therefore, check for
727!--                            upward-facing wall on w-grid. MAXLOC will return
728!--                            the index of the lowest upward-facing wall.
729                               k_surf = MAXLOC(                                &
730                                             MERGE( 1, 0,                      &
731                                   BTEST( wall_flags_0(nzb:nzb_max,jp,ip), 18 )&
732                                                  ), DIM = 1                   &
733                                              ) - 1
734
735                               IF ( seed_follows_topography )  THEN
736!
737!--                               Particle height is given relative to topography
738                                  kp = kp + k_surf
739                                  tmp_particle%z = tmp_particle%z + zw(k_surf)
740!--                               Skip particle release if particle position is
741!--                               above model top, or within topography in case
742!--                               of overhanging structures.
743                                  IF ( kp > nzt  .OR.                          &
744                                 .NOT. BTEST( wall_flags_0(kp,jp,ip), 0 ) )  THEN
745                                     pos_x = pos_x + pdx(i)
746                                     CYCLE xloop
747                                  ENDIF
748!
749!--                            Skip particle release if particle position is
750!--                            below surface, or within topography in case
751!--                            of overhanging structures.
752                               ELSEIF ( .NOT. seed_follows_topography .AND.    &
753                                         tmp_particle%z <= zw(k_surf)  .OR.    &
754                                        .NOT. BTEST( wall_flags_0(kp,jp,ip), 0 ) )&
755                               THEN
756                                  pos_x = pos_x + pdx(i)
757                                  CYCLE xloop
758                               ENDIF
759
760                               local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1
761
762                               IF ( .NOT. first_stride )  THEN
763                                  IF ( ip < nxl  .OR.  jp < nys  .OR.  kp < nzb+1 )  THEN
764                                     write(6,*) 'xl ',ip,jp,kp,nxl,nys,nzb+1
765                                  ENDIF
766                                  IF ( ip > nxr  .OR.  jp > nyn  .OR.  kp > nzt )  THEN
767                                     write(6,*) 'xu ',ip,jp,kp,nxr,nyn,nzt
768                                  ENDIF
769                                  grid_particles(kp,jp,ip)%particles(local_count(kp,jp,ip)) = tmp_particle
770
771                               ENDIF
772                            ENDDO
773
774                         ENDIF
775
776                         pos_x = pos_x + pdx(i)
777
778                      ENDDO xloop
779
780                   ENDIF
781
782                   pos_y = pos_y + pdy(i)
783
784                ENDDO
785
786             ENDIF
787
788             pos_z = pos_z + pdz(i)
789
790          ENDDO
791
792       ENDDO
793
794       IF ( first_stride )  THEN
795          DO  ip = nxl, nxr
796             DO  jp = nys, nyn
797                DO  kp = nzb+1, nzt
798                   IF ( phase == PHASE_INIT )  THEN
799                      IF ( local_count(kp,jp,ip) > 0 )  THEN
800                         alloc_size = MAX( INT( local_count(kp,jp,ip) *        &
801                            ( 1.0_wp + alloc_factor / 100.0_wp ) ),            &
802                            min_nr_particle )
803                      ELSE
804                         alloc_size = min_nr_particle
805                      ENDIF
806                      ALLOCATE(grid_particles(kp,jp,ip)%particles(1:alloc_size))
807                      DO  n = 1, alloc_size
808                         grid_particles(kp,jp,ip)%particles(n) = zero_particle
809                      ENDDO
810                   ELSEIF ( phase == PHASE_RELEASE )  THEN
811                      IF ( local_count(kp,jp,ip) > 0 )  THEN
812                         new_size   = local_count(kp,jp,ip) + prt_count(kp,jp,ip)
813                         alloc_size = MAX( INT( new_size * ( 1.0_wp +          &
814                            alloc_factor / 100.0_wp ) ), min_nr_particle )
815                         IF( alloc_size > SIZE( grid_particles(kp,jp,ip)%particles) )  THEN
816                            CALL realloc_particles_array(ip,jp,kp,alloc_size)
817                         ENDIF
818                      ENDIF
819                   ENDIF
820                ENDDO
821             ENDDO
822          ENDDO
823       ENDIF
824
825    ENDDO
826
827
828
829    local_start = prt_count+1
830    prt_count   = local_count
831
832!
833!-- Calculate particle IDs
834    DO  ip = nxl, nxr
835       DO  jp = nys, nyn
836          DO  kp = nzb+1, nzt
837             number_of_particles = prt_count(kp,jp,ip)
838             IF ( number_of_particles <= 0 )  CYCLE
839             particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles)
840
841             DO  n = local_start(kp,jp,ip), number_of_particles  !only new particles
842
843                particles(n)%id = 10000_idp**3 * grid_particles(kp,jp,ip)%id_counter + &
844                                  10000_idp**2 * kp + 10000_idp * jp + ip
845!
846!--             Count the number of particles that have been released before
847                grid_particles(kp,jp,ip)%id_counter =                          &
848                                         grid_particles(kp,jp,ip)%id_counter + 1
849
850             ENDDO
851
852          ENDDO
853       ENDDO
854    ENDDO
855
856!
857!-- Initialize aerosol background spectrum
858    IF ( curvature_solution_effects )  THEN
859       CALL lpm_init_aerosols(local_start)
860    ENDIF
861
862!
863!-- Add random fluctuation to particle positions.
864    IF ( random_start_position )  THEN
865       DO  ip = nxl, nxr
866          DO  jp = nys, nyn
867             DO  kp = nzb+1, nzt
868                number_of_particles = prt_count(kp,jp,ip)
869                IF ( number_of_particles <= 0 )  CYCLE
870                particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles)
871!
872!--             Move only new particles. Moreover, limit random fluctuation
873!--             in order to prevent that particles move more than one grid box,
874!--             which would lead to problems concerning particle exchange
875!--             between processors in case pdx/pdy are larger than dx/dy,
876!--             respectively.
877                DO  n = local_start(kp,jp,ip), number_of_particles
878                   IF ( psl(particles(n)%group) /= psr(particles(n)%group) )  THEN
879                      rand_contr = ( random_function( iran_part ) - 0.5_wp ) * &
880                                     pdx(particles(n)%group)
881                      particles(n)%x = particles(n)%x +                        &
882                              MERGE( rand_contr, SIGN( dx, rand_contr ),       &
883                                     ABS( rand_contr ) < dx                    &
884                                   )
885                   ENDIF
886                   IF ( pss(particles(n)%group) /= psn(particles(n)%group) )  THEN
887                      rand_contr = ( random_function( iran_part ) - 0.5_wp ) * &
888                                     pdy(particles(n)%group)
889                      particles(n)%y = particles(n)%y +                        &
890                              MERGE( rand_contr, SIGN( dy, rand_contr ),       &
891                                     ABS( rand_contr ) < dy                    &
892                                   )
893                   ENDIF
894                   IF ( psb(particles(n)%group) /= pst(particles(n)%group) )  THEN
895                      rand_contr = ( random_function( iran_part ) - 0.5_wp ) * &
896                                     pdz(particles(n)%group)
897                      particles(n)%z = particles(n)%z +                        &
898                              MERGE( rand_contr, SIGN( dz, rand_contr ),       &
899                                     ABS( rand_contr ) < dz                    &
900                                   )
901                   ENDIF
902                ENDDO
903!
904!--             Identify particles located outside the model domain and reflect
905!--             or absorb them if necessary.
906                CALL lpm_boundary_conds( 'bottom/top' )
907!
908!--             Furthermore, remove particles located in topography. Note, as
909!--             the particle speed is still zero at this point, wall
910!--             reflection boundary conditions will not work in this case.
911                particles =>                                                   &
912                       grid_particles(kp,jp,ip)%particles(1:number_of_particles)
913                DO  n = local_start(kp,jp,ip), number_of_particles
914                   i = ( particles(n)%x + 0.5_wp * dx ) * ddx
915                   j = ( particles(n)%y + 0.5_wp * dy ) * ddy
916                   k =   particles(n)%z / dz + 1 + offset_ocean_nzt
917!
918!--                Check if particle is within topography
919                   IF ( .NOT. BTEST( wall_flags_0(k,j,i), 0 ) )  THEN
920                      particles(n)%particle_mask = .FALSE.
921                      deleted_particles = deleted_particles + 1
922                   ENDIF
923
924                ENDDO
925             ENDDO
926          ENDDO
927       ENDDO
928!
929!--    Exchange particles between grid cells and processors
930       CALL lpm_move_particle
931       CALL lpm_exchange_horiz
932
933    ENDIF
934!
935!-- In case of random_start_position, delete particles identified by
936!-- lpm_exchange_horiz and lpm_boundary_conds. Then sort particles into blocks,
937!-- which is needed for a fast interpolation of the LES fields on the particle
938!-- position.
939    CALL lpm_pack_all_arrays
940
941!
942!-- Determine the current number of particles
943    DO  ip = nxl, nxr
944       DO  jp = nys, nyn
945          DO  kp = nzb+1, nzt
946             number_of_particles         = number_of_particles                 &
947                                           + prt_count(kp,jp,ip)
948          ENDDO
949       ENDDO
950    ENDDO
951!
952!-- Calculate the number of particles of the total domain
953#if defined( __parallel )
954    IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
955    CALL MPI_ALLREDUCE( number_of_particles, total_number_of_particles, 1, &
956    MPI_INTEGER, MPI_SUM, comm2d, ierr )
957#else
958    total_number_of_particles = number_of_particles
959#endif
960
961    RETURN
962
963 END SUBROUTINE lpm_create_particle
964
965 SUBROUTINE lpm_init_aerosols(local_start)
966
967    USE arrays_3d,                                                             &
968        ONLY: hyp, pt, q
969
970    USE cloud_parameters,                                                      &
971        ONLY: l_d_rv, rho_l, r_v
972
973    USE constants,                                                             &
974        ONLY: pi
975
976    USE kinds
977
978    USE particle_attributes,                                                   &
979        ONLY: aero_type, aero_weight, log_sigma, molecular_weight_of_solute,   &
980              molecular_weight_of_water, na, rho_s, rm, vanthoff
981
982    IMPLICIT NONE
983
984    REAL(wp)  :: afactor            !< curvature effects
985    REAL(wp)  :: bfactor            !< solute effects
986    REAL(wp)  :: dlogr              !< logarithmic width of radius bin
987    REAL(wp)  :: e_a                !< vapor pressure
988    REAL(wp)  :: e_s                !< saturation vapor pressure
989    REAL(wp)  :: rmin = 0.005e-6_wp !< minimum aerosol radius
990    REAL(wp)  :: rmax = 10.0e-6_wp  !< maximum aerosol radius
991    REAL(wp)  :: r_mid              !< mean radius of bin
992    REAL(wp)  :: r_l                !< left radius of bin
993    REAL(wp)  :: r_r                !< right radius of bin
994    REAL(wp)  :: sigma              !< surface tension
995    REAL(wp)  :: t_int              !< temperature
996
997    INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(IN) ::  local_start !<
998
999    INTEGER(iwp)  :: n              !<
1000    INTEGER(iwp)  :: ip             !<
1001    INTEGER(iwp)  :: jp             !<
1002    INTEGER(iwp)  :: kp             !<
1003
1004!
1005!-- The following typical aerosol spectra are taken from Jaenicke (1993):
1006!-- Tropospheric aerosols. Published in Aerosol-Cloud-Climate Interactions.
1007    IF ( TRIM(aero_type) .EQ. 'polar' )  THEN
1008       na        = (/ 2.17e1, 1.86e-1, 3.04e-4 /) * 1.0E6
1009       rm        = (/ 0.0689, 0.375, 4.29 /) * 1.0E-6
1010       log_sigma = (/ 0.245, 0.300, 0.291 /)
1011    ELSEIF ( TRIM(aero_type) .EQ. 'background' )  THEN
1012       na        = (/ 1.29e2, 5.97e1, 6.35e1 /) * 1.0E6
1013       rm        = (/ 0.0036, 0.127, 0.259 /) * 1.0E-6
1014       log_sigma = (/ 0.645, 0.253, 0.425 /)
1015    ELSEIF ( TRIM(aero_type) .EQ. 'maritime' )  THEN
1016       na        = (/ 1.33e2, 6.66e1, 3.06e0 /) * 1.0E6
1017       rm        = (/ 0.0039, 0.133, 0.29 /) * 1.0E-6
1018       log_sigma = (/ 0.657, 0.210, 0.396 /)
1019    ELSEIF ( TRIM(aero_type) .EQ. 'continental' )  THEN
1020       na        = (/ 3.20e3, 2.90e3, 3.00e-1 /) * 1.0E6
1021       rm        = (/ 0.01, 0.058, 0.9 /) * 1.0E-6
1022       log_sigma = (/ 0.161, 0.217, 0.380 /)
1023    ELSEIF ( TRIM(aero_type) .EQ. 'desert' )  THEN
1024       na        = (/ 7.26e2, 1.14e3, 1.78e-1 /) * 1.0E6
1025       rm        = (/ 0.001, 0.0188, 10.8 /) * 1.0E-6
1026       log_sigma = (/ 0.247, 0.770, 0.438 /)
1027    ELSEIF ( TRIM(aero_type) .EQ. 'rural' )  THEN
1028       na        = (/ 6.65e3, 1.47e2, 1.99e3 /) * 1.0E6
1029       rm        = (/ 0.00739, 0.0269, 0.0419 /) * 1.0E-6
1030       log_sigma = (/ 0.225, 0.557, 0.266 /)
1031    ELSEIF ( TRIM(aero_type) .EQ. 'urban' )  THEN
1032       na        = (/ 9.93e4, 1.11e3, 3.64e4 /) * 1.0E6
1033       rm        = (/ 0.00651, 0.00714, 0.0248 /) * 1.0E-6
1034       log_sigma = (/ 0.245, 0.666, 0.337 /)
1035    ELSEIF ( TRIM(aero_type) .EQ. 'user' )  THEN
1036       CONTINUE
1037    ELSE
1038       WRITE( message_string, * ) 'unknown aerosol type ',   &
1039                                'aero_type = "', TRIM( aero_type ), '"'
1040       CALL message( 'lpm_init', 'PA0459', 1, 2, 0, 6, 0 )
1041    ENDIF
1042
1043    DO  ip = nxl, nxr
1044       DO  jp = nys, nyn
1045          DO  kp = nzb+1, nzt
1046
1047             number_of_particles = prt_count(kp,jp,ip)
1048             IF ( number_of_particles <= 0 )  CYCLE
1049             particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles)
1050
1051             dlogr   = ( LOG10(rmax) - LOG10(rmin) ) / ( number_of_particles - local_start(kp,jp,ip) + 1 )
1052!
1053!--          Initialize the aerosols with a predefined spectral distribution
1054!--          of the dry radius (logarithmically increasing bins) and a varying
1055!--          weighting factor
1056             DO  n = local_start(kp,jp,ip), number_of_particles  !only new particles
1057
1058                r_l   = 10.0**( LOG10( rmin ) + (n-1) * dlogr )
1059                r_r   = 10.0**( LOG10( rmin ) + n * dlogr )
1060                r_mid = SQRT( r_l * r_r )
1061
1062                particles(n)%aux1          = r_mid
1063                particles(n)%weight_factor =                                           &
1064                   ( na(1) / ( SQRT( 2.0 * pi ) * log_sigma(1) ) *                     &
1065                     EXP( - LOG10( r_mid / rm(1) )**2 / ( 2.0 * log_sigma(1)**2 ) ) +  &
1066                     na(2) / ( SQRT( 2.0 * pi ) * log_sigma(2) ) *                     &
1067                     EXP( - LOG10( r_mid / rm(2) )**2 / ( 2.0 * log_sigma(2)**2 ) ) +  &
1068                     na(3) / ( SQRT( 2.0 * pi ) * log_sigma(3) ) *                     &
1069                     EXP( - LOG10( r_mid / rm(3) )**2 / ( 2.0 * log_sigma(3)**2 ) )    &
1070                   ) * ( LOG10(r_r) - LOG10(r_l) ) * ( dx * dy * dz )
1071
1072!
1073!--             Multiply weight_factor with the namelist parameter aero_weight
1074!--             to increase or decrease the number of simulated aerosols
1075                particles(n)%weight_factor = particles(n)%weight_factor * aero_weight
1076
1077                IF ( particles(n)%weight_factor - FLOOR(particles(n)%weight_factor,KIND=wp) &
1078                     .GT. random_function( iran_part ) )  THEN
1079                   particles(n)%weight_factor = FLOOR(particles(n)%weight_factor,KIND=wp) + 1.0
1080                ELSE
1081                   particles(n)%weight_factor = FLOOR(particles(n)%weight_factor,KIND=wp)
1082                ENDIF
1083!
1084!--             Unnecessary particles will be deleted
1085                IF ( particles(n)%weight_factor .LE. 0.0 )  particles(n)%particle_mask = .FALSE.
1086
1087             ENDDO
1088!
1089!--          Set particle radius to equilibrium radius based on the environmental
1090!--          supersaturation (Khvorostyanov and Curry, 2007, JGR). This avoids
1091!--          the sometimes lengthy growth toward their equilibrium radius within
1092!--          the simulation.
1093             t_int  = pt(kp,jp,ip) * ( hyp(kp) / 100000.0_wp )**0.286_wp
1094
1095             e_s = 611.0_wp * EXP( l_d_rv * ( 3.6609E-3_wp - 1.0_wp / t_int ) )
1096             e_a = q(kp,jp,ip) * hyp(kp) / ( 0.378_wp * q(kp,jp,ip) + 0.622_wp )
1097
1098             sigma   = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp )
1099             afactor = 2.0_wp * sigma / ( rho_l * r_v * t_int )
1100
1101             bfactor = vanthoff * molecular_weight_of_water *    &
1102                       rho_s / ( molecular_weight_of_solute * rho_l )
1103!
1104!--          The formula is only valid for subsaturated environments. For
1105!--          supersaturations higher than -5 %, the supersaturation is set to -5%.
1106             IF ( e_a / e_s >= 0.95_wp )  e_a = 0.95_wp * e_s
1107
1108             DO  n = local_start(kp,jp,ip), number_of_particles  !only new particles
1109!
1110!--             For details on this equation, see Eq. (14) of Khvorostyanov and
1111!--             Curry (2007, JGR)
1112                particles(n)%radius = bfactor**0.3333333_wp *                  &
1113                   particles(n)%aux1 / ( 1.0_wp - e_a / e_s )**0.3333333_wp / &
1114                   ( 1.0_wp + ( afactor / ( 3.0_wp * bfactor**0.3333333_wp *   &
1115                     particles(n)%aux1 ) ) /                                  &
1116                     ( 1.0_wp - e_a / e_s )**0.6666666_wp                      &
1117                   )
1118
1119             ENDDO
1120
1121          ENDDO
1122       ENDDO
1123    ENDDO
1124
1125 END SUBROUTINE lpm_init_aerosols
1126
1127END MODULE lpm_init_mod
Note: See TracBrowser for help on using the repository browser.