In this video I will explain how to build a very simple program in fortran to write out data using the HDF5 library. Compared to the ascii routine it requires a lot more lines/effort to program, but IMO it is worth the time. In the end read/writing will be faster, file size will be smaller, and the data format will be portable.
An interface (wrapper) exists for multiple languages: C, Fortran, Python, Java, Matlab, etc.
hdfview, or hdf-compass quite useful for getting a quick glance at a HDF5 file's contents.
I just briefly touched on some hdf5 concepts, but there is so much more.
E.g. for a proper self contained simulation data file, I could have added the gridresolution, and number of particles, etc, as attributes.
See https://portal.hdfgroup.org/display/HDF5/HDF5 for the documentation.