12 |
! Calcule les longitudes et dérivées dans la grille du GCM pour |
! Calcule les longitudes et dérivées dans la grille du GCM pour |
13 |
! une fonction f(x) à dérivée tangente hyperbolique. |
! une fonction f(x) à dérivée tangente hyperbolique. |
14 |
|
|
15 |
! Il vaut mieux avoir : grossismx \times dzoom < pi |
! Il vaut mieux avoir : grossismx \times delta < pi |
16 |
|
|
17 |
! Le premier point scalaire pour une grille regulière (grossismx = |
! Le premier point scalaire pour une grille regulière (grossismx = |
18 |
! 1., taux = 0., clon = 0.) est à - 180 degrés. |
! 1., taux = 0., clon = 0.) est à - 180 degrés. |
29 |
|
|
30 |
! Local: |
! Local: |
31 |
real rlonm025(iim + 1), rlonp025(iim + 1), d_rlonv(iim) |
real rlonm025(iim + 1), rlonp025(iim + 1), d_rlonv(iim) |
32 |
REAL dzoom, step |
REAL delta, step |
33 |
DOUBLE PRECISION, dimension(0:nmax):: xtild, fhyp, G, Xf |
DOUBLE PRECISION, dimension(0:nmax):: xtild, fhyp, G, Xf, ffdx |
34 |
DOUBLE PRECISION ffdx, beta |
DOUBLE PRECISION beta |
35 |
INTEGER i, is2 |
INTEGER i, is2 |
36 |
DOUBLE PRECISION xxpr(nmax - 1), xmoy(nmax), fxm(nmax) |
DOUBLE PRECISION xmoy(nmax), fxm(nmax) |
37 |
|
|
38 |
!---------------------------------------------------------------------- |
!---------------------------------------------------------------------- |
39 |
|
|
40 |
print *, "Call sequence information: fxhyp" |
print *, "Call sequence information: fxhyp" |
41 |
|
|
42 |
test_grossismx: if (grossismx == 1.) then |
if (grossismx == 1.) then |
43 |
step = twopi / iim |
step = twopi / iim |
44 |
|
|
45 |
xprimm025(:iim) = step |
xprimm025(:iim) = step |
51 |
rlonm025(:iim) = rlonv(:iim) - 0.25 * step |
rlonm025(:iim) = rlonv(:iim) - 0.25 * step |
52 |
rlonp025(:iim) = rlonv(:iim) + 0.25 * step |
rlonp025(:iim) = rlonv(:iim) + 0.25 * step |
53 |
rlonu(:iim) = rlonv(:iim) + 0.5 * step |
rlonu(:iim) = rlonv(:iim) + 0.5 * step |
54 |
else test_grossismx |
else |
55 |
dzoom = dzoomx * twopi_d |
delta = dzoomx * twopi_d |
56 |
xtild = arth(0d0, pi_d / nmax, nmax + 1) |
xtild = arth(0d0, pi_d / nmax, nmax + 1) |
57 |
forall (i = 1:nmax) xmoy(i) = 0.5d0 * (xtild(i-1) + xtild(i)) |
forall (i = 1:nmax) xmoy(i) = 0.5d0 * (xtild(i-1) + xtild(i)) |
58 |
|
|
59 |
! Compute fhyp: |
! Compute fhyp: |
60 |
fhyp(1:nmax - 1) = tanh_cautious(taux * (dzoom / 2. & |
fhyp(1:nmax - 1) = tanh_cautious(taux * (delta / 2d0 & |
61 |
- xtild(1:nmax - 1)), xtild(1:nmax - 1) & |
- xtild(1:nmax - 1)), xtild(1:nmax - 1) & |
62 |
* (pi_d - xtild(1:nmax - 1))) |
* (pi_d - xtild(1:nmax - 1))) |
63 |
fhyp(0) = 1d0 |
fhyp(0) = 1d0 |
64 |
fhyp(nmax) = -1d0 |
fhyp(nmax) = -1d0 |
65 |
|
|
66 |
fxm = tanh_cautious(taux * (dzoom / 2. - xmoy), xmoy * (pi_d - xmoy)) |
fxm = tanh_cautious(taux * (delta / 2d0 - xmoy), xmoy * (pi_d - xmoy)) |
67 |
|
|
68 |
! Calcul de beta |
! Compute \int_0 ^{\tilde x} F: |
69 |
|
|
70 |
ffdx = 0. |
ffdx(0) = 0d0 |
71 |
|
|
72 |
DO i = 1, nmax |
DO i = 1, nmax |
73 |
ffdx = ffdx + fxm(i) * (xtild(i) - xtild(i-1)) |
ffdx(i) = ffdx(i - 1) + fxm(i) * (xtild(i) - xtild(i-1)) |
74 |
END DO |
END DO |
75 |
|
|
76 |
print *, "ffdx = ", ffdx |
print *, "ffdx(nmax) = ", ffdx(nmax) |
77 |
beta = (pi_d - grossismx * ffdx) / (pi_d - ffdx) |
beta = (pi_d - grossismx * ffdx(nmax)) / (pi_d - ffdx(nmax)) |
78 |
print *, "beta = ", beta |
print *, "beta = ", beta |
79 |
|
|
80 |
IF (2. * beta - grossismx <= 0.) THEN |
IF (2d0 * beta - grossismx <= 0d0) THEN |
81 |
print *, 'Bad choice of grossismx, taux, dzoomx.' |
print *, 'Bad choice of grossismx, taux, dzoomx.' |
82 |
print *, 'Decrease dzoomx or grossismx.' |
print *, 'Decrease dzoomx or grossismx.' |
83 |
STOP 1 |
STOP 1 |
85 |
|
|
86 |
G = beta + (grossismx - beta) * fhyp |
G = beta + (grossismx - beta) * fhyp |
87 |
|
|
88 |
! Calcul de Xf |
Xf(:nmax - 1) = beta * xtild(:nmax - 1) + (grossismx - beta) & |
89 |
|
* ffdx(:nmax - 1) |
|
xxpr = beta + (grossismx - beta) * fxm(:nmax - 1) |
|
|
Xf(0) = 0d0 |
|
|
|
|
|
DO i = 1, nmax - 1 |
|
|
Xf(i) = Xf(i-1) + xxpr(i) * (xtild(i) - xtild(i-1)) |
|
|
END DO |
|
|
|
|
90 |
Xf(nmax) = pi_d |
Xf(nmax) = pi_d |
91 |
|
|
92 |
call invert_zoom_x(xf, xtild, G, rlonm025(:iim), xprimm025(:iim), & |
call invert_zoom_x(xf, xtild, G, rlonm025(:iim), xprimm025(:iim), & |
95 |
call invert_zoom_x(xf, xtild, G, rlonu(:iim), xprimu(:iim), xuv = 0.5d0) |
call invert_zoom_x(xf, xtild, G, rlonu(:iim), xprimu(:iim), xuv = 0.5d0) |
96 |
call invert_zoom_x(xf, xtild, G, rlonp025(:iim), xprimp025(:iim), & |
call invert_zoom_x(xf, xtild, G, rlonp025(:iim), xprimp025(:iim), & |
97 |
xuv = 0.25d0) |
xuv = 0.25d0) |
98 |
end if test_grossismx |
end if |
99 |
|
|
100 |
is2 = 0 |
is2 = 0 |
101 |
|
|