particle_soa_serialize Subroutine

private 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.

Type Bound

particle_soa_t

Arguments

Type IntentOptional 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, ERROR_IO if the stream cannot be written.


Calls

proc~~particle_soa_serialize~~CallsGraph proc~particle_soa_serialize particle_soa_t%particle_soa_serialize interface~soa_write_field soa_write_field proc~particle_soa_serialize->interface~soa_write_field proc~error_has_error error_t%error_has_error proc~particle_soa_serialize->proc~error_has_error proc~soa_write_prologue soa_write_prologue proc~particle_soa_serialize->proc~soa_write_prologue proc~soa_write_int32_field soa_write_int32_field interface~soa_write_field->proc~soa_write_int32_field proc~soa_write_int64_field soa_write_int64_field interface~soa_write_field->proc~soa_write_int64_field proc~soa_write_logical_field soa_write_logical_field interface~soa_write_field->proc~soa_write_logical_field proc~soa_write_real_dp_field soa_write_real_dp_field interface~soa_write_field->proc~soa_write_real_dp_field proc~soa_write_real_sp_field soa_write_real_sp_field interface~soa_write_field->proc~soa_write_real_sp_field proc~soa_write_prologue->proc~error_has_error interface~to_char to_char proc~soa_write_prologue->interface~to_char interface~write_array write_array proc~soa_write_prologue->interface~write_array proc~error_set error_t%error_set proc~soa_write_prologue->proc~error_set proc~write_header write_header proc~soa_write_prologue->proc~write_header 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 proc~write_char_record write_char_record interface~write_array->proc~write_char_record proc~write_int32_array write_int32_array interface~write_array->proc~write_int32_array proc~write_int64_array write_int64_array interface~write_array->proc~write_int64_array proc~write_real_dp_array write_real_dp_array interface~write_array->proc~write_real_dp_array proc~write_real_sp_array write_real_sp_array interface~write_array->proc~write_real_sp_array proc~soa_write_int32_field->proc~error_has_error proc~soa_write_int32_field->interface~write_array proc~soa_check_live_count soa_check_live_count proc~soa_write_int32_field->proc~soa_check_live_count proc~soa_write_int64_field->proc~error_has_error proc~soa_write_int64_field->interface~write_array proc~soa_write_int64_field->proc~soa_check_live_count proc~soa_write_logical_field->proc~error_has_error proc~soa_write_logical_field->interface~write_array proc~soa_check_alloc soa_check_alloc proc~soa_write_logical_field->proc~soa_check_alloc proc~soa_write_logical_field->proc~soa_check_live_count proc~soa_write_real_dp_field->proc~error_has_error proc~soa_write_real_dp_field->interface~write_array proc~soa_write_real_dp_field->proc~soa_check_live_count proc~soa_write_real_sp_field->proc~error_has_error proc~soa_write_real_sp_field->interface~write_array proc~soa_write_real_sp_field->proc~soa_check_live_count proc~check_io check_io proc~write_header->proc~check_io proc~check_io->interface~to_char proc~check_io->proc~error_set proc~soa_check_alloc->interface~to_char proc~soa_check_alloc->proc~error_set proc~soa_check_live_count->interface~to_char proc~soa_check_live_count->proc~error_set proc~write_char_record->proc~check_io proc~error_get_code error_t%error_get_code proc~write_char_record->proc~error_get_code proc~error_wrap error_t%error_wrap proc~write_char_record->proc~error_wrap proc~write_record_header write_record_header proc~write_char_record->proc~write_record_header proc~write_int32_array->proc~check_io proc~write_int32_array->proc~error_get_code proc~write_int32_array->proc~error_wrap proc~write_int32_array->proc~write_record_header proc~write_int64_array->proc~check_io proc~write_int64_array->proc~error_get_code proc~write_int64_array->proc~error_wrap proc~write_int64_array->proc~write_record_header proc~write_real_dp_array->proc~check_io proc~write_real_dp_array->proc~error_get_code proc~write_real_dp_array->proc~error_wrap proc~write_real_dp_array->proc~write_record_header proc~write_real_sp_array->proc~check_io proc~write_real_sp_array->proc~error_get_code proc~write_real_sp_array->proc~error_wrap proc~write_real_sp_array->proc~write_record_header proc~error_wrap->proc~error_has_error proc~clip_tail clip_tail proc~error_wrap->proc~clip_tail proc~write_record_header->proc~check_io

Variables

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

Source Code

   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