completed hdf5 saving function of lattice