source: palm/trunk/SOURCE/init_particles.f90 @ 826

Last change on this file since 826 was 826, checked in by raasch, 12 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 23.5 KB
Line 
1 SUBROUTINE init_particles
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: init_particles.f90 826 2012-02-19 03:41:34Z raasch $
11!
12! 824 2012-02-17 09:09:57Z raasch
13! particle attributes speed_x|y|z_sgs renamed rvar1|2|3,
14! array particles implemented as pointer
15!
16! 667 2010-12-23 12:06:00Z suehring/gryschka
17! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng for allocation
18! of arrays.
19!
20! 622 2010-12-10 08:08:13Z raasch
21! optional barriers included in order to speed up collective operations
22!
23! 336 2009-06-10 11:19:35Z raasch
24! Maximum number of tails is calculated from maximum number of particles and
25! skip_particles_for_tail,
26! output of messages replaced by message handling routine
27! Bugfix: arrays for tails are allocated with a minimum size of 10 tails if
28! there is no tail initially
29!
30! 150 2008-02-29 08:19:58Z raasch
31! Setting offset_ocean_* needed for calculating vertical indices within ocean
32! runs
33!
34! 117 2007-10-11 03:27:59Z raasch
35! Sorting of particles only in case of cloud droplets
36!
37! 106 2007-08-16 14:30:26Z raasch
38! variable iran replaced by iran_part
39!
40! 82 2007-04-16 15:40:52Z raasch
41! Preprocessor directives for old systems removed
42!
43! 70 2007-03-18 23:46:30Z raasch
44! displacements for mpi_particle_type changed, age_m initialized,
45! particles-package is now part of the default code
46!
47! 16 2007-02-15 13:16:47Z raasch
48! Bugfix: MPI_REAL in MPI_ALLREDUCE replaced by MPI_INTEGER
49!
50! r4 | raasch | 2007-02-13 12:33:16 +0100 (Tue, 13 Feb 2007)
51! RCS Log replace by Id keyword, revision history cleaned up
52!
53! Revision 1.24  2007/02/11 13:00:17  raasch
54! Bugfix: allocation of tail_mask and new_tail_id in case of restart-runs
55! Bugfix: __ was missing in a cpp-directive
56!
57! Revision 1.1  1999/11/25 16:22:38  raasch
58! Initial revision
59!
60!
61! Description:
62! ------------
63! This routine initializes a set of particles and their attributes (position,
64! radius, ..). Advection of these particles is carried out by advec_particles,
65! plotting is done in data_output_dvrp.
66!------------------------------------------------------------------------------!
67
68    USE arrays_3d
69    USE cloud_parameters
70    USE control_parameters
71    USE dvrp_variables
72    USE grid_variables
73    USE indices
74    USE particle_attributes
75    USE pegrid
76    USE random_function_mod
77
78
79    IMPLICIT NONE
80
81    CHARACTER (LEN=10) ::  particle_binary_version, version_on_file
82
83    INTEGER ::  i, j, n, nn
84#if defined( __parallel )
85    INTEGER, DIMENSION(3) ::  blocklengths, displacements, types
86#endif
87    LOGICAL ::  uniform_particles_l
88    REAL    ::  factor, pos_x, pos_y, pos_z, value
89
90
91#if defined( __parallel )
92!
93!-- Define MPI derived datatype for FORTRAN datatype particle_type (see module
94!-- particle_attributes). Integer length is 4 byte, Real is 8 byte
95    blocklengths(1)  = 19;  blocklengths(2)  =   4;  blocklengths(3)  =   1
96    displacements(1) =  0;  displacements(2) = 152;  displacements(3) = 168
97
98    types(1) = MPI_REAL
99    types(2) = MPI_INTEGER
100    types(3) = MPI_UB
101    CALL MPI_TYPE_STRUCT( 3, blocklengths, displacements, types, &
102                          mpi_particle_type, ierr )
103    CALL MPI_TYPE_COMMIT( mpi_particle_type, ierr )
104#endif
105
106!
107!-- In case of oceans runs, the vertical index calculations need an offset,
108!-- because otherwise the k indices will become negative
109    IF ( ocean )  THEN
110       offset_ocean_nzt    = nzt
111       offset_ocean_nzt_m1 = nzt - 1
112    ENDIF
113
114
115!
116!-- Check the number of particle groups.
117    IF ( number_of_particle_groups > max_number_of_particle_groups )  THEN
118       WRITE( message_string, * ) 'max_number_of_particle_groups =',      &
119                                  max_number_of_particle_groups ,         &
120                                  '&number_of_particle_groups reset to ', &
121                                  max_number_of_particle_groups
122       CALL message( 'init_particles', 'PA0213', 0, 1, 0, 6, 0 )
123       number_of_particle_groups = max_number_of_particle_groups
124    ENDIF
125
126!
127!-- Set default start positions, if necessary
128    IF ( psl(1) == 9999999.9 )  psl(1) = -0.5 * dx
129    IF ( psr(1) == 9999999.9 )  psr(1) = ( nx + 0.5 ) * dx
130    IF ( pss(1) == 9999999.9 )  pss(1) = -0.5 * dy
131    IF ( psn(1) == 9999999.9 )  psn(1) = ( ny + 0.5 ) * dy
132    IF ( psb(1) == 9999999.9 )  psb(1) = zu(nz/2)
133    IF ( pst(1) == 9999999.9 )  pst(1) = psb(1)
134
135    IF ( pdx(1) == 9999999.9  .OR.  pdx(1) == 0.0 )  pdx(1) = dx
136    IF ( pdy(1) == 9999999.9  .OR.  pdy(1) == 0.0 )  pdy(1) = dy
137    IF ( pdz(1) == 9999999.9  .OR.  pdz(1) == 0.0 )  pdz(1) = zu(2) - zu(1)
138
139    DO  j = 2, number_of_particle_groups
140       IF ( psl(j) == 9999999.9 )  psl(j) = psl(j-1)
141       IF ( psr(j) == 9999999.9 )  psr(j) = psr(j-1)
142       IF ( pss(j) == 9999999.9 )  pss(j) = pss(j-1)
143       IF ( psn(j) == 9999999.9 )  psn(j) = psn(j-1)
144       IF ( psb(j) == 9999999.9 )  psb(j) = psb(j-1)
145       IF ( pst(j) == 9999999.9 )  pst(j) = pst(j-1)
146       IF ( pdx(j) == 9999999.9  .OR.  pdx(j) == 0.0 )  pdx(j) = pdx(j-1)
147       IF ( pdy(j) == 9999999.9  .OR.  pdy(j) == 0.0 )  pdy(j) = pdy(j-1)
148       IF ( pdz(j) == 9999999.9  .OR.  pdz(j) == 0.0 )  pdz(j) = pdz(j-1)
149    ENDDO
150
151!
152!-- For the first model run of a possible job chain initialize the
153!-- particles, otherwise read the particle data from file.
154    IF ( TRIM( initializing_actions ) == 'read_restart_data'  &
155         .AND.  read_particles_from_restartfile )  THEN
156
157!
158!--    Read particle data from previous model run.
159!--    First open the input unit.
160       IF ( myid_char == '' )  THEN
161          OPEN ( 90, FILE='PARTICLE_RESTART_DATA_IN'//myid_char, &
162                     FORM='UNFORMATTED' )
163       ELSE
164          OPEN ( 90, FILE='PARTICLE_RESTART_DATA_IN/'//myid_char, &
165                     FORM='UNFORMATTED' )
166       ENDIF
167
168!
169!--    First compare the version numbers
170       READ ( 90 )  version_on_file
171       particle_binary_version = '3.0'
172       IF ( TRIM( version_on_file ) /= TRIM( particle_binary_version ) )  THEN
173          message_string = 'version mismatch concerning data from prior ' // &
174                           'run &version on file    = "' //                  &
175                                         TRIM( version_on_file ) //          &
176                           '&version in program = "' //                      &
177                                         TRIM( particle_binary_version ) // '"'
178          CALL message( 'init_particles', 'PA0214', 1, 2, 0, 6, 0 )
179       ENDIF
180
181!
182!--    Read some particle parameters and the size of the particle arrays,
183!--    allocate them and read their contents.
184       READ ( 90 )  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,                  &
185                    maximum_number_of_particles, maximum_number_of_tailpoints, &
186                    maximum_number_of_tails, number_of_initial_particles,      &
187                    number_of_particles, number_of_particle_groups,            &
188                    number_of_tails, particle_groups, time_prel,               &
189                    time_write_particle_data, uniform_particles
190
191       IF ( number_of_initial_particles /= 0 )  THEN
192          ALLOCATE( initial_particles(1:number_of_initial_particles) )
193          READ ( 90 )  initial_particles
194       ENDIF
195
196       ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg),       &
197                 prt_start_index(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
198                 particle_mask(maximum_number_of_particles),     &
199                 part_1(maximum_number_of_particles),            &
200                 part_2(maximum_number_of_particles) )
201
202       part_1 = particle_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
203                               0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
204                               0.0, 0, 0, 0, 0 )
205
206       part_2 = particle_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
207                               0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
208                               0.0, 0, 0, 0, 0 )
209
210       sort_count = 0
211
212       particles => part_1
213
214       READ ( 90 )  prt_count, prt_start_index
215       READ ( 90 )  particles
216
217       IF ( use_particle_tails )  THEN
218          ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &
219                    maximum_number_of_tails),                                 &
220                    new_tail_id(maximum_number_of_tails),                     &
221                    tail_mask(maximum_number_of_tails) )
222          READ ( 90 )  particle_tail_coordinates
223       ENDIF
224
225       CLOSE ( 90 )
226
227    ELSE
228
229!
230!--    Allocate particle arrays and set attributes of the initial set of
231!--    particles, which can be also periodically released at later times.
232!--    Also allocate array for particle tail coordinates, if needed.
233       ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg),       &
234                 prt_start_index(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
235                 particle_mask(maximum_number_of_particles),     &
236                 part_1(maximum_number_of_particles),            &
237                 part_2(maximum_number_of_particles)  )
238
239       particles => part_1
240
241       sort_count = 0
242
243!
244!--    Initialize all particles with dummy values (otherwise errors may
245!--    occur within restart runs). The reason for this is still not clear
246!--    and may be presumably caused by errors in the respective user-interface.
247       particles = particle_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
248                                  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
249                                  0.0, 0, 0, 0, 0 )
250       particle_groups = particle_groups_type( 0.0, 0.0, 0.0, 0.0 )
251
252!
253!--    Set the default particle size used for dvrp plots
254       IF ( dvrp_psize == 9999999.9 )  dvrp_psize = 0.2 * dx
255
256!
257!--    Set values for the density ratio and radius for all particle
258!--    groups, if necessary
259       IF ( density_ratio(1) == 9999999.9 )  density_ratio(1) = 0.0
260       IF ( radius(1)        == 9999999.9 )  radius(1) = 0.0
261       DO  i = 2, number_of_particle_groups
262          IF ( density_ratio(i) == 9999999.9 )  THEN
263             density_ratio(i) = density_ratio(i-1)
264          ENDIF
265          IF ( radius(i) == 9999999.9 )  radius(i) = radius(i-1)
266       ENDDO
267
268       DO  i = 1, number_of_particle_groups
269          IF ( density_ratio(i) /= 0.0  .AND.  radius(i) == 0 )  THEN
270             WRITE( message_string, * ) 'particle group #', i, 'has a', &
271                                        'density ratio /= 0 but radius = 0'
272             CALL message( 'init_particles', 'PA0215', 1, 2, 0, 6, 0 )
273          ENDIF
274          particle_groups(i)%density_ratio = density_ratio(i)
275          particle_groups(i)%radius        = radius(i)
276       ENDDO
277
278!
279!--    Calculate particle positions and store particle attributes, if
280!--    particle is situated on this PE
281       n = 0
282
283       DO  i = 1, number_of_particle_groups
284
285          pos_z = psb(i)
286
287          DO WHILE ( pos_z <= pst(i) )
288
289             pos_y = pss(i)
290
291             DO WHILE ( pos_y <= psn(i) )
292
293                IF ( pos_y >= ( nys - 0.5 ) * dy  .AND.  &
294                     pos_y <  ( nyn + 0.5 ) * dy )  THEN
295
296                   pos_x = psl(i)
297
298                   DO WHILE ( pos_x <= psr(i) )
299
300                      IF ( pos_x >= ( nxl - 0.5 ) * dx  .AND.  &
301                           pos_x <  ( nxr + 0.5 ) * dx )  THEN
302
303                         DO  j = 1, particles_per_point
304
305                            n = n + 1
306                            IF ( n > maximum_number_of_particles )  THEN
307                               WRITE( message_string, * ) 'number of initial', &
308                                      'particles (', n, ') exceeds',           &
309                                      '&maximum_number_of_particles (',        &
310                                      maximum_number_of_particles, ') on PE ', &
311                                             myid
312                               CALL message( 'init_particles', 'PA0216', &
313                                                                 2, 2, -1, 6, 1 )
314                            ENDIF
315                            particles(n)%x             = pos_x
316                            particles(n)%y             = pos_y
317                            particles(n)%z             = pos_z
318                            particles(n)%age           = 0.0
319                            particles(n)%age_m         = 0.0
320                            particles(n)%dt_sum        = 0.0
321                            particles(n)%dvrp_psize    = dvrp_psize
322                            particles(n)%e_m           = 0.0
323                            IF ( curvature_solution_effects )  THEN
324!
325!--                            Initial values (internal timesteps, derivative)
326!--                            for Rosenbrock method
327                               particles(n)%rvar1      = 1.0E-12
328                               particles(n)%rvar2      = 1.0E-3
329                               particles(n)%rvar3      = -9999999.9
330                            ELSE
331!
332!--                            Initial values for SGS velocities
333                               particles(n)%rvar1      = 0.0
334                               particles(n)%rvar2      = 0.0
335                               particles(n)%rvar3      = 0.0
336                            ENDIF
337                            particles(n)%speed_x       = 0.0
338                            particles(n)%speed_y       = 0.0
339                            particles(n)%speed_z       = 0.0
340                            particles(n)%origin_x      = pos_x
341                            particles(n)%origin_y      = pos_y
342                            particles(n)%origin_z      = pos_z
343                            particles(n)%radius      = particle_groups(i)%radius
344                            particles(n)%weight_factor =initial_weighting_factor
345                            particles(n)%color         = 1
346                            particles(n)%group         = i
347                            particles(n)%tailpoints    = 0
348                            IF ( use_particle_tails  .AND. &
349                                 MOD( n, skip_particles_for_tail ) == 0 )  THEN
350                               number_of_tails         = number_of_tails + 1
351!
352!--                            This is a temporary provisional setting (see
353!--                            further below!)
354                               particles(n)%tail_id    = number_of_tails
355                            ELSE
356                               particles(n)%tail_id    = 0
357                            ENDIF
358
359                         ENDDO
360
361                      ENDIF
362
363                      pos_x = pos_x + pdx(i)
364
365                   ENDDO
366
367                ENDIF
368
369                pos_y = pos_y + pdy(i)
370
371             ENDDO
372
373             pos_z = pos_z + pdz(i)
374
375          ENDDO
376
377       ENDDO
378
379       number_of_initial_particles = n
380       number_of_particles         = n
381
382!
383!--    Calculate the number of particles and tails of the total domain
384#if defined( __parallel )
385       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
386       CALL MPI_ALLREDUCE( number_of_particles, total_number_of_particles, 1, &
387                           MPI_INTEGER, MPI_SUM, comm2d, ierr )
388       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
389       CALL MPI_ALLREDUCE( number_of_tails, total_number_of_tails, 1, &
390                           MPI_INTEGER, MPI_SUM, comm2d, ierr )
391#else
392       total_number_of_particles = number_of_particles
393       total_number_of_tails     = number_of_tails
394#endif
395
396!
397!--    Set a seed value for the random number generator to be exclusively
398!--    used for the particle code. The generated random numbers should be
399!--    different on the different PEs.
400       iran_part = iran_part + myid
401
402!
403!--    User modification of initial particles
404       CALL user_init_particles
405
406!
407!--    Store the initial set of particles for release at later times
408       IF ( number_of_initial_particles /= 0 )  THEN
409          ALLOCATE( initial_particles(1:number_of_initial_particles) )
410          initial_particles(1:number_of_initial_particles) = &
411                                        particles(1:number_of_initial_particles)
412       ENDIF
413
414!
415!--    Add random fluctuation to particle positions
416       IF ( random_start_position )  THEN
417
418          DO  n = 1, number_of_initial_particles
419             IF ( psl(particles(n)%group) /= psr(particles(n)%group) )  THEN
420                particles(n)%x = particles(n)%x + &
421                                 ( random_function( iran_part ) - 0.5 ) * &
422                                 pdx(particles(n)%group)
423                IF ( particles(n)%x  <=  ( nxl - 0.5 ) * dx )  THEN
424                   particles(n)%x = ( nxl - 0.4999999999 ) * dx
425                ELSEIF ( particles(n)%x  >=  ( nxr + 0.5 ) * dx )  THEN
426                   particles(n)%x = ( nxr + 0.4999999999 ) * dx
427                ENDIF
428             ENDIF
429             IF ( pss(particles(n)%group) /= psn(particles(n)%group) )  THEN
430                particles(n)%y = particles(n)%y + &
431                                 ( random_function( iran_part ) - 0.5 ) * &
432                                 pdy(particles(n)%group)
433                IF ( particles(n)%y  <=  ( nys - 0.5 ) * dy )  THEN
434                   particles(n)%y = ( nys - 0.4999999999 ) * dy
435                ELSEIF ( particles(n)%y  >=  ( nyn + 0.5 ) * dy )  THEN
436                   particles(n)%y = ( nyn + 0.4999999999 ) * dy
437                ENDIF
438             ENDIF
439             IF ( psb(particles(n)%group) /= pst(particles(n)%group) )  THEN
440                particles(n)%z = particles(n)%z + &
441                                 ( random_function( iran_part ) - 0.5 ) * &
442                                 pdz(particles(n)%group)
443             ENDIF
444          ENDDO
445       ENDIF
446
447!
448!--    Sort particles in the sequence the gridboxes are stored in the memory.
449!--    Only required if cloud droplets are used.
450       IF ( cloud_droplets )  CALL sort_particles
451
452!
453!--    Open file for statistical informations about particle conditions
454       IF ( write_particle_statistics )  THEN
455          CALL check_open( 80 )
456          WRITE ( 80, 8000 )  current_timestep_number, simulated_time, &
457                              number_of_initial_particles,             &
458                              maximum_number_of_particles
459          CALL close_file( 80 )
460       ENDIF
461
462!
463!--    Check if particles are really uniform in color and radius (dvrp_size)
464!--    (uniform_particles is preset TRUE)
465       IF ( uniform_particles )  THEN
466          IF ( number_of_initial_particles == 0 )  THEN
467             uniform_particles_l = .TRUE.
468          ELSE
469             n = number_of_initial_particles
470             IF ( MINVAL( particles(1:n)%dvrp_psize  ) ==     &
471                  MAXVAL( particles(1:n)%dvrp_psize  )  .AND. &
472                  MINVAL( particles(1:n)%color ) ==     &
473                  MAXVAL( particles(1:n)%color ) )  THEN
474                uniform_particles_l = .TRUE.
475             ELSE
476                uniform_particles_l = .FALSE.
477             ENDIF
478          ENDIF
479
480#if defined( __parallel )
481          IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
482          CALL MPI_ALLREDUCE( uniform_particles_l, uniform_particles, 1, &
483                              MPI_LOGICAL, MPI_LAND, comm2d, ierr )
484#else
485          uniform_particles = uniform_particles_l
486#endif
487
488       ENDIF
489
490!
491!--    Particles will probably become none-uniform, if their size and color
492!--    will be determined by flow variables
493       IF ( particle_color /= 'none'  .OR.  particle_dvrpsize /= 'none' )  THEN
494          uniform_particles = .FALSE.
495       ENDIF
496
497!
498!--    Set the beginning of the particle tails and their age
499       IF ( use_particle_tails )  THEN
500!
501!--       Choose the maximum number of tails with respect to the maximum number
502!--       of particles and skip_particles_for_tail
503          maximum_number_of_tails = maximum_number_of_particles / &
504                                    skip_particles_for_tail
505
506!
507!--       Create a minimum number of tails in case that there is no tail
508!--       initially (otherwise, index errors will occur when adressing the
509!--       arrays below)
510          IF ( maximum_number_of_tails == 0 )  maximum_number_of_tails = 10
511
512          ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &
513                    maximum_number_of_tails),                                 &
514                    new_tail_id(maximum_number_of_tails),                     &
515                    tail_mask(maximum_number_of_tails) )
516
517          particle_tail_coordinates  = 0.0
518          minimum_tailpoint_distance = minimum_tailpoint_distance**2
519          number_of_initial_tails    = number_of_tails
520
521          nn = 0
522          DO  n = 1, number_of_particles
523!
524!--          Only for those particles marked above with a provisional tail_id
525!--          tails will be created. Particles now get their final tail_id.
526             IF ( particles(n)%tail_id /= 0 )  THEN
527
528                nn = nn + 1
529                particles(n)%tail_id = nn
530
531                particle_tail_coordinates(1,1,nn) = particles(n)%x
532                particle_tail_coordinates(1,2,nn) = particles(n)%y
533                particle_tail_coordinates(1,3,nn) = particles(n)%z
534                particle_tail_coordinates(1,4,nn) = particles(n)%color
535                particles(n)%tailpoints = 1
536                IF ( minimum_tailpoint_distance /= 0.0 )  THEN
537                   particle_tail_coordinates(2,1,nn) = particles(n)%x
538                   particle_tail_coordinates(2,2,nn) = particles(n)%y
539                   particle_tail_coordinates(2,3,nn) = particles(n)%z
540                   particle_tail_coordinates(2,4,nn) = particles(n)%color
541                   particle_tail_coordinates(1:2,5,nn) = 0.0
542                   particles(n)%tailpoints = 2
543                ENDIF
544
545             ENDIF
546          ENDDO
547       ENDIF
548
549!
550!--    Plot initial positions of particles (only if particle advection is
551!--    switched on from the beginning of the simulation (t=0))
552       IF ( particle_advection_start == 0.0 )  CALL data_output_dvrp
553
554    ENDIF
555
556!
557!-- Check boundary condition and set internal variables
558    SELECT CASE ( bc_par_b )
559   
560       CASE ( 'absorb' )
561          ibc_par_b = 1
562
563       CASE ( 'reflect' )
564          ibc_par_b = 2
565         
566       CASE DEFAULT
567          WRITE( message_string, * )  'unknown boundary condition ',   &
568                                       'bc_par_b = "', TRIM( bc_par_b ), '"'
569          CALL message( 'init_particles', 'PA0217', 1, 2, 0, 6, 0 )
570         
571    END SELECT
572    SELECT CASE ( bc_par_t )
573   
574       CASE ( 'absorb' )
575          ibc_par_t = 1
576
577       CASE ( 'reflect' )
578          ibc_par_t = 2
579         
580       CASE DEFAULT
581          WRITE( message_string, * ) 'unknown boundary condition ',   &
582                                     'bc_par_t = "', TRIM( bc_par_t ), '"'
583          CALL message( 'init_particles', 'PA0218', 1, 2, 0, 6, 0 )
584         
585    END SELECT
586    SELECT CASE ( bc_par_lr )
587
588       CASE ( 'cyclic' )
589          ibc_par_lr = 0
590
591       CASE ( 'absorb' )
592          ibc_par_lr = 1
593
594       CASE ( 'reflect' )
595          ibc_par_lr = 2
596         
597       CASE DEFAULT
598          WRITE( message_string, * ) 'unknown boundary condition ',   &
599                                     'bc_par_lr = "', TRIM( bc_par_lr ), '"'
600          CALL message( 'init_particles', 'PA0219', 1, 2, 0, 6, 0 )
601         
602    END SELECT
603    SELECT CASE ( bc_par_ns )
604
605       CASE ( 'cyclic' )
606          ibc_par_ns = 0
607
608       CASE ( 'absorb' )
609          ibc_par_ns = 1
610
611       CASE ( 'reflect' )
612          ibc_par_ns = 2
613         
614       CASE DEFAULT
615          WRITE( message_string, * ) 'unknown boundary condition ',   &
616                                     'bc_par_ns = "', TRIM( bc_par_ns ), '"'
617          CALL message( 'init_particles', 'PA0220', 1, 2, 0, 6, 0 )
618         
619    END SELECT
620!
621!-- Formats
6228000 FORMAT (I6,1X,F7.2,4X,I6,71X,I6)
623
624 END SUBROUTINE init_particles
Note: See TracBrowser for help on using the repository browser.