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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | tag |
One of the |
||
| integer(kind=int64), | intent(in) | :: | count |
Number of elements in the record. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int64), | private | :: | esz |
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