source: palm/trunk/SOURCE/init_advec.f90 @ 1274

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

last commit documented

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1 SUBROUTINE init_advec
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: init_advec.f90 1037 2012-10-22 14:10:22Z heinze $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 1003 2012-09-14 14:35:53Z raasch
32! obsolete variables removed
33!
34! 1001 2012-09-13 14:08:46Z raasch
35! all actions concerning upstream-spline-method removed
36!
37! RCS Log replace by Id keyword, revision history cleaned up
38!
39! Revision 1.6  2004/04/30 11:59:31  raasch
40! impulse_advec renamed momentum_advec
41!
42! Revision 1.1  1999/02/05 09:07:38  raasch
43! Initial revision
44!
45!
46! Description:
47! ------------
48! Initialize constant coefficients and parameters for certain advection schemes.
49!------------------------------------------------------------------------------!
50
51    USE advection
52    USE arrays_3d
53    USE indices
54    USE control_parameters
55
56    IMPLICIT NONE
57
58    INTEGER :: i, intervals, j
59    REAL    :: delt, dn, dnneu, ex1, ex2, ex3, ex4, ex5, ex6, sterm
60
61
62    IF ( scalar_advec == 'bc-scheme' )  THEN
63
64!
65!--    Compute exponential coefficients for the Bott-Chlond scheme
66       intervals = 1000
67       ALLOCATE( aex(intervals), bex(intervals), dex(intervals), eex(intervals) )
68
69       delt  = 1.0 / REAL( intervals )
70       sterm = delt * 0.5
71
72       DO  i = 1, intervals
73
74          IF ( sterm > 0.5 )  THEN
75             dn = -5.0
76          ELSE
77             dn = 5.0
78          ENDIF
79
80          DO  j = 1, 15
81             ex1 = dn * EXP( -dn ) - EXP( 0.5 * dn ) + EXP( -0.5 * dn )
82             ex2 = EXP( dn ) - EXP( -dn )
83             ex3 = EXP( -dn ) * ( 1.0 - dn ) - 0.5 * EXP(  0.5 * dn ) &
84                                             - 0.5 * EXP( -0.5 * dn )
85             ex4 = EXP( dn ) + EXP( -dn )
86             ex5 = dn * sterm + ex1 / ex2
87             ex6 = sterm + ( ex3 * ex2 - ex4 * ex1 ) / ( ex2 * ex2 )
88             dnneu = dn - ex5 / ex6
89             dn  = dnneu
90          ENDDO
91
92          IF ( sterm < 0.5 )  dn = MAX(  2.95E-2, dn )
93          IF ( sterm > 0.5 )  dn = MIN( -2.95E-2, dn )
94          ex1 = EXP( -dn )
95          ex2 = EXP( dn ) - ex1
96          aex(i) = -ex1 / ex2
97          bex(i) = 1.0 / ex2
98          dex(i) = dn
99          eex(i) = EXP( dex(i) * 0.5 )
100          sterm = sterm + delt
101
102       ENDDO
103
104    ENDIF
105
106 END SUBROUTINE init_advec
Note: See TracBrowser for help on using the repository browser.