1 | !> @file data_output_dvrp.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 terms |
---|
6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | ! either version 3 of the License, or (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with |
---|
14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ----------------- |
---|
21 | ! Code annotations made doxygen readable |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: data_output_dvrp.f90 1682 2015-10-07 23:56:08Z knoop $ |
---|
26 | ! |
---|
27 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
28 | ! REAL constants provided with KIND-attribute |
---|
29 | ! |
---|
30 | ! 1346 2014-03-27 13:18:20Z heinze |
---|
31 | ! Bugfix: REAL constants provided with KIND-attribute especially in call of |
---|
32 | ! intrinsic function like MAX, MIN, SIGN |
---|
33 | ! |
---|
34 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
35 | ! ONLY-attribute added to USE-statements, |
---|
36 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
37 | ! kinds are defined in new module kinds, |
---|
38 | ! revision history before 2012 removed, |
---|
39 | ! comment fields (!:) to be used for variable explanations added to |
---|
40 | ! all variable declaration statements |
---|
41 | ! |
---|
42 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
43 | ! module interfaces removed |
---|
44 | ! |
---|
45 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
46 | ! code put under GPL (PALM 3.9) |
---|
47 | ! |
---|
48 | ! 828 2012-02-21 12:00:36Z raasch |
---|
49 | ! particle feature color renamed class |
---|
50 | ! |
---|
51 | ! Revision 1.1 2000/04/27 06:27:17 raasch |
---|
52 | ! Initial revision |
---|
53 | ! |
---|
54 | ! |
---|
55 | ! Description: |
---|
56 | ! ------------ |
---|
57 | !> Plot of isosurface, particles and slicers with dvrp-software |
---|
58 | !------------------------------------------------------------------------------! |
---|
59 | MODULE dvrp_color |
---|
60 | |
---|
61 | |
---|
62 | USE dvrp_variables |
---|
63 | |
---|
64 | USE kinds |
---|
65 | |
---|
66 | IMPLICIT NONE |
---|
67 | |
---|
68 | CONTAINS |
---|
69 | |
---|
70 | !------------------------------------------------------------------------------! |
---|
71 | ! Description: |
---|
72 | ! ------------ |
---|
73 | !> @todo Missing subroutine description. |
---|
74 | !------------------------------------------------------------------------------! |
---|
75 | SUBROUTINE color_dvrp( value, color ) |
---|
76 | |
---|
77 | REAL(wp), INTENT(IN) :: value !< |
---|
78 | REAL(wp), INTENT(OUT) :: color(4) !< |
---|
79 | |
---|
80 | REAL(wp) :: scale !< |
---|
81 | |
---|
82 | scale = ( value - slicer_range_limits_dvrp(1,islice_dvrp) ) / & |
---|
83 | ( slicer_range_limits_dvrp(2,islice_dvrp) - & |
---|
84 | slicer_range_limits_dvrp(1,islice_dvrp) ) |
---|
85 | |
---|
86 | scale = MODULO( 180.0_wp + 180.0_wp * scale, 360.0_wp ) |
---|
87 | |
---|
88 | color = (/ scale, 0.5_wp, 1.0_wp, 0.0_wp /) |
---|
89 | |
---|
90 | END SUBROUTINE color_dvrp |
---|
91 | |
---|
92 | END MODULE dvrp_color |
---|
93 | |
---|
94 | |
---|
95 | RECURSIVE SUBROUTINE data_output_dvrp |
---|
96 | |
---|
97 | #if defined( __dvrp_graphics ) |
---|
98 | |
---|
99 | USE arrays_3d, & |
---|
100 | ONLY: p, pt, q, ql, ts, u, us, v, w, zu |
---|
101 | |
---|
102 | USE cloud_parameters, & |
---|
103 | ONLY: l_d_cp, pt_d_t |
---|
104 | |
---|
105 | USE constants, & |
---|
106 | ONLY: pi |
---|
107 | |
---|
108 | USE control_parameters, & |
---|
109 | ONLY: cloud_droplets, cloud_physics, do2d, do3d, humidity, ibc_uv_b, & |
---|
110 | message_string, nz_do3d, passive_scalar, simulated_time, & |
---|
111 | threshold |
---|
112 | |
---|
113 | USE cpulog, & |
---|
114 | ONLY: log_point, log_point_s, cpu_log |
---|
115 | |
---|
116 | USE DVRP |
---|
117 | |
---|
118 | USE dvrp_color |
---|
119 | |
---|
120 | USE dvrp_variables |
---|
121 | |
---|
122 | USE grid_variables, & |
---|
123 | ONLY: dx, dy |
---|
124 | |
---|
125 | USE indices, & |
---|
126 | ONLY: nxl, nxr, nyn, nys, nzb |
---|
127 | |
---|
128 | USE kinds |
---|
129 | |
---|
130 | USE particle_attributes, & |
---|
131 | ONLY: maximum_number_of_tailpoints, number_of_particles, & |
---|
132 | number_of_tails, particle_advection, particle_advection_start, & |
---|
133 | particle_tail_coordinates, particles, uniform_particles, & |
---|
134 | use_particle_tails |
---|
135 | |
---|
136 | USE pegrid |
---|
137 | |
---|
138 | IMPLICIT NONE |
---|
139 | |
---|
140 | CHARACTER (LEN=2) :: section_chr !< |
---|
141 | CHARACTER (LEN=6) :: output_variable !< |
---|
142 | |
---|
143 | INTEGER(iwp) :: c_mode !< |
---|
144 | INTEGER(iwp) :: c_size_x !< |
---|
145 | INTEGER(iwp) :: c_size_y !< |
---|
146 | INTEGER(iwp) :: c_size_z !< |
---|
147 | INTEGER(iwp) :: dvrp_nop !< |
---|
148 | INTEGER(iwp) :: dvrp_not !< |
---|
149 | INTEGER(iwp) :: gradient_normals !< |
---|
150 | INTEGER(iwp) :: i !< |
---|
151 | INTEGER(iwp) :: ip !< |
---|
152 | INTEGER(iwp) :: j !< |
---|
153 | INTEGER(iwp) :: jp !< |
---|
154 | INTEGER(iwp) :: k !< |
---|
155 | INTEGER(iwp) :: l !< |
---|
156 | INTEGER(iwp) :: m !< |
---|
157 | INTEGER(iwp) :: n !< |
---|
158 | INTEGER(iwp) :: n_isosurface !< |
---|
159 | INTEGER(iwp) :: n_slicer !< |
---|
160 | INTEGER(iwp) :: nn !< |
---|
161 | INTEGER(iwp) :: section_mode !< |
---|
162 | INTEGER(iwp) :: vn !< |
---|
163 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: p_c !< |
---|
164 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: p_t !< |
---|
165 | |
---|
166 | LOGICAL, DIMENSION(:), ALLOCATABLE :: dvrp_mask !< |
---|
167 | |
---|
168 | REAL(sp) :: slicer_position !< |
---|
169 | REAL(sp) :: tmp_alpha !< |
---|
170 | REAL(sp) :: tmp_alpha_w !< |
---|
171 | REAL(sp) :: tmp_b !< |
---|
172 | REAL(sp) :: tmp_c_alpha !< |
---|
173 | REAL(sp) :: tmp_g !< |
---|
174 | REAL(sp) :: tmp_norm !< |
---|
175 | REAL(sp) :: tmp_pos !< |
---|
176 | REAL(sp) :: tmp_r !< |
---|
177 | REAL(sp) :: tmp_t !< |
---|
178 | REAL(sp) :: tmp_th !< |
---|
179 | REAL(sp), DIMENSION(:), ALLOCATABLE :: psize !< |
---|
180 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_x !< |
---|
181 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_y !< |
---|
182 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_z !< |
---|
183 | REAL(sp), DIMENSION(:,:,:), ALLOCATABLE :: local_pf !< |
---|
184 | REAL(sp), DIMENSION(:,:,:,:), ALLOCATABLE :: local_pfi !< |
---|
185 | |
---|
186 | |
---|
187 | CALL cpu_log( log_point(27), 'data_output_dvrp', 'start' ) |
---|
188 | |
---|
189 | ! |
---|
190 | !-- Loop over all output modes choosed |
---|
191 | m = 1 |
---|
192 | n_isosurface = 0 ! isosurface counter (for threshold values and color) |
---|
193 | n_slicer = 0 ! slice plane counter (for range of values) |
---|
194 | DO WHILE ( mode_dvrp(m) /= ' ' ) |
---|
195 | ! |
---|
196 | !-- Update of the steering variables |
---|
197 | IF ( .NOT. lock_steering_update ) THEN |
---|
198 | ! |
---|
199 | !-- Set lock to avoid recursive calls of DVRP_STEERING_UPDATE |
---|
200 | lock_steering_update = .TRUE. |
---|
201 | ! CALL DVRP_STEERING_UPDATE( m-1, data_output_dvrp ) |
---|
202 | lock_steering_update = .FALSE. |
---|
203 | ENDIF |
---|
204 | |
---|
205 | ! |
---|
206 | !-- Determine the variable which shall be plotted (in case of slicers or |
---|
207 | !-- isosurfaces) |
---|
208 | IF ( mode_dvrp(m)(1:10) == 'isosurface' ) THEN |
---|
209 | READ ( mode_dvrp(m), '(10X,I2)' ) vn |
---|
210 | output_variable = do3d(0,vn) |
---|
211 | n_isosurface = n_isosurface + 1 |
---|
212 | ELSEIF ( mode_dvrp(m)(1:6) == 'slicer' ) THEN |
---|
213 | READ ( mode_dvrp(m), '(6X,I2)' ) vn |
---|
214 | output_variable = do2d(0,vn) |
---|
215 | l = MAX( 2, LEN_TRIM( do2d(0,vn) ) ) |
---|
216 | section_chr = do2d(0,vn)(l-1:l) |
---|
217 | SELECT CASE ( section_chr ) |
---|
218 | CASE ( 'xy' ) |
---|
219 | section_mode = 2 |
---|
220 | slicer_position = zu(MIN( slicer_position_dvrp(m), nz_do3d )) |
---|
221 | CASE ( 'xz' ) |
---|
222 | section_mode = 1 |
---|
223 | slicer_position = slicer_position_dvrp(m) * dy |
---|
224 | CASE ( 'yz' ) |
---|
225 | section_mode = 0 |
---|
226 | slicer_position = slicer_position_dvrp(m) * dx |
---|
227 | END SELECT |
---|
228 | ENDIF |
---|
229 | |
---|
230 | ! |
---|
231 | !-- Select the plot mode (in case of isosurface or slicer only if user has |
---|
232 | !-- defined a variable which shall be plotted; otherwise do nothing) |
---|
233 | IF ( mode_dvrp(m)(1:9) == 'particles' .AND. particle_advection .AND. & |
---|
234 | simulated_time >= particle_advection_start ) THEN |
---|
235 | ! |
---|
236 | !-- DVRP-Calls for plotting particles: |
---|
237 | CALL cpu_log( log_point_s(28), 'dvrp_particles', 'start' ) |
---|
238 | |
---|
239 | ! |
---|
240 | !-- Definition of characteristics of particle material |
---|
241 | ! tmp_r = 0.1; tmp_g = 0.7; tmp_b = 0.1; tmp_t = 0.0 |
---|
242 | tmp_r = 0.0_wp; tmp_g = 0.0_wp; tmp_b = 0.0_wp; tmp_t = 0.0_wp |
---|
243 | CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) |
---|
244 | |
---|
245 | ! |
---|
246 | !-- If clipping is active and if this subdomain is clipped, find out the |
---|
247 | !-- number of particles and tails to be plotted; otherwise, all |
---|
248 | !-- particles/tails are plotted. dvrp_mask is used to mark the partikles. |
---|
249 | ALLOCATE( dvrp_mask(number_of_particles) ) |
---|
250 | |
---|
251 | IF ( dvrp_total_overlap ) THEN |
---|
252 | dvrp_mask = .TRUE. |
---|
253 | dvrp_nop = number_of_particles |
---|
254 | dvrp_not = number_of_tails |
---|
255 | ELSE |
---|
256 | dvrp_mask = .FALSE. |
---|
257 | dvrp_nop = 0 |
---|
258 | dvrp_not = 0 |
---|
259 | IF ( dvrp_overlap ) THEN |
---|
260 | IF ( .NOT. use_particle_tails ) THEN |
---|
261 | DO n = 1, number_of_particles |
---|
262 | ip = particles(n)%x / dx |
---|
263 | jp = particles(n)%y / dy |
---|
264 | IF ( ip >= nxl_dvrp .AND. ip <= nxr_dvrp .AND. & |
---|
265 | jp >= nys_dvrp .AND. jp <= nyn_dvrp ) THEN |
---|
266 | dvrp_nop = dvrp_nop + 1 |
---|
267 | dvrp_mask(n) = .TRUE. |
---|
268 | ENDIF |
---|
269 | ENDDO |
---|
270 | ELSE |
---|
271 | k = 0 |
---|
272 | DO n = 1, number_of_particles |
---|
273 | IF ( particles(n)%tail_id /= 0 ) THEN |
---|
274 | k = k + 1 |
---|
275 | ip = particles(n)%x / dx |
---|
276 | jp = particles(n)%y / dy |
---|
277 | IF ( ip >= nxl_dvrp .AND. ip <= nxr_dvrp .AND. & |
---|
278 | jp >= nys_dvrp .AND. jp <= nyn_dvrp ) THEN |
---|
279 | dvrp_not = dvrp_not + 1 |
---|
280 | dvrp_mask(n) = .TRUE. |
---|
281 | ENDIF |
---|
282 | ENDIF |
---|
283 | ENDDO |
---|
284 | ENDIF |
---|
285 | ENDIF |
---|
286 | ENDIF |
---|
287 | |
---|
288 | ! |
---|
289 | !-- Move particle coordinates to one-dimensional arrays |
---|
290 | IF ( .NOT. use_particle_tails ) THEN |
---|
291 | ! |
---|
292 | !-- All particles are output |
---|
293 | ALLOCATE( psize(dvrp_nop), p_t(dvrp_nop), p_c(dvrp_nop), & |
---|
294 | p_x(dvrp_nop), p_y(dvrp_nop), p_z(dvrp_nop) ) |
---|
295 | psize = 0.0_wp; p_t = 0_wp; p_c = 0.0_wp |
---|
296 | p_x = 0.0_wp; p_y = 0.0_wp |
---|
297 | p_z = 0.0_wp |
---|
298 | k = 0 |
---|
299 | DO n = 1, number_of_particles |
---|
300 | IF ( dvrp_mask(n) ) THEN |
---|
301 | k = k + 1 |
---|
302 | psize(k) = particles(n)%dvrp_psize |
---|
303 | p_x(k) = particles(n)%x * superelevation_x |
---|
304 | p_y(k) = particles(n)%y * superelevation_y |
---|
305 | p_z(k) = particles(n)%z * superelevation |
---|
306 | p_c(k) = particles(n)%class |
---|
307 | ENDIF |
---|
308 | ENDDO |
---|
309 | ELSE |
---|
310 | ! |
---|
311 | !-- Particles have a tail |
---|
312 | ALLOCATE( psize(dvrp_not), p_t(dvrp_not), & |
---|
313 | p_c(dvrp_not*maximum_number_of_tailpoints), & |
---|
314 | p_x(dvrp_not*maximum_number_of_tailpoints), & |
---|
315 | p_y(dvrp_not*maximum_number_of_tailpoints), & |
---|
316 | p_z(dvrp_not*maximum_number_of_tailpoints) ) |
---|
317 | psize = 0.0_wp; p_t = 0_wp; p_c = 0.0_wp |
---|
318 | p_x = 0.0_wp; p_y = 0.0_wp |
---|
319 | p_z = 0.0_wp |
---|
320 | i = 0 |
---|
321 | k = 0 |
---|
322 | |
---|
323 | DO n = 1, number_of_particles |
---|
324 | nn = particles(n)%tail_id |
---|
325 | IF ( nn /= 0 .AND. dvrp_mask(n) ) THEN |
---|
326 | k = k + 1 |
---|
327 | DO j = 1, particles(n)%tailpoints |
---|
328 | i = i + 1 |
---|
329 | p_x(i) = particle_tail_coordinates(j,1,nn) * & |
---|
330 | superelevation_x |
---|
331 | p_y(i) = particle_tail_coordinates(j,2,nn) * & |
---|
332 | superelevation_y |
---|
333 | p_z(i) = particle_tail_coordinates(j,3,nn) * & |
---|
334 | superelevation |
---|
335 | p_c(i) = particle_tail_coordinates(j,4,nn) |
---|
336 | ENDDO |
---|
337 | psize(k) = particles(n)%dvrp_psize |
---|
338 | p_t(k) = particles(n)%tailpoints - 1 |
---|
339 | ENDIF |
---|
340 | ENDDO |
---|
341 | ENDIF |
---|
342 | |
---|
343 | ! |
---|
344 | !-- Compute and plot particles in dvr-format |
---|
345 | IF ( uniform_particles .AND. .NOT. use_particle_tails ) THEN |
---|
346 | ! |
---|
347 | !-- All particles have the same color. Use simple routine to set |
---|
348 | !-- the particle attributes (produces less output data) |
---|
349 | CALL DVRP_PARTICLES( m-1, p_x, p_y, p_z, psize ) |
---|
350 | ELSE |
---|
351 | ! |
---|
352 | !-- Set color definitions |
---|
353 | CALL user_dvrp_coltab( 'particles', 'none' ) |
---|
354 | |
---|
355 | CALL DVRP_COLORTABLE_HLS( m-1, 0, interval_values_dvrp_prt, & |
---|
356 | interval_h_dvrp_prt, & |
---|
357 | interval_l_dvrp_prt, & |
---|
358 | interval_s_dvrp_prt, & |
---|
359 | interval_a_dvrp_prt ) |
---|
360 | |
---|
361 | IF ( .NOT. use_particle_tails ) THEN |
---|
362 | CALL DVRP_PARTICLES( m-1, dvrp_nop, p_x, p_y, p_z, 3, psize, & |
---|
363 | p_c, p_t ) |
---|
364 | ELSE |
---|
365 | CALL DVRP_PARTICLES( m-1, dvrp_not, p_x, p_y, p_z, 15, psize, & |
---|
366 | p_c, p_t ) |
---|
367 | ENDIF |
---|
368 | ENDIF |
---|
369 | |
---|
370 | CALL DVRP_VISUALIZE( m-1, 3, dvrp_filecount ) |
---|
371 | |
---|
372 | DEALLOCATE( dvrp_mask, psize, p_c, p_t, p_x, p_y, p_z ) |
---|
373 | |
---|
374 | CALL cpu_log( log_point_s(28), 'dvrp_particles', 'stop' ) |
---|
375 | |
---|
376 | |
---|
377 | ELSEIF ( ( mode_dvrp(m)(1:10) == 'isosurface' .OR. & |
---|
378 | mode_dvrp(m)(1:6) == 'slicer' ) & |
---|
379 | .AND. output_variable /= ' ' ) THEN |
---|
380 | |
---|
381 | ! |
---|
382 | !-- Create an intermediate array, properly dimensioned for plot-output |
---|
383 | ALLOCATE( local_pf(nxl_dvrp:nxr_dvrp+1,nys_dvrp:nyn_dvrp+1, & |
---|
384 | nzb:nz_do3d) ) |
---|
385 | |
---|
386 | ! |
---|
387 | !-- Move original array to intermediate array |
---|
388 | IF ( dvrp_overlap ) THEN |
---|
389 | |
---|
390 | SELECT CASE ( output_variable ) |
---|
391 | |
---|
392 | CASE ( 'u', 'u_xy', 'u_xz', 'u_yz' ) |
---|
393 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
394 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
395 | DO k = nzb, nz_do3d |
---|
396 | local_pf(i,j,k) = u(k,j,i) |
---|
397 | ENDDO |
---|
398 | ENDDO |
---|
399 | ENDDO |
---|
400 | ! |
---|
401 | !-- Replace mirrored values at lower surface by real surface |
---|
402 | !-- values |
---|
403 | IF ( output_variable == 'u_xz' .OR. & |
---|
404 | output_variable == 'u_yz' ) THEN |
---|
405 | IF ( ibc_uv_b == 0 ) local_pf(:,:,nzb) = 0.0_wp |
---|
406 | ENDIF |
---|
407 | |
---|
408 | |
---|
409 | CASE ( 'v', 'v_xy', 'v_xz', 'v_yz' ) |
---|
410 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
411 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
412 | DO k = nzb, nz_do3d |
---|
413 | local_pf(i,j,k) = v(k,j,i) |
---|
414 | ENDDO |
---|
415 | ENDDO |
---|
416 | ENDDO |
---|
417 | ! |
---|
418 | !-- Replace mirrored values at lower surface by real surface |
---|
419 | !-- values |
---|
420 | IF ( output_variable == 'v_xz' .OR. & |
---|
421 | output_variable == 'v_yz' ) THEN |
---|
422 | IF ( ibc_uv_b == 0 ) local_pf(:,:,nzb) = 0.0_wp |
---|
423 | ENDIF |
---|
424 | |
---|
425 | CASE ( 'w', 'w_xy', 'w_xz', 'w_yz' ) |
---|
426 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
427 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
428 | DO k = nzb, nz_do3d |
---|
429 | local_pf(i,j,k) = w(k,j,i) |
---|
430 | ENDDO |
---|
431 | ENDDO |
---|
432 | ENDDO |
---|
433 | ! Averaging for Langmuir circulation |
---|
434 | ! DO k = nzb, nz_do3d |
---|
435 | ! DO j = nys_dvrp+1, nyn_dvrp |
---|
436 | ! DO i = nxl_dvrp, nxr_dvrp+1 |
---|
437 | ! local_pf(i,j,k) = 0.25 * local_pf(i,j-1,k) + & |
---|
438 | ! 0.50 * local_pf(i,j,k) + & |
---|
439 | ! 0.25 * local_pf(i,j+1,k) |
---|
440 | ! ENDDO |
---|
441 | ! ENDDO |
---|
442 | ! ENDDO |
---|
443 | |
---|
444 | CASE ( 'p', 'p_xy', 'p_xz', 'p_yz' ) |
---|
445 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
446 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
447 | DO k = nzb, nz_do3d |
---|
448 | local_pf(i,j,k) = p(k,j,i) |
---|
449 | ENDDO |
---|
450 | ENDDO |
---|
451 | ENDDO |
---|
452 | |
---|
453 | CASE ( 'pt', 'pt_xy', 'pt_xz', 'pt_yz' ) |
---|
454 | IF ( .NOT. cloud_physics ) THEN |
---|
455 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
456 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
457 | DO k = nzb, nz_do3d |
---|
458 | local_pf(i,j,k) = pt(k,j,i) |
---|
459 | ENDDO |
---|
460 | ENDDO |
---|
461 | ENDDO |
---|
462 | ELSE |
---|
463 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
464 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
465 | DO k = nzb, nz_do3d |
---|
466 | local_pf(i,j,k) = pt(k,j,i) + l_d_cp * & |
---|
467 | pt_d_t(k) * ql(k,j,i) |
---|
468 | ENDDO |
---|
469 | ENDDO |
---|
470 | ENDDO |
---|
471 | ENDIF |
---|
472 | |
---|
473 | CASE ( 'q', 'q_xy', 'q_xz', 'q_yz' ) |
---|
474 | IF ( humidity .OR. passive_scalar ) THEN |
---|
475 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
476 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
477 | DO k = nzb, nz_do3d |
---|
478 | local_pf(i,j,k) = q(k,j,i) |
---|
479 | ENDDO |
---|
480 | ENDDO |
---|
481 | ENDDO |
---|
482 | ELSE |
---|
483 | message_string = 'if humidity/passive_scalar = ' // & |
---|
484 | 'FALSE output of ' // TRIM( output_variable ) // & |
---|
485 | 'is not provided' |
---|
486 | CALL message( 'data_output_dvrp', 'PA0183',& |
---|
487 | 0, 0, 0, 6, 0 ) |
---|
488 | ENDIF |
---|
489 | |
---|
490 | CASE ( 'ql', 'ql_xy', 'ql_xz', 'ql_yz' ) |
---|
491 | IF ( cloud_physics .OR. cloud_droplets ) THEN |
---|
492 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
493 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
494 | DO k = nzb, nz_do3d |
---|
495 | local_pf(i,j,k) = ql(k,j,i) |
---|
496 | ENDDO |
---|
497 | ENDDO |
---|
498 | ENDDO |
---|
499 | ELSE |
---|
500 | message_string = 'if cloud_physics = FALSE ' // & |
---|
501 | 'output of ' // TRIM( output_variable) // & |
---|
502 | 'is not provided' |
---|
503 | CALL message( 'data_output_dvrp', 'PA0184',& |
---|
504 | 0, 0, 0, 6, 0 ) |
---|
505 | ENDIF |
---|
506 | |
---|
507 | CASE ( 'u*_xy' ) |
---|
508 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
509 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
510 | local_pf(i,j,nzb+1) = us(j,i) |
---|
511 | ENDDO |
---|
512 | ENDDO |
---|
513 | slicer_position = zu(nzb+1) |
---|
514 | |
---|
515 | CASE ( 't*_xy' ) |
---|
516 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
517 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
518 | local_pf(i,j,nzb+1) = ts(j,i) |
---|
519 | ENDDO |
---|
520 | ENDDO |
---|
521 | slicer_position = zu(nzb+1) |
---|
522 | |
---|
523 | |
---|
524 | CASE DEFAULT |
---|
525 | ! |
---|
526 | !-- The DEFAULT case is reached either if output_variable |
---|
527 | !-- contains unsupported variable or if the user has coded a |
---|
528 | !-- special case in the user interface. There, the subroutine |
---|
529 | !-- user_data_output_dvrp checks which of these two conditions |
---|
530 | !-- applies. |
---|
531 | CALL user_data_output_dvrp( output_variable, local_pf ) |
---|
532 | |
---|
533 | |
---|
534 | END SELECT |
---|
535 | |
---|
536 | ELSE |
---|
537 | ! |
---|
538 | !-- No overlap of clipping domain with the current subdomain |
---|
539 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
540 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
541 | DO k = nzb, nz_do3d |
---|
542 | local_pf(i,j,k) = 0.0_wp |
---|
543 | ENDDO |
---|
544 | ENDDO |
---|
545 | ENDDO |
---|
546 | |
---|
547 | ENDIF |
---|
548 | |
---|
549 | IF ( mode_dvrp(m)(1:10) == 'isosurface' ) THEN |
---|
550 | |
---|
551 | ! |
---|
552 | !-- DVRP-Calls for plotting isosurfaces: |
---|
553 | CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'start' ) |
---|
554 | |
---|
555 | ! |
---|
556 | !-- Definition of isosurface color |
---|
557 | tmp_r = isosurface_color(1,n_isosurface) |
---|
558 | tmp_g = isosurface_color(2,n_isosurface) |
---|
559 | tmp_b = isosurface_color(3,n_isosurface) |
---|
560 | tmp_t = 0.0_wp |
---|
561 | CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) |
---|
562 | |
---|
563 | ! |
---|
564 | !-- Compute and plot isosurface in dvr-format |
---|
565 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
566 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
567 | |
---|
568 | c_size_x = vc_size_x; c_size_y = vc_size_y; c_size_z = vc_size_z |
---|
569 | CALL DVRP_CLUSTER_SIZE( m-1, c_size_x, c_size_y, c_size_z ) |
---|
570 | |
---|
571 | c_mode = vc_mode |
---|
572 | CALL DVRP_CLUSTERING_MODE( m-1, c_mode ) |
---|
573 | |
---|
574 | gradient_normals = vc_gradient_normals |
---|
575 | CALL DVRP_GRADIENTNORMALS( m-1, gradient_normals ) |
---|
576 | |
---|
577 | ! |
---|
578 | !-- A seperate procedure for setting vc_alpha will be in the next |
---|
579 | !-- version of libDVRP |
---|
580 | tmp_c_alpha = vc_alpha |
---|
581 | CALL DVRP_THRESHOLD( -(m-1)-1, tmp_c_alpha ) |
---|
582 | |
---|
583 | IF ( dvrp_overlap ) THEN |
---|
584 | tmp_th = threshold(n_isosurface) |
---|
585 | ELSE |
---|
586 | tmp_th = 1.0_wp ! nothing is plotted because array values are 0 |
---|
587 | ENDIF |
---|
588 | |
---|
589 | CALL DVRP_THRESHOLD( m-1, tmp_th ) |
---|
590 | |
---|
591 | CALL DVRP_VISUALIZE( m-1, 21, dvrp_filecount ) |
---|
592 | |
---|
593 | CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'stop' ) |
---|
594 | |
---|
595 | ELSEIF ( mode_dvrp(m)(1:6) == 'slicer' ) THEN |
---|
596 | |
---|
597 | ! |
---|
598 | !-- DVRP-Calls for plotting slicers: |
---|
599 | CALL cpu_log( log_point_s(27), 'dvrp_slicer', 'start' ) |
---|
600 | |
---|
601 | ! |
---|
602 | !-- Material and color definitions |
---|
603 | tmp_r = 0.0_wp; tmp_g = 0.0_wp; tmp_b = 0.0_wp; tmp_t = 0.0_wp |
---|
604 | CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) |
---|
605 | |
---|
606 | n_slicer = n_slicer + 1 |
---|
607 | |
---|
608 | ! |
---|
609 | !-- Using dolorfunction has not been properly tested |
---|
610 | ! islice_dvrp = n_slicer |
---|
611 | ! CALL DVRP_COLORFUNCTION( m-1, DVRP_CM_HLS, 25, & |
---|
612 | ! slicer_range_limits_dvrp(:,n_slicer), & |
---|
613 | ! color_dvrp ) |
---|
614 | |
---|
615 | ! |
---|
616 | !-- Set interval of values defining the colortable |
---|
617 | CALL set_slicer_attributes_dvrp( n_slicer ) |
---|
618 | |
---|
619 | ! |
---|
620 | !-- Create user-defined colortable |
---|
621 | CALL user_dvrp_coltab( 'slicer', output_variable ) |
---|
622 | |
---|
623 | CALL DVRP_COLORTABLE_HLS( m-1, 1, interval_values_dvrp, & |
---|
624 | interval_h_dvrp, interval_l_dvrp, & |
---|
625 | interval_s_dvrp, interval_a_dvrp ) |
---|
626 | |
---|
627 | ! |
---|
628 | !-- Compute and plot slicer in dvr-format |
---|
629 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
630 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
631 | tmp_pos = slicer_position |
---|
632 | CALL DVRP_SLICER( m-1, section_mode, tmp_pos ) |
---|
633 | |
---|
634 | CALL DVRP_VISUALIZE( m-1, 2, dvrp_filecount ) |
---|
635 | |
---|
636 | CALL cpu_log( log_point_s(27), 'dvrp_slicer', 'stop' ) |
---|
637 | |
---|
638 | ENDIF |
---|
639 | |
---|
640 | DEALLOCATE( local_pf ) |
---|
641 | |
---|
642 | ELSEIF ( mode_dvrp(m)(1:9) == 'pathlines' ) THEN |
---|
643 | |
---|
644 | ALLOCATE( local_pfi(4,nxl:nxr+1,nys:nyn+1,nzb:nz_do3d) ) |
---|
645 | DO i = nxl, nxr+1 |
---|
646 | DO j = nys, nyn+1 |
---|
647 | DO k = nzb, nz_do3d |
---|
648 | local_pfi(1,i,j,k) = u(k,j,i) |
---|
649 | local_pfi(2,i,j,k) = v(k,j,i) |
---|
650 | local_pfi(3,i,j,k) = w(k,j,i) |
---|
651 | tmp_norm = SQRT( u(k,j,i) * u(k,j,i) + & |
---|
652 | v(k,j,i) * v(k,j,i) + & |
---|
653 | w(k,j,i) * w(k,j,i) ) |
---|
654 | tmp_alpha = ACOS( 0.0_wp * u(k,j,i) / tmp_norm + & |
---|
655 | 0.0_wp * v(k,j,i) / tmp_norm - & |
---|
656 | 1.0_wp * w(k,j,i) / tmp_norm ) |
---|
657 | tmp_alpha_w = tmp_alpha / pi * 180.0_wp |
---|
658 | local_pfi(4,i,j,k) = tmp_alpha_w |
---|
659 | ENDDO |
---|
660 | ENDDO |
---|
661 | ENDDO |
---|
662 | |
---|
663 | CALL cpu_log( log_point_s(31), 'dvrp_pathlines', 'start' ) |
---|
664 | |
---|
665 | CALL DVRP_DATA( m-1, local_pfi, 4, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
666 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
667 | CALL DVRP_VISUALIZE( m-1, 20, dvrp_filecount ) |
---|
668 | |
---|
669 | CALL cpu_log( log_point_s(31), 'dvrp_pathlines', 'stop' ) |
---|
670 | |
---|
671 | DEALLOCATE( local_pfi ) |
---|
672 | |
---|
673 | ENDIF |
---|
674 | |
---|
675 | m = m + 1 |
---|
676 | |
---|
677 | ENDDO |
---|
678 | |
---|
679 | dvrp_filecount = dvrp_filecount + 1 |
---|
680 | |
---|
681 | CALL cpu_log( log_point(27), 'data_output_dvrp', 'stop' ) |
---|
682 | |
---|
683 | #endif |
---|
684 | END SUBROUTINE data_output_dvrp |
---|