[1873] | 1 | !> @file advec_v_pw.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of the PALM model system. |
---|
[1036] | 5 | ! |
---|
[2000] | 6 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 7 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 8 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 9 | ! version. |
---|
[1036] | 10 | ! |
---|
| 11 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 12 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 13 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 14 | ! |
---|
| 15 | ! You should have received a copy of the GNU General Public License along with |
---|
| 16 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 17 | ! |
---|
[3655] | 18 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
[2000] | 19 | !------------------------------------------------------------------------------! |
---|
[1036] | 20 | ! |
---|
[484] | 21 | ! Current revisions: |
---|
[1] | 22 | ! ----------------- |
---|
[1354] | 23 | ! |
---|
[2233] | 24 | ! |
---|
[1321] | 25 | ! Former revisions: |
---|
| 26 | ! ----------------- |
---|
| 27 | ! $Id: advec_v_pw.f90 3655 2019-01-07 16:51:22Z suehring $ |
---|
[3547] | 28 | ! variables documented |
---|
| 29 | ! |
---|
| 30 | ! 3538 2018-11-20 10:55:41Z suehring |
---|
[3538] | 31 | ! Remove unnecessary double-masking of topography |
---|
| 32 | ! |
---|
| 33 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 34 | ! Corrected "Former revisions" section |
---|
| 35 | ! |
---|
| 36 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 37 | ! Change in file header (GPL part) |
---|
[1321] | 38 | ! |
---|
[2716] | 39 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
| 40 | ! |
---|
[2233] | 41 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 42 | ! topography representation via flags |
---|
| 43 | ! |
---|
[2001] | 44 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 45 | ! Forced header and separation lines into 80 columns |
---|
| 46 | ! |
---|
[1874] | 47 | ! 1873 2016-04-18 14:50:06Z maronga |
---|
| 48 | ! Module renamed (removed _mod) |
---|
| 49 | ! |
---|
| 50 | ! |
---|
[1851] | 51 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
| 52 | ! Module renamed |
---|
| 53 | ! |
---|
| 54 | ! |
---|
[1683] | 55 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 56 | ! Code annotations made doxygen readable |
---|
| 57 | ! |
---|
[1354] | 58 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 59 | ! REAL constants provided with KIND-attribute |
---|
| 60 | ! |
---|
[1321] | 61 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 62 | ! ONLY-attribute added to USE-statements, |
---|
| 63 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 64 | ! kinds are defined in new module kinds, |
---|
| 65 | ! revision history before 2012 removed, |
---|
| 66 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 67 | ! all variable declaration statements |
---|
[1] | 68 | ! |
---|
[1037] | 69 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 70 | ! code put under GPL (PALM 3.9) |
---|
| 71 | ! |
---|
[1] | 72 | ! Revision 1.1 1997/08/11 06:09:57 raasch |
---|
| 73 | ! Initial revision |
---|
| 74 | ! |
---|
| 75 | ! |
---|
| 76 | ! Description: |
---|
| 77 | ! ------------ |
---|
[1682] | 78 | !> Advection term for v velocity-component using Piacsek and Williams. |
---|
| 79 | !> Vertical advection at the first grid point above the surface is done with |
---|
| 80 | !> normal centred differences, because otherwise no information from the surface |
---|
| 81 | !> would be communicated upwards due to w=0 at K=nzb. |
---|
[1] | 82 | !------------------------------------------------------------------------------! |
---|
[1682] | 83 | MODULE advec_v_pw_mod |
---|
| 84 | |
---|
[1] | 85 | |
---|
| 86 | PRIVATE |
---|
| 87 | PUBLIC advec_v_pw |
---|
| 88 | |
---|
| 89 | INTERFACE advec_v_pw |
---|
| 90 | MODULE PROCEDURE advec_v_pw |
---|
| 91 | MODULE PROCEDURE advec_v_pw_ij |
---|
| 92 | END INTERFACE advec_v_pw |
---|
| 93 | |
---|
| 94 | CONTAINS |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | !------------------------------------------------------------------------------! |
---|
[1682] | 98 | ! Description: |
---|
| 99 | ! ------------ |
---|
| 100 | !> Call for all grid points |
---|
[1] | 101 | !------------------------------------------------------------------------------! |
---|
| 102 | SUBROUTINE advec_v_pw |
---|
| 103 | |
---|
[1320] | 104 | USE arrays_3d, & |
---|
| 105 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 106 | |
---|
[1320] | 107 | USE control_parameters, & |
---|
| 108 | ONLY: u_gtrans, v_gtrans |
---|
| 109 | |
---|
| 110 | USE grid_variables, & |
---|
| 111 | ONLY: ddx, ddy |
---|
| 112 | |
---|
| 113 | USE indices, & |
---|
[3538] | 114 | ONLY: nxl, nxr, nyn, nysv, nzb, nzt |
---|
[1320] | 115 | |
---|
| 116 | USE kinds |
---|
| 117 | |
---|
| 118 | |
---|
[1] | 119 | IMPLICIT NONE |
---|
| 120 | |
---|
[3547] | 121 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 122 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 123 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
[1320] | 124 | |
---|
[3547] | 125 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 126 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 127 | |
---|
| 128 | |
---|
[1353] | 129 | gu = 2.0_wp * u_gtrans |
---|
| 130 | gv = 2.0_wp * v_gtrans |
---|
[1] | 131 | DO i = nxl, nxr |
---|
[106] | 132 | DO j = nysv, nyn |
---|
[2232] | 133 | DO k = nzb+1, nzt |
---|
[1353] | 134 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 135 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 136 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 137 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 138 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 139 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 140 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 141 | * ddzw(k) & |
---|
[3538] | 142 | ) |
---|
[1] | 143 | ENDDO |
---|
| 144 | ENDDO |
---|
| 145 | ENDDO |
---|
| 146 | |
---|
| 147 | END SUBROUTINE advec_v_pw |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | !------------------------------------------------------------------------------! |
---|
[1682] | 151 | ! Description: |
---|
| 152 | ! ------------ |
---|
| 153 | !> Call for grid point i,j |
---|
[1] | 154 | !------------------------------------------------------------------------------! |
---|
| 155 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
| 156 | |
---|
[1320] | 157 | USE arrays_3d, & |
---|
| 158 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 159 | |
---|
[1320] | 160 | USE control_parameters, & |
---|
| 161 | ONLY: u_gtrans, v_gtrans |
---|
| 162 | |
---|
| 163 | USE grid_variables, & |
---|
| 164 | ONLY: ddx, ddy |
---|
| 165 | |
---|
| 166 | USE indices, & |
---|
[3538] | 167 | ONLY: nzb, nzt |
---|
[1320] | 168 | |
---|
| 169 | USE kinds |
---|
| 170 | |
---|
| 171 | |
---|
[1] | 172 | IMPLICIT NONE |
---|
| 173 | |
---|
[3547] | 174 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 175 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 176 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
[1320] | 177 | |
---|
[3547] | 178 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 179 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 180 | |
---|
| 181 | |
---|
[1353] | 182 | gu = 2.0_wp * u_gtrans |
---|
| 183 | gv = 2.0_wp * v_gtrans |
---|
[2232] | 184 | DO k = nzb+1, nzt |
---|
[1353] | 185 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 186 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 187 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 188 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 189 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 190 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 191 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 192 | * ddzw(k) & |
---|
[3538] | 193 | ) |
---|
[1] | 194 | ENDDO |
---|
| 195 | |
---|
| 196 | END SUBROUTINE advec_v_pw_ij |
---|
| 197 | |
---|
| 198 | END MODULE advec_v_pw_mod |
---|
| 199 | |
---|