! gtvarclose.f90
! Copyright (C) TOYODA Eizi, 2000.  All rights reserved.

subroutine GTVarClose(var, err)
    use gtdata_types, only: GT_VARIABLE
    use an_generic, only: ANVarClose
    type(GT_VARIABLE), intent(inout):: var
    logical, intent(out), optional:: err
continue
    if (associated(var%an)) then
        call ANVarClose(var%an, err)
        deallocate(var%an)
    endif
end subroutine
