1 | !> @file lpm_write_exchange_statistics.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 terms |
---|
6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | ! either version 3 of the License, or (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with |
---|
14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ------------------ |
---|
21 | ! |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: lpm_write_exchange_statistics.f90 1823 2016-04-07 08:57:52Z suehring $ |
---|
26 | ! |
---|
27 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
28 | ! Unused variables removed. |
---|
29 | ! |
---|
30 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
31 | ! Code annotations made doxygen readable |
---|
32 | ! |
---|
33 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
34 | ! New particle structure integrated. |
---|
35 | ! |
---|
36 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
37 | ! ONLY-attribute added to USE-statements, |
---|
38 | ! comment fields (!:) to be used for variable explanations added to |
---|
39 | ! all variable declaration statements |
---|
40 | ! |
---|
41 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
42 | ! code put under GPL (PALM 3.9) |
---|
43 | ! |
---|
44 | ! 849 2012-03-15 10:35:09Z raasch |
---|
45 | ! initial revision (former part of advec_particles) |
---|
46 | ! |
---|
47 | ! |
---|
48 | ! Description: |
---|
49 | ! ------------ |
---|
50 | !> Write particle statistics (total particle numbers and number of particles |
---|
51 | !> exchanged between subdomains) on ASCII file. |
---|
52 | !> |
---|
53 | !> @attention Output format of this file could be further improved! At current |
---|
54 | !> stage it is only a test output. |
---|
55 | !------------------------------------------------------------------------------! |
---|
56 | SUBROUTINE lpm_write_exchange_statistics |
---|
57 | |
---|
58 | |
---|
59 | USE control_parameters, & |
---|
60 | ONLY: current_timestep_number, dt_3d, simulated_time |
---|
61 | |
---|
62 | USE indices, & |
---|
63 | ONLY: nxl, nxr, nys, nyn, nzb, nzt |
---|
64 | |
---|
65 | USE particle_attributes, & |
---|
66 | ONLY: grid_particles, maximum_number_of_particles, & |
---|
67 | number_of_particles, prt_count, & |
---|
68 | trlp_count_sum, trlp_count_recv_sum, trnp_count_sum, & |
---|
69 | trnp_count_recv_sum, trrp_count_sum, trrp_count_recv_sum, & |
---|
70 | trsp_count_sum, trsp_count_recv_sum |
---|
71 | |
---|
72 | USE pegrid |
---|
73 | |
---|
74 | IMPLICIT NONE |
---|
75 | |
---|
76 | INTEGER(iwp) :: ip !< |
---|
77 | INTEGER(iwp) :: jp !< |
---|
78 | INTEGER(iwp) :: kp !< |
---|
79 | |
---|
80 | ! |
---|
81 | !-- Determine maximum number of particles (i.e., all possible particles that |
---|
82 | !-- have been allocated) and the current number of particles |
---|
83 | number_of_particles = 0 |
---|
84 | maximum_number_of_particles = 0 |
---|
85 | DO ip = nxl, nxr |
---|
86 | DO jp = nys, nyn |
---|
87 | DO kp = nzb+1, nzt |
---|
88 | number_of_particles = number_of_particles & |
---|
89 | + prt_count(kp,jp,ip) |
---|
90 | maximum_number_of_particles = maximum_number_of_particles & |
---|
91 | + SIZE(grid_particles(kp,jp,ip)%particles) |
---|
92 | ENDDO |
---|
93 | ENDDO |
---|
94 | ENDDO |
---|
95 | |
---|
96 | CALL check_open( 80 ) |
---|
97 | #if defined( __parallel ) |
---|
98 | WRITE ( 80, 8000 ) current_timestep_number+1, simulated_time+dt_3d, & |
---|
99 | number_of_particles, pleft, trlp_count_sum, & |
---|
100 | trlp_count_recv_sum, pright, trrp_count_sum, & |
---|
101 | trrp_count_recv_sum, psouth, trsp_count_sum, & |
---|
102 | trsp_count_recv_sum, pnorth, trnp_count_sum, & |
---|
103 | trnp_count_recv_sum, maximum_number_of_particles |
---|
104 | CALL close_file( 80 ) |
---|
105 | #else |
---|
106 | WRITE ( 80, 8000 ) current_timestep_number+1, simulated_time+dt_3d, & |
---|
107 | number_of_particles, maximum_number_of_particles |
---|
108 | #endif |
---|
109 | |
---|
110 | ! |
---|
111 | !-- Formats |
---|
112 | 8000 FORMAT (I6,1X,F7.2,4X,I10,5X,4(I3,1X,I4,'/',I4,2X),6X,I10) |
---|
113 | |
---|
114 | |
---|
115 | END SUBROUTINE lpm_write_exchange_statistics |
---|