!----------------------------------------------------------------------
!     Copyright (c) 2002 Shin-ichi Takehiro. All rights reserved.
!----------------------------------------------------------------------
!
!$BI=Bj(B  FTPACK/ISPACK-F90 $B%F%9%H%W%m%0%i%`(B
!
!$BMzNr(B  2002/01/25  $BC]9-??0l(B
!
program ftpack_test1d

  use ftrpack
  implicit none
  integer, parameter :: im=8, km=3
  real(8), parameter :: xlength=1.0
  real(8), parameter :: eps=1.0D-14
  real(8), parameter :: pi=3.1415926535897932385D0

  real(8), dimension(0:im-1) :: f

  integer :: k, i, m

  call ftrinitial(im,km,xlength)

  f(:) = 1
  write(6,*) 'f=1'
  write(6,*) e_g(f)
  write(6,*) 
  write(6,*) g_e(e_g(f)) - f
  write(6,*) 
  write(6,*) g_e(e_dx_e(e_g(f))) 
  write(6,*) 

  f = sin(2*pi*g_x)
  write(6,*) 'f=sin(2*pi*x)'
  write(6,*) e_g(f)
  write(6,*) 
  write(6,*) g_e(e_g(f)) - f
  write(6,*) 
  write(6,*) g_e(e_dx_e(e_g(f))) - 2*pi*cos(2*pi*g_x)
  write(6,*) 

  f = cos(4*pi*g_x)
  write(6,*) 'f=cos(4*pi*x)'
  write(6,*) e_g(f)
  write(6,*) 
  write(6,*) g_e(e_g(f)) - f
  write(6,*) 
  write(6,*) g_e(e_dx_e(e_dx_e((e_g(f))))) + 16*pi**2*cos(4*pi*g_x)

end program ftpack_test1d
