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