source: palm/trunk/SOURCE/advec_v_pw.f90 @ 1036

Last change on this file since 1036 was 1036, checked in by raasch, 9 years ago

code has been put under the GNU General Public License (v3)

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1 MODULE advec_v_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_v_pw.f90 1036 2012-10-22 13:43:42Z raasch $
27!
28! 106 2007-08-16 14:30:26Z raasch
29! j loop is starting from nysv (needed for non-cyclic boundary conditions)
30!
31! 75 2007-03-22 09:54:05Z raasch
32! vynp eliminated
33!
34! RCS Log replace by Id keyword, revision history cleaned up
35!
36! Revision 1.15  2006/02/23 09:46:08  raasch
37! nzb_2d replaced by nzb_v_inner
38!
39! Revision 1.1  1997/08/11 06:09:57  raasch
40! Initial revision
41!
42!
43! Description:
44! ------------
45! Advection term for v velocity-component using Piacsek and Williams.
46! Vertical advection at the first grid point above the surface is done with
47! normal centred differences, because otherwise no information from the surface
48! would be communicated upwards due to w=0 at K=nzb.
49!------------------------------------------------------------------------------!
50
51    PRIVATE
52    PUBLIC advec_v_pw
53
54    INTERFACE advec_v_pw
55       MODULE PROCEDURE advec_v_pw
56       MODULE PROCEDURE advec_v_pw_ij
57    END INTERFACE advec_v_pw
58 
59 CONTAINS
60
61
62!------------------------------------------------------------------------------!
63! Call for all grid points
64!------------------------------------------------------------------------------!
65    SUBROUTINE advec_v_pw
66
67       USE arrays_3d
68       USE control_parameters
69       USE grid_variables
70       USE indices
71
72       IMPLICIT NONE
73
74       INTEGER ::  i, j, k
75       REAL    ::  gu, gv
76 
77
78       gu = 2.0 * u_gtrans
79       gv = 2.0 * v_gtrans
80       DO  i = nxl, nxr
81          DO  j = nysv, nyn
82             DO  k = nzb_v_inner(j,i)+1, nzt
83                tend(k,j,i) = tend(k,j,i) - 0.25 * (                           &
84                         ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu )     &
85                         - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx &
86                       + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv )         &
87                         - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy &
88                       + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) )              &
89                         - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) )        &
90                                                                  * ddzw(k)    &
91                                                   )
92             ENDDO
93          ENDDO
94       ENDDO
95
96    END SUBROUTINE advec_v_pw
97
98
99!------------------------------------------------------------------------------!
100! Call for grid point i,j
101!------------------------------------------------------------------------------!
102    SUBROUTINE advec_v_pw_ij( i, j )
103
104       USE arrays_3d
105       USE control_parameters
106       USE grid_variables
107       USE indices
108
109       IMPLICIT NONE
110
111       INTEGER ::  i, j, k
112       REAL    ::  gu, gv
113
114
115       gu = 2.0 * u_gtrans
116       gv = 2.0 * v_gtrans
117       DO  k = nzb_v_inner(j,i)+1, nzt
118          tend(k,j,i) = tend(k,j,i) - 0.25 * (                              &
119                         ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu )     &
120                         - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx &
121                       + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv )         &
122                         - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy &
123                       + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) )              &
124                         - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) )        &
125                                                                  * ddzw(k)    &
126                                             )
127       ENDDO
128 
129    END SUBROUTINE advec_v_pw_ij
130
131 END MODULE advec_v_pw_mod
132 
Note: See TracBrowser for help on using the repository browser.