! Copyright (C) GFD Dennou Club, 2000.  All rights reserved.

subroutine GTLineLoad(Line, var)
    use gtgraph_types, only: GT_Line
    use gtgraph_generic, only: Load
    use gtdata_types, only: GT_VARIABLE
    use gtdata_generic
    use dc_trace, only: beginsub, endsub
    use dc_error
    use dc_types, only: STRING
    implicit none
    type(GT_Line), intent(out):: Line
    type(GT_VARIABLE), intent(in):: var
    character(STRING):: varname
    character(*), parameter:: GTLN = "gt_graph_line_"
continue
    ! リンク名が data であることを仮定
    call beginsub('gtlineload')
    call get_attr(var, "gt_structure_link_data", varname)
    call Open(line%var, varname)
    allocate(line%h_axis, line%v_axis)
    call get_attr(var, "gt_structure_link_haxis", varname)
    call Load(line%h_axis, varname)
    call get_attr(var, "gt_structure_link_vaxis", varname)
    call Load(line%v_axis, varname)
    ! オプションの初期化
    call get_attr(var, GTLN // 'index', line%index, default=0)
    call get_attr(var, GTLN // 'type', line%type, default=0)
    call get_attr(var, GTLN // 'mark', line%mark, default=0)
    call endsub('gtlineload')
end subroutine
