I am using a Fortran code that writes REAL type variables in h5files, so it uses this code
call h5dcreate_f(file_id,varn,H5T_NATIVE_REAL, filespace,dset_id, hdferr)
and of course other h5 functions like geth5dims
.
But I am confused as to why when I open the h5 file using either R or HDFview, REAL variables have up to 20+ digits of precision instead of the 7 that I would expect from a fortran REAL. Example: In fortran when I print out a variable I have 0.1662154 but in my h5file the same variable is 0.166215423415234653524...
Why all these extra digits, are these digits just noise? It's important because I will do further calculations that are sensitive to rounding errors.
Using the write statement with FORMAT(F30.25)
in Fortran I get 0.0006564661744050681591034 but in R I get 0.00065646617440506816, if in Fortran I only use write(,) var or print *,var instead I get only 6.565466E-4