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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 120 by guez, Tue Jan 13 14:56:15 2015 UTC revision 121 by guez, Wed Jan 28 16:10:02 2015 UTC
# Line 6  contains Line 6  contains
6    
7    SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)    SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)
8    
9      ! From LMDZ4/libf/dyn3d/coefpoly.F,v 1.1.1.1 2004/05/19 12:53:05      ! From LMDZ4/libf/dyn3d/coefpoly.F, version 1.1.1.1 2004/05/19 12:53:05
10    
11      ! ...  Auteur :   P. Le Van  ...      ! Author: P. Le Van
12    
13      ! Calcul des coefficients a0, a1, a2, a3 du polynome de degre 3 qui      ! Calcul des coefficients a0, a1, a2, a3 du polynôme de degré 3 qui
14      ! satisfait aux 4 equations  suivantes :      ! satisfait aux 4 équations suivantes :
15    
16      ! a0 + a1*xtild1 + a2*xtild1*xtild1 + a3*xtild1*xtild1*xtild1 = Xf1      ! a0 + a1 * xtild1 + a2 * xtild1**2 + a3 * xtild1**3 = Xf1
17      ! a0 + a1*xtild2 + a2*xtild2*xtild2 + a3*xtild2*xtild2*xtild2 = Xf2      ! a0 + a1 * xtild2 + a2 * xtild2**2 + a3 * xtild2**3 = Xf2
18      ! a1  +     2.*a2*xtild1 +     3.*a3*xtild1*xtild1 = Xprim1      ! a1 + 2. * a2 * xtild1 + 3. * a3 * xtild1**2 = Xprim1
19      ! a1  +     2.*a2*xtild2 +     3.*a3*xtild2*xtild2 = Xprim2      ! a1 + 2. * a2 * xtild2 + 3. * a3 * xtild2**2 = Xprim2
20    
21      ! On en revient a resoudre un systeme de 4 equat.a 4 inconnues a0,a1,a2,a3      ! 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      DOUBLE PRECISION, intent(in):: xf1, xf2, xprim1, xprim2, xtild1, xtild2
25      DOUBLE PRECISION, intent(out):: a0, a1, a2, a3      DOUBLE PRECISION, intent(out):: a0, a1, a2, a3
# Line 28  contains Line 29  contains
29    
30      !------------------------------------------------------------      !------------------------------------------------------------
31    
32      xtil1car = xtild1*xtild1      xtil1car = xtild1 * xtild1
33      xtil2car = xtild2*xtild2      xtil2car = xtild2 * xtild2
34    
35      derr = 2.*(xf2-xf1)/(xtild1-xtild2)      derr = 2. * (xf2-xf1)/(xtild1-xtild2)
36    
37      x1x2car = (xtild1-xtild2)*(xtild1-xtild2)      x1x2car = (xtild1-xtild2) * (xtild1-xtild2)
38    
39      a3 = (derr+xprim1+xprim2)/x1x2car      a3 = (derr+xprim1+xprim2)/x1x2car
40      a2 = (xprim1-xprim2+3.*a3*(xtil2car-xtil1car))/(2.*(xtild1-xtild2))      a2 = (xprim1-xprim2+3. * a3 * (xtil2car-xtil1car))/(2. * (xtild1-xtild2))
41    
42      a1 = xprim1 - 3.*a3*xtil1car - 2.*a2*xtild1      a1 = xprim1 - 3. * a3 * xtil1car - 2. * a2 * xtild1
43      a0 = xf1 - a3*xtild1*xtil1car - a2*xtil1car - a1*xtild1      a0 = xf1 - a3 * xtild1 * xtil1car - a2 * xtil1car - a1 * xtild1
44    
45    END SUBROUTINE coefpoly    END SUBROUTINE coefpoly
46    

Legend:
Removed from v.120  
changed lines
  Added in v.121

  ViewVC Help
Powered by ViewVC 1.1.21