get_next_non_blank_character_any_record Subroutine

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

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: unit
character(kind=CK,len=1), intent(out) :: ch
integer, intent(out) :: iostat
character(kind=CK,len=*), intent(inout) :: iomsg

Calls

proc~~get_next_non_blank_character_any_record~2~~CallsGraph proc~get_next_non_blank_character_any_record~2 get_next_non_blank_character_any_record proc~get_next_non_blank_character_this_record~2 get_next_non_blank_character_this_record proc~get_next_non_blank_character_any_record~2->proc~get_next_non_blank_character_this_record~2

Called by

proc~~get_next_non_blank_character_any_record~2~~CalledByGraph proc~get_next_non_blank_character_any_record~2 get_next_non_blank_character_any_record proc~read_formatted~2 read_formatted proc~read_formatted~2->proc~get_next_non_blank_character_any_record~2

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