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