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

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

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

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