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