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