!----------------------------------------------------------------------
!     Copyright (c) 2002 Shin-ichi Takehiro. All rights reserved.
!----------------------------------------------------------------------
!
!  yt_divrad_yt のテスト (1/r^2 d/dr r^2)
!  
program spctest2

  use spcpack
  implicit none

  integer,parameter  :: im=32, jm=16, km=16  ! 格子点の設定(経度, 緯度, 動径)
  integer,parameter  :: nm=10, lm=16         ! 切断波数の設定(水平, 動径)
  real(8),parameter  :: ri=0.5, ro=1.5      ! 内外半径

  real(8), dimension(im,jm,0:km)     :: ggg_data
  real(8), dimension(im,jm,0:km)     :: ggg_data1
  real(8), dimension((nm+1)**2,0:lm) :: yt_data

  integer :: i,j,k

  integer :: n=1

  write(6,*) 'n?'
  read(5,*) n

  call spcinitial(im,jm,km,nm,lm,ri,ro)

  ggg_data = ggg_rad**n
  ggg_data1 = (n+2)*ggg_rad**(n-1)

  ggg_data = ggg_yt(yt_divrad_yt(yt_ggg(ggg_data)))

  write( 6,* ) maxval(abs(ggg_data-ggg_data1))

end program spctest2

  
