source: palm/trunk/SOURCE/advec_u_pw.f90 @ 4180

Last change on this file since 4180 was 4180, checked in by scharf, 5 years ago

removed comments in 'Former revisions' section that are older than 01.01.2019

  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1!> @file advec_u_pw.f90
2!------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
4!
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.
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!
17! Copyright 1997-2019 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: advec_u_pw.f90 4180 2019-08-21 14:37:54Z scharf $
27! variables documented
28!
29!
30! Description:
31! ------------
32!> Advection term for u velocity-component using Piacsek and Williams.
33!> Vertical advection at the first grid point above the surface is done with
34!> normal centred differences, because otherwise no information from the surface
35!> would be communicated upwards due to w=0 at K=nzb.
36!------------------------------------------------------------------------------!
37 MODULE advec_u_pw_mod
38 
39
40    PRIVATE
41    PUBLIC advec_u_pw
42
43    INTERFACE advec_u_pw
44       MODULE PROCEDURE advec_u_pw
45       MODULE PROCEDURE advec_u_pw_ij
46    END INTERFACE advec_u_pw
47 
48 CONTAINS
49
50
51!------------------------------------------------------------------------------!
52! Description:
53! ------------
54!> Call for all grid points
55!------------------------------------------------------------------------------!
56    SUBROUTINE advec_u_pw
57
58       USE arrays_3d,                                                          &
59           ONLY:  ddzw, tend, u, v, w
60
61       USE control_parameters,                                                 &
62           ONLY:  u_gtrans, v_gtrans
63
64       USE grid_variables,                                                     &
65           ONLY:  ddx, ddy
66
67       USE indices,                                                            &
68           ONLY:  nxlu, nxr, nyn, nys, nzb, nzt
69
70       USE kinds
71
72
73       IMPLICIT NONE
74
75       INTEGER(iwp) ::  i !< grid index along x-direction
76       INTEGER(iwp) ::  j !< grid index along y-direction
77       INTEGER(iwp) ::  k !< grid index along z-direction
78       
79       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
80       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
81 
82       gu = 2.0_wp * u_gtrans
83       gv = 2.0_wp * v_gtrans
84       DO  i = nxlu, nxr
85          DO  j = nys, nyn
86             DO  k = nzb+1, nzt
87                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
88                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
89                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
90                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
91                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
92                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
93                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
94                                                                  * ddzw(k)    &
95                                                      )
96             ENDDO
97          ENDDO
98       ENDDO
99
100    END SUBROUTINE advec_u_pw
101
102
103!------------------------------------------------------------------------------!
104! Description:
105! ------------
106!> Call for grid point i,j
107!------------------------------------------------------------------------------!
108    SUBROUTINE advec_u_pw_ij( i, j )
109
110       USE arrays_3d,                                                          &
111           ONLY:  ddzw, tend, u, v, w
112
113       USE control_parameters,                                                 &
114           ONLY:  u_gtrans, v_gtrans
115
116       USE grid_variables,                                                     &
117           ONLY:  ddx, ddy
118
119       USE indices,                                                            &
120           ONLY:  nzb, nzt
121
122       USE kinds
123
124
125       IMPLICIT NONE
126
127       INTEGER(iwp) ::  i !< grid index along x-direction
128       INTEGER(iwp) ::  j !< grid index along y-direction
129       INTEGER(iwp) ::  k !< grid index along z-direction
130       
131       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
132       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
133
134       gu = 2.0_wp * u_gtrans
135       gv = 2.0_wp * v_gtrans
136       DO  k = nzb+1, nzt
137          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
138                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
139                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
140                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
141                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
142                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
143                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
144                                                                  * ddzw(k)    &
145                                                )
146       ENDDO
147
148    END SUBROUTINE advec_u_pw_ij
149
150 END MODULE advec_u_pw_mod
Note: See TracBrowser for help on using the repository browser.