Debian Codegraph @

packages/seacas/applications/genshell/gs_spline.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6 SUBROUTINE SPLINE(X,Y,N,YP1,YPN,Y2, U)
7 DIMENSION X(N),Y(N),Y2(N),U(N)
8 IF (YP1.GT..99E30) THEN
9 Y2(1)=0.
10 U(1)=0.
11 ELSE
12 Y2(1)=-0.5
13 U(1)=(3./(X(2)-X(1)))*((Y(2)-Y(1))/(X(2)-X(1))-YP1)
14 ENDIF
15 DO 11 I=2,N-1
16 SIG=(X(I)-X(I-1))/(X(I+1)-X(I-1))
17 P=SIG*Y2(I-1)+2.
18 Y2(I)=(SIG-1.)/P
19 U(I)=(6.*((Y(I+1)-Y(I))/(X(I+1)-X(I))-(Y(I)-Y(I-1))
20 * /(X(I)-X(I-1)))/(X(I+1)-X(I-1))-SIG*U(I-1))/P
21 11 CONTINUE
22 IF (YPN.GT..99E30) THEN
23 QN=0.
24 UN=0.
25 ELSE
26 QN=0.5
27 UN=(3./(X(N)-X(N-1)))*(YPN-(Y(N)-Y(N-1))/(X(N)-X(N-1)))
28 ENDIF
29 Y2(N)=(UN-QN*U(N-1))/(QN*Y2(N-1)+1.)
30 DO 12 K=N-1,1,-1
31 Y2(K)=Y2(K)*Y2(K+1)+U(K)
32 12 CONTINUE
33 RETURN
34 END