!--
! *** Caution!! ***
! 
! This file is generated from "historyaxisaddattr.rb2f90" by Ruby 1.8.7.
! Please do not edit this file directly.
!
! [JAPANESE]
!
! ※※※ 注意!!! ※※※
!
! このファイルは "historyaxisaddattr.rb2f90" から Ruby 1.8.7
! によって自動生成されたファイルです.
! このファイルを直接編集しませんようお願い致します.
!
!
!++
!
!= GT_HISTORY_AXIS への属性付加
!= Add attributes to GT_HISTORY_AXIS
!
! Authors::   Yasuhiro MORIKAWA
! Version::   $Id: historyaxisaddattr.f90,v 1.3 2010-06-22 14:13:46 morikawa Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2009. All rights reserved.
! License::   See COPYRIGHT[link:../../../COPYRIGHT]
!

  subroutine HistoryAxisAddAttrChar0( &
    & axis, attrname, value)
    !
                        !
    !== GT_HISTORY_AXIS 型変数への属性付加
    !
    ! GT_HISTORY_AXIS 型の変数 *axis* へ属性を付加します。
    !
    ! *HistoryAxisAddAttr* は複数のサブルーチンの総称名です。
    ! value には様々な型の引数を与えることが可能です。
    ! 下記のサブルーチンを参照ください。
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    character(*), intent(in):: value
                                                  ! 属性に与えられる値
                              ! 
                              ! 配列の場合でも、数値型以外
                              ! では配列の 1 つ目の要素のみ
                              ! 値として付加されます。
                              ! 
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrChar0"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(value))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Char'
                        axis % attrs(attrs_num) % array     = .false.
    axis % attrs(attrs_num) % Charvalue = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrChar0

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Char0( &
    & axis, attrname, value)
    !
                        !
    ! 使用方法は HistoryAxisAddAttr と同様です. 
    !
    ! Usage is same as "HistoryAxisAddAttr".
    !
    !--
    ! 総称名 Put_Attr として提供するための関数です. 
    ! 機能は HistoryAxisAttr と同じです. 
    !++
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    character(*), intent(in):: value
    character(*), parameter:: subname = "HistoryAxisAddAttr2Char0"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Char0


  subroutine HistoryAxisAddAttrLogical0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    logical, intent(in):: value
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrLogical0"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Logical'
                        axis % attrs(attrs_num) % array     = .false.
    axis % attrs(attrs_num) % Logicalvalue = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrLogical0

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Logical0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    logical, intent(in):: value
    character(*), parameter:: subname = "HistoryAxisAddAttr2Logical0"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Logical0


  subroutine HistoryAxisAddAttrInt0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    integer, intent(in):: value
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrInt0"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Int'
                        axis % attrs(attrs_num) % array     = .false.
    axis % attrs(attrs_num) % Intvalue = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrInt0

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Int0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    integer, intent(in):: value
    character(*), parameter:: subname = "HistoryAxisAddAttr2Int0"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Int0


  subroutine HistoryAxisAddAttrInt1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    integer, intent(in):: value(:)
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrInt1"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Int'
                        axis % attrs(attrs_num) % array                = .true.
    allocate(  axis % attrs(attrs_num) % Intarray( size(value) )  )
    axis % attrs(attrs_num) % Intarray    = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrInt1

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Int1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    integer, intent(in):: value(:)
    character(*), parameter:: subname = "HistoryAxisAddAttr2Int1"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Int1


  subroutine HistoryAxisAddAttrReal0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real, intent(in):: value
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrReal0"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Real'
                        axis % attrs(attrs_num) % array     = .false.
    axis % attrs(attrs_num) % Realvalue = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrReal0

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Real0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real, intent(in):: value
    character(*), parameter:: subname = "HistoryAxisAddAttr2Real0"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Real0


  subroutine HistoryAxisAddAttrReal1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real, intent(in):: value(:)
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrReal1"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Real'
                        axis % attrs(attrs_num) % array                = .true.
    allocate(  axis % attrs(attrs_num) % Realarray( size(value) )  )
    axis % attrs(attrs_num) % Realarray    = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrReal1

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Real1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real, intent(in):: value(:)
    character(*), parameter:: subname = "HistoryAxisAddAttr2Real1"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Real1


  subroutine HistoryAxisAddAttrDouble0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real(DP), intent(in):: value
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrDouble0"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Double'
                        axis % attrs(attrs_num) % array     = .false.
    axis % attrs(attrs_num) % Doublevalue = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrDouble0

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Double0( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real(DP), intent(in):: value
    character(*), parameter:: subname = "HistoryAxisAddAttr2Double0"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Double0


  subroutine HistoryAxisAddAttrDouble1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisInquire
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use gtool_history_internal, only: default, copy_attrs
    use gtdata_generic, only: Put_Attr
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    use dc_string, only: toChar, JoinChar
    use dc_url, only: GT_PLUS
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real(DP), intent(in):: value(:)
                    
    type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
    integer:: attrs_num
    character(STRING) :: name
    character(*), parameter:: subname = "HistoryAxisAddAttrDouble1"
  continue
    call BeginSub(subname, &
      & 'attrname=<%c>, value=<%c>', &
      & c1=trim(attrname), c2=trim(toChar(value)))
    call HistoryAxisInquire( axis, name )
    call DbgMessage('axis name=<%c>', c1=trim(name))

    ! これまでの属性を保持しつつ配列を1つ増やす
    if ( .not. associated(axis % attrs) ) then
      allocate( axis % attrs(1) )
      attrs_num = 1
    else
      attrs_num = size( axis % attrs ) + 1
      ! 配列データの領域確保
      allocate( attrs_tmp(attrs_num - 1) )
      call copy_attrs( from = axis % attrs(1:attrs_num - 1), &
        &                to = attrs_tmp(1:attrs_num - 1))
      deallocate( axis % attrs )
      allocate( axis % attrs(attrs_num) )
      call copy_attrs( from = attrs_tmp(1:attrs_num - 1), &
        &                to = axis % attrs(1:attrs_num - 1))
      deallocate( attrs_tmp )
    endif

    axis % attrs(attrs_num) % attrname  = attrname
    axis % attrs(attrs_num) % attrtype  = 'Double'
                        axis % attrs(attrs_num) % array                = .true.
    allocate(  axis % attrs(attrs_num) % Doublearray( size(value) )  )
    axis % attrs(attrs_num) % Doublearray    = value
                    

    call EndSub(subname)
  end subroutine HistoryAxisAddAttrDouble1

  !-------------------------------------------------------------------

  subroutine HistoryAxisAddAttr2Double1( &
    & axis, attrname, value)
    !
                    
    !
    use gtool_history_generic, only: HistoryAxisAddAttr
    use gtool_history_types, only: GT_HISTORY, GT_HISTORY_AXIS, GT_HISTORY_VARINFO, GT_HISTORY_ATTR
    use dc_trace, only: BeginSub, EndSub, DbgMessage
    use dc_types, only: STRING, TOKEN, DP
    implicit none
    type(GT_HISTORY_AXIS),intent(inout) :: axis
    character(*), intent(in):: attrname ! 属性の名前
    real(DP), intent(in):: value(:)
    character(*), parameter:: subname = "HistoryAxisAddAttr2Double1"
  continue
    call BeginSub(subname)
    call HistoryAxisAddAttr( axis, attrname, value )
    call EndSub(subname)
  end subroutine HistoryAxisAddAttr2Double1

!--
! vi:set readonly sw=4 ts=8:
!
!Local Variables:
!mode: f90
!buffer-read-only: t
!End:
!
!++
