increase polymorphism, read not allocatable
in preparation for potential slice/slab, increase polymorphism with select type
, which greatly deduplicates code for read and write
to provide a more stable user experience, instead of blindly allocating arbitrarily large arrays on read, make the user allocate the destination array before read. This was necessary to use select type
on read, and is a better practice for a stable library--we don't have to try to catch out-of-memory errors in the library for simple reasons of read array being too large.
There are plenty of use cases where the destination array size is known--particularly for slice/slab reads.