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

Last change on this file since 1280 was 1037, checked in by raasch, 12 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1 MODULE advec_u_pw_mod
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: advec_u_pw.f90 1037 2012-10-22 14:10:22Z raasch $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 106 2007-08-16 14:30:26Z raasch
32! i loop is starting from nxlu (needed for non-cyclic boundary conditions)
33!
34! 75 2007-03-22 09:54:05Z raasch
35! uxrp eliminated
36!
37! RCS Log replace by Id keyword, revision history cleaned up
38!
39! Revision 1.15  2006/02/23 09:44:21  raasch
40! nzb_2d replaced by nzb_u_inner
41!
42! Revision 1.1  1997/08/11 06:09:21  raasch
43! Initial revision
44!
45!
46! Description:
47! ------------
48! Advection term for u velocity-component using Piacsek and Williams.
49! Vertical advection at the first grid point above the surface is done with
50! normal centred differences, because otherwise no information from the surface
51! would be communicated upwards due to w=0 at K=nzb.
52!------------------------------------------------------------------------------!
53
54    PRIVATE
55    PUBLIC advec_u_pw
56
57    INTERFACE advec_u_pw
58       MODULE PROCEDURE advec_u_pw
59       MODULE PROCEDURE advec_u_pw_ij
60    END INTERFACE advec_u_pw
61 
62 CONTAINS
63
64
65!------------------------------------------------------------------------------!
66! Call for all grid points
67!------------------------------------------------------------------------------!
68    SUBROUTINE advec_u_pw
69
70       USE arrays_3d
71       USE control_parameters
72       USE grid_variables
73       USE indices
74
75       IMPLICIT NONE
76
77       INTEGER ::  i, j, k
78       REAL    ::  gu, gv
79 
80       gu = 2.0 * u_gtrans
81       gv = 2.0 * v_gtrans
82       DO  i = nxlu, nxr
83          DO  j = nys, nyn
84             DO  k = nzb_u_inner(j,i)+1, nzt
85                tend(k,j,i) = tend(k,j,i) - 0.25 * (                           &
86                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
87                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
88                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
89                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
90                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
91                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
92                                                                  * ddzw(k)    &
93                                                   )
94             ENDDO
95          ENDDO
96       ENDDO
97
98    END SUBROUTINE advec_u_pw
99
100
101!------------------------------------------------------------------------------!
102! Call for grid point i,j
103!------------------------------------------------------------------------------!
104    SUBROUTINE advec_u_pw_ij( i, j )
105
106       USE arrays_3d
107       USE control_parameters
108       USE grid_variables
109       USE indices
110
111       IMPLICIT NONE
112
113       INTEGER ::  i, j, k
114       REAL    ::  gu, gv
115
116       gu = 2.0 * u_gtrans
117       gv = 2.0 * v_gtrans
118       DO  k = nzb_u_inner(j,i)+1, nzt
119          tend(k,j,i) = tend(k,j,i) - 0.25 * (                                 &
120                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
121                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
122                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
123                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
124                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
125                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
126                                                                  * ddzw(k)    &
127                                             )
128       ENDDO
129
130    END SUBROUTINE advec_u_pw_ij
131
132 END MODULE advec_u_pw_mod
Note: See TracBrowser for help on using the repository browser.