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