index_ca Function

private pure function index_ca(ca, chara) result(idx)

Arguments

Type IntentOptional Attributes Name
type(character_array_t), intent(in) :: ca(:)
character(len=*), intent(in) :: chara

Return Value integer


Source Code

   pure function index_ca(ca, chara) result(idx)
      use :: forgex_parameters_m
      implicit none
      type(character_array_t), intent(in) :: ca(:)
      character(*), intent(in) :: chara
      integer :: idx
      integer :: i, siz
      idx = 0
      siz = size(ca, dim=1)
      do i = 1, siz
         if (ca(i)%c == chara) then
            idx = i
            return
         end if
      end do
   end function index_ca