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