scan_write_between_line1_line2_flush_Left Subroutine

public subroutine scan_write_between_line1_line2_flush_Left(ur, uw, L1, L2)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ur
integer, intent(in) :: uw
character(len=*), intent(in) :: L1
character(len=*), intent(in) :: L2

Source Code

  subroutine scan_write_between_line1_line2_flush_Left (ur, uw, L1, L2)
    character (len=*), intent(in) :: L1, L2
    integer, intent(in) :: ur, uw

    integer :: i, j, k
    character (len=150) :: line

    rewind(ur)
    ios=0
    j=0
    k=0
    do while (ios==0)
       read (ur, '(a150)', iostat = ios, err = 300) line
       i=index( adjustl(line), trim(L1) )
       if ( i==1 ) then
          j=1
       end if
       if (j==1) then
          write(uw, '(a)')  trim(line)
          k=index( adjustl(line), trim(L2) )
          if (k==1) then
             j=0
          end if
       end if
    end do
300 continue
    write(uw,*)

  end subroutine scan_write_between_line1_line2_flush_Left