subroutine GTVarCopyAttrAll(to, from, err, global)
type(gt_variable), intent(inout):: to
type(gt_variable), intent(inout):: from
logical, intent(out), optional:: err
logical, intent(in), optional:: global
character(len = *), parameter:: subnam = "GTVarCopyAttrAll"
character(len = STRING):: aname
logical:: end
if (present(err)) err = .false.
call beginsub(subnam)
call attr_rewind(from)
do
call attr_next(from, aname, end)
if (end) exit
if ( (present_and_false(global)) .and. (aname(1:1) == GT_PLUS) ) then
call DbgMessage("Ignored attr=%c", c1=aname)
cycle
end if
call DbgMessage("Copied attr=%c", c1=aname)
call GTVarCopyAttr(to=to, attrname=aname, from=from, err=err)
if (present_and_true(err)) err = .false.
enddo
call endsub(subnam)
end subroutine