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

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1!> @file advec_u_pw.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
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.
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-2016 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! Forced header and separation lines into 80 columns
23!
24! Former revisions:
25! -----------------
26! $Id: advec_u_pw.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1873 2016-04-18 14:50:06Z maronga
29! Module renamed (removed _mod)
30!
31!
32! 1850 2016-04-08 13:29:27Z maronga
33! Module renamed
34!
35!
36! 1682 2015-10-07 23:56:08Z knoop
37! Code annotations made doxygen readable
38!
39! 1353 2014-04-08 15:21:23Z heinze
40! REAL constants provided with KIND-attribute
41!
42! 1320 2014-03-20 08:40:49Z raasch
43! ONLY-attribute added to USE-statements,
44! kind-parameters added to all INTEGER and REAL declaration statements,
45! kinds are defined in new module kinds,
46! revision history before 2012 removed,
47! comment fields (!:) to be used for variable explanations added to
48! all variable declaration statements
49!
50! 1036 2012-10-22 13:43:42Z raasch
51! code put under GPL (PALM 3.9)
52!
53! Revision 1.1  1997/08/11 06:09:21  raasch
54! Initial revision
55!
56!
57! Description:
58! ------------
59!> Advection term for u velocity-component using Piacsek and Williams.
60!> Vertical advection at the first grid point above the surface is done with
61!> normal centred differences, because otherwise no information from the surface
62!> would be communicated upwards due to w=0 at K=nzb.
63!------------------------------------------------------------------------------!
64 MODULE advec_u_pw_mod
65 
66
67    PRIVATE
68    PUBLIC advec_u_pw
69
70    INTERFACE advec_u_pw
71       MODULE PROCEDURE advec_u_pw
72       MODULE PROCEDURE advec_u_pw_ij
73    END INTERFACE advec_u_pw
74 
75 CONTAINS
76
77
78!------------------------------------------------------------------------------!
79! Description:
80! ------------
81!> Call for all grid points
82!------------------------------------------------------------------------------!
83    SUBROUTINE advec_u_pw
84
85       USE arrays_3d,                                                          &
86           ONLY:  ddzw, tend, u, v, w
87
88       USE control_parameters,                                                 &
89           ONLY:  u_gtrans, v_gtrans
90
91       USE grid_variables,                                                     &
92           ONLY:  ddx, ddy
93
94       USE indices,                                                            &
95           ONLY:  nxlu, nxr, nyn, nys, nzb_u_inner, nzt
96
97       USE kinds
98
99
100       IMPLICIT NONE
101
102       INTEGER(iwp) ::  i !<
103       INTEGER(iwp) ::  j !<
104       INTEGER(iwp) ::  k !<
105       
106       REAL(wp)    ::  gu !<
107       REAL(wp)    ::  gv !<
108 
109       gu = 2.0_wp * u_gtrans
110       gv = 2.0_wp * v_gtrans
111       DO  i = nxlu, nxr
112          DO  j = nys, nyn
113             DO  k = nzb_u_inner(j,i)+1, nzt
114                tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                        &
115                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
116                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
117                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
118                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
119                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
120                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
121                                                                  * ddzw(k)    &
122                                                      )
123             ENDDO
124          ENDDO
125       ENDDO
126
127    END SUBROUTINE advec_u_pw
128
129
130!------------------------------------------------------------------------------!
131! Description:
132! ------------
133!> Call for grid point i,j
134!------------------------------------------------------------------------------!
135    SUBROUTINE advec_u_pw_ij( i, j )
136
137       USE arrays_3d,                                                          &
138           ONLY:  ddzw, tend, u, v, w
139
140       USE control_parameters,                                                 &
141           ONLY:  u_gtrans, v_gtrans
142
143       USE grid_variables,                                                     &
144           ONLY:  ddx, ddy
145
146       USE indices,                                                            &
147           ONLY:  nzb_u_inner, nzt
148
149       USE kinds
150
151
152       IMPLICIT NONE
153
154       INTEGER(iwp) ::  i !<
155       INTEGER(iwp) ::  j !<
156       INTEGER(iwp) ::  k !<
157       
158       REAL(wp)    ::  gu !<
159       REAL(wp)    ::  gv !<
160
161       gu = 2.0_wp * u_gtrans
162       gv = 2.0_wp * v_gtrans
163       DO  k = nzb_u_inner(j,i)+1, nzt
164          tend(k,j,i) = tend(k,j,i) - 0.25_wp * (                              &
165                         ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu )         &
166                         - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx &
167                       + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv )     &
168                         - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy &
169                       + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) )              &
170                         - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) )        &
171                                                                  * ddzw(k)    &
172                                                )
173       ENDDO
174
175    END SUBROUTINE advec_u_pw_ij
176
177 END MODULE advec_u_pw_mod
Note: See TracBrowser for help on using the repository browser.