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

Last change on this file since 2 was 1, checked in by raasch, 18 years ago

Initial repository layout and content

File size: 4.5 KB
Line 
1 MODULE advec_u_pw_mod
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Log: advec_u_pw.f90,v $
11! Revision 1.15  2006/02/23 09:44:21  raasch
12! nzb_2d replaced by nzb_u_inner
13!
14! Revision 1.14  2005/03/26 14:49:31  raasch
15! Extension of horizontal loop upper bounds for non-cyclic boundary conditions
16!
17! Revision 1.13  2004/01/30 10:11:21  raasch
18! Scalar lower k index nzb replaced by 2d-array nzb_2d
19!
20! Revision 1.12  2003/03/12 16:17:06  raasch
21! Full code replaced in the call for all gridpoints instead of calling the
22! _ij version (required by NEC, because otherwise no vectorization)
23!
24! Revision 1.11  2002/06/11 12:25:00  raasch
25! Former subroutine changed to a module which allows to be called for all grid
26! points of a single vertical column with index i,j or for all grid points by
27! using function overloading.
28!
29! Revision 1.10  2001/03/29 17:34:21  raasch
30! Translation of remaining German identifiers (variables, subroutines, etc.)
31!
32! Revision 1.9  2001/01/22 04:55:36  raasch
33! Module test_variables removed
34!
35! Revision 1.8  2000/01/20 09:34:26  letzel
36! All comments translated into English
37!
38! Revision 1.7  1998/08/05 06:47:04  raasch
39! Alle Gitterpunkte gleich behandelt (keine zentralen Differenzenquotienten
40! mehr bei Vertikaladvektion bei k=1)
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 = nxl, nxr+uxrp
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.