[1] | 1 | MODULE advec_v_pw_mod |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1321] | 22 | ! |
---|
| 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: advec_v_pw.f90 1321 2014-03-20 09:40:40Z heinze $ |
---|
| 27 | ! |
---|
| 28 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 29 | ! ONLY-attribute added to USE-statements, |
---|
| 30 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 31 | ! kinds are defined in new module kinds, |
---|
| 32 | ! revision history before 2012 removed, |
---|
| 33 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 34 | ! all variable declaration statements |
---|
[1] | 35 | ! |
---|
[1037] | 36 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 37 | ! code put under GPL (PALM 3.9) |
---|
| 38 | ! |
---|
[1] | 39 | ! Revision 1.1 1997/08/11 06:09:57 raasch |
---|
| 40 | ! Initial revision |
---|
| 41 | ! |
---|
| 42 | ! |
---|
| 43 | ! Description: |
---|
| 44 | ! ------------ |
---|
| 45 | ! Advection term for v velocity-component using Piacsek and Williams. |
---|
| 46 | ! Vertical advection at the first grid point above the surface is done with |
---|
| 47 | ! normal centred differences, because otherwise no information from the surface |
---|
| 48 | ! would be communicated upwards due to w=0 at K=nzb. |
---|
| 49 | !------------------------------------------------------------------------------! |
---|
| 50 | |
---|
| 51 | PRIVATE |
---|
| 52 | PUBLIC advec_v_pw |
---|
| 53 | |
---|
| 54 | INTERFACE advec_v_pw |
---|
| 55 | MODULE PROCEDURE advec_v_pw |
---|
| 56 | MODULE PROCEDURE advec_v_pw_ij |
---|
| 57 | END INTERFACE advec_v_pw |
---|
| 58 | |
---|
| 59 | CONTAINS |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | !------------------------------------------------------------------------------! |
---|
| 63 | ! Call for all grid points |
---|
| 64 | !------------------------------------------------------------------------------! |
---|
| 65 | SUBROUTINE advec_v_pw |
---|
| 66 | |
---|
[1320] | 67 | USE arrays_3d, & |
---|
| 68 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 69 | |
---|
[1320] | 70 | USE control_parameters, & |
---|
| 71 | ONLY: u_gtrans, v_gtrans |
---|
| 72 | |
---|
| 73 | USE grid_variables, & |
---|
| 74 | ONLY: ddx, ddy |
---|
| 75 | |
---|
| 76 | USE indices, & |
---|
| 77 | ONLY: nxl, nxr, nyn, nysv, nzb_v_inner, nzt |
---|
| 78 | |
---|
| 79 | USE kinds |
---|
| 80 | |
---|
| 81 | |
---|
[1] | 82 | IMPLICIT NONE |
---|
| 83 | |
---|
[1320] | 84 | INTEGER(iwp) :: i !: |
---|
| 85 | INTEGER(iwp) :: j !: |
---|
| 86 | INTEGER(iwp) :: k !: |
---|
| 87 | |
---|
| 88 | REAL(wp) :: gu !: |
---|
| 89 | REAL(wp) :: gv !: |
---|
[1] | 90 | |
---|
| 91 | |
---|
| 92 | gu = 2.0 * u_gtrans |
---|
| 93 | gv = 2.0 * v_gtrans |
---|
| 94 | DO i = nxl, nxr |
---|
[106] | 95 | DO j = nysv, nyn |
---|
[1] | 96 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
| 97 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
| 98 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 99 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 100 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 101 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 102 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 103 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 104 | * ddzw(k) & |
---|
| 105 | ) |
---|
| 106 | ENDDO |
---|
| 107 | ENDDO |
---|
| 108 | ENDDO |
---|
| 109 | |
---|
| 110 | END SUBROUTINE advec_v_pw |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | !------------------------------------------------------------------------------! |
---|
| 114 | ! Call for grid point i,j |
---|
| 115 | !------------------------------------------------------------------------------! |
---|
| 116 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
| 117 | |
---|
[1320] | 118 | USE arrays_3d, & |
---|
| 119 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 120 | |
---|
[1320] | 121 | USE control_parameters, & |
---|
| 122 | ONLY: u_gtrans, v_gtrans |
---|
| 123 | |
---|
| 124 | USE grid_variables, & |
---|
| 125 | ONLY: ddx, ddy |
---|
| 126 | |
---|
| 127 | USE indices, & |
---|
| 128 | ONLY: nzb_v_inner, nzt |
---|
| 129 | |
---|
| 130 | USE kinds |
---|
| 131 | |
---|
| 132 | |
---|
[1] | 133 | IMPLICIT NONE |
---|
| 134 | |
---|
[1320] | 135 | INTEGER(iwp) :: i !: |
---|
| 136 | INTEGER(iwp) :: j !: |
---|
| 137 | INTEGER(iwp) :: k !: |
---|
| 138 | |
---|
| 139 | REAL(wp) :: gu !: |
---|
| 140 | REAL(wp) :: gv !: |
---|
[1] | 141 | |
---|
| 142 | |
---|
| 143 | gu = 2.0 * u_gtrans |
---|
| 144 | gv = 2.0 * v_gtrans |
---|
| 145 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
[1320] | 146 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
[1] | 147 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 148 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 149 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 150 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 151 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 152 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
| 153 | * ddzw(k) & |
---|
| 154 | ) |
---|
| 155 | ENDDO |
---|
| 156 | |
---|
| 157 | END SUBROUTINE advec_v_pw_ij |
---|
| 158 | |
---|
| 159 | END MODULE advec_v_pw_mod |
---|
| 160 | |
---|