| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in), | dimension(NSTATE) | :: | state |
index in the queue. -1 if not present
function index_in_queue(state) result(idx) integer(ip),dimension(NSTATE),intent(in) :: state integer(ip) :: idx !! index in the queue. -1 if not present integer(ip) :: i logical :: found integer(ip) :: cache_idx integer(ip),dimension(:),allocatable :: cache_ival call cache%get(state,cache_idx,cache_ival,found) if (found) then idx = cache_ival(1) else idx = -1 if (.not. allocated(queue)) error stop 'error: queue not allocated' do i = 1, queue_size if (all(state == queue(i)%state)) then idx = i exit end if end do if (idx /= -1) call cache%put(cache_idx,state,[idx]) end if end function index_in_queue