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