source: palm/tags/release-3.7a/SOURCE/average_3d_data.f90 @ 4095

Last change on this file since 4095 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: 7.9 KB
Line 
1 SUBROUTINE average_3d_data
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: average_3d_data.f90 392 2009-09-24 10:39:14Z knoop $
11!
12! 367 2009-08-25 08:35:52Z maronga
13! Added calculation of shf* and qsws*
14!
15! 96 2007-06-04 08:07:41Z raasch
16! Averaging of density and salinity
17!
18! 72 2007-03-19 08:20:46Z raasch
19! Averaging the precipitation rate and roughness length (prr*, z0*)
20!
21! RCS Log replace by Id keyword, revision history cleaned up
22!
23! Revision 1.1  2006/02/23 09:48:58  raasch
24! Initial revision
25!
26!
27! Description:
28! ------------
29! Time-averaging of 3d-data-arrays.
30!------------------------------------------------------------------------------!
31
32    USE arrays_3d
33    USE averaging
34    USE cloud_parameters
35    USE control_parameters
36    USE cpulog
37    USE indices
38    USE interfaces
39
40    IMPLICIT NONE
41
42    INTEGER ::  i, ii, j, k
43
44
45    CALL cpu_log (log_point(35),'average_3d_data','start')
46
47!
48!-- Check, if averaging is necessary
49    IF ( average_count_3d <= 1 )  RETURN
50
51!
52!-- Loop of all variables to be averaged.
53    DO  ii = 1, doav_n
54
55!
56!--    Store the array chosen on the temporary array.
57       SELECT CASE ( TRIM( doav(ii) ) )
58
59          CASE ( 'e' )
60             DO  i = nxl-1, nxr+1
61                DO  j = nys-1, nyn+1
62                   DO  k = nzb, nzt+1
63                      e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d )
64                   ENDDO
65                ENDDO
66             ENDDO
67
68          CASE ( 'qsws*' )
69             DO  i = nxl-1, nxr+1
70                DO  j = nys-1, nyn+1
71                   qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d )
72                ENDDO
73             ENDDO
74
75          CASE ( 'lwp*' )
76             DO  i = nxl-1, nxr+1
77                DO  j = nys-1, nyn+1
78                   lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d )
79                ENDDO
80             ENDDO
81
82          CASE ( 'p' )
83             DO  i = nxl-1, nxr+1
84                DO  j = nys-1, nyn+1
85                   DO  k = nzb, nzt+1
86                      p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d )
87                   ENDDO
88                ENDDO
89             ENDDO
90
91          CASE ( 'pc' )
92             DO  i = nxl, nxr
93                DO  j = nys, nyn
94                   DO  k = nzb, nzt+1
95                      pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d )
96                   ENDDO
97                ENDDO
98             ENDDO
99
100          CASE ( 'pr' )
101             DO  i = nxl, nxr
102                DO  j = nys, nyn
103                   DO  k = nzb, nzt+1
104                      pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d )
105                   ENDDO
106                ENDDO
107             ENDDO
108
109          CASE ( 'prr*' )
110             DO  i = nxl-1, nxr+1
111                DO  j = nys-1, nyn+1
112                   precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / &
113                                                REAL( average_count_3d )
114                ENDDO
115             ENDDO
116
117          CASE ( 'pt' )
118             DO  i = nxl-1, nxr+1
119                DO  j = nys-1, nyn+1
120                   DO  k = nzb, nzt+1
121                      pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d )
122                   ENDDO
123                ENDDO
124             ENDDO
125
126          CASE ( 'q' )
127             DO  i = nxl-1, nxr+1
128                DO  j = nys-1, nyn+1
129                   DO  k = nzb, nzt+1
130                      q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d )
131                   ENDDO
132                ENDDO
133             ENDDO
134
135          CASE ( 'ql' )
136             DO  i = nxl-1, nxr+1
137                DO  j = nys-1, nyn+1
138                   DO  k = nzb, nzt+1
139                      ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d )
140                   ENDDO
141                ENDDO
142             ENDDO
143
144          CASE ( 'ql_c' )
145             DO  i = nxl-1, nxr+1
146                DO  j = nys-1, nyn+1
147                   DO  k = nzb, nzt+1
148                      ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d )
149                   ENDDO
150                ENDDO
151             ENDDO
152
153          CASE ( 'ql_v' )
154             DO  i = nxl-1, nxr+1
155                DO  j = nys-1, nyn+1
156                   DO  k = nzb, nzt+1
157                      ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d )
158                   ENDDO
159                ENDDO
160             ENDDO
161
162          CASE ( 'ql_vp' )
163             DO  i = nxl-1, nxr+1
164                DO  j = nys-1, nyn+1
165                   DO  k = nzb, nzt+1
166                      ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / &
167                                        REAL( average_count_3d )
168                   ENDDO
169                ENDDO
170             ENDDO
171
172          CASE ( 'qv' )
173             DO  i = nxl-1, nxr+1
174                DO  j = nys-1, nyn+1
175                   DO  k = nzb, nzt+1
176                      qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d )
177                   ENDDO
178                ENDDO
179             ENDDO
180
181          CASE ( 'rho' )
182             DO  i = nxl-1, nxr+1
183                DO  j = nys-1, nyn+1
184                   DO  k = nzb, nzt+1
185                      rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d )
186                   ENDDO
187                ENDDO
188             ENDDO
189
190          CASE ( 's' )
191             DO  i = nxl-1, nxr+1
192                DO  j = nys-1, nyn+1
193                   DO  k = nzb, nzt+1
194                      s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d )
195                   ENDDO
196                ENDDO
197             ENDDO
198
199          CASE ( 'sa' )
200             DO  i = nxl-1, nxr+1
201                DO  j = nys-1, nyn+1
202                   DO  k = nzb, nzt+1
203                      sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d )
204                   ENDDO
205                ENDDO
206             ENDDO
207
208         CASE ( 'shf*' )
209             DO  i = nxl-1, nxr+1
210                DO  j = nys-1, nyn+1
211                   shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d )
212                ENDDO
213             ENDDO
214
215          CASE ( 't*' )
216             DO  i = nxl-1, nxr+1
217                DO  j = nys-1, nyn+1
218                   ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d )
219                ENDDO
220             ENDDO
221
222          CASE ( 'u' )
223             DO  i = nxl-1, nxr+1
224                DO  j = nys-1, nyn+1
225                   DO  k = nzb, nzt+1
226                      u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d )
227                   ENDDO
228                ENDDO
229             ENDDO
230
231          CASE ( 'u*' )
232             DO  i = nxl-1, nxr+1
233                DO  j = nys-1, nyn+1
234                   us_av(j,i) = us_av(j,i) / REAL( average_count_3d )
235                ENDDO
236             ENDDO
237
238          CASE ( 'v' )
239             DO  i = nxl-1, nxr+1
240                DO  j = nys-1, nyn+1
241                   DO  k = nzb, nzt+1
242                      v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d )
243                   ENDDO
244                ENDDO
245             ENDDO
246
247          CASE ( 'vpt' )
248             DO  i = nxl-1, nxr+1
249                DO  j = nys-1, nyn+1
250                   DO  k = nzb, nzt+1
251                      vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d )
252                   ENDDO
253                ENDDO
254             ENDDO
255
256          CASE ( 'w' )
257             DO  i = nxl-1, nxr+1
258                DO  j = nys-1, nyn+1
259                   DO  k = nzb, nzt+1
260                      w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d )
261                   ENDDO
262                ENDDO
263             ENDDO
264
265          CASE ( 'z0*' )
266             DO  i = nxl-1, nxr+1
267                DO  j = nys-1, nyn+1
268                   z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d )
269                ENDDO
270             ENDDO
271
272          CASE DEFAULT
273!
274!--          User-defined quantity
275             CALL user_3d_data_averaging( 'average', doav(ii) )
276
277       END SELECT
278
279    ENDDO
280
281!
282!-- Reset the counter
283    average_count_3d = 0.0
284
285    CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier')
286
287
288 END SUBROUTINE average_3d_data
Note: See TracBrowser for help on using the repository browser.