Write the container to an open stream unit.
Writes the prologue – stream header, schema record, element count –
and then one record per field in declaration order, each holding
exactly size() elements. The unit must be open for unformatted
stream writing, for instance from serialize_open_write.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to write. |
||
| 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 | :: | n |
subroutine particle_soa_serialize(this, unit, err) !! Write the container to an open stream unit. !! !! Writes the prologue -- stream header, schema record, element count -- !! and then one record per field in declaration order, each holding !! exactly `size()` elements. The unit must be open for unformatted !! stream writing, for instance from `serialize_open_write`. class(particle_soa_t), intent(in) :: this !! Container to write. integer(default_int), intent(in) :: unit !! Stream unit opened for unformatted stream writing. type(error_t), intent(inout) :: err !! Error state, `ERROR_IO` if the stream cannot be written. integer(default_int) :: n n = this%extent%used call soa_write_prologue(unit, PARTICLE_SOA_SCHEMA, n, err) if (err%has_error()) return call soa_write_field(unit, this%id, n, err) if (err%has_error()) return call soa_write_field(unit, this%x, n, err) if (err%has_error()) return call soa_write_field(unit, this%y, n, err) if (err%has_error()) return call soa_write_field(unit, this%z, n, err) if (err%has_error()) return call soa_write_field(unit, this%mass, n, err) if (err%has_error()) return call soa_write_field(unit, this%active, n, err) if (err%has_error()) return end subroutine particle_soa_serialize