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