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