get_next_non_blank_character_any_record Subroutine

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

Get the next non-blank character, advancing records if necessary.

Arguments

Type IntentOptional Attributes Name
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.


Calls

proc~~get_next_non_blank_character_any_record~~CallsGraph proc~get_next_non_blank_character_any_record stringifor_string_t::get_next_non_blank_character_any_record proc~get_next_non_blank_character_this_record stringifor_string_t::get_next_non_blank_character_this_record proc~get_next_non_blank_character_any_record->proc~get_next_non_blank_character_this_record

Called by

proc~~get_next_non_blank_character_any_record~~CalledByGraph proc~get_next_non_blank_character_any_record stringifor_string_t::get_next_non_blank_character_any_record proc~read_formatted stringifor_string_t::string%read_formatted proc~read_formatted->proc~get_next_non_blank_character_any_record

Contents


Source Code

   subroutine get_next_non_blank_character_any_record(unit, ch, iostat, iomsg)
   !< Get the next non-blank character, advancing records if necessary.
   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.
   character(len(iomsg))                    :: local_iomsg !< Local variant of iomsg, so it doesn't get inappropriately redefined.

   do
      call get_next_non_blank_character_this_record(unit=unit, ch=ch, iostat=iostat, iomsg=local_iomsg)
      if (is_iostat_eor(iostat)) then
         ! try again on the next record
         read (unit, "(/)", iostat=iostat, iomsg=iomsg)
         if (iostat /= 0) return
      elseif (iostat /= 0) then
         ! some sort of problem
         iomsg = local_iomsg
         return
      else
         ! got it
         exit
      endif
   enddo
   endsubroutine get_next_non_blank_character_any_record