record_bytes Function

public pure function record_bytes(tag, count) result(nbytes)

Total on disk size of a record, including its 12 byte record header.

Returns -1 when the tag is unknown or the count is negative. Useful to size a file up front, and used by the test suite to pin the format.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: tag

One of the PIC_TAG_* constants.

integer(kind=int64), intent(in) :: count

Number of elements in the record.

Return Value integer(kind=int64)


Calls

proc~~record_bytes~~CallsGraph proc~record_bytes record_bytes proc~element_bytes element_bytes proc~record_bytes->proc~element_bytes

Called by

proc~~record_bytes~~CalledByGraph proc~record_bytes record_bytes proc~soa_stream_bytes soa_stream_bytes proc~soa_stream_bytes->proc~record_bytes proc~particle_soa_serialized_bytes particle_soa_t%particle_soa_serialized_bytes proc~particle_soa_serialized_bytes->proc~soa_stream_bytes

Variables

Type Visibility Attributes Name Initial
integer(kind=int64), private :: esz

Source Code

   pure function record_bytes(tag, count) result(nbytes)
      !! Total on disk size of a record, including its 12 byte record header.
      !!
      !! Returns -1 when the tag is unknown or the count is negative. Useful to
      !! size a file up front, and used by the test suite to pin the format.
      integer(int32), intent(in) :: tag
         !! One of the `PIC_TAG_*` constants.
      integer(int64), intent(in) :: count
         !! Number of elements in the record.
      integer(int64) :: nbytes

      integer(int64) :: esz

      esz = element_bytes(tag)
      if (esz < 0_int64 .or. count < 0_int64) then
         nbytes = -1_int64
      else
         nbytes = PIC_RECORD_HEADER_BYTES + count*esz
      end if
   end function record_bytes