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