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