Write the 16 byte stream header at the current position.
Call this once, before any record, on a freshly opened unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=default_int), | intent(in) | :: | unit |
Stream unit opened for unformatted stream writing. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | ios |
subroutine write_header(unit, err) !! Write the 16 byte stream header at the current position. !! !! Call this once, before any record, on a freshly opened unit. integer(default_int), intent(in) :: unit !! Stream unit opened for unformatted stream writing. type(error_t), intent(inout) :: err !! Error state, `ERROR_IO` if any field could not be written. integer(default_int) :: ios write (unit, iostat=ios) PIC_MAGIC if (ios == 0) write (unit, iostat=ios) PIC_ENDIAN_MARK if (ios == 0) write (unit, iostat=ios) PIC_FORMAT_VERSION if (ios == 0) write (unit, iostat=ios) RESERVED_WORD call check_io(ios, "failed to write stream header", err) end subroutine write_header