!
!= å±žæ€§ã®å‰Šé™¤
!
! Authors::   Eizi TOYODA, Yasuhiro MORIKAWA
! Version::   $Id: gtvardelattr.f90,v 1.5 2009-05-25 09:55:58 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#Del_Attr
! ã¨ã—ã¦æä¾›ã•ã‚Œã¾ã™ã€‚

subroutine GTVarDelAttr(var, name, err)
  !
  !== å±žæ€§ã®å‰Šé™¤
  !
  ! å¤‰æ•° *var* ã®å±žæ€§ *name* ã‚’å‰Šé™¤ã—ã¾ã™ã€‚
  !
  ! å±žæ€§ã®å‰Šé™¤æ™‚ã«ã‚¨ãƒ©ãƒ¼ãŒç”Ÿã˜ãŸå ´åˆã€ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’å‡ºåŠ›
  ! ã—ã¦ãƒ—ãƒã‚°ãƒ©ãƒ ã¯å¼·åˆ¶çµ‚äº†ã—ã¾ã™ã€‚*err* ã‚’ä¸Žãˆã¦ã‚ã‚‹å ´åˆã«ã¯
  ! ã®å¼•æ•°ã« .true. ãŒè¿”ã‚Šã€ãƒ—ãƒã‚°ãƒ©ãƒ ã¯çµ‚äº†ã—ã¾ã›ã‚“ã€‚
  !
  use gtdata_types, only: GT_VARIABLE
  use gtdata_internal_map, only: var_class, vtb_class_netcdf, vtb_class_memory
  use gtdata_netcdf_generic, only: del_attr
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use gtdata_memory_generic, only: del_attr
  use gtdata_memory_types, only: GD_MEM_VARIABLE
  use dc_error, only: GT_EBADVAR, StoreError
  implicit none
  type(GT_VARIABLE), intent(inout):: var
  character(len = *), intent(in):: name
  logical, intent(out), optional:: err
  integer:: class, cid
continue
  call var_class(var, class, cid)
  if (class == vtb_class_netcdf) then
    call del_attr(GD_NC_VARIABLE(cid), name, err)
  else if (class == vtb_class_memory) then
    call del_attr(GD_MEM_VARIABLE(cid), name, err)
  else
    call StoreError(GT_EBADVAR, 'GTVarDelAttr', err)
  endif
end subroutine GTVarDelAttr