!----------------------------------------------------------------------
!     Copyright (c) 2001 Shin-ichi Takehiro. All rights reserved.
!----------------------------------------------------------------------

program sntest_single

  use snpack_single
  implicit none

  integer,parameter  :: im=32, jm=16    ! 格子点の設定(X,Y)
  integer,parameter  :: nm=10
  double precision,parameter :: radius=1.0
  double precision,parameter :: pi=3.14159265358979

  double precision, dimension(im,jm)         :: gg  ! 格子点
  double precision, dimension((nm+1)*(nm+1)) :: ep  ! スペクトル

  integer :: i, j, n, m

  call sninitial_single(nm,im,jm)

!!$  do i=1,im
!!$     write(6,*) i,longitude(i), lon_weight(i)
!!$  enddo
!!$  do j=1,jm
!!$     write(6,*) j,latitude(j), lat_weight(j)
!!$  enddo

  n=1 ; m=-1
  !write(6,*) 'n,m?'
  !read(5,*) n,m

  ep=0 ; ep(l_nm(n,m))=1.0
  gg = sin(gg_lon)*sin(gg_lat)

  call gropn(1)
  call grfrm
  call grsvpt(0.2,0.8,0.2,0.8)
  call grswnd(0.0,360.0,-90.0,90.0)
  call grstrn(1)

  !call sgssim( 1.0, 0.0, 0.0 )
  !call sgsmpl( 0.0, 0.0, 0.0 )
  !call grstrn(30)

  call grstrf
  call usdaxs
  call udcntr(real(gg_ep(ep,0,1)),im,im,jm)

  call grfrm
  call grsvpt(0.2,0.8,0.2,0.8)
  call grswnd(0.0,360.0,-90.0,90.0)
  call grstrn(1)
  call usdaxs
  call udcntr(real(gg),im,im,jm)

  call grcls

end program sntest_single
