source: palm/trunk/SOURCE/lpm_write_exchange_statistics.f90 @ 2805

Last change on this file since 2805 was 2801, checked in by thiele, 7 years ago

Introduce particle transfer in nested models

  • Property svn:keywords set to Id
File size: 4.8 KB
RevLine 
[1682]1!> @file lpm_write_exchange_statistics.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]4!
[2000]5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
[1036]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!
[2718]17! Copyright 1997-2018 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[849]20! Current revisions:
21! ------------------
[1360]22!
[2001]23!
[849]24! Former revisions:
25! -----------------
26! $Id: lpm_write_exchange_statistics.f90 2801 2018-02-14 16:01:55Z suehring $
[2801]27! Introduce particle transfer in nested models.
28!
29! 2718 2018-01-02 08:49:38Z maronga
[2716]30! Corrected "Former revisions" section
31!
32! 2696 2017-12-14 17:12:51Z kanani
33! Change in file header (GPL part)
34!
35! 2265 2017-06-08 16:58:28Z schwenkel
[2265]36! Unused variables removed.
37!
38! 2101 2017-01-05 16:42:31Z suehring
[849]39!
[2001]40! 2000 2016-08-20 18:09:15Z knoop
41! Forced header and separation lines into 80 columns
42!
[1823]43! 1822 2016-04-07 07:49:42Z hoffmann
44! Unused variables removed.
45!
[1683]46! 1682 2015-10-07 23:56:08Z knoop
47! Code annotations made doxygen readable
48!
[1360]49! 1359 2014-04-11 17:15:14Z hoffmann
50! New particle structure integrated.
51!
[1321]52! 1320 2014-03-20 08:40:49Z raasch
53! ONLY-attribute added to USE-statements,
54! comment fields (!:) to be used for variable explanations added to
55! all variable declaration statements
56!
[1037]57! 1036 2012-10-22 13:43:42Z raasch
58! code put under GPL (PALM 3.9)
59!
[850]60! 849 2012-03-15 10:35:09Z raasch
61! initial revision (former part of advec_particles)
[849]62!
[850]63!
[849]64! Description:
65! ------------
[1682]66!> Write particle statistics (total particle numbers and number of particles
67!> exchanged between subdomains) on ASCII file.
68!>
69!> @attention Output format of this file could be further improved! At current
70!>            stage it is only a test output.
[849]71!------------------------------------------------------------------------------!
[1682]72 SUBROUTINE lpm_write_exchange_statistics
73 
[2801]74    USE MPI
[849]75
[1359]76    USE control_parameters,                                                    &
[1320]77        ONLY:  current_timestep_number, dt_3d, simulated_time
78
[1359]79    USE indices,                                                               &
80        ONLY:  nxl, nxr, nys, nyn, nzb, nzt
[1320]81
[1359]82    USE particle_attributes,                                                   &
[2265]83        ONLY:  grid_particles,  number_of_particles, prt_count,                &
[1359]84               trlp_count_sum, trlp_count_recv_sum, trnp_count_sum,            &
85               trnp_count_recv_sum, trrp_count_sum, trrp_count_recv_sum,       &
86               trsp_count_sum, trsp_count_recv_sum
87
[2801]88    USE pmc_particle_interface,                                                &
89        ONLY:  pmcp_g_print_number_of_particles
90
[849]91    USE pegrid
92
93    IMPLICIT NONE
94
[1682]95    INTEGER(iwp) :: ip         !<
96    INTEGER(iwp) :: jp         !<
97    INTEGER(iwp) :: kp         !<
[2801]98    INTEGER(iwp) :: tot_number_of_particles
[849]99
[2801]100
101
[1359]102!
[2265]103!-- Determine the current number of particles
[1359]104    number_of_particles         = 0
105    DO  ip = nxl, nxr
106       DO  jp = nys, nyn
107          DO  kp = nzb+1, nzt
108             number_of_particles = number_of_particles                         &
109                                     + prt_count(kp,jp,ip)
110          ENDDO
111       ENDDO
112    ENDDO
113
[849]114    CALL check_open( 80 )
115#if defined( __parallel )
116    WRITE ( 80, 8000 )  current_timestep_number+1, simulated_time+dt_3d, &
117                        number_of_particles, pleft, trlp_count_sum,      &
118                        trlp_count_recv_sum, pright, trrp_count_sum,     &
119                        trrp_count_recv_sum, psouth, trsp_count_sum,     &
120                        trsp_count_recv_sum, pnorth, trnp_count_sum,     &
[2265]121                        trnp_count_recv_sum
[849]122#else
123    WRITE ( 80, 8000 )  current_timestep_number+1, simulated_time+dt_3d, &
[2265]124                        number_of_particles
[849]125#endif
[2801]126    CALL close_file( 80 )
[849]127
[2801]128    IF ( number_of_particles > 0 ) THEN
129        WRITE(9,*) 'number_of_particles ', number_of_particles, current_timestep_number + 1, simulated_time + dt_3d
130    ENDIF
131
132#if defined( __parallel )
133    CALL MPI_ALLREDUCE( number_of_particles, tot_number_of_particles, 1, MPI_INTEGER,      &
134                                    MPI_SUM, comm2d, ierr)
135#else
136    tot_number_of_particles = number_of_particles
137#endif
138
139    CALL pmcp_g_print_number_of_particles (simulated_time+dt_3d, tot_number_of_particles)
140
[849]141!
142!-- Formats
[1359]1438000 FORMAT (I6,1X,F7.2,4X,I10,5X,4(I3,1X,I4,'/',I4,2X),6X,I10)
[849]144
145
146 END SUBROUTINE lpm_write_exchange_statistics
Note: See TracBrowser for help on using the repository browser.