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

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

leapfrog timestep scheme and upstream-spline advection scheme completely removed from the code,
reading of dt_fixed from restart file removed

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1 SUBROUTINE init_advec
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! -----------------
6! all actions concerning upstream-spline-method removed
7!
8! Former revisions:
9! -----------------
10! $Id: init_advec.f90 484 2010-02-05 07:36:54Z raasch
11! RCS Log replace by Id keyword, revision history cleaned up
12!
13! Revision 1.6  2004/04/30 11:59:31  raasch
14! impulse_advec renamed momentum_advec
15!
16! Revision 1.1  1999/02/05 09:07:38  raasch
17! Initial revision
18!
19!
20! Description:
21! ------------
22! Initialize constant coefficients and parameters for certain advection schemes.
23!------------------------------------------------------------------------------!
24
25    USE advection
26    USE arrays_3d
27    USE indices
28    USE control_parameters
29
30    IMPLICIT NONE
31
32    INTEGER :: i, intervals, j, k
33    REAL    :: delt, dn, dnneu, ex1, ex2, ex3, ex4, ex5, ex6, spl_alpha, &
34               spl_beta, sterm
35    REAL, DIMENSION(:), ALLOCATABLE ::  spl_u, temp
36
37
38    IF ( scalar_advec == 'bc-scheme' )  THEN
39
40!
41!--    Compute exponential coefficients for the Bott-Chlond scheme
42       intervals = 1000
43       ALLOCATE( aex(intervals), bex(intervals), dex(intervals), eex(intervals) )
44
45       delt  = 1.0 / REAL( intervals )
46       sterm = delt * 0.5
47
48       DO  i = 1, intervals
49
50          IF ( sterm > 0.5 )  THEN
51             dn = -5.0
52          ELSE
53             dn = 5.0
54          ENDIF
55
56          DO  j = 1, 15
57             ex1 = dn * EXP( -dn ) - EXP( 0.5 * dn ) + EXP( -0.5 * dn )
58             ex2 = EXP( dn ) - EXP( -dn )
59             ex3 = EXP( -dn ) * ( 1.0 - dn ) - 0.5 * EXP(  0.5 * dn ) &
60                                             - 0.5 * EXP( -0.5 * dn )
61             ex4 = EXP( dn ) + EXP( -dn )
62             ex5 = dn * sterm + ex1 / ex2
63             ex6 = sterm + ( ex3 * ex2 - ex4 * ex1 ) / ( ex2 * ex2 )
64             dnneu = dn - ex5 / ex6
65             dn  = dnneu
66          ENDDO
67
68          IF ( sterm < 0.5 )  dn = MAX(  2.95E-2, dn )
69          IF ( sterm > 0.5 )  dn = MIN( -2.95E-2, dn )
70          ex1 = EXP( -dn )
71          ex2 = EXP( dn ) - ex1
72          aex(i) = -ex1 / ex2
73          bex(i) = 1.0 / ex2
74          dex(i) = dn
75          eex(i) = EXP( dex(i) * 0.5 )
76          sterm = sterm + delt
77
78       ENDDO
79
80    ENDIF
81
82 END SUBROUTINE init_advec
Note: See TracBrowser for help on using the repository browser.