subroutine print_itemlist (names, types)
character(*), intent(in) :: names(:)
type(ESMF_StateItem_Flag), intent(in) :: types(:)
integer :: i
print *, 'size(names) =', size (names)
do, i=1, size (names)
select case (types(i)%ot)
case (ESMF_STATEITEM_FIELD%ot)
print *, 'ESMF_STATEITEM_FIELD: ', trim (names(i))
case (ESMF_STATEITEM_FIELDBUNDLE%ot)
print *, 'ESMF_STATEITEM_FIELDBUNDLE: ', trim (names(i))
case (ESMF_STATEITEM_ARRAY%ot)
print *, 'ESMF_STATEITEM_ARRAY: ', trim (names(i))
case (ESMF_STATEITEM_ARRAYBUNDLE%ot)
print *, 'ESMF_STATEITEM_ARRAYBUNDLE: ', trim (names(i))
case (ESMF_STATEITEM_ROUTEHANDLE%ot)
print *, 'ESMF_STATEITEM_ROUTEHANDLE: ', trim (names(i))
case (ESMF_STATEITEM_STATE%ot)
print *, 'ESMF_STATEITEM_STATE: ', trim (names(i))
case (ESMF_STATEITEM_UNKNOWN%ot)
print *, 'ESMF_STATEITEM_UNKNOWN: ', trim (names(i))
case (ESMF_STATEITEM_NOTFOUND%ot)
print *, 'ESMF_STATEITEM_NOTFOUND: ', trim (names(i))
case default
print *, '(unknown type): ', trim (names(i))
end select
end do
end subroutine print_itemlist