serialize_open_read Subroutine

public subroutine serialize_open_read(filename, unit, err)

Open an existing serialized stream for reading.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

Path of the file to read.

integer(kind=default_int), intent(out) :: unit

Newly opened unit number, -1 when the open failed.

type(error_t), intent(inout) :: err

Error state, ERROR_IO if the file cannot be opened.


Calls

proc~~serialize_open_read~~CallsGraph proc~serialize_open_read serialize_open_read proc~check_io check_io proc~serialize_open_read->proc~check_io interface~to_char to_char proc~check_io->interface~to_char proc~error_set error_t%error_set proc~check_io->proc~error_set proc~to_char_char to_char_char interface~to_char->proc~to_char_char proc~to_char_dp to_char_dp interface~to_char->proc~to_char_dp proc~to_char_int32 to_char_int32 interface~to_char->proc~to_char_int32 proc~to_char_int64 to_char_int64 interface~to_char->proc~to_char_int64 proc~to_char_logical to_char_logical interface~to_char->proc~to_char_logical proc~to_char_matrix_dp to_char_matrix_dp interface~to_char->proc~to_char_matrix_dp proc~to_char_matrix_int32 to_char_matrix_int32 interface~to_char->proc~to_char_matrix_int32 proc~to_char_matrix_int64 to_char_matrix_int64 interface~to_char->proc~to_char_matrix_int64 proc~to_char_matrix_sp to_char_matrix_sp interface~to_char->proc~to_char_matrix_sp proc~to_char_sp to_char_sp interface~to_char->proc~to_char_sp proc~to_char_vector_dp to_char_vector_dp interface~to_char->proc~to_char_vector_dp proc~to_char_vector_int32 to_char_vector_int32 interface~to_char->proc~to_char_vector_int32 proc~to_char_vector_int64 to_char_vector_int64 interface~to_char->proc~to_char_vector_int64 proc~to_char_vector_sp to_char_vector_sp interface~to_char->proc~to_char_vector_sp

Variables

Type Visibility Attributes Name Initial
integer(kind=default_int), private :: ios

Source Code

   subroutine serialize_open_read(filename, unit, err)
      !! Open an existing serialized stream for reading.
      character(len=*), intent(in) :: filename
         !! Path of the file to read.
      integer(default_int), intent(out) :: unit
         !! Newly opened unit number, -1 when the open failed.
      type(error_t), intent(inout) :: err
         !! Error state, `ERROR_IO` if the file cannot be opened.

      integer(default_int) :: ios

      unit = -1_default_int
      open (newunit=unit, file=filename, form="unformatted", access="stream", &
            action="read", status="old", iostat=ios)
      call check_io(ios, "cannot open '"//filename//"' for reading", err)
   end subroutine serialize_open_read