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