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