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

subroutine GTVarSync(var, stat)
    use gtdata_types, only: GT_VARIABLE
    use an_generic, only: ANVarSync
    type(GT_VARIABLE), intent(inout), optional:: var
    integer, intent(out), optional:: stat
    if (.not. present(var)) then
        call ANVarSync(stat=stat)
    else if (associated(var%an)) then
        call ANVarSync(var%an, stat=stat)
    endif
end subroutine
