source: palm/trunk/SOURCE/lpm_extend_particle_array.f90 @ 849

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

Changed:


Original routine advec_particles split into several new subroutines and renamed
lpm.
init_particles renamed lpm_init
user_advec_particles renamed user_lpm_advec,
particle_boundary_conds renamed lpm_boundary_conds,
set_particle_attributes renamed lpm_set_attributes,
user_init_particles renamed user_lpm_init,
user_particle_attributes renamed user_lpm_set_attributes
(Makefile, lpm_droplet_collision, lpm_droplet_condensation, init_3d_model, modules, palm, read_var_list, time_integration, write_var_list, deleted: advec_particles, init_particles, particle_boundary_conds, set_particle_attributes, user_advec_particles, user_init_particles, user_particle_attributes, new: lpm, lpm_advec, lpm_boundary_conds, lpm_calc_liquid_water_content, lpm_data_output_particles, lpm_droplet_collision, lpm_drollet_condensation, lpm_exchange_horiz, lpm_extend_particle_array, lpm_extend_tails, lpm_extend_tail_array, lpm_init, lpm_init_sgs_tke, lpm_pack_arrays, lpm_read_restart_file, lpm_release_set, lpm_set_attributes, lpm_sort_arrays, lpm_write_exchange_statistics, lpm_write_restart_file, user_lpm_advec, user_lpm_init, user_lpm_set_attributes

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1 SUBROUTINE lpm_extend_particle_array( number_of_new_particles )
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! ------------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: lpm_extend_particle_array.f90 849 2012-03-15 10:35:09Z raasch $
11!
12!
13! Description:
14! ------------
15! Allocates more memory for the particle array.
16!------------------------------------------------------------------------------!
17
18    USE particle_attributes
19
20    IMPLICIT NONE
21
22    INTEGER ::  new_maximum_number, number_of_new_particles
23
24    LOGICAL, DIMENSION(:), ALLOCATABLE ::  tmp_particle_mask
25
26    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  tmp_particles
27
28
29
30    new_maximum_number = maximum_number_of_particles + &
31                   MAX( 5*number_of_new_particles, number_of_initial_particles )
32
33    IF ( write_particle_statistics )  THEN
34       CALL check_open( 80 )
35       WRITE ( 80, '(''*** Request: '', I7, '' new_maximum_number(prt)'')' ) &
36                            new_maximum_number
37       CALL close_file( 80 )
38    ENDIF
39
40    ALLOCATE( tmp_particles(maximum_number_of_particles), &
41              tmp_particle_mask(maximum_number_of_particles) )
42
43    tmp_particles     = particles
44    tmp_particle_mask = particle_mask
45
46    DEALLOCATE( particles, particle_mask )
47    ALLOCATE( particles(new_maximum_number), particle_mask(new_maximum_number) )
48
49    maximum_number_of_particles = new_maximum_number
50
51    particles(1:number_of_particles) = tmp_particles(1:number_of_particles)
52    particle_mask(1:number_of_particles) = &
53                                       tmp_particle_mask(1:number_of_particles)
54    particle_mask(number_of_particles+1:maximum_number_of_particles) = .TRUE.
55
56    DEALLOCATE( tmp_particles, tmp_particle_mask )
57
58
59 END SUBROUTINE lpm_extend_particle_array
Note: See TracBrowser for help on using the repository browser.