[1873] | 1 | !> @file advec_v_pw.f90 |
---|
[4488] | 2 | !--------------------------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[4488] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
| 6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
| 7 | ! (at your option) any later version. |
---|
[1036] | 8 | ! |
---|
[4488] | 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
| 10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 11 | ! Public License for more details. |
---|
[1036] | 12 | ! |
---|
[4488] | 13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
| 14 | ! <http://www.gnu.org/licenses/>. |
---|
[1036] | 15 | ! |
---|
[4828] | 16 | ! Copyright 1997-2021 Leibniz Universitaet Hannover |
---|
[4488] | 17 | !--------------------------------------------------------------------------------------------------! |
---|
[1036] | 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1354] | 21 | ! |
---|
[2233] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: advec_v_pw.f90 4828 2021-01-05 11:21:41Z moh.hefny $ |
---|
[4488] | 26 | ! file re-formatted to follow the PALM coding standard |
---|
| 27 | ! |
---|
| 28 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
[4182] | 29 | ! Corrected "Former revisions" section |
---|
| 30 | ! |
---|
| 31 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[3547] | 32 | ! variables documented |
---|
[1321] | 33 | ! |
---|
[4182] | 34 | ! Revision 1.1 1997/08/11 06:09:57 raasch |
---|
| 35 | ! Initial revision |
---|
| 36 | ! |
---|
| 37 | ! |
---|
[1] | 38 | ! Description: |
---|
| 39 | ! ------------ |
---|
[1682] | 40 | !> Advection term for v velocity-component using Piacsek and Williams. |
---|
[4488] | 41 | !> Vertical advection at the first grid point above the surface is done with normal centred |
---|
| 42 | !> differences, because otherwise no information from the surface would be communicated upwards due |
---|
| 43 | !> to w=0 at K=nzb. |
---|
| 44 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 45 | MODULE advec_v_pw_mod |
---|
| 46 | |
---|
[1] | 47 | |
---|
| 48 | PRIVATE |
---|
| 49 | PUBLIC advec_v_pw |
---|
| 50 | |
---|
| 51 | INTERFACE advec_v_pw |
---|
| 52 | MODULE PROCEDURE advec_v_pw |
---|
| 53 | MODULE PROCEDURE advec_v_pw_ij |
---|
| 54 | END INTERFACE advec_v_pw |
---|
| 55 | |
---|
| 56 | CONTAINS |
---|
| 57 | |
---|
| 58 | |
---|
[4488] | 59 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 60 | ! Description: |
---|
| 61 | ! ------------ |
---|
| 62 | !> Call for all grid points |
---|
[4488] | 63 | !--------------------------------------------------------------------------------------------------! |
---|
| 64 | SUBROUTINE advec_v_pw |
---|
[1] | 65 | |
---|
[4488] | 66 | USE arrays_3d, & |
---|
| 67 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 68 | |
---|
[4488] | 69 | USE control_parameters, & |
---|
| 70 | ONLY: u_gtrans, v_gtrans |
---|
[1320] | 71 | |
---|
[4488] | 72 | USE grid_variables, & |
---|
| 73 | ONLY: ddx, ddy |
---|
[1320] | 74 | |
---|
[4488] | 75 | USE indices, & |
---|
| 76 | ONLY: nxl, nxr, nyn, nysv, nzb, nzt |
---|
[1320] | 77 | |
---|
[4488] | 78 | USE kinds |
---|
[1320] | 79 | |
---|
| 80 | |
---|
[4488] | 81 | IMPLICIT NONE |
---|
[1] | 82 | |
---|
[4488] | 83 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 84 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 85 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
| 86 | |
---|
| 87 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 88 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 89 | |
---|
[4488] | 90 | |
---|
| 91 | gu = 2.0_wp * u_gtrans |
---|
| 92 | gv = 2.0_wp * v_gtrans |
---|
| 93 | DO i = nxl, nxr |
---|
| 94 | DO j = nysv, nyn |
---|
| 95 | DO k = nzb+1, nzt |
---|
| 96 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
| 97 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
| 98 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
| 99 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
| 100 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
| 101 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
| 102 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) * ddzw(k) & |
---|
| 103 | ) |
---|
[1] | 104 | ENDDO |
---|
| 105 | ENDDO |
---|
[4488] | 106 | ENDDO |
---|
[1] | 107 | |
---|
[4488] | 108 | END SUBROUTINE advec_v_pw |
---|
[1] | 109 | |
---|
| 110 | |
---|
[4488] | 111 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 112 | ! Description: |
---|
| 113 | ! ------------ |
---|
| 114 | !> Call for grid point i,j |
---|
[4488] | 115 | !--------------------------------------------------------------------------------------------------! |
---|
| 116 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
[1] | 117 | |
---|
[4488] | 118 | USE arrays_3d, & |
---|
| 119 | ONLY: ddzw, tend, u, v, w |
---|
[1] | 120 | |
---|
[4488] | 121 | USE control_parameters, & |
---|
| 122 | ONLY: u_gtrans, v_gtrans |
---|
[1320] | 123 | |
---|
[4488] | 124 | USE grid_variables, & |
---|
| 125 | ONLY: ddx, ddy |
---|
[1320] | 126 | |
---|
[4488] | 127 | USE indices, & |
---|
| 128 | ONLY: nzb, nzt |
---|
[1320] | 129 | |
---|
[4488] | 130 | USE kinds |
---|
[1320] | 131 | |
---|
| 132 | |
---|
[4488] | 133 | IMPLICIT NONE |
---|
[1] | 134 | |
---|
[4488] | 135 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
| 136 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
| 137 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
| 138 | |
---|
| 139 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
| 140 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
[1] | 141 | |
---|
| 142 | |
---|
[4488] | 143 | gu = 2.0_wp * u_gtrans |
---|
| 144 | gv = 2.0_wp * v_gtrans |
---|
| 145 | DO k = nzb+1, nzt |
---|
| 146 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
| 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) ) ) * ddzw(k) & |
---|
| 153 | ) |
---|
| 154 | ENDDO |
---|
[1] | 155 | |
---|
[4488] | 156 | END SUBROUTINE advec_v_pw_ij |
---|
| 157 | |
---|
[1] | 158 | END MODULE advec_v_pw_mod |
---|
| 159 | |
---|