source: palm/trunk/SOURCE/lpm_extend_tail_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: 2.0 KB
RevLine 
[849]1 SUBROUTINE lpm_extend_tail_array( number_of_new_tails )
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! ------------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: lpm_extend_tail_array.f90 849 2012-03-15 10:35:09Z raasch $
11!
12!
13! Description:
14! ------------
15! Allocates more memory for the particle tail array.
16!------------------------------------------------------------------------------!
17
18    USE particle_attributes
19
20    IMPLICIT NONE
21
22    INTEGER ::  new_maximum_number, number_of_new_tails
23
24    LOGICAL, DIMENSION(maximum_number_of_tails) ::  tmp_tail_mask
25
26    REAL, DIMENSION(maximum_number_of_tailpoints,5,maximum_number_of_tails) :: &
27                                                    tmp_tail
28
29
30    new_maximum_number = maximum_number_of_tails + &
31                         MAX( 5*number_of_new_tails, number_of_initial_tails )
32
33    IF ( write_particle_statistics )  THEN
34       CALL check_open( 80 )
35       WRITE ( 80, '(''*** Request: '', I5, '' new_maximum_number(tails)'')' ) &
36                            new_maximum_number
37       CALL close_file( 80 )
38    ENDIF
39    WRITE (9,*) '*** Request: ',new_maximum_number,' new_maximum_number(tails)'
40
41    tmp_tail(:,:,1:number_of_tails)  = &
42                                particle_tail_coordinates(:,:,1:number_of_tails)
43    tmp_tail_mask(1:number_of_tails) = tail_mask(1:number_of_tails)
44
45    DEALLOCATE( new_tail_id, particle_tail_coordinates, tail_mask )
46    ALLOCATE( new_tail_id(new_maximum_number),                          &
47              particle_tail_coordinates(maximum_number_of_tailpoints,5, &
48              new_maximum_number),                                      &
49              tail_mask(new_maximum_number) )
50
51    maximum_number_of_tails = new_maximum_number
52
53    particle_tail_coordinates = 0.0
54    particle_tail_coordinates(:,:,1:number_of_tails) = &
55                                                 tmp_tail(:,:,1:number_of_tails)
56    tail_mask(1:number_of_tails) = tmp_tail_mask(1:number_of_tails)
57    tail_mask(number_of_tails+1:maximum_number_of_tails) = .TRUE.
58
59
60 END SUBROUTINE lpm_extend_tail_array
Note: See TracBrowser for help on using the repository browser.