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