scan_count_match_bgn Subroutine

public subroutine scan_count_match_bgn(iunps, string, count, rew)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iunps
character(len=*), intent(in) :: string
integer, intent(out) :: count
logical, intent(in) :: rew

Calls

proc~~scan_count_match_bgn~~CallsGraph proc~scan_count_match_bgn scan_count_match_bgn proc~matchbgn matchbgn proc~scan_count_match_bgn->proc~matchbgn

Source Code

  subroutine scan_count_match_bgn (iunps, string, count, rew)
    !---------------------------------------------------------------------
    !
    implicit none
    integer, intent(in) :: iunps
    character (len=*), intent(in) :: string
    integer, intent(out) :: count
    logical, intent(in) :: rew            ! if rewind
    character (len=100) :: line
!!    logical :: matches          ! function name
    integer :: ios
    !
    ios = 0
    count = 0
    if (rew) rewind (iunps)
    do while (ios==0)
       read (iunps, '(a100)', iostat = ios) line
       if (matchbgn (line, string) ) then
          count = count + 1
       endif
    enddo
    return
  end subroutine scan_count_match_bgn