[1873] | 1 | !> @file advec_w_pw.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 | ! |
---|
[3655] | 17 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1354] | 22 | ! |
---|
[2233] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: advec_w_pw.f90 4182 2019-08-22 15:20:23Z oliver.maas $ |
---|
[4182] | 27 | ! Corrected "Former revisions" section |
---|
| 28 | ! |
---|
| 29 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[3547] | 30 | ! variables documented |
---|
[1321] | 31 | ! |
---|
[4182] | 32 | ! Revision 1.1 1997/08/11 06:10:29 raasch |
---|
| 33 | ! Initial revision |
---|
| 34 | ! |
---|
| 35 | ! |
---|
[1] | 36 | ! Description: |
---|
| 37 | ! ------------ |
---|
[1682] | 38 | !> Advection term for w velocity-component using Piacsek and Williams. |
---|
| 39 | !> Vertical advection at the first grid point above the surface is done with |
---|
| 40 | !> normal centred differences, because otherwise no information from the surface |
---|
| 41 | !> would be communicated upwards due to w=0 at k=nzb. |
---|
[1] | 42 | !------------------------------------------------------------------------------! |
---|
[1682] | 43 | MODULE advec_w_pw_mod |
---|
| 44 | |
---|
[1] | 45 | |
---|
| 46 | PRIVATE |
---|
| 47 | PUBLIC advec_w_pw |
---|
| 48 | |
---|
| 49 | INTERFACE advec_w_pw |
---|
| 50 | MODULE PROCEDURE advec_w_pw |
---|
| 51 | MODULE PROCEDURE advec_w_pw_ij |
---|
| 52 | END INTERFACE advec_w_pw |
---|
| 53 | |
---|
| 54 | CONTAINS |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | !------------------------------------------------------------------------------! |
---|
[1682] | 58 | ! Description: |
---|
| 59 | ! ------------ |
---|
| 60 | !> Call for all grid points |
---|
[1] | 61 | !------------------------------------------------------------------------------! |
---|
| 62 | SUBROUTINE advec_w_pw |
---|
| 63 | |
---|
[1320] | 64 | USE arrays_3d, & |
---|
| 65 | ONLY: ddzu, tend, u, v, w |
---|
[1] | 66 | |
---|
[1320] | 67 | USE control_parameters, & |
---|
| 68 | ONLY: u_gtrans, v_gtrans |
---|
| 69 | |
---|
| 70 | USE grid_variables, & |
---|
| 71 | ONLY: ddx, ddy |
---|
| 72 | |
---|
| 73 | USE indices, & |
---|
[3538] | 74 | ONLY: nxl, nxr, nyn, nys, nzb, nzt |
---|
[1320] | 75 | |
---|
| 76 | USE kinds |
---|
| 77 | |
---|
| 78 | |
---|
[1] | 79 | IMPLICIT NONE |
---|
| 80 | |
---|
[3547] | 81 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 82 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 83 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
[1320] | 84 | |
---|
[3547] | 85 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 86 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 87 | |
---|
| 88 | |
---|
[1353] | 89 | gu = 2.0_wp * u_gtrans |
---|
| 90 | gv = 2.0_wp * v_gtrans |
---|
[1] | 91 | DO i = nxl, nxr |
---|
| 92 | DO j = nys, nyn |
---|
[2232] | 93 | DO k = nzb+1, nzt |
---|
[1353] | 94 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 95 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
| 96 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 97 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
| 98 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
| 99 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
| 100 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
| 101 | * ddzu(k+1) & |
---|
[3538] | 102 | ) |
---|
[1] | 103 | ENDDO |
---|
| 104 | ENDDO |
---|
| 105 | ENDDO |
---|
| 106 | |
---|
| 107 | END SUBROUTINE advec_w_pw |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | !------------------------------------------------------------------------------! |
---|
[1682] | 111 | ! Description: |
---|
| 112 | ! ------------ |
---|
| 113 | !> Call for grid point i,j |
---|
[1] | 114 | !------------------------------------------------------------------------------! |
---|
| 115 | SUBROUTINE advec_w_pw_ij( i, j ) |
---|
| 116 | |
---|
[1320] | 117 | USE arrays_3d, & |
---|
| 118 | ONLY: ddzu, tend, u, v, w |
---|
[1] | 119 | |
---|
[1320] | 120 | USE control_parameters, & |
---|
| 121 | ONLY: u_gtrans, v_gtrans |
---|
| 122 | |
---|
| 123 | USE grid_variables, & |
---|
| 124 | ONLY: ddx, ddy |
---|
| 125 | |
---|
| 126 | USE indices, & |
---|
[3538] | 127 | ONLY: nzb, nzt |
---|
[1320] | 128 | |
---|
| 129 | USE kinds |
---|
| 130 | |
---|
| 131 | |
---|
[1] | 132 | IMPLICIT NONE |
---|
| 133 | |
---|
[3547] | 134 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 135 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 136 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
[1320] | 137 | |
---|
[3547] | 138 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 139 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 140 | |
---|
[1353] | 141 | gu = 2.0_wp * u_gtrans |
---|
| 142 | gv = 2.0_wp * v_gtrans |
---|
[2232] | 143 | DO k = nzb+1, nzt |
---|
[1353] | 144 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 145 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
| 146 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 147 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
| 148 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
| 149 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
| 150 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
| 151 | * ddzu(k+1) & |
---|
[3538] | 152 | ) |
---|
[1] | 153 | ENDDO |
---|
| 154 | END SUBROUTINE advec_w_pw_ij |
---|
| 155 | |
---|
| 156 | END MODULE advec_w_pw_mod |
---|