FISH.





Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include(http://www.beloshenko.org.ua/panel.html) [function.include]: failed to open stream: no suitable wrapper could be found in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8

Warning: include() [function.include]: Failed opening 'http://www.beloshenko.org.ua/panel.html' for inclusion (include_path='.:') in /home/virtwww/w_beloshenko-org-ua_e2c5fc46/http/topp.php on line 8







Spline interpolation. (FORTRAN)

Beloshenko + 2007
-------------------------------------------------------------------------------
InterpSpl.for
program InterpSpl
integer Nt,Nf,i
real Xt(7),X(7),Y(7),h(7),Dy(7)
real A(7,7),s(7)
real Alpha(7),Betta(7)

open(unit=1,file='Data.txt',status='old')
read(1,*)Nt
if (Nt.GE.101) goto 1
do 2 i=1,Nt
read(1,3)Xt(i)
3 format(f4.7)
2 continue
read(1,*)Nf
if (Nf.GE.101) goto 1
do 4 i=1,Nf
read(1,5)(X(i),Y(i))
5 format(f6.9,f6.9)
4 continue
close(1)

do 6 i=1,Nf-1
h(i)=x(i+1)-x(i)
Dy(i)=y(i+1)-y(i)
6 continue
h(Nf)=0

do 7 i=1,Nf-1
A(i,i)=h(i)
A(i,i+1)=2*(h(i)+h(i+1))
A(i,i+2)=h(i+1)
A(i,Nf+1)=Dy(i+1)/h(i+1)-Dy(i)/h(i)
7 continue

Alpha(2)=-A(1,2)/A(1,1)
Betta(2)=A(1,Nf+1)/A(1,1)
do 8 i=2,Nf-1
Alpha(i+1)=-A(i,i+1)/(A(i,i-1)*Alpha(i)+A(i,i))
Betta(i+1)=
v (A(i,Nf+1)-A(i,i-1)*Betta(i))/(A(i,i-1)*Alpha(i)+A(i,i))
8 continue

s(1)=0
s(Nf)=0
s(Nf-1)=
v (A(Nf,Nf+1)-A(Nf,Nf-1)*Betta(Nf))/(A(Nf,Nf-1)*Alpha(Nf)+A(Nf,Nf))
do 9 i=Nf-2,2
s(i-1)=0-A(i,i+1)/(A(i,i-1)*Alpha(i)+
v +A(i,i))*s(i)+(A(i,Nf+1)-A(i,i-1)*Betta(i))/(A(i,i-1)*Alpha(i)+
v +A(i,i))

9 continue

1 continue
end

----------------------------------------------------------------------------------
Data.txt

3
2.01
2.15
3.24
5
1.2323 4.312
2.3213 7.133
8.1321 12.23
9.2231 9.231
10.233 19.19





Click Here for Free Traffic!

FISH.