-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Following an internal discussion about Fortran real kinds, I noticed that the BMI 2.0 API uses the Fortran "double precision" as the real kind as the work horse for data exchange. It's these days considered bad practise to use real kind "double precision" since it depends on various compiler flags. One should instead define the precision kind that one really is expecting there. Now, there are two aspects to the BMI API. First, strictly it's a Fortran API and hence one could opt for any real kind definition that is commonly used in Fortran programs and libaries. However, there is also the second aspect of interoperability. I'm not sure how the internals of the Babelizer work, but I expect that at some level it assumes that the values in Fortran can be transferred to C, Java or Python without conversion. This would suggest across language interoperability. For this purpose the iso_c_bindings were introduced including the definition of a real kind c_double. I had a recent discussion about this topic on the Fortran-lang discourse grop. Maybe we should consider changing the Fortran real kinds being used in the API from real and double precision to c_float and c_double although on most platforms these definitions probably align.