/[lmdze]/trunk/Sources/misc/coefpoly.f
ViewVC logotype

Contents of /trunk/Sources/misc/coefpoly.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (show annotations)
Wed Jan 28 16:10:02 2015 UTC (9 years, 3 months ago) by guez
Original Path: trunk/dyn3d/coefpoly.f
File size: 1402 byte(s)
In procedure fxhyp, extracted the body of the loop on ik into a new
procedure:  fxhyp_loop_ik.

dzoomx and dzoomy must now be fractions of the entire range, they
cannot be ranges in degrees or rad.

In fxhyp, force Xf(2 * nmax) = pi_d instead of possibly doing it in
fxhyp_loop_ik.

In fxhyp_loop_ik, when testing whether xvrai is between -pi and pi,
changed the boundaries from -pi - 0.1 to - pi_d - 1d-5 and from pi +
0.1 to pi_d + 1d-5. This reveals a misconception of the
code. Therefore, this version does not work.

1 module coefpoly_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)
8
9 ! From LMDZ4/libf/dyn3d/coefpoly.F, version 1.1.1.1 2004/05/19 12:53:05
10
11 ! Author: P. Le Van
12
13 ! Calcul des coefficients a0, a1, a2, a3 du polynôme de degré 3 qui
14 ! satisfait aux 4 équations suivantes :
15
16 ! a0 + a1 * xtild1 + a2 * xtild1**2 + a3 * xtild1**3 = Xf1
17 ! a0 + a1 * xtild2 + a2 * xtild2**2 + a3 * xtild2**3 = Xf2
18 ! a1 + 2. * a2 * xtild1 + 3. * a3 * xtild1**2 = Xprim1
19 ! a1 + 2. * a2 * xtild2 + 3. * a3 * xtild2**2 = Xprim2
20
21 ! On en revient à resoudre un système de 4 équations à 4 inconnues
22 ! a0, a1, a2, a3.
23
24 DOUBLE PRECISION, intent(in):: xf1, xf2, xprim1, xprim2, xtild1, xtild2
25 DOUBLE PRECISION, intent(out):: a0, a1, a2, a3
26
27 ! Local:
28 DOUBLE PRECISION xtil1car, xtil2car, derr, x1x2car
29
30 !------------------------------------------------------------
31
32 xtil1car = xtild1 * xtild1
33 xtil2car = xtild2 * xtild2
34
35 derr = 2. * (xf2-xf1)/(xtild1-xtild2)
36
37 x1x2car = (xtild1-xtild2) * (xtild1-xtild2)
38
39 a3 = (derr+xprim1+xprim2)/x1x2car
40 a2 = (xprim1-xprim2+3. * a3 * (xtil2car-xtil1car))/(2. * (xtild1-xtild2))
41
42 a1 = xprim1 - 3. * a3 * xtil1car - 2. * a2 * xtild1
43 a0 = xf1 - a3 * xtild1 * xtil1car - a2 * xtil1car - a1 * xtild1
44
45 END SUBROUTINE coefpoly
46
47 end module coefpoly_m

  ViewVC Help
Powered by ViewVC 1.1.21