source: palm/trunk/SOURCE/advec_w_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_w_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_w_pw.f90 4180 2019-08-21 14:37:54Z scharf $
27! variables documented
28!
29!
30! Description:
31! ------------
32!> Advection term for w 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_w_pw_mod
38 
39
40    PRIVATE
41    PUBLIC advec_w_pw
42
43    INTERFACE advec_w_pw
44       MODULE PROCEDURE advec_w_pw
45       MODULE PROCEDURE advec_w_pw_ij
46    END INTERFACE advec_w_pw
47 
48 CONTAINS
49
50
51!------------------------------------------------------------------------------!
52! Description:
53! ------------
54!> Call for all grid points
55!------------------------------------------------------------------------------!
56    SUBROUTINE advec_w_pw
57
58       USE arrays_3d,                                                          &
59           ONLY:  ddzu, 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:  nxl, 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 
83       gu = 2.0_wp * u_gtrans
84       gv = 2.0_wp * v_gtrans
85       DO  i = nxl, nxr
86          DO  j = nys, nyn
87             DO  k = nzb+1, nzt
88                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
89                         ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu )     &
90                         - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx &
91                       + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv )     &
92                         - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy &
93                       + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) )              &
94                         - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) )            &
95                                                                  * ddzu(k+1)  &
96                                                      )
97             ENDDO
98          ENDDO
99       ENDDO
100
101    END SUBROUTINE advec_w_pw
102
103
104!------------------------------------------------------------------------------!
105! Description:
106! ------------
107!> Call for grid point i,j
108!------------------------------------------------------------------------------!
109    SUBROUTINE advec_w_pw_ij( i, j )
110
111       USE arrays_3d,                                                          &
112           ONLY:  ddzu, tend, u, v, w
113
114       USE control_parameters,                                                 &
115           ONLY:  u_gtrans, v_gtrans
116
117       USE grid_variables,                                                     &
118           ONLY:  ddx, ddy
119
120       USE indices,                                                            &
121           ONLY:  nzb, nzt
122
123       USE kinds
124
125
126       IMPLICIT NONE
127
128       INTEGER(iwp) ::  i !< grid index along x-direction
129       INTEGER(iwp) ::  j !< grid index along y-direction
130       INTEGER(iwp) ::  k !< grid index along z-direction
131       
132       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
133       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
134
135       gu = 2.0_wp * u_gtrans
136       gv = 2.0_wp * v_gtrans
137       DO  k = nzb+1, nzt
138          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
139                         ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu )     &
140                         - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx &
141                       + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv )     &
142                         - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy &
143                       + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) )              &
144                         - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) )            &
145                                                                  * ddzu(k+1)  &
146                                                )
147       ENDDO
148    END SUBROUTINE advec_w_pw_ij
149
150 END MODULE advec_w_pw_mod
Note: See TracBrowser for help on using the repository browser.