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