cla__get_patterns Subroutine

private subroutine cla__get_patterns(cla, offset)

Type Bound

cla_t

Arguments

Type IntentOptional Attributes Name
class(cla_t), intent(inout) :: cla
integer, intent(in) :: offset

Source Code

   subroutine cla__get_patterns(cla, offset)
      implicit none
      class(cla_t), intent(inout) :: cla
      integer, intent(in) :: offset
      integer :: i, j, k
      integer, allocatable :: idx(:)

      j = 0
      outer: do i = offset, cla%arg_info%argc

         !
         if (i <= maxval(cla%flag_idx)) then
            do k = 1, ubound(cla%flags, dim=1)
               if ( i == cla%flag_idx(k))  cycle outer
            end do
         end if

         j = j + 1
         if (.not. allocated(idx)) then
            idx = [i]
            cycle
         end if
         idx = [idx, i]

      end do outer

      if (j == 0) return

      allocate(cla%patterns(j))

      do i = 1, j
         cla%patterns(i)%p = cla%arg_info%arg(idx(i))%v
      end do

   end subroutine cla__get_patterns