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

Last change on this file since 4281 was 4182, checked in by scharf, 22 months ago
  • corrected "Former revisions" section
  • minor formatting in "Former revisions" section
  • added "Author" section
  • Property svn:keywords set to Id
File size: 5.6 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 4182 2019-08-22 15:20:23Z schwenkel $
[4182]27! Corrected "Former revisions" section
28!
29! 3655 2019-01-07 16:51:22Z knoop
[3547]30! variables documented
[1321]31!
[4182]32! Revision 1.1  1997/08/11 06:09:21  raasch
33! Initial revision
34!
35!
[1]36! Description:
37! ------------
[1682]38!> Advection term for u velocity-component using Piacsek and Williams.
39!> Vertical advection at the first grid point above the surface is done with
40!> normal centred differences, because otherwise no information from the surface
41!> would be communicated upwards due to w=0 at K=nzb.
[1]42!------------------------------------------------------------------------------!
[1682]43 MODULE advec_u_pw_mod
44 
[1]45
46    PRIVATE
47    PUBLIC advec_u_pw
48
49    INTERFACE advec_u_pw
50       MODULE PROCEDURE advec_u_pw
51       MODULE PROCEDURE advec_u_pw_ij
52    END INTERFACE advec_u_pw
53 
54 CONTAINS
55
56
57!------------------------------------------------------------------------------!
[1682]58! Description:
59! ------------
60!> Call for all grid points
[1]61!------------------------------------------------------------------------------!
62    SUBROUTINE advec_u_pw
63
[1320]64       USE arrays_3d,                                                          &
65           ONLY:  ddzw, tend, u, v, w
[1]66
[1320]67       USE control_parameters,                                                 &
68           ONLY:  u_gtrans, v_gtrans
69
70       USE grid_variables,                                                     &
71           ONLY:  ddx, ddy
72
73       USE indices,                                                            &
[3538]74           ONLY:  nxlu, nxr, nyn, nys, nzb, nzt
[1320]75
76       USE kinds
77
78
[1]79       IMPLICIT NONE
80
[3547]81       INTEGER(iwp) ::  i !< grid index along x-direction
82       INTEGER(iwp) ::  j !< grid index along y-direction
83       INTEGER(iwp) ::  k !< grid index along z-direction
[1320]84       
[3547]85       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
86       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
[1]87 
[1353]88       gu = 2.0_wp * u_gtrans
89       gv = 2.0_wp * v_gtrans
[106]90       DO  i = nxlu, nxr
[1]91          DO  j = nys, nyn
[2232]92             DO  k = nzb+1, nzt
[1353]93                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
[1]94                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
95                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
96                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
97                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
98                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
99                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
100                                                                  * ddzw(k)    &
[3538]101                                                      )
[1]102             ENDDO
103          ENDDO
104       ENDDO
105
106    END SUBROUTINE advec_u_pw
107
108
109!------------------------------------------------------------------------------!
[1682]110! Description:
111! ------------
112!> Call for grid point i,j
[1]113!------------------------------------------------------------------------------!
114    SUBROUTINE advec_u_pw_ij( i, j )
115
[1320]116       USE arrays_3d,                                                          &
117           ONLY:  ddzw, tend, u, v, w
[1]118
[1320]119       USE control_parameters,                                                 &
120           ONLY:  u_gtrans, v_gtrans
121
122       USE grid_variables,                                                     &
123           ONLY:  ddx, ddy
124
125       USE indices,                                                            &
[3538]126           ONLY:  nzb, nzt
[1320]127
128       USE kinds
129
130
[1]131       IMPLICIT NONE
132
[3547]133       INTEGER(iwp) ::  i !< grid index along x-direction
134       INTEGER(iwp) ::  j !< grid index along y-direction
135       INTEGER(iwp) ::  k !< grid index along z-direction
[1320]136       
[3547]137       REAL(wp)    ::  gu !< Galilei-transformation velocity along x
138       REAL(wp)    ::  gv !< Galilei-transformation velocity along y
[1]139
[1353]140       gu = 2.0_wp * u_gtrans
141       gv = 2.0_wp * v_gtrans
[2232]142       DO  k = nzb+1, nzt
[1353]143          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
[1]144                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
145                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
146                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
147                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
148                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
149                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
150                                                                  * ddzw(k)    &
[3538]151                                                )
[1]152       ENDDO
153
154    END SUBROUTINE advec_u_pw_ij
155
156 END MODULE advec_u_pw_mod
Note: See TracBrowser for help on using the repository browser.