asdf-standard icon indicating copy to clipboard operation
asdf-standard copied to clipboard

Reading from Fortran

Open certik opened this issue 9 years ago • 1 comments

I would like to read ASDF from Fortran, just like I can read netcdf or hdf5. What is the best way to do that?

Due to #124, there are very few libraries in C or C++ (none in Fortran) that can actually read YAML. In fact, the only choice is to use http://pyyaml.org/wiki/LibYAML which is in C, or use https://github.com/jbeder/yaml-cpp/ and write C wrappers. Then use iso_c_binding to call from Fortran.

It seems that ASDF is no better than netcdf or hdf5 in this respect, where each has essentially just one library that can read it.

A different issue is if you use Python or Ruby, then yaml is better supported. But for a format that can be used to save data from production codes (typically written in Fortran or C++), the options seem to be very limited. For saving, one can simply emit the YAML code by hand and if you use Python to post-process it, that would work just fine. But I also want to be able to read ASDF from Fortran for post processing that requires more computation, and that's where I am stuck.

P.S. Let me know if this is not the right place to ask such a question, I opened #123 to add instructions how people can participate into the README.

certik avatar Jun 24 '16 16:06 certik

Hi @certik, thanks your interest and information. We'll get back to you shortly with more information.

justincely avatar Jun 29 '16 14:06 justincely