get_next_non_blank_character_this_record Subroutine

private subroutine get_next_non_blank_character_this_record(unit, ch, iostat, iomsg)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: unit

Logical unit.

character(kind=CK,len=1), intent(out) :: ch

The non-blank character read. Not valid if IOSTAT is non-zero.

integer, intent(out) :: iostat

IO status code.

character(kind=CK,len=*), intent(inout) :: iomsg

IO status message.

Description

Get the next non-blank character in the current record.

Called By

proc~~get_next_non_blank_character_this_record~~CalledByGraph proc~get_next_non_blank_character_this_record get_next_non_blank_character_this_record proc~get_next_non_blank_character_any_record get_next_non_blank_character_any_record proc~get_next_non_blank_character_any_record->proc~get_next_non_blank_character_this_record proc~read_formatted read_formatted proc~read_formatted->proc~get_next_non_blank_character_any_record
Help

Source Code

  subroutine get_next_non_blank_character_this_record(unit, ch, iostat, iomsg)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Get the next non-blank character in the current record.
  !---------------------------------------------------------------------------------------------------------------------------------
  integer,                   intent(in)    :: unit   !< Logical unit.
  character(kind=CK, len=1), intent(out)   :: ch     !< The non-blank character read. Not valid if IOSTAT is non-zero.
  integer,                   intent(out)   :: iostat !< IO status code.
  character(kind=CK, len=*), intent(inout) :: iomsg  !< IO status message.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  do
    ! we spcify non-advancing, just in case we want this callable outside the context of a child input statement
    ! the PAD specifier simply saves the need for the READ statement to define ch if EOR is hit
    ! read(unit, "(A)", iostat=iostat, iomsg=iomsg, advance='NO') ch
    ! ...but that causes ifort to blow up at runtime
    read(unit, "(A)", iostat=iostat, iomsg=iomsg, pad='NO') ch
    if (iostat /= 0) return
    if (ch /= '') exit
  enddo
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine get_next_non_blank_character_this_record