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
RevLine 
[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!
[3655]17! Copyright 1997-2019 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 4180 2019-08-21 14:37:54Z scharf $
[3547]27! variables documented
28!
[1321]29!
[1]30! Description:
31! ------------
[1682]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.
[1]36!------------------------------------------------------------------------------!
[1682]37 MODULE advec_u_pw_mod
38 
[1]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!------------------------------------------------------------------------------!
[1682]52! Description:
53! ------------
54!> Call for all grid points
[1]55!------------------------------------------------------------------------------!
56    SUBROUTINE advec_u_pw
57
[1320]58       USE arrays_3d,                                                          &
59           ONLY:  ddzw, tend, u, v, w
[1]60
[1320]61       USE control_parameters,                                                 &
62           ONLY:  u_gtrans, v_gtrans
63
64       USE grid_variables,                                                     &
65           ONLY:  ddx, ddy
66
67       USE indices,                                                            &
[3538]68           ONLY:  nxlu, nxr, nyn, nys, nzb, nzt
[1320]69
70       USE kinds
71
72
[1]73       IMPLICIT NONE
74
[3547]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
[1320]78       
[3547]79       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
80       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
[1]81 
[1353]82       gu = 2.0_wp * u_gtrans
83       gv = 2.0_wp * v_gtrans
[106]84       DO  i = nxlu, nxr
[1]85          DO  j = nys, nyn
[2232]86             DO  k = nzb+1, nzt
[1353]87                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
[1]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)    &
[3538]95                                                      )
[1]96             ENDDO
97          ENDDO
98       ENDDO
99
100    END SUBROUTINE advec_u_pw
101
102
103!------------------------------------------------------------------------------!
[1682]104! Description:
105! ------------
106!> Call for grid point i,j
[1]107!------------------------------------------------------------------------------!
108    SUBROUTINE advec_u_pw_ij( i, j )
109
[1320]110       USE arrays_3d,                                                          &
111           ONLY:  ddzw, tend, u, v, w
[1]112
[1320]113       USE control_parameters,                                                 &
114           ONLY:  u_gtrans, v_gtrans
115
116       USE grid_variables,                                                     &
117           ONLY:  ddx, ddy
118
119       USE indices,                                                            &
[3538]120           ONLY:  nzb, nzt
[1320]121
122       USE kinds
123
124
[1]125       IMPLICIT NONE
126
[3547]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
[1320]130       
[3547]131       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
132       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
[1]133
[1353]134       gu = 2.0_wp * u_gtrans
135       gv = 2.0_wp * v_gtrans
[2232]136       DO  k = nzb+1, nzt
[1353]137          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
[1]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)    &
[3538]145                                                )
[1]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.