[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 | ! |
---|
[2718] | 18 | ! Copyright 1997-2018 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 3538 2018-11-20 10:55:41Z suehring $ |
---|
[3538] | 28 | ! Remove unnecessary double-masking of topography |
---|
| 29 | ! |
---|
| 30 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 31 | ! Corrected "Former revisions" section |
---|
| 32 | ! |
---|
| 33 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 34 | ! Change in file header (GPL part) |
---|
[1321] | 35 | ! |
---|
[2716] | 36 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
| 37 | ! |
---|
[2233] | 38 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 39 | ! topography representation via flags |
---|
| 40 | ! |
---|
[2001] | 41 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 42 | ! Forced header and separation lines into 80 columns |
---|
| 43 | ! |
---|
[1874] | 44 | ! 1873 2016-04-18 14:50:06Z maronga |
---|
| 45 | ! Module renamed (removed _mod) |
---|
| 46 | ! |
---|
| 47 | ! |
---|
[1851] | 48 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
| 49 | ! Module renamed |
---|
| 50 | ! |
---|
| 51 | ! |
---|
[1683] | 52 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 53 | ! Code annotations made doxygen readable |
---|
| 54 | ! |
---|
[1354] | 55 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 56 | ! REAL constants provided with KIND-attribute |
---|
| 57 | ! |
---|
[1321] | 58 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 59 | ! ONLY-attribute added to USE-statements, |
---|
| 60 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 61 | ! kinds are defined in new module kinds, |
---|
| 62 | ! revision history before 2012 removed, |
---|
| 63 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 64 | ! all variable declaration statements |
---|
[1] | 65 | ! |
---|
[1037] | 66 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 67 | ! code put under GPL (PALM 3.9) |
---|
| 68 | ! |
---|
[1] | 69 | ! Revision 1.1 1997/08/11 06:09:57 raasch |
---|
| 70 | ! Initial revision |
---|
| 71 | ! |
---|
| 72 | ! |
---|
| 73 | ! Description: |
---|
| 74 | ! ------------ |
---|
[1682] | 75 | !> Advection term for v velocity-component using Piacsek and Williams. |
---|
| 76 | !> Vertical advection at the first grid point above the surface is done with |
---|
| 77 | !> normal centred differences, because otherwise no information from the surface |
---|
| 78 | !> would be communicated upwards due to w=0 at K=nzb. |
---|
[1] | 79 | !------------------------------------------------------------------------------! |
---|
[1682] | 80 | MODULE advec_v_pw_mod |
---|
| 81 | |
---|
[1] | 82 | |
---|
| 83 | PRIVATE |
---|
| 84 | PUBLIC advec_v_pw |
---|
| 85 | |
---|
| 86 | INTERFACE advec_v_pw |
---|
| 87 | MODULE PROCEDURE advec_v_pw |
---|
| 88 | MODULE PROCEDURE advec_v_pw_ij |
---|
| 89 | END INTERFACE advec_v_pw |
---|
| 90 | |
---|
| 91 | CONTAINS |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | !------------------------------------------------------------------------------! |
---|
[1682] | 95 | ! Description: |
---|
| 96 | ! ------------ |
---|
| 97 | !> Call for all grid points |
---|
[1] | 98 | !------------------------------------------------------------------------------! |
---|
| 99 | SUBROUTINE advec_v_pw |
---|
| 100 | |
---|
[1320] | 101 | USE arrays_3d, & |
---|
| 102 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 103 | |
---|
[1320] | 104 | USE control_parameters, & |
---|
| 105 | ONLY: u_gtrans, v_gtrans |
---|
| 106 | |
---|
| 107 | USE grid_variables, & |
---|
| 108 | ONLY: ddx, ddy |
---|
| 109 | |
---|
| 110 | USE indices, & |
---|
[3538] | 111 | ONLY: nxl, nxr, nyn, nysv, nzb, nzt |
---|
[1320] | 112 | |
---|
| 113 | USE kinds |
---|
| 114 | |
---|
| 115 | |
---|
[1] | 116 | IMPLICIT NONE |
---|
| 117 | |
---|
[1682] | 118 | INTEGER(iwp) :: i !< |
---|
| 119 | INTEGER(iwp) :: j !< |
---|
| 120 | INTEGER(iwp) :: k !< |
---|
[1320] | 121 | |
---|
[1682] | 122 | REAL(wp) :: gu !< |
---|
| 123 | REAL(wp) :: gv !< |
---|
[1] | 124 | |
---|
| 125 | |
---|
[1353] | 126 | gu = 2.0_wp * u_gtrans |
---|
| 127 | gv = 2.0_wp * v_gtrans |
---|
[1] | 128 | DO i = nxl, nxr |
---|
[106] | 129 | DO j = nysv, nyn |
---|
[2232] | 130 | DO k = nzb+1, nzt |
---|
[1353] | 131 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 132 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 133 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 134 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 135 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 136 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 137 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 138 | * ddzw(k) & |
---|
[3538] | 139 | ) |
---|
[1] | 140 | ENDDO |
---|
| 141 | ENDDO |
---|
| 142 | ENDDO |
---|
| 143 | |
---|
| 144 | END SUBROUTINE advec_v_pw |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | !------------------------------------------------------------------------------! |
---|
[1682] | 148 | ! Description: |
---|
| 149 | ! ------------ |
---|
| 150 | !> Call for grid point i,j |
---|
[1] | 151 | !------------------------------------------------------------------------------! |
---|
| 152 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
| 153 | |
---|
[1320] | 154 | USE arrays_3d, & |
---|
| 155 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 156 | |
---|
[1320] | 157 | USE control_parameters, & |
---|
| 158 | ONLY: u_gtrans, v_gtrans |
---|
| 159 | |
---|
| 160 | USE grid_variables, & |
---|
| 161 | ONLY: ddx, ddy |
---|
| 162 | |
---|
| 163 | USE indices, & |
---|
[3538] | 164 | ONLY: nzb, nzt |
---|
[1320] | 165 | |
---|
| 166 | USE kinds |
---|
| 167 | |
---|
| 168 | |
---|
[1] | 169 | IMPLICIT NONE |
---|
| 170 | |
---|
[1682] | 171 | INTEGER(iwp) :: i !< |
---|
| 172 | INTEGER(iwp) :: j !< |
---|
| 173 | INTEGER(iwp) :: k !< |
---|
[1320] | 174 | |
---|
[1682] | 175 | REAL(wp) :: gu !< |
---|
| 176 | REAL(wp) :: gv !< |
---|
[1] | 177 | |
---|
| 178 | |
---|
[1353] | 179 | gu = 2.0_wp * u_gtrans |
---|
| 180 | gv = 2.0_wp * v_gtrans |
---|
[2232] | 181 | DO k = nzb+1, nzt |
---|
[1353] | 182 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
[1] | 183 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 184 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 185 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 186 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 187 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 188 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 189 | * ddzw(k) & |
---|
[3538] | 190 | ) |
---|
[1] | 191 | ENDDO |
---|
| 192 | |
---|
| 193 | END SUBROUTINE advec_v_pw_ij |
---|
| 194 | |
---|
| 195 | END MODULE advec_v_pw_mod |
---|
| 196 | |
---|