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