!
!= å¤‰æ•°æŽ¢æŸ»
!
! Authors::   Yasuhiro MORIKAWA, Eizi TOYODA
! Version::   $Id: gtvarsearch.f90,v 1.4 2009-05-29 15:03:49 morikawa Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!
! ä»¥ä¸‹ã®ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã€é–¢æ•°ã¯ gtdata_generic ã‹ã‚‰ gtdata_generic#GTVarSearch
! ã¨ã—ã¦æä¾›ã•ã‚Œã¾ã™ã€‚
!

subroutine GTVarSearchNext(url, end)
  !
  !== å¤‰æ•°æŽ¢æŸ»ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³
  !
  ! ã‚ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«å urlBase ã«ä¾å˜ã™ã‚‹å¤‰æ•°ã™ã¹ã¦ã‚’å–å¾—ã™ã‚‹ã«ã¯ã€
  ! ã¾ãš GTVarSearch(urlBase) (ä¸‹è¨˜ã®ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³) ã‚’å‘¼ã³å‡ºã—ã€
  ! ãã®å¾Œç„¡é™ãƒ«ãƒ¼ãƒ—ã®ä¸ã§ GTVarSearch(url, end) ã‚’å‘¼ã³å‡ºã—ã¾ã™ã€‚
  ! ãã†ã™ã‚‹ã“ã¨ã§ url ã«1ã¤1ã¤ã®å¤‰æ•°åãŒè¿”ã‚Šã¾ã™ã€‚
  ! *end* ãŒçœŸã«ãªã£ãŸã¨ãã€ã™ã¹ã¦ã®å¤‰æ•°åã‚’æŽ¢ç´¢ã—çµ‚ãˆãŸã“ã¨ã«ãªã‚Šã¾ã™ã€‚
  !
  !=== ä¾‹
  !
  !    use gtool5
  !    character(len = STRING) :: filename, varname
  !    logical                 :: end
  !
  !    write(*,*) "Enter file name: "
  !    read(*,*) filename
  !
  !    call GTVarSearch(filename)
  !    do
  !      call GTVarSearch(varname, end)
  !      if (end) exit
  !      write(*, *) trim(varname)
  !    enddo
  !
  use gtdata_netcdf_generic, only: var_search
  use gtdata_internal_vartable, only: gdnc_search
  use dc_trace, only: beginsub, endsub
  implicit none
  character(len = *), intent(out):: url
  logical, intent(out):: end
continue
  call beginsub('gtvarsearchnext')
  call var_search(gdnc_search, &    ! (inout)
    &             url=url, end=end) ! (out)
  call endsub('gtvarsearchnext', 'url=%c end=%y', c1=trim(url), L=(/end/))
end subroutine GTVarSearchNext

subroutine GTVarSearchInit(urlBase)
  !
  !== å¤‰æ•°æŽ¢æŸ»åˆæœŸåŒ–ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³
  !
  ! ä¸Šè¨˜ã® GTVarSearch ã‚’å‚ç…§ã—ã¦ãã ã•ã„ã€‚
  !
  use gtdata_netcdf_generic, only: var_search
  use gtdata_internal_vartable, only: gdnc_search
  use dc_trace, only: beginsub, endsub
  implicit none
  character(len = *), intent(in):: urlBase
continue
  call beginsub('gtvarsearchinit', 'urlbase=<%c>', c1=trim(urlbase))
  call var_search(gdnc_search, &      ! (out)
    &             urlBase = urlBase ) ! (in)
  call endsub('gtvarsearchinit')
end subroutine GTVarSearchInit