The present implementation of defined formatted I/O is incorrect for arrays in the data item list; it assumes that a DT defined format descriptor (or list-directed/namelist instance) applies to all of the elements in the array. The loop over the elements in the array is within the DefinedFormattedIo() template function that handles defined formatted I/O, not around its calls. This causes only one format list edit descriptor to be used for the whole array, which is of course wrong. Invert this arrangment by performing the per-element looping in at the top level in FormattedDerivedTypeIo() instead. Defined unformatted I/O remains as it was.
6.3 KiB
6.3 KiB