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