1 | !> @file data_output_dvrp.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
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-2018 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: data_output_dvrp.f90 3045 2018-05-28 07:55:41Z sward $ |
---|
27 | ! Code adjusted according to PALM coding standards |
---|
28 | ! |
---|
29 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
30 | ! Corrected "Former revisions" section |
---|
31 | ! |
---|
32 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
33 | ! Change in file header (GPL part) |
---|
34 | ! |
---|
35 | ! 2274 2017-06-09 13:27:48Z Giersch |
---|
36 | ! Changed error messages |
---|
37 | ! |
---|
38 | ! 2101 2017-01-05 16:42:31Z suehring |
---|
39 | ! |
---|
40 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
41 | ! Forced header and separation lines into 80 columns |
---|
42 | ! |
---|
43 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
44 | ! Separate humidity and passive scalar |
---|
45 | ! |
---|
46 | ! 1873 2016-04-18 14:50:06Z maronga |
---|
47 | ! Module renamed (removed _mod) |
---|
48 | ! |
---|
49 | ! |
---|
50 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
51 | ! Module renamed |
---|
52 | ! |
---|
53 | ! |
---|
54 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
55 | ! Particles and tails removed. |
---|
56 | ! |
---|
57 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
58 | ! Code annotations made doxygen readable |
---|
59 | ! |
---|
60 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
61 | ! REAL constants provided with KIND-attribute |
---|
62 | ! |
---|
63 | ! 1346 2014-03-27 13:18:20Z heinze |
---|
64 | ! Bugfix: REAL constants provided with KIND-attribute especially in call of |
---|
65 | ! intrinsic function like MAX, MIN, SIGN |
---|
66 | ! |
---|
67 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
68 | ! ONLY-attribute added to USE-statements, |
---|
69 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
70 | ! kinds are defined in new module kinds, |
---|
71 | ! revision history before 2012 removed, |
---|
72 | ! comment fields (!:) to be used for variable explanations added to |
---|
73 | ! all variable declaration statements |
---|
74 | ! |
---|
75 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
76 | ! module interfaces removed |
---|
77 | ! |
---|
78 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
79 | ! code put under GPL (PALM 3.9) |
---|
80 | ! |
---|
81 | ! 828 2012-02-21 12:00:36Z raasch |
---|
82 | ! particle feature color renamed class |
---|
83 | ! |
---|
84 | ! Revision 1.1 2000/04/27 06:27:17 raasch |
---|
85 | ! Initial revision |
---|
86 | ! |
---|
87 | ! |
---|
88 | ! Description: |
---|
89 | ! ------------ |
---|
90 | !> Plot of isosurface and slicers with dvrp-software |
---|
91 | !------------------------------------------------------------------------------! |
---|
92 | MODULE dvrp_color |
---|
93 | |
---|
94 | |
---|
95 | USE dvrp_variables |
---|
96 | |
---|
97 | USE kinds |
---|
98 | |
---|
99 | IMPLICIT NONE |
---|
100 | |
---|
101 | CONTAINS |
---|
102 | |
---|
103 | !------------------------------------------------------------------------------! |
---|
104 | ! Description: |
---|
105 | ! ------------ |
---|
106 | !> @todo Missing subroutine description. |
---|
107 | !------------------------------------------------------------------------------! |
---|
108 | SUBROUTINE color_dvrp( value, color ) |
---|
109 | |
---|
110 | REAL(wp), INTENT(IN) :: value !< |
---|
111 | REAL(wp), INTENT(OUT) :: color(4) !< |
---|
112 | |
---|
113 | REAL(wp) :: scale !< |
---|
114 | |
---|
115 | scale = ( value - slicer_range_limits_dvrp(1,islice_dvrp) ) / & |
---|
116 | ( slicer_range_limits_dvrp(2,islice_dvrp) - & |
---|
117 | slicer_range_limits_dvrp(1,islice_dvrp) ) |
---|
118 | |
---|
119 | scale = MODULO( 180.0_wp + 180.0_wp * scale, 360.0_wp ) |
---|
120 | |
---|
121 | color = (/ scale, 0.5_wp, 1.0_wp, 0.0_wp /) |
---|
122 | |
---|
123 | END SUBROUTINE color_dvrp |
---|
124 | |
---|
125 | END MODULE dvrp_color |
---|
126 | |
---|
127 | |
---|
128 | RECURSIVE SUBROUTINE data_output_dvrp |
---|
129 | |
---|
130 | #if defined( __dvrp_graphics ) |
---|
131 | |
---|
132 | USE arrays_3d, & |
---|
133 | ONLY: p, pt, q, ql, s, ts, u, us, v, w, zu |
---|
134 | |
---|
135 | USE cloud_parameters, & |
---|
136 | ONLY: l_d_cp, pt_d_t |
---|
137 | |
---|
138 | USE constants, & |
---|
139 | ONLY: pi |
---|
140 | |
---|
141 | USE control_parameters, & |
---|
142 | ONLY: cloud_droplets, cloud_physics, do2d, do3d, humidity, ibc_uv_b, & |
---|
143 | message_string, nz_do3d, passive_scalar, simulated_time, & |
---|
144 | threshold |
---|
145 | |
---|
146 | USE cpulog, & |
---|
147 | ONLY: log_point, log_point_s, cpu_log |
---|
148 | |
---|
149 | USE DVRP |
---|
150 | |
---|
151 | USE dvrp_color |
---|
152 | |
---|
153 | USE dvrp_variables |
---|
154 | |
---|
155 | USE grid_variables, & |
---|
156 | ONLY: dx, dy |
---|
157 | |
---|
158 | USE indices, & |
---|
159 | ONLY: nxl, nxr, nyn, nys, nzb |
---|
160 | |
---|
161 | USE kinds |
---|
162 | |
---|
163 | USE pegrid |
---|
164 | |
---|
165 | IMPLICIT NONE |
---|
166 | |
---|
167 | CHARACTER (LEN=2) :: section_chr !< |
---|
168 | CHARACTER (LEN=6) :: output_variable !< |
---|
169 | |
---|
170 | INTEGER(iwp) :: c_mode !< |
---|
171 | INTEGER(iwp) :: c_size_x !< |
---|
172 | INTEGER(iwp) :: c_size_y !< |
---|
173 | INTEGER(iwp) :: c_size_z !< |
---|
174 | INTEGER(iwp) :: dvrp_nop !< |
---|
175 | INTEGER(iwp) :: dvrp_not !< |
---|
176 | INTEGER(iwp) :: gradient_normals !< |
---|
177 | INTEGER(iwp) :: i !< |
---|
178 | INTEGER(iwp) :: ip !< |
---|
179 | INTEGER(iwp) :: j !< |
---|
180 | INTEGER(iwp) :: jp !< |
---|
181 | INTEGER(iwp) :: k !< |
---|
182 | INTEGER(iwp) :: l !< |
---|
183 | INTEGER(iwp) :: m !< |
---|
184 | INTEGER(iwp) :: n !< |
---|
185 | INTEGER(iwp) :: n_isosurface !< |
---|
186 | INTEGER(iwp) :: n_slicer !< |
---|
187 | INTEGER(iwp) :: nn !< |
---|
188 | INTEGER(iwp) :: section_mode !< |
---|
189 | INTEGER(iwp) :: vn !< |
---|
190 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: p_c !< |
---|
191 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: p_t !< |
---|
192 | |
---|
193 | LOGICAL, DIMENSION(:), ALLOCATABLE :: dvrp_mask !< |
---|
194 | |
---|
195 | REAL(sp) :: slicer_position !< |
---|
196 | REAL(sp) :: tmp_alpha !< |
---|
197 | REAL(sp) :: tmp_alpha_w !< |
---|
198 | REAL(sp) :: tmp_b !< |
---|
199 | REAL(sp) :: tmp_c_alpha !< |
---|
200 | REAL(sp) :: tmp_g !< |
---|
201 | REAL(sp) :: tmp_norm !< |
---|
202 | REAL(sp) :: tmp_pos !< |
---|
203 | REAL(sp) :: tmp_r !< |
---|
204 | REAL(sp) :: tmp_t !< |
---|
205 | REAL(sp) :: tmp_th !< |
---|
206 | REAL(sp), DIMENSION(:), ALLOCATABLE :: psize !< |
---|
207 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_x !< |
---|
208 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_y !< |
---|
209 | REAL(sp), DIMENSION(:), ALLOCATABLE :: p_z !< |
---|
210 | REAL(sp), DIMENSION(:,:,:), ALLOCATABLE :: local_pf !< |
---|
211 | REAL(sp), DIMENSION(:,:,:,:), ALLOCATABLE :: local_pfi !< |
---|
212 | |
---|
213 | |
---|
214 | CALL cpu_log( log_point(27), 'data_output_dvrp', 'start' ) |
---|
215 | |
---|
216 | ! |
---|
217 | !-- Loop over all output modes choosed |
---|
218 | m = 1 |
---|
219 | n_isosurface = 0 ! isosurface counter (for threshold values and color) |
---|
220 | n_slicer = 0 ! slice plane counter (for range of values) |
---|
221 | DO WHILE ( mode_dvrp(m) /= ' ' ) |
---|
222 | ! |
---|
223 | !-- Update of the steering variables |
---|
224 | IF ( .NOT. lock_steering_update ) THEN |
---|
225 | ! |
---|
226 | !-- Set lock to avoid recursive calls of DVRP_STEERING_UPDATE |
---|
227 | lock_steering_update = .TRUE. |
---|
228 | ! CALL DVRP_STEERING_UPDATE( m-1, data_output_dvrp ) |
---|
229 | lock_steering_update = .FALSE. |
---|
230 | ENDIF |
---|
231 | |
---|
232 | ! |
---|
233 | !-- Determine the variable which shall be plotted (in case of slicers or |
---|
234 | !-- isosurfaces) |
---|
235 | IF ( mode_dvrp(m)(1:10) == 'isosurface' ) THEN |
---|
236 | READ ( mode_dvrp(m), '(10X,I2)' ) vn |
---|
237 | output_variable = do3d(0,vn) |
---|
238 | n_isosurface = n_isosurface + 1 |
---|
239 | ELSEIF ( mode_dvrp(m)(1:6) == 'slicer' ) THEN |
---|
240 | READ ( mode_dvrp(m), '(6X,I2)' ) vn |
---|
241 | output_variable = do2d(0,vn) |
---|
242 | l = MAX( 2, LEN_TRIM( do2d(0,vn) ) ) |
---|
243 | section_chr = do2d(0,vn)(l-1:l) |
---|
244 | SELECT CASE ( section_chr ) |
---|
245 | CASE ( 'xy' ) |
---|
246 | section_mode = 2 |
---|
247 | slicer_position = zu(MIN( slicer_position_dvrp(m), nz_do3d )) |
---|
248 | CASE ( 'xz' ) |
---|
249 | section_mode = 1 |
---|
250 | slicer_position = slicer_position_dvrp(m) * dy |
---|
251 | CASE ( 'yz' ) |
---|
252 | section_mode = 0 |
---|
253 | slicer_position = slicer_position_dvrp(m) * dx |
---|
254 | END SELECT |
---|
255 | ENDIF |
---|
256 | |
---|
257 | ! |
---|
258 | !-- Select the plot mode (in case of isosurface or slicer only if user has |
---|
259 | !-- defined a variable which shall be plotted; otherwise do nothing) |
---|
260 | IF ( ( mode_dvrp(m)(1:10) == 'isosurface' .OR. & |
---|
261 | mode_dvrp(m)(1:6) == 'slicer' ) & |
---|
262 | .AND. output_variable /= ' ' ) THEN |
---|
263 | |
---|
264 | ! |
---|
265 | !-- Create an intermediate array, properly dimensioned for plot-output |
---|
266 | ALLOCATE( local_pf(nxl_dvrp:nxr_dvrp+1,nys_dvrp:nyn_dvrp+1, & |
---|
267 | nzb:nz_do3d) ) |
---|
268 | |
---|
269 | ! |
---|
270 | !-- Move original array to intermediate array |
---|
271 | IF ( dvrp_overlap ) THEN |
---|
272 | |
---|
273 | SELECT CASE ( output_variable ) |
---|
274 | |
---|
275 | CASE ( 'u', 'u_xy', 'u_xz', 'u_yz' ) |
---|
276 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
277 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
278 | DO k = nzb, nz_do3d |
---|
279 | local_pf(i,j,k) = u(k,j,i) |
---|
280 | ENDDO |
---|
281 | ENDDO |
---|
282 | ENDDO |
---|
283 | ! |
---|
284 | !-- Replace mirrored values at lower surface by real surface |
---|
285 | !-- values |
---|
286 | IF ( output_variable == 'u_xz' .OR. & |
---|
287 | output_variable == 'u_yz' ) THEN |
---|
288 | IF ( ibc_uv_b == 0 ) local_pf(:,:,nzb) = 0.0_wp |
---|
289 | ENDIF |
---|
290 | |
---|
291 | |
---|
292 | CASE ( 'v', 'v_xy', 'v_xz', 'v_yz' ) |
---|
293 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
294 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
295 | DO k = nzb, nz_do3d |
---|
296 | local_pf(i,j,k) = v(k,j,i) |
---|
297 | ENDDO |
---|
298 | ENDDO |
---|
299 | ENDDO |
---|
300 | ! |
---|
301 | !-- Replace mirrored values at lower surface by real surface |
---|
302 | !-- values |
---|
303 | IF ( output_variable == 'v_xz' .OR. & |
---|
304 | output_variable == 'v_yz' ) THEN |
---|
305 | IF ( ibc_uv_b == 0 ) local_pf(:,:,nzb) = 0.0_wp |
---|
306 | ENDIF |
---|
307 | |
---|
308 | CASE ( 'w', 'w_xy', 'w_xz', 'w_yz' ) |
---|
309 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
310 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
311 | DO k = nzb, nz_do3d |
---|
312 | local_pf(i,j,k) = w(k,j,i) |
---|
313 | ENDDO |
---|
314 | ENDDO |
---|
315 | ENDDO |
---|
316 | ! Averaging for Langmuir circulation |
---|
317 | ! DO k = nzb, nz_do3d |
---|
318 | ! DO j = nys_dvrp+1, nyn_dvrp |
---|
319 | ! DO i = nxl_dvrp, nxr_dvrp+1 |
---|
320 | ! local_pf(i,j,k) = 0.25 * local_pf(i,j-1,k) + & |
---|
321 | ! 0.50 * local_pf(i,j,k) + & |
---|
322 | ! 0.25 * local_pf(i,j+1,k) |
---|
323 | ! ENDDO |
---|
324 | ! ENDDO |
---|
325 | ! ENDDO |
---|
326 | |
---|
327 | CASE ( 'p', 'p_xy', 'p_xz', 'p_yz' ) |
---|
328 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
329 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
330 | DO k = nzb, nz_do3d |
---|
331 | local_pf(i,j,k) = p(k,j,i) |
---|
332 | ENDDO |
---|
333 | ENDDO |
---|
334 | ENDDO |
---|
335 | |
---|
336 | CASE ( 'pt', 'pt_xy', 'pt_xz', 'pt_yz' ) |
---|
337 | IF ( .NOT. cloud_physics ) THEN |
---|
338 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
339 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
340 | DO k = nzb, nz_do3d |
---|
341 | local_pf(i,j,k) = pt(k,j,i) |
---|
342 | ENDDO |
---|
343 | ENDDO |
---|
344 | ENDDO |
---|
345 | ELSE |
---|
346 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
347 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
348 | DO k = nzb, nz_do3d |
---|
349 | local_pf(i,j,k) = pt(k,j,i) + l_d_cp * & |
---|
350 | pt_d_t(k) * ql(k,j,i) |
---|
351 | ENDDO |
---|
352 | ENDDO |
---|
353 | ENDDO |
---|
354 | ENDIF |
---|
355 | |
---|
356 | CASE ( 'q', 'q_xy', 'q_xz', 'q_yz' ) |
---|
357 | IF ( humidity ) THEN |
---|
358 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
359 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
360 | DO k = nzb, nz_do3d |
---|
361 | local_pf(i,j,k) = q(k,j,i) |
---|
362 | ENDDO |
---|
363 | ENDDO |
---|
364 | ENDDO |
---|
365 | ELSE |
---|
366 | message_string = 'if humidity = ' // & |
---|
367 | '.FALSE. output of ' // TRIM( output_variable ) // & |
---|
368 | 'is not provided' |
---|
369 | CALL message( 'data_output_dvrp', 'PA0183',& |
---|
370 | 0, 0, 0, 6, 0 ) |
---|
371 | ENDIF |
---|
372 | |
---|
373 | CASE ( 'ql', 'ql_xy', 'ql_xz', 'ql_yz' ) |
---|
374 | IF ( cloud_physics .OR. cloud_droplets ) THEN |
---|
375 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
376 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
377 | DO k = nzb, nz_do3d |
---|
378 | local_pf(i,j,k) = ql(k,j,i) |
---|
379 | ENDDO |
---|
380 | ENDDO |
---|
381 | ENDDO |
---|
382 | ELSE |
---|
383 | message_string = 'if cloud_physics = .FALSE. and ' // & |
---|
384 | 'cloud_droplets = .FALSE. ' |
---|
385 | 'output of ' // TRIM( output_variable) // & |
---|
386 | 'is not provided' |
---|
387 | CALL message( 'data_output_dvrp', 'PA0184',& |
---|
388 | 0, 0, 0, 6, 0 ) |
---|
389 | ENDIF |
---|
390 | |
---|
391 | CASE ( 's', 's_xy', 's_xz', 's_yz' ) |
---|
392 | IF ( passive_scalar ) THEN |
---|
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) = s(k,j,i) |
---|
397 | ENDDO |
---|
398 | ENDDO |
---|
399 | ENDDO |
---|
400 | ELSE |
---|
401 | message_string = 'if passive_scalar = ' // & |
---|
402 | '.FALSE. output of ' // TRIM( output_variable ) // & |
---|
403 | 'is not provided' |
---|
404 | CALL message( 'data_output_dvrp', 'PA0183',& |
---|
405 | 0, 0, 0, 6, 0 ) |
---|
406 | ENDIF |
---|
407 | |
---|
408 | CASE ( 'u*_xy' ) |
---|
409 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
410 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
411 | local_pf(i,j,nzb+1) = us(j,i) |
---|
412 | ENDDO |
---|
413 | ENDDO |
---|
414 | slicer_position = zu(nzb+1) |
---|
415 | |
---|
416 | CASE ( 't*_xy' ) |
---|
417 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
418 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
419 | local_pf(i,j,nzb+1) = ts(j,i) |
---|
420 | ENDDO |
---|
421 | ENDDO |
---|
422 | slicer_position = zu(nzb+1) |
---|
423 | |
---|
424 | |
---|
425 | CASE DEFAULT |
---|
426 | ! |
---|
427 | !-- The DEFAULT case is reached either if output_variable |
---|
428 | !-- contains unsupported variable or if the user has coded a |
---|
429 | !-- special case in the user interface. There, the subroutine |
---|
430 | !-- user_data_output_dvrp checks which of these two conditions |
---|
431 | !-- applies. |
---|
432 | CALL user_data_output_dvrp( output_variable, local_pf ) |
---|
433 | |
---|
434 | |
---|
435 | END SELECT |
---|
436 | |
---|
437 | ELSE |
---|
438 | ! |
---|
439 | !-- No overlap of clipping domain with the current subdomain |
---|
440 | DO i = nxl_dvrp, nxr_dvrp+1 |
---|
441 | DO j = nys_dvrp, nyn_dvrp+1 |
---|
442 | DO k = nzb, nz_do3d |
---|
443 | local_pf(i,j,k) = 0.0_wp |
---|
444 | ENDDO |
---|
445 | ENDDO |
---|
446 | ENDDO |
---|
447 | |
---|
448 | ENDIF |
---|
449 | |
---|
450 | IF ( mode_dvrp(m)(1:10) == 'isosurface' ) THEN |
---|
451 | |
---|
452 | ! |
---|
453 | !-- DVRP-Calls for plotting isosurfaces: |
---|
454 | CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'start' ) |
---|
455 | |
---|
456 | ! |
---|
457 | !-- Definition of isosurface color |
---|
458 | tmp_r = isosurface_color(1,n_isosurface) |
---|
459 | tmp_g = isosurface_color(2,n_isosurface) |
---|
460 | tmp_b = isosurface_color(3,n_isosurface) |
---|
461 | tmp_t = 0.0_wp |
---|
462 | CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) |
---|
463 | |
---|
464 | ! |
---|
465 | !-- Compute and plot isosurface in dvr-format |
---|
466 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
467 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
468 | |
---|
469 | c_size_x = vc_size_x; c_size_y = vc_size_y; c_size_z = vc_size_z |
---|
470 | CALL DVRP_CLUSTER_SIZE( m-1, c_size_x, c_size_y, c_size_z ) |
---|
471 | |
---|
472 | c_mode = vc_mode |
---|
473 | CALL DVRP_CLUSTERING_MODE( m-1, c_mode ) |
---|
474 | |
---|
475 | gradient_normals = vc_gradient_normals |
---|
476 | CALL DVRP_GRADIENTNORMALS( m-1, gradient_normals ) |
---|
477 | |
---|
478 | ! |
---|
479 | !-- A seperate procedure for setting vc_alpha will be in the next |
---|
480 | !-- version of libDVRP |
---|
481 | tmp_c_alpha = vc_alpha |
---|
482 | CALL DVRP_THRESHOLD( -(m-1)-1, tmp_c_alpha ) |
---|
483 | |
---|
484 | IF ( dvrp_overlap ) THEN |
---|
485 | tmp_th = threshold(n_isosurface) |
---|
486 | ELSE |
---|
487 | tmp_th = 1.0_wp ! nothing is plotted because array values are 0 |
---|
488 | ENDIF |
---|
489 | |
---|
490 | CALL DVRP_THRESHOLD( m-1, tmp_th ) |
---|
491 | |
---|
492 | CALL DVRP_VISUALIZE( m-1, 21, dvrp_filecount ) |
---|
493 | |
---|
494 | CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'stop' ) |
---|
495 | |
---|
496 | ELSEIF ( mode_dvrp(m)(1:6) == 'slicer' ) THEN |
---|
497 | |
---|
498 | ! |
---|
499 | !-- DVRP-Calls for plotting slicers: |
---|
500 | CALL cpu_log( log_point_s(27), 'dvrp_slicer', 'start' ) |
---|
501 | |
---|
502 | ! |
---|
503 | !-- Material and color definitions |
---|
504 | tmp_r = 0.0_wp; tmp_g = 0.0_wp; tmp_b = 0.0_wp; tmp_t = 0.0_wp |
---|
505 | CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) |
---|
506 | |
---|
507 | n_slicer = n_slicer + 1 |
---|
508 | |
---|
509 | ! |
---|
510 | !-- Using dolorfunction has not been properly tested |
---|
511 | ! islice_dvrp = n_slicer |
---|
512 | ! CALL DVRP_COLORFUNCTION( m-1, DVRP_CM_HLS, 25, & |
---|
513 | ! slicer_range_limits_dvrp(:,n_slicer), & |
---|
514 | ! color_dvrp ) |
---|
515 | |
---|
516 | ! |
---|
517 | !-- Set interval of values defining the colortable |
---|
518 | CALL set_slicer_attributes_dvrp( n_slicer ) |
---|
519 | |
---|
520 | ! |
---|
521 | !-- Create user-defined colortable |
---|
522 | CALL user_dvrp_coltab( 'slicer', output_variable ) |
---|
523 | |
---|
524 | CALL DVRP_COLORTABLE_HLS( m-1, 1, interval_values_dvrp, & |
---|
525 | interval_h_dvrp, interval_l_dvrp, & |
---|
526 | interval_s_dvrp, interval_a_dvrp ) |
---|
527 | |
---|
528 | ! |
---|
529 | !-- Compute and plot slicer in dvr-format |
---|
530 | CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
531 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
532 | tmp_pos = slicer_position |
---|
533 | CALL DVRP_SLICER( m-1, section_mode, tmp_pos ) |
---|
534 | |
---|
535 | CALL DVRP_VISUALIZE( m-1, 2, dvrp_filecount ) |
---|
536 | |
---|
537 | CALL cpu_log( log_point_s(27), 'dvrp_slicer', 'stop' ) |
---|
538 | |
---|
539 | ENDIF |
---|
540 | |
---|
541 | DEALLOCATE( local_pf ) |
---|
542 | |
---|
543 | ELSEIF ( mode_dvrp(m)(1:9) == 'pathlines' ) THEN |
---|
544 | |
---|
545 | ALLOCATE( local_pfi(4,nxl:nxr+1,nys:nyn+1,nzb:nz_do3d) ) |
---|
546 | DO i = nxl, nxr+1 |
---|
547 | DO j = nys, nyn+1 |
---|
548 | DO k = nzb, nz_do3d |
---|
549 | local_pfi(1,i,j,k) = u(k,j,i) |
---|
550 | local_pfi(2,i,j,k) = v(k,j,i) |
---|
551 | local_pfi(3,i,j,k) = w(k,j,i) |
---|
552 | tmp_norm = SQRT( u(k,j,i) * u(k,j,i) + & |
---|
553 | v(k,j,i) * v(k,j,i) + & |
---|
554 | w(k,j,i) * w(k,j,i) ) |
---|
555 | tmp_alpha = ACOS( 0.0_wp * u(k,j,i) / tmp_norm + & |
---|
556 | 0.0_wp * v(k,j,i) / tmp_norm - & |
---|
557 | 1.0_wp * w(k,j,i) / tmp_norm ) |
---|
558 | tmp_alpha_w = tmp_alpha / pi * 180.0_wp |
---|
559 | local_pfi(4,i,j,k) = tmp_alpha_w |
---|
560 | ENDDO |
---|
561 | ENDDO |
---|
562 | ENDDO |
---|
563 | |
---|
564 | CALL cpu_log( log_point_s(31), 'dvrp_pathlines', 'start' ) |
---|
565 | |
---|
566 | CALL DVRP_DATA( m-1, local_pfi, 4, nx_dvrp, ny_dvrp, nz_dvrp, & |
---|
567 | cyclic_dvrp, cyclic_dvrp, cyclic_dvrp ) |
---|
568 | CALL DVRP_VISUALIZE( m-1, 20, dvrp_filecount ) |
---|
569 | |
---|
570 | CALL cpu_log( log_point_s(31), 'dvrp_pathlines', 'stop' ) |
---|
571 | |
---|
572 | DEALLOCATE( local_pfi ) |
---|
573 | |
---|
574 | ENDIF |
---|
575 | |
---|
576 | m = m + 1 |
---|
577 | |
---|
578 | ENDDO |
---|
579 | |
---|
580 | dvrp_filecount = dvrp_filecount + 1 |
---|
581 | |
---|
582 | CALL cpu_log( log_point(27), 'data_output_dvrp', 'stop' ) |
---|
583 | |
---|
584 | #endif |
---|
585 | END SUBROUTINE data_output_dvrp |
---|