Changeset 4671 for palm/trunk/SOURCE/diffusion_s.f90
- Timestamp:
- Sep 9, 2020 8:27:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/diffusion_s.f90
r4583 r4671 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 22 ! 21 ! 22 ! 23 23 ! Former revisions: 24 24 ! ----------------- 25 25 ! $Id$ 26 ! Implementation of downward facing USM and LSM surfaces 27 ! 28 ! 4583 2020-06-29 12:36:47Z raasch 26 29 ! file re-formatted to follow the PALM coding standard 27 30 ! … … 74 77 SUBROUTINE diffusion_s( s, s_flux_def_h_up, s_flux_def_h_down, & 75 78 s_flux_t, & 76 s_flux_lsm_h_up, s_flux_usm_h_up, & 79 s_flux_lsm_h_up, s_flux_lsm_h_down, & 80 s_flux_usm_h_up, s_flux_usm_h_down, & 77 81 s_flux_def_v_north, s_flux_def_v_south, & 78 82 s_flux_def_v_east, s_flux_def_v_west, & … … 116 120 REAL(wp) :: mask_west !< flag to mask vertical surface west of the grid point 117 121 122 REAL(wp), DIMENSION(1:surf_def_h(0)%ns) :: s_flux_def_h_up !< flux at horizontal upward-facing default-type surfaces 118 123 REAL(wp), DIMENSION(1:surf_def_h(1)%ns) :: s_flux_def_h_down !< flux at horizontal donwward-facing default-type surfaces 119 REAL(wp), DIMENSION(1:surf_def_h(0)%ns) :: s_flux_def_h_up !< flux at horizontal upward-facing default-type surfaces120 124 REAL(wp), DIMENSION(1:surf_def_v(2)%ns) :: s_flux_def_v_east !< flux at east-facing vertical default-type surfaces 121 125 REAL(wp), DIMENSION(1:surf_def_v(0)%ns) :: s_flux_def_v_north !< flux at north-facing vertical default-type surfaces 122 126 REAL(wp), DIMENSION(1:surf_def_v(1)%ns) :: s_flux_def_v_south !< flux at south-facing vertical default-type surfaces 123 127 REAL(wp), DIMENSION(1:surf_def_v(3)%ns) :: s_flux_def_v_west !< flux at west-facing vertical default-type surfaces 124 REAL(wp), DIMENSION(1:surf_lsm_h%ns) :: s_flux_lsm_h_up !< flux at horizontal upward-facing natural-type surfaces 128 REAL(wp), DIMENSION(1:surf_lsm_h(0)%ns) :: s_flux_lsm_h_up !< flux at horizontal upward-facing natural-type surfaces 129 REAL(wp), DIMENSION(1:surf_lsm_h(1)%ns) :: s_flux_lsm_h_down !< flux at horizontal downward-facing natural-type surfaces 125 130 REAL(wp), DIMENSION(1:surf_lsm_v(2)%ns) :: s_flux_lsm_v_east !< flux at east-facing vertical natural-type surfaces 126 131 REAL(wp), DIMENSION(1:surf_lsm_v(0)%ns) :: s_flux_lsm_v_north !< flux at north-facing vertical natural-type surfaces 127 132 REAL(wp), DIMENSION(1:surf_lsm_v(1)%ns) :: s_flux_lsm_v_south !< flux at south-facing vertical natural-type surfaces 128 133 REAL(wp), DIMENSION(1:surf_lsm_v(3)%ns) :: s_flux_lsm_v_west !< flux at west-facing vertical natural-type surfaces 129 REAL(wp), DIMENSION(1:surf_usm_h%ns) :: s_flux_usm_h_up !< flux at horizontal upward-facing urban-type surfaces 134 REAL(wp), DIMENSION(1:surf_usm_h(0)%ns) :: s_flux_usm_h_up !< flux at horizontal upward-facing urban-type surfaces 135 REAL(wp), DIMENSION(1:surf_usm_h(1)%ns) :: s_flux_usm_h_down !< flux at horizontal downward-facing urban-type surfaces 130 136 REAL(wp), DIMENSION(1:surf_usm_v(2)%ns) :: s_flux_usm_v_east !< flux at east-facing vertical urban-type surfaces 131 137 REAL(wp), DIMENSION(1:surf_usm_v(0)%ns) :: s_flux_usm_v_north !< flux at north-facing vertical urban-type surfaces … … 144 150 !$ACC PRESENT(ddzu, ddzw, drho_air, rho_air_zw) & 145 151 !$ACC PRESENT(surf_def_h(0:2), surf_def_v(0:3)) & 146 !$ACC PRESENT(surf_lsm_h , surf_lsm_v(0:3)) &147 !$ACC PRESENT(surf_usm_h , surf_usm_v(0:3)) &152 !$ACC PRESENT(surf_lsm_h(0:1), surf_lsm_v(0:3)) & 153 !$ACC PRESENT(surf_usm_h(0:1), surf_usm_v(0:3)) & 148 154 !$ACC PRESENT(s_flux_def_h_up, s_flux_def_h_down) & 149 155 !$ACC PRESENT(s_flux_t) & 150 156 !$ACC PRESENT(s_flux_def_v_north, s_flux_def_v_south) & 151 157 !$ACC PRESENT(s_flux_def_v_east, s_flux_def_v_west) & 152 !$ACC PRESENT(s_flux_lsm_h_up ) &158 !$ACC PRESENT(s_flux_lsm_h_up, s_flux_lsm_h_down) & 153 159 !$ACC PRESENT(s_flux_lsm_v_north, s_flux_lsm_v_south) & 154 160 !$ACC PRESENT(s_flux_lsm_v_east, s_flux_lsm_v_west) & 155 !$ACC PRESENT(s_flux_usm_h_up ) &161 !$ACC PRESENT(s_flux_usm_h_up, s_flux_usm_h_down) & 156 162 !$ACC PRESENT(s_flux_usm_v_north, s_flux_usm_v_south) & 157 163 !$ACC PRESENT(s_flux_usm_v_east, s_flux_usm_v_west) & … … 328 334 surf_e = surf_def_h(0)%end_index(j,i) 329 335 DO m = surf_s, surf_e 330 331 336 k = surf_def_h(0)%k(m) 332 337 tend(k,j,i) = tend(k,j,i) + s_flux_def_h_up(m) * ddzw(k) * drho_air(k) 333 334 338 ENDDO 335 339 ! … … 338 342 surf_e = surf_def_h(1)%end_index(j,i) 339 343 DO m = surf_s, surf_e 340 341 344 k = surf_def_h(1)%k(m) 342 345 tend(k,j,i) = tend(k,j,i) + s_flux_def_h_down(m) * ddzw(k) * drho_air(k) 343 344 346 ENDDO 345 347 ! 346 348 !-- Natural-type surfaces, upward-facing 347 surf_s = surf_lsm_h %start_index(j,i)348 surf_e = surf_lsm_h %end_index(j,i)349 surf_s = surf_lsm_h(0)%start_index(j,i) 350 surf_e = surf_lsm_h(0)%end_index(j,i) 349 351 DO m = surf_s, surf_e 350 351 k = surf_lsm_h%k(m) 352 k = surf_lsm_h(0)%k(m) 352 353 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_up(m) * ddzw(k) * drho_air(k) 353 354 354 ENDDO 355 355 ! 356 !-- Natural-type surfaces, downward-facing 357 surf_s = surf_lsm_h(1)%start_index(j,i) 358 surf_e = surf_lsm_h(1)%end_index(j,i) 359 DO m = surf_s, surf_e 360 k = surf_lsm_h(1)%k(m) 361 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_down(m) * ddzw(k) * drho_air(k) 362 ENDDO 363 ! 356 364 !-- Urban-type surfaces, upward-facing 357 surf_s = surf_usm_h %start_index(j,i)358 surf_e = surf_usm_h %end_index(j,i)365 surf_s = surf_usm_h(0)%start_index(j,i) 366 surf_e = surf_usm_h(0)%end_index(j,i) 359 367 DO m = surf_s, surf_e 360 361 k = surf_usm_h%k(m) 368 k = surf_usm_h(0)%k(m) 362 369 tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_up(m) * ddzw(k) * drho_air(k) 363 370 ENDDO 371 ! 372 !-- Urban-type surfaces, downward-facing 373 surf_s = surf_usm_h(1)%start_index(j,i) 374 surf_e = surf_usm_h(1)%end_index(j,i) 375 DO m = surf_s, surf_e 376 k = surf_usm_h(1)%k(m) 377 tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_down(m) * ddzw(k) * drho_air(k) 364 378 ENDDO 365 379 … … 390 404 s_flux_def_h_up, s_flux_def_h_down, & 391 405 s_flux_t, & 392 s_flux_lsm_h_up, s_flux_usm_h_up, & 406 s_flux_lsm_h_up, s_flux_lsm_h_down, & 407 s_flux_usm_h_up, s_flux_usm_h_down, & 393 408 s_flux_def_v_north, s_flux_def_v_south, & 394 409 s_flux_def_v_east, s_flux_def_v_west, & … … 438 453 REAL(wp), DIMENSION(1:surf_def_v(1)%ns) :: s_flux_def_v_south !< flux at south-facing vertical default-type surfaces 439 454 REAL(wp), DIMENSION(1:surf_def_v(3)%ns) :: s_flux_def_v_west !< flux at west-facing vertical default-type surfaces 440 REAL(wp), DIMENSION(1:surf_lsm_h%ns) :: s_flux_lsm_h_up !< flux at horizontal upward-facing natural-type surfaces 455 REAL(wp), DIMENSION(1:surf_lsm_h(0)%ns) :: s_flux_lsm_h_up !< flux at horizontal upward-facing natural-type surfaces 456 REAL(wp), DIMENSION(1:surf_lsm_h(1)%ns) :: s_flux_lsm_h_down !< flux at horizontal downward-facing natural-type surfaces 441 457 REAL(wp), DIMENSION(1:surf_lsm_v(2)%ns) :: s_flux_lsm_v_east !< flux at east-facing vertical urban-type surfaces 442 458 REAL(wp), DIMENSION(1:surf_lsm_v(0)%ns) :: s_flux_lsm_v_north !< flux at north-facing vertical urban-type surfaces 443 459 REAL(wp), DIMENSION(1:surf_lsm_v(1)%ns) :: s_flux_lsm_v_south !< flux at south-facing vertical urban-type surfaces 444 460 REAL(wp), DIMENSION(1:surf_lsm_v(3)%ns) :: s_flux_lsm_v_west !< flux at west-facing vertical urban-type surfaces 445 REAL(wp), DIMENSION(1:surf_usm_h%ns) :: s_flux_usm_h_up !< flux at horizontal upward-facing urban-type surfaces 461 REAL(wp), DIMENSION(1:surf_usm_h(0)%ns) :: s_flux_usm_h_up !< flux at horizontal upward-facing urban-type surfaces 462 REAL(wp), DIMENSION(1:surf_usm_h(1)%ns) :: s_flux_usm_h_down !< flux at horizontal downward-facing urban-type surfaces 446 463 REAL(wp), DIMENSION(1:surf_usm_v(2)%ns) :: s_flux_usm_v_east !< flux at east-facing vertical urban-type surfaces 447 464 REAL(wp), DIMENSION(1:surf_usm_v(0)%ns) :: s_flux_usm_v_north !< flux at north-facing vertical urban-type surfaces … … 625 642 surf_e = surf_def_h(0)%end_index(j,i) 626 643 DO m = surf_s, surf_e 627 628 644 k = surf_def_h(0)%k(m) 629 630 645 tend(k,j,i) = tend(k,j,i) + s_flux_def_h_up(m) * ddzw(k) * drho_air(k) 631 646 ENDDO … … 635 650 surf_e = surf_def_h(1)%end_index(j,i) 636 651 DO m = surf_s, surf_e 637 638 652 k = surf_def_h(1)%k(m) 639 640 653 tend(k,j,i) = tend(k,j,i) + s_flux_def_h_down(m) * ddzw(k) * drho_air(k) 641 654 ENDDO 642 655 ! 643 656 !-- Natural-type surfaces, upward-facing 644 surf_s = surf_lsm_h %start_index(j,i)645 surf_e = surf_lsm_h %end_index(j,i)657 surf_s = surf_lsm_h(0)%start_index(j,i) 658 surf_e = surf_lsm_h(0)%end_index(j,i) 646 659 DO m = surf_s, surf_e 647 k = surf_lsm_h%k(m) 648 660 k = surf_lsm_h(0)%k(m) 649 661 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_up(m) * ddzw(k) * drho_air(k) 650 662 ENDDO 651 663 ! 664 !-- Natural-type surfaces, downward-facing 665 surf_s = surf_lsm_h(1)%start_index(j,i) 666 surf_e = surf_lsm_h(1)%end_index(j,i) 667 DO m = surf_s, surf_e 668 k = surf_lsm_h(1)%k(m) 669 tend(k,j,i) = tend(k,j,i) + s_flux_lsm_h_down(m) * ddzw(k) * drho_air(k) 670 ENDDO 671 ! 652 672 !-- Urban-type surfaces, upward-facing 653 surf_s = surf_usm_h %start_index(j,i)654 surf_e = surf_usm_h %end_index(j,i)673 surf_s = surf_usm_h(0)%start_index(j,i) 674 surf_e = surf_usm_h(0)%end_index(j,i) 655 675 DO m = surf_s, surf_e 656 k = surf_usm_h%k(m) 657 676 k = surf_usm_h(0)%k(m) 658 677 tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_up(m) * ddzw(k) * drho_air(k) 678 ENDDO 679 ! 680 !-- Urban-type surfaces, upward-facing 681 surf_s = surf_usm_h(1)%start_index(j,i) 682 surf_e = surf_usm_h(1)%end_index(j,i) 683 DO m = surf_s, surf_e 684 k = surf_usm_h(1)%k(m) 685 tend(k,j,i) = tend(k,j,i) + s_flux_usm_h_down(m) * ddzw(k) * drho_air(k) 659 686 ENDDO 660 687 ENDIF … … 665 692 surf_e = surf_def_h(2)%end_index(j,i) 666 693 DO m = surf_s, surf_e 667 668 694 k = surf_def_h(2)%k(m) 669 695 tend(k,j,i) = tend(k,j,i) + ( - s_flux_t(m) ) * ddzw(k) * drho_air(k)
Note: See TracChangeset
for help on using the changeset viewer.