Experimental netcdf4 interface package #458
LKedward
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Fantastic, I will try it in the coming week. How do you think can this be best kept up to date with future NetCDF versions? If I understand it right, the interface should keep working as long as the API doesn't change. How do we update the interface when it does change? Is it possible to keep it in sync with the upstream repo? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've mentioned in previous threads that lightweight packages containing module interfaces are a better way of interfacing with system-installed packages instead of relying on
.mod
files. I've put together such a package for netcdf-fortran here: https://github.com/LKedward/netcdf-interfaces.Reading through the structure of netcdf-fortran I came to the tentative conclusion that the existing modern fortran interface modules therein are already well-defined and self-contained, and therefore sufficient for use as an fpm package that interfaces with an existing netcdf installation.
Moreover since the modern interface module only calls an
f77
style API (I think), then this fpm package should be useable across different compilers, even ifnetcdf-fortran
itself has only been compiled with a single compiler. The package currently contains some test programs copied from the netcdf-fortran repo, which run successfully in the CI with bothgfortran
andifort
(where netcdf-fortran is always compiler withgfortran
).The only caveat so far is that you need to use
--flag -fallow-argument-mismatch
withgfortran-10
.If anyone has success (or not) using it with their projects, do let me know.
Beta Was this translation helpful? Give feedback.
All reactions