c One diamensional lagrangian interpolation
integer n
real x(50),f(50),a,sm,pro
print *, 'Enter the number of available stations'
read *, n
open(1,file='onedim.dat')
do i=1,n
read(1,*)x(i),f(i)
write(*,*)x(i),f(i)
enddo
close(1)
print*, 'Enter position of unknown data station'
read *, a
sm=0
pro=1
do i=1,n
pro=f(i)
do j=1,n
if(j.ne.i)then
pro=pro*(a-x(j))/(x(i)-x(j))
endif
enddo
sm=sm+pro
enddo
write(*,2)a,sm
2 format('The value at station ',f5.2,'is',f7.2)
stop
end
Monday, December 1, 2008
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2008
(34)
-
▼
December
(9)
- Northeast Monsoon
- zonal and meridianal components of wind code in f...
- Stream function by Relaxation Tecnique in fortran
- Velocity potential by Relaxation Tecnique in fortran
- Relaxation Technique using fortran
- Lifting condensation level calculation using fortran
- vertical distribution of vorticity using fortran
- One diamensional lagrangian interpolation using fo...
- Vertical Velocity calculation using fortran
-
▼
December
(9)
No comments:
Post a Comment