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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (show annotations)
Wed Mar 5 14:38:41 2014 UTC (10 years, 2 months ago) by guez
Original Path: trunk/dyn3d/coefpoly.f90
File size: 1242 byte(s)
 Converted to free source form files which were still in fixed source
form. The conversion was done using the polish mode of the NAG Fortran
Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

1
2 ! $Header: /home/cvsroot/LMDZ4/libf/dyn3d/coefpoly.F,v 1.1.1.1 2004/05/19
3 ! 12:53:05 lmdzadmin Exp $
4
5 SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)
6 IMPLICIT NONE
7
8 ! ... Auteur : P. Le Van ...
9
10
11 ! Calcul des coefficients a0, a1, a2, a3 du polynome de degre 3 qui
12 ! satisfait aux 4 equations suivantes :
13
14 ! a0 + a1*xtild1 + a2*xtild1*xtild1 + a3*xtild1*xtild1*xtild1 = Xf1
15 ! a0 + a1*xtild2 + a2*xtild2*xtild2 + a3*xtild2*xtild2*xtild2 = Xf2
16 ! a1 + 2.*a2*xtild1 + 3.*a3*xtild1*xtild1 = Xprim1
17 ! a1 + 2.*a2*xtild2 + 3.*a3*xtild2*xtild2 = Xprim2
18
19 ! On en revient a resoudre un systeme de 4 equat.a 4 inconnues a0,a1,a2,a3
20
21 DOUBLE PRECISION xf1, xf2, xprim1, xprim2, xtild1, xtild2, xi
22 DOUBLE PRECISION xfout, xprim
23 DOUBLE PRECISION a1, a2, a3, a0, xtil1car, xtil2car, derr, x1x2car
24
25 xtil1car = xtild1*xtild1
26 xtil2car = xtild2*xtild2
27
28 derr = 2.*(xf2-xf1)/(xtild1-xtild2)
29
30 x1x2car = (xtild1-xtild2)*(xtild1-xtild2)
31
32 a3 = (derr+xprim1+xprim2)/x1x2car
33 a2 = (xprim1-xprim2+3.*a3*(xtil2car-xtil1car))/(2.*(xtild1-xtild2))
34
35 a1 = xprim1 - 3.*a3*xtil1car - 2.*a2*xtild1
36 a0 = xf1 - a3*xtild1*xtil1car - a2*xtil1car - a1*xtild1
37
38 RETURN
39 END SUBROUTINE coefpoly

  ViewVC Help
Powered by ViewVC 1.1.21