source: palm/trunk/SOURCE/lpm_data_output_particles.f90 @ 2000

Last change on this file since 2000 was 2000, checked in by knoop, 5 years ago

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 9.3 KB
Line 
1!> @file lpm_data_output_particles.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
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.
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!
17! Copyright 1997-2016 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! ------------------
22! Forced header and separation lines into 80 columns
23!
24! Former revisions:
25! -----------------
26! $Id: lpm_data_output_particles.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1822 2016-04-07 07:49:42Z hoffmann
29! Tails removed. Unused variables removed.
30!
31! 1783 2016-03-06 18:36:17Z raasch
32! name change of netcdf routines and module + related changes
33!
34! 1682 2015-10-07 23:56:08Z knoop
35! Code annotations made doxygen readable
36!
37! 1359 2014-04-11 17:15:14Z hoffmann
38! netCDF output currently not available
39! output of particle data in binary format adopted to new particle structure
40!
41! 1327 2014-03-21 11:00:16Z raasch
42! -netcdf output queries
43!
44! 1320 2014-03-20 08:40:49Z raasch
45! ONLY-attribute added to USE-statements,
46! revision history before 2012 removed
47!
48! 1036 2012-10-22 13:43:42Z raasch
49! code put under GPL (PALM 3.9)
50!
51! 849 2012-03-15 10:35:09Z raasch
52! initial revision (former part of advec_particles)
53!
54! 22/02/12 - Initial version
55!
56! Description:
57! ------------
58!> Write particle data in FORTRAN binary and/or netCDF format
59!------------------------------------------------------------------------------!
60 SUBROUTINE lpm_data_output_particles
61 
62
63    USE control_parameters,                                                    &
64        ONLY:  simulated_time
65
66    USE cpulog,                                                                &
67        ONLY:  cpu_log, log_point_s
68
69    USE indices,                                                               &
70        ONLY:  nxl, nxr, nyn, nys, nzb, nzt
71
72    USE kinds
73
74    USE particle_attributes,                                                   &
75        ONLY:  grid_particles, number_of_particles,  particles, prt_count
76
77    IMPLICIT NONE
78
79    INTEGER(iwp) ::  ip !<
80    INTEGER(iwp) ::  jp !<
81    INTEGER(iwp) ::  kp !<
82
83    CALL cpu_log( log_point_s(40), 'lpm_data_output', 'start' )
84
85!
86!-- Attention: change version number for unit 85 (in routine check_open)
87!--            whenever the output format for this unit is changed!
88    CALL check_open( 85 )
89
90    WRITE ( 85 )  simulated_time
91    WRITE ( 85 )  prt_count
92         
93    DO  ip = nxl, nxr
94       DO  jp = nys, nyn
95          DO  kp = nzb+1, nzt
96             number_of_particles = prt_count(kp,jp,ip)
97             particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles)
98             IF ( number_of_particles <= 0 )  CYCLE
99             WRITE ( 85 )  particles
100          ENDDO
101       ENDDO
102    ENDDO
103
104    CALL close_file( 85 )
105
106
107#if defined( __netcdf )
108! !
109! !-- Output in netCDF format
110!     CALL check_open( 108 )
111!
112! !
113! !-- Update the NetCDF time axis
114!     prt_time_count = prt_time_count + 1
115!
116!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_time_prt, &
117!                             (/ simulated_time /),        &
118!                             start = (/ prt_time_count /), count = (/ 1 /) )
119!     CALL netcdf_handle_error( 'lpm_data_output_particles', 1 )
120!
121! !
122! !-- Output the real number of particles used
123!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_rnop_prt, &
124!                             (/ number_of_particles /),   &
125!                             start = (/ prt_time_count /), count = (/ 1 /) )
126!     CALL netcdf_handle_error( 'lpm_data_output_particles', 2 )
127!
128! !
129! !-- Output all particle attributes
130!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(1), particles%age,      &
131!                             start = (/ 1, prt_time_count /),               &
132!                             count = (/ maximum_number_of_particles /) )
133!     CALL netcdf_handle_error( 'lpm_data_output_particles', 3 )
134!
135!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles%dvrp_psize,&
136!                             start = (/ 1, prt_time_count /),                &
137!                             count = (/ maximum_number_of_particles /) )
138!     CALL netcdf_handle_error( 'lpm_data_output_particles', 4 )
139!
140!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(3), particles%origin_x, &
141!                             start = (/ 1, prt_time_count /),               &
142!                             count = (/ maximum_number_of_particles /) )
143!     CALL netcdf_handle_error( 'lpm_data_output_particles', 5 )
144!
145!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(4), particles%origin_y, &
146!                             start = (/ 1, prt_time_count /),               &
147!                             count = (/ maximum_number_of_particles /) )
148!     CALL netcdf_handle_error( 'lpm_data_output_particles', 6 )
149!
150!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(5), particles%origin_z, &
151!                             start = (/ 1, prt_time_count /),               &
152!                             count = (/ maximum_number_of_particles /) )
153!     CALL netcdf_handle_error( 'lpm_data_output_particles', 7 )
154!
155!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(6), particles%radius,   &
156!                             start = (/ 1, prt_time_count /),               &
157!                             count = (/ maximum_number_of_particles /) )
158!     CALL netcdf_handle_error( 'lpm_data_output_particles', 8 )
159!
160!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(7), particles%speed_x,  &
161!                             start = (/ 1, prt_time_count /),               &
162!                             count = (/ maximum_number_of_particles /) )
163!     CALL netcdf_handle_error( 'lpm_data_output_particles', 9 )
164!
165!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(8), particles%speed_y,  &
166!                             start = (/ 1, prt_time_count /),               &
167!                             count = (/ maximum_number_of_particles /) )
168!     CALL netcdf_handle_error( 'lpm_data_output_particles', 10 )
169!
170!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(9), particles%speed_z,  &
171!                             start = (/ 1, prt_time_count /),               &
172!                             count = (/ maximum_number_of_particles /) )
173!     CALL netcdf_handle_error( 'lpm_data_output_particles', 11 )
174!
175!     nc_stat = NF90_PUT_VAR( id_set_prt,id_var_prt(10),                     &
176!                             particles%weight_factor,                       &
177!                             start = (/ 1, prt_time_count /),               &
178!                             count = (/ maximum_number_of_particles /) )
179!     CALL netcdf_handle_error( 'lpm_data_output_particles', 12 )
180!
181!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(11), particles%x,       &
182!                             start = (/ 1, prt_time_count /),               &
183!                             count = (/ maximum_number_of_particles /) )
184!     CALL netcdf_handle_error( 'lpm_data_output_particles', 13 )
185!
186!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(12), particles%y,       &
187!                             start = (/ 1, prt_time_count /),               &
188!                             count = (/ maximum_number_of_particles /) )
189!     CALL netcdf_handle_error( 'lpm_data_output_particles', 14 )
190!
191!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(13), particles%z,       &
192!                             start = (/ 1, prt_time_count /),               &
193!                             count = (/ maximum_number_of_particles /) )
194!     CALL netcdf_handle_error( 'lpm_data_output_particles', 15 )
195!
196!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(14), particles%class,   &
197!                             start = (/ 1, prt_time_count /),               &
198!                             count = (/ maximum_number_of_particles /) )
199!     CALL netcdf_handle_error( 'lpm_data_output_particles', 16 )
200!
201!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(15), particles%group,   &
202!                             start = (/ 1, prt_time_count /),               &
203!                             count = (/ maximum_number_of_particles /) )
204!     CALL netcdf_handle_error( 'lpm_data_output_particles', 17 )
205!
206!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(16),                    &
207!                             particles%tailpoints,                          &
208!                             start = (/ 1, prt_time_count /),               &
209!                             count = (/ maximum_number_of_particles /) )
210!     CALL netcdf_handle_error( 'lpm_data_output_particles', 18 )
211!
212!     nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles%tail_id, &
213!                             start = (/ 1, prt_time_count /),               &
214!                             count = (/ maximum_number_of_particles /) )
215!     CALL netcdf_handle_error( 'lpm_data_output_particles', 19 )
216!
217#endif
218
219    CALL cpu_log( log_point_s(40), 'lpm_data_output', 'stop' )
220
221 END SUBROUTINE lpm_data_output_particles
Note: See TracBrowser for help on using the repository browser.