source: palm/trunk/SOURCE/data_output_ptseries.f90 @ 546

Last change on this file since 546 was 392, checked in by raasch, 15 years ago

New:
---

Adapted for machine lck
(mrun, mbuild, subjob)

bc_lr/bc_ns in most subroutines replaced by LOGICAL variables bc_lr_cyc,
bc_ns_cyc for speed optimization
(check_parameters, diffusion_u, diffusion_v, diffusion_w, modules)

Additional timestep criterion in case of simulations with plant canopy (timestep)

Check for illegal entries in section_xy|xz|yz that exceed nz+1|ny+1|nx+1
(check_parameters)

Clipping of dvrp output implemented. Default colourtable for particles
implemented, particle attributes (color, dvrp_size) can be set with new
parameters particle_color, particle_dvrpsize, color_interval,
dvrpsize_interval (init_dvrp, data_output_dvrp, modules, user_data_output_dvrp).
Slicer attributes (dvrp) are set with new routine set_slicer_attributes_dvrp
and are controlled with existing parameters slicer_range_limits.
(set_slicer_attributes_dvrp)

Ocean atmosphere coupling allows to use independent precursor runs in order
to account for different spin-up times. The time when coupling has to be
started is given by new inipar parameter coupling_start_time. The precursor
ocean run has to be started using new mrun option "-y" in order to add
appendix "_O" to all output files.
(check_for_restart, check_parameters, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, header, init_coupling, modules, mrun,
parin, read_var_list, surface_coupler, time_integration, write_var_list)

Polygon reduction for topography and ground plate isosurface. Reduction level
for buildings can be chosen with parameter cluster_size. (init_dvrp)

External pressure gradient (check_parameters, header, init_3d_model, modules,
parin, prognostic_equations, read_var_list, write_var_list)

New topography case 'single_street_canyon' (header, init_grid, modules, parin,
read_var_list, user_check_parameters, user_header, user_init_grid, write_var_list)

Option to predefine a target bulk velocity for conserve_volume_flow
(check_parameters, header, init_3d_model, modules, parin, read_var_list,
write_var_list)

Option for user defined 2D data output in xy cross sections at z=nzb+1
(data_output_2d, user_data_output_2d)

xy cross section output of surface heatfluxes (latent, sensible)
(average_3d_data, check_parameters, data_output_2d, modules, read_3d_binary,
sum_up_3d_data, write_3d_binary)

average_3d_data, check_for_restart, check_parameters, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, init_coupling, init_dvrp, init_grid, init_3d_model, header, mbuild, modules, mrun, package_parin, parin, prognostic_equations, read_3d_binary, read_var_list, subjob, surface_coupler, timestep, time_integration, user_check_parameters, user_data_output_2d, user_data_output_dvrp, user_header, user_init_grid, write_3d_binary, write_var_list

New: set_particle_attributes, set_slicer_attributes_dvrp

Changed:


lcmuk changed to lc to avoid problems with Intel compiler on sgi-ice
(poisfft)

For extended NetCDF files, the updated title attribute includes an update of
time_average_text where appropriate. (netcdf)

In case of restart runs without extension, initial profiles are not written
to NetCDF-file anymore. (data_output_profiles, modules, read_var_list, write_var_list)

Small change in formatting of the message handling routine concering the output in the
job protocoll. (message)

initializing_actions='read_data_for_recycling' renamed to 'cyclic_fill', now
independent of turbulent_inflow (check_parameters, header, init_3d_model)

2 NetCDF error numbers changed. (data_output_3d)

A Link to the website appendix_a.html is printed for further information
about the possible errors. (message)

Temperature gradient criterion for estimating the boundary layer height
replaced by the gradient criterion of Sullivan et al. (1998). (flow_statistics)

NetCDF unit attribute in timeseries output in case of statistic regions added
(netcdf)

Output of NetCDF messages with aid of message handling routine.
(check_open, close_file, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, netcdf, output_particles_netcdf)

Output of messages replaced by message handling routine.
(advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart,
check_open, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp,
data_output_profiles, data_output_spectra, fft_xy, flow_statistics, header,
init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid,
netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary,
read_var_list, surface_coupler, temperton_fft, timestep, user_actions,
user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy,
user_parin, user_read_restart_data, user_spectra )

Maximum number of tails is calculated from maximum number of particles and
skip_particles_for_tail (init_particles)

Value of vertical_particle_advection may differ for each particle group
(advec_particles, header, modules)

First constant in array den also defined as type double. (eqn_state_seawater)

Parameter dvrp_psize moved from particles_par to dvrp_graphics_par. (package_parin)

topography_grid_convention moved from userpar to inipar (check_parameters,
header, parin, read_var_list, user_check_parameters, user_header,
user_init_grid, user_parin, write_var_list)

Default value of grid_matching changed to strict.

Adjustments for runs on lcxt4 (necessary due to an software update on CRAY) and
for coupled runs on ibmy (mrun, subjob)

advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, close_file, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, message, mrun, netcdf, output_particles_netcdf, package_parin, parin, plant_canopy_model, poisfft, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, subjob, user_check_parameters, user_header, user_init_grid, user_parin, surface_coupler, temperton_fft, timestep, user_actions, user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy, user_parin, user_read_restart_data, user_spectra, write_var_list

Errors:


Bugfix: Initial hydrostatic pressure profile in case of ocean runs is now
calculated in 5 iteration steps. (init_ocean)

Bugfix: wrong sign in buoyancy production of ocean part in case of not using
the reference density (only in 3D routine production_e) (production_e)

Bugfix: output of averaged 2d/3d quantities requires that an avaraging
interval has been set, respective error message is included (check_parameters)

Bugfix: Output on unit 14 only if requested by write_binary.
(user_last_actions)

Bugfix to avoid zero division by km_neutral (production_e)

Bugfix for extended NetCDF files: In order to avoid 'data mode' errors if
updated attributes are larger than their original size, NF90_PUT_ATT is called
in 'define mode' enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a
possible performance loss; an alternative strategy would be to ensure equal
attribute size in a job chain. (netcdf)

Bugfix: correction of initial volume flow for non-flat topography (init_3d_model)
Bugfix: zero initialization of arrays within buildings for 'cyclic_fill' (init_3d_model)

Bugfix: to_be_resorted => s_av for time-averaged scalars (data_output_2d, data_output_3d)

Bugfix: error in formatting the output (message)

Bugfix: avoid that ngp_2dh_s_inner becomes zero (init_3_model)

Typographical error: unit of wpt in dots_unit (modules)

Bugfix: error in check, if particles moved further than one subdomain length.
This check must not be applied for newly released particles. (advec_particles)

Bugfix: several tail counters are initialized, particle_tail_coordinates is
only written to file if its third index is > 0, arrays for tails are allocated
with a minimum size of 10 tails if there is no tail initially (init_particles,
advec_particles)

Bugfix: pressure included for profile output (check_parameters)

Bugfix: Type of count and count_rate changed to default INTEGER on NEC machines
(cpu_log)

Bugfix: output if particle time series only if particle advection is switched
on. (time_integration)

Bugfix: qsws was calculated in case of constant heatflux = .FALSE. (prandtl_fluxes)

Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0) (data_output_2d)

Typographical errors (netcdf)

If the inversion height calculated by the prerun is zero, inflow_damping_height
must be explicitly specified (init_3d_model)

Small bugfix concerning 3d 64bit netcdf output format (header)

Bugfix: dt_fixed removed from the restart file, because otherwise, no change
from a fixed to a variable timestep would be possible in restart runs.
(read_var_list, write_var_list)

Bugfix: initial setting of time_coupling in coupled restart runs (time_integration)

advec_particles, check_parameters, cpu_log, data_output_2d, data_output_3d, header, init_3d_model, init_particles, init_ocean, modules, netcdf, prandtl_fluxes, production_e, read_var_list, time_integration, user_last_actions, write_var_list

  • Property svn:keywords set to Id
File size: 11.0 KB
RevLine 
[1]1 SUBROUTINE data_output_ptseries
2
3!------------------------------------------------------------------------------!
[263]4! Current revisions:
[1]5! -----------------
[392]6!
[1]7!
8! Former revisions:
9! -----------------
[3]10! $Id: data_output_ptseries.f90 392 2009-09-24 10:39:14Z maronga $
[77]11!
[392]12! 291 2009-04-16 12:07:26Z raasch
13! simulated_time in NetCDF output replaced by time_since_reference_point.
14! Output of NetCDF messages with aid of message handling routine.
15!
[77]16! 60 2007-03-11 11:50:04Z raasch
17! Particles-package is now part of the default code.
18!
[3]19! RCS Log replace by Id keyword, revision history cleaned up
20!
[1]21! Revision 1.2  2006/08/22 13:51:13  raasch
22! Seperate output for particle groups
23!
24! Revision 1.1  2006/08/04 14:24:18  raasch
25! Initial revision
26!
27!
28! Description:
29! ------------
30! Output of particle data timeseries in NetCDF format.
31!------------------------------------------------------------------------------!
32
33    USE control_parameters
34    USE cpulog
35    USE indices
36    USE interfaces
37    USE netcdf_control
38    USE particle_attributes
39    USE pegrid
40
41    IMPLICIT NONE
42
43
44    INTEGER ::  i, inum, j, n
45
46    REAL, DIMENSION(0:number_of_particle_groups,30) ::  pts_value, pts_value_l
47
48
49
50    CALL cpu_log( log_point(36), 'data_output_ptseries', 'start' )
51
52    IF ( myid == 0  .AND.  netcdf_output )  THEN
53!
54!--    Open file for time series output in NetCDF format
55       dopts_time_count = dopts_time_count + 1
56       CALL check_open( 109 )
57#if defined( __netcdf )
58!
59!--    Update the particle time series time axis
[291]60       nc_stat = NF90_PUT_VAR( id_set_pts, id_var_time_pts,      &
61                               (/ time_since_reference_point /), &
[1]62                               start = (/ dopts_time_count /), count = (/ 1 /) )
[263]63       CALL handle_netcdf_error( 'data_output_ptseries', 391 )
[1]64#endif
65
66    ENDIF
67
68    pts_value_l = 0.0
69
70!
71!-- Calculate or collect the particle time series quantities for all particles
72!-- and seperately for each particle group (if there is more than one group)
73    DO  n = 1, number_of_particles
74
75       pts_value_l(0,1)  = number_of_particles            ! total # of particles
76       pts_value_l(0,2)  = pts_value_l(0,2) + &
77                           ( particles(n)%x - particles(n)%origin_x )  ! mean x
78       pts_value_l(0,3)  = pts_value_l(0,3) + &
79                           ( particles(n)%y - particles(n)%origin_y )  ! mean y
80       pts_value_l(0,4)  = pts_value_l(0,4) + &
81                           ( particles(n)%z - particles(n)%origin_z )  ! mean z
82       pts_value_l(0,5)  = pts_value_l(0,5) + particles(n)%z ! mean z (absolute)
83       pts_value_l(0,6)  = pts_value_l(0,6) + particles(n)%speed_x     ! mean u
84       pts_value_l(0,7)  = pts_value_l(0,7) + particles(n)%speed_y     ! mean v
85       pts_value_l(0,8)  = pts_value_l(0,8) + particles(n)%speed_z     ! mean w
86       pts_value_l(0,9)  = pts_value_l(0,9) + &
87                                            particles(n)%speed_x_sgs ! mean sgsu
88       pts_value_l(0,10) = pts_value_l(0,10) + &
89                                            particles(n)%speed_y_sgs ! mean sgsv
90       pts_value_l(0,11) = pts_value_l(0,11) + &
91                                            particles(n)%speed_z_sgs ! mean sgsw
92       IF ( particles(n)%speed_z > 0.0 )  THEN
93          pts_value_l(0,12) = pts_value_l(0,12) + 1.0  ! # of upward moving prts
94          pts_value_l(0,13) = pts_value_l(0,13) + &
95                                            particles(n)%speed_z ! mean w upw.
96       ELSE
97          pts_value_l(0,14) = pts_value_l(0,14) + &
98                                            particles(n)%speed_z ! mean w down
99       ENDIF
100       pts_value_l(0,15) = number_of_particles
101       pts_value_l(0,16) = number_of_particles
102
103!
104!--    Repeat the same for the respective particle group
105       IF ( number_of_particle_groups > 1 )  THEN
106          j = particles(n)%group
107
108          pts_value_l(j,1)  = pts_value_l(j,1)  + 1
109          pts_value_l(j,2)  = pts_value_l(j,2)  + &
110                              ( particles(n)%x - particles(n)%origin_x )
111          pts_value_l(j,3)  = pts_value_l(j,3)  + &
112                              ( particles(n)%y - particles(n)%origin_y )
113          pts_value_l(j,4)  = pts_value_l(j,4)  + &
114                              ( particles(n)%z - particles(n)%origin_z )
115          pts_value_l(j,5)  = pts_value_l(j,5)  + particles(n)%z
116          pts_value_l(j,6)  = pts_value_l(j,6)  + particles(n)%speed_x
117          pts_value_l(j,7)  = pts_value_l(j,7)  + particles(n)%speed_y
118          pts_value_l(j,8)  = pts_value_l(j,8)  + particles(n)%speed_z
119          pts_value_l(j,9)  = pts_value_l(j,9)  + particles(n)%speed_x_sgs
120          pts_value_l(j,10) = pts_value_l(j,10) + particles(n)%speed_y_sgs
121          pts_value_l(j,11) = pts_value_l(j,11) + particles(n)%speed_z_sgs
122          IF ( particles(n)%speed_z > 0.0 )  THEN
123             pts_value_l(j,12) = pts_value_l(j,12) + 1.0
124             pts_value_l(j,13) = pts_value_l(j,13) + particles(n)%speed_z
125          ELSE
126             pts_value_l(j,14) = pts_value_l(j,14) + particles(n)%speed_z
127          ENDIF
128          pts_value_l(j,15) = pts_value_l(j,15) + 1.0
129          pts_value_l(j,16) = pts_value_l(j,16) + 1.0
130
131       ENDIF
132
133    ENDDO
134
135#if defined( __parallel )
136!
137!-- Sum values of the subdomains
138    inum = number_of_particle_groups + 1
139
140    CALL MPI_ALLREDUCE( pts_value_l(0,1), pts_value(0,1), 14*inum, MPI_REAL, &
141                        MPI_SUM, comm2d, ierr )
142    CALL MPI_ALLREDUCE( pts_value_l(0,15), pts_value(0,15), inum, MPI_REAL, &
143                        MPI_MAX, comm2d, ierr )
144    CALL MPI_ALLREDUCE( pts_value_l(0,16), pts_value(0,16), inum, MPI_REAL, &
145                        MPI_MIN, comm2d, ierr )
146#else
147    pts_value(:,1:16) = pts_value_l(:,1:16)
148#endif
149
150!
151!-- Normalize the above calculated quantities with the total number of
152!-- particles
153    IF ( number_of_particle_groups > 1 )  THEN
154       inum = number_of_particle_groups
155    ELSE
156       inum = 0
157    ENDIF
158
159    DO  j = 0, inum
160
161       IF ( pts_value(j,1) > 0.0 )  THEN
162
163          pts_value(j,2:14) = pts_value(j,2:14) / pts_value(j,1)
164          IF ( pts_value(j,12) > 0.0  .AND.  pts_value(j,12) < 1.0 )  THEN
165             pts_value(j,13) = pts_value(j,13) / pts_value(j,12)
166             pts_value(j,14) = pts_value(j,14) / ( 1.0 - pts_value(j,12) )
167          ELSEIF ( pts_value(j,12) == 0.0 )  THEN
168             pts_value(j,13) = -1.0
169          ELSE
170             pts_value(j,14) = -1.0
171          ENDIF
172
173       ENDIF
174
175    ENDDO
176
177!
178!-- Calculate higher order moments of particle time series quantities,
179!-- seperately for each particle group (if there is more than one group)
180    DO  n = 1, number_of_particles
181
182       pts_value_l(0,17) = pts_value_l(0,17) + ( particles(n)%x - &
183                           particles(n)%origin_x - pts_value(0,2) )**2 ! x*2
184       pts_value_l(0,18) = pts_value_l(0,18) + ( particles(n)%y - &
185                           particles(n)%origin_y - pts_value(0,3) )**2 ! y*2
186       pts_value_l(0,19) = pts_value_l(0,19) + ( particles(n)%z - &
187                           particles(n)%origin_z - pts_value(0,4) )**2 ! z*2
188       pts_value_l(0,20) = pts_value_l(0,20) + ( particles(n)%speed_x - &
189                                               pts_value(0,6) )**2     ! u*2
190       pts_value_l(0,21) = pts_value_l(0,21) + ( particles(n)%speed_y - &
191                                               pts_value(0,7) )**2     ! v*2
192       pts_value_l(0,22) = pts_value_l(0,22) + ( particles(n)%speed_z - &
193                                               pts_value(0,8) )**2     ! w*2
194       pts_value_l(0,23) = pts_value_l(0,23) + ( particles(n)%speed_x_sgs - &
195                                               pts_value(0,9) )**2     ! u"2
196       pts_value_l(0,24) = pts_value_l(0,24) + ( particles(n)%speed_y_sgs - &
197                                               pts_value(0,10) )**2    ! v"2
198       pts_value_l(0,25) = pts_value_l(0,25) + ( particles(n)%speed_z_sgs - &
199                                               pts_value(0,11) )**2    ! w"2
200!
201!--    Repeat the same for the respective particle group
202       IF ( number_of_particle_groups > 1 )  THEN
203          j = particles(n)%group
204
205          pts_value_l(j,17) = pts_value_l(j,17) + ( particles(n)%x - &
206                              particles(n)%origin_x - pts_value(j,2) )**2
207          pts_value_l(j,18) = pts_value_l(j,18) + ( particles(n)%y - &
208                              particles(n)%origin_y - pts_value(j,3) )**2
209          pts_value_l(j,19) = pts_value_l(j,19) + ( particles(n)%z - &
210                              particles(n)%origin_z - pts_value(j,4) )**2
211          pts_value_l(j,20) = pts_value_l(j,20) + ( particles(n)%speed_x - &
212                                                  pts_value(j,6) )**2
213          pts_value_l(j,21) = pts_value_l(j,21) + ( particles(n)%speed_y - &
214                                                  pts_value(j,7) )**2
215          pts_value_l(j,22) = pts_value_l(j,22) + ( particles(n)%speed_z - &
216                                                  pts_value(j,8) )**2
217          pts_value_l(j,23) = pts_value_l(j,23) + ( particles(n)%speed_x_sgs - &
218                                                  pts_value(j,9) )**2
219          pts_value_l(j,24) = pts_value_l(j,24) + ( particles(n)%speed_y_sgs - &
220                                                  pts_value(j,10) )**2
221          pts_value_l(j,25) = pts_value_l(j,25) + ( particles(n)%speed_z_sgs - &
222                                                  pts_value(j,11) )**2
223       ENDIF
224
225    ENDDO
226
227    pts_value_l(0,26) = ( number_of_particles - pts_value(0,1) / numprocs )**2
228                                                 ! variance of particle numbers
229    IF ( number_of_particle_groups > 1 )  THEN
230       DO  j = 1, number_of_particle_groups
231          pts_value_l(j,26) = ( pts_value_l(j,1) - &
232                                pts_value(j,1) / numprocs )**2
233       ENDDO
234    ENDIF
235
236#if defined( __parallel )
237!
238!-- Sum values of the subdomains
239    inum = number_of_particle_groups + 1
240
241    CALL MPI_ALLREDUCE( pts_value_l(0,17), pts_value(0,17), inum*10, MPI_REAL, &
242                        MPI_SUM, comm2d, ierr )
243#else
244    pts_value(:,17:26) = pts_value_l(:,17:26)
245#endif
246
247!
248!-- Normalize the above calculated quantities with the total number of
249!-- particles
250    IF ( number_of_particle_groups > 1 )  THEN
251       inum = number_of_particle_groups
252    ELSE
253       inum = 0
254    ENDIF
255
256    DO  j = 0, inum
257
258       IF ( pts_value(j,1) > 0.0 )  THEN
259          pts_value(j,17:25) = pts_value(j,17:25) / pts_value(j,1)
260       ENDIF
261       pts_value(j,26) = pts_value(j,26) / numprocs
262
263    ENDDO
264
265#if defined( __netcdf )
266!
267!-- Output particle time series quantities in NetCDF format
268    IF ( myid == 0  .AND.  netcdf_output )  THEN
269       DO  j = 0, inum
270          DO  i = 1, dopts_num
271             nc_stat = NF90_PUT_VAR( id_set_pts, id_var_dopts(i,j),  &
272                                     (/ pts_value(j,i) /),           &
273                                     start = (/ dopts_time_count /), &
274                                     count = (/ 1 /) )
[263]275             CALL handle_netcdf_error( 'data_output_ptseries', 392 )
[1]276          ENDDO
277       ENDDO
278    ENDIF
279#endif
280
281    CALL cpu_log( log_point(36), 'data_output_ptseries','stop', 'nobarrier' )
282
283 END SUBROUTINE data_output_ptseries
Note: See TracBrowser for help on using the repository browser.