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

subroutine GTVarGetReal(var, value, nvalue, err)
    use gtdata_types, only: GT_VARIABLE
    use an_generic, only: ANVarGetReal
    use dc_error
    type(GT_VARIABLE), intent(inout):: var
    real, intent(out):: value(*)
    integer, intent(in):: nvalue
    logical, intent(out), optional:: err
    if (associated(var%an)) then
        call AnVarGetReal(var%an, value, nvalue, err)
    else
        call StoreError(GT_EFAKE, "GTVarGetReal, unknown format")
    endif
end subroutine

subroutine GTVarGetDouble(var, value, nvalue, err)
    use gtdata_types, only: GT_VARIABLE
    use an_generic, only: ANVarGetDouble
    use dc_error
    type(GT_VARIABLE), intent(inout):: var
    double precision, intent(out):: value(*)
    integer, intent(in):: nvalue
    logical, intent(out), optional:: err
    if (associated(var%an)) then
        call AnVarGetDouble(var%an, value, nvalue, err)
    else
        call StoreError(GT_EFAKE, "GTVarGetDouble, unknown format")
    endif
end subroutine
