source: palm/trunk/SOURCE/lpm_read_restart_file.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: 3.4 KB
Line 
1 SUBROUTINE lpm_read_restart_file
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! ------------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: lpm_read_restart_file.f90 849 2012-03-15 10:35:09Z raasch $
11!
12!
13! Description:
14! ------------
15! Read particle data from the restart file.
16!------------------------------------------------------------------------------!
17
18    USE control_parameters
19    USE indices
20    USE particle_attributes
21    USE pegrid
22
23    IMPLICIT NONE
24
25    CHARACTER (LEN=10) ::  particle_binary_version, version_on_file
26
27!
28!-- Read particle data from previous model run.
29!-- First open the input unit.
30    IF ( myid_char == '' )  THEN
31       OPEN ( 90, FILE='PARTICLE_RESTART_DATA_IN'//myid_char, &
32                  FORM='UNFORMATTED' )
33    ELSE
34       OPEN ( 90, FILE='PARTICLE_RESTART_DATA_IN/'//myid_char, &
35                  FORM='UNFORMATTED' )
36    ENDIF
37
38!
39!-- First compare the version numbers
40    READ ( 90 )  version_on_file
41    particle_binary_version = '3.0'
42    IF ( TRIM( version_on_file ) /= TRIM( particle_binary_version ) )  THEN
43       message_string = 'version mismatch concerning data from prior ' // &
44                        'run &version on file    = "' //                  &
45                                      TRIM( version_on_file ) //          &
46                        '&version in program = "' //                      &
47                                      TRIM( particle_binary_version ) // '"'
48       CALL message( 'lpm_read_restart_file', 'PA0214', 1, 2, 0, 6, 0 )
49    ENDIF
50
51!
52!-- Read some particle parameters and the size of the particle arrays,
53!-- allocate them and read their contents.
54    READ ( 90 )  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,                  &
55                 maximum_number_of_particles, maximum_number_of_tailpoints, &
56                 maximum_number_of_tails, number_of_initial_particles,      &
57                 number_of_particles, number_of_particle_groups,            &
58                 number_of_tails, particle_groups, time_prel,               &
59                 time_write_particle_data, uniform_particles
60
61    IF ( number_of_initial_particles /= 0 )  THEN
62       ALLOCATE( initial_particles(1:number_of_initial_particles) )
63       READ ( 90 )  initial_particles
64    ENDIF
65
66    ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg),       &
67              prt_start_index(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
68              particle_mask(maximum_number_of_particles),     &
69              part_1(maximum_number_of_particles),            &
70              part_2(maximum_number_of_particles) )
71
72    part_1 = particle_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
73                            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
74                            0.0, 0, 0, 0, 0 )
75
76    part_2 = particle_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
77                            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &
78                            0.0, 0, 0, 0, 0 )
79
80    sort_count = 0
81
82    particles => part_1
83
84    READ ( 90 )  prt_count, prt_start_index
85    READ ( 90 )  particles
86
87    IF ( use_particle_tails )  THEN
88       ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &
89                 maximum_number_of_tails),                                 &
90                 new_tail_id(maximum_number_of_tails),                     &
91                 tail_mask(maximum_number_of_tails) )
92       READ ( 90 )  particle_tail_coordinates
93    ENDIF
94
95    CLOSE ( 90 )
96
97
98 END SUBROUTINE lpm_read_restart_file
Note: See TracBrowser for help on using the repository browser.