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
RevLine 
[1873]1!> @file advec_w_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_w_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 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.
[1]36!------------------------------------------------------------------------------!
[1682]37 MODULE advec_w_pw_mod
38 
[1]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!------------------------------------------------------------------------------!
[1682]52! Description:
53! ------------
54!> Call for all grid points
[1]55!------------------------------------------------------------------------------!
56    SUBROUTINE advec_w_pw
57
[1320]58       USE arrays_3d,                                                          &
59           ONLY:  ddzu, 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:  nxl, 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
82 
[1353]83       gu = 2.0_wp * u_gtrans
84       gv = 2.0_wp * v_gtrans
[1]85       DO  i = nxl, nxr
86          DO  j = nys, nyn
[2232]87             DO  k = nzb+1, nzt
[1353]88                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
[1]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)  &
[3538]96                                                      )
[1]97             ENDDO
98          ENDDO
99       ENDDO
100
101    END SUBROUTINE advec_w_pw
102
103
104!------------------------------------------------------------------------------!
[1682]105! Description:
106! ------------
107!> Call for grid point i,j
[1]108!------------------------------------------------------------------------------!
109    SUBROUTINE advec_w_pw_ij( i, j )
110
[1320]111       USE arrays_3d,                                                          &
112           ONLY:  ddzu, tend, u, v, w
[1]113
[1320]114       USE control_parameters,                                                 &
115           ONLY:  u_gtrans, v_gtrans
116
117       USE grid_variables,                                                     &
118           ONLY:  ddx, ddy
119
120       USE indices,                                                            &
[3538]121           ONLY:  nzb, nzt
[1320]122
123       USE kinds
124
125
[1]126       IMPLICIT NONE
127
[3547]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
[1320]131       
[3547]132       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
133       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
[1]134
[1353]135       gu = 2.0_wp * u_gtrans
136       gv = 2.0_wp * v_gtrans
[2232]137       DO  k = nzb+1, nzt
[1353]138          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
[1]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)  &
[3538]146                                                )
[1]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.