skip_to_end Subroutine

public subroutine skip_to_end(unit, error)

Skip lines until ‘end’ marker is found

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(error_t), intent(out) :: error

Calls

proc~~skip_to_end~~CallsGraph proc~skip_to_end skip_to_end proc~error_set error_t%error_set proc~skip_to_end->proc~error_set proc~strip_comment strip_comment proc~skip_to_end->proc~strip_comment

Called by

proc~~skip_to_end~~CalledByGraph proc~skip_to_end skip_to_end proc~parse_connectivity_generic parse_connectivity_generic proc~parse_connectivity_generic->proc~skip_to_end proc~parse_fragments_generic parse_fragments_generic proc~parse_fragments_generic->proc~skip_to_end proc~parse_molecules_section parse_molecules_section proc~parse_molecules_section->proc~skip_to_end proc~parse_single_molecule parse_single_molecule proc~parse_molecules_section->proc~parse_single_molecule proc~parse_single_molecule->proc~skip_to_end proc~parse_molecule_connectivity parse_molecule_connectivity proc~parse_single_molecule->proc~parse_molecule_connectivity proc~parse_molecule_fragments parse_molecule_fragments proc~parse_single_molecule->proc~parse_molecule_fragments proc~read_mqc_file read_mqc_file proc~read_mqc_file->proc~skip_to_end interface~parse_molecules_section parse_molecules_section proc~read_mqc_file->interface~parse_molecules_section interface~parse_connectivity_section parse_connectivity_section proc~read_mqc_file->interface~parse_connectivity_section interface~parse_fragments_section parse_fragments_section proc~read_mqc_file->interface~parse_fragments_section interface~parse_connectivity_generic parse_connectivity_generic interface~parse_connectivity_generic->proc~parse_connectivity_generic interface~parse_fragments_generic parse_fragments_generic interface~parse_fragments_generic->proc~parse_fragments_generic interface~parse_molecules_section->proc~parse_molecules_section program~main main program~main->proc~read_mqc_file proc~parse_connectivity_section parse_connectivity_section proc~parse_connectivity_section->interface~parse_connectivity_generic proc~parse_fragments_section parse_fragments_section proc~parse_fragments_section->interface~parse_fragments_generic proc~parse_molecule_connectivity->interface~parse_connectivity_generic proc~parse_molecule_fragments->interface~parse_fragments_generic interface~parse_connectivity_section->proc~parse_connectivity_section interface~parse_fragments_section->proc~parse_fragments_section

Variables

Type Visibility Attributes Name Initial
integer, private :: io_stat
character(len=MAX_LINE_LEN), private :: line

Source Code

   subroutine skip_to_end(unit, error)
      !! Skip lines until 'end' marker is found
      integer, intent(in) :: unit
      type(error_t), intent(out) :: error

      character(len=MAX_LINE_LEN) :: line
      integer :: io_stat
      do
         read (unit, '(A)', iostat=io_stat) line
         if (io_stat /= 0) then
            call error%set(ERROR_IO, "Unexpected end of file while skipping section")
            return
         end if

         line = adjustl(line)
         if (trim(strip_comment(line)) == 'end') exit
      end do

   end subroutine skip_to_end