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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 147 - (hide annotations)
Wed Jun 17 14:20:14 2015 UTC (8 years, 10 months ago) by guez
File size: 1166 byte(s)
In procedure fxhyp, instead of computing twice the integral of F,
store it the first time: ffdx becomes an array and we do not need xxpr
any longer. The storage is the same, there is less computation.

In procedure grid_noro, instead of storing the non-smoothed orography
in a temporary array zmea0, compute zphi earlier.

1 guez 120 module coefpoly_m
2 guez 3
3 guez 81 IMPLICIT NONE
4 guez 3
5 guez 120 contains
6 guez 3
7 guez 146 SUBROUTINE coefpoly(y1, y2, yp1, yp2, x1, x2, a0, a1, a2, a3)
8 guez 3
9 guez 121 ! From LMDZ4/libf/dyn3d/coefpoly.F, version 1.1.1.1 2004/05/19 12:53:05
10 guez 3
11 guez 121 ! Author: P. Le Van
12 guez 3
13 guez 145 ! Calcul des coefficients a0, a1, a2, a3 du polynôme de degré 3
14 guez 146 ! qui passe par les points (x1, Y1) et (x2, Y2) avec les
15     ! dérivées yp1 et yp2. Système linéaire de 4 équations à 4
16 guez 145 ! inconnues :
17 guez 3
18 guez 146 ! a0 + a1 * x1 + a2 * x1**2 + a3 * x1**3 = Y1
19     ! a0 + a1 * x2 + a2 * x2**2 + a3 * x2**3 = Y2
20     ! a1 + 2 * a2 * x1 + 3 * a3 * x1**2 = Yp1
21     ! a1 + 2 * a2 * x2 + 3 * a3 * x2**2 = Yp2
22 guez 3
23 guez 146 DOUBLE PRECISION, intent(in):: y1, y2, yp1, yp2, x1, x2
24 guez 120 DOUBLE PRECISION, intent(out):: a0, a1, a2, a3
25 guez 81
26 guez 120 ! Local:
27 guez 146 DOUBLE PRECISION x1car, x2car
28 guez 81
29 guez 120 !------------------------------------------------------------
30 guez 81
31 guez 146 x1car = x1 * x1
32     x2car = x2 * x2
33 guez 81
34 guez 146 a3 = (2d0 * (y2-y1)/(x1-x2)+yp1+yp2)/((x1-x2) * (x1-x2))
35     a2 = (yp1-yp2+3d0 * a3 * (x2car-x1car))/(2d0 * (x1-x2))
36 guez 120
37 guez 146 a1 = yp1 - 3d0 * a3 * x1car - 2d0 * a2 * x1
38     a0 = y1 - a3 * x1 * x1car - a2 * x1car - a1 * x1
39 guez 120
40     END SUBROUTINE coefpoly
41    
42     end module coefpoly_m

  ViewVC Help
Powered by ViewVC 1.1.21