-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calling AST from Fortran 90 #22
Comments
FYI, Fortran 2003 defines ISO C Binding: https://fortranwiki.org/fortran/show/iso_c_binding Just as you did with the F77 interface file, it should be possible to programmatically generate a Modern Fortran interface module file ast.f90 from a C header file (there are just too many functions to convert manually). One needs to be careful about passing function arguments by value or reference as and when required. Then for legacy F77 systems one would use the existing |
This seems like a great idea. Unfortunately I'm not sure if there is any effort available to do any of it. I don't think EAO have any use of or experience of Fortran 90 that would motivate them to do this. I don't think any Starlink contributor knows any of the new Fortran dialects either. |
Yeah, that's the problem! Insufficient resources and a general decline in the use of Fortran these days. Younger people are not inclined to learn Fortran anymore... |
It seems the Fortran bindings in AST are terribly, terribly outdated and cannot be used together with, for example, Fortran 90 or newer.
The 'AST_PAR' file uses old fixed-form FORTRAN 77. Even after converting it to newer free-form Fortran 90 and including it in a new Modern Fortran 2018 project, the AST functions cannot be called from within Fortran.
Frankly, the entire Fortran interface to AST needs a complete overhaul to make use of modern C <--> Fortran 2018 interoperability, each AST function should have a proper interface to C with all the function arguments listed explicitly etc., instead of being plain INTEGER types, and the Fortran interface file should be made a Fortran module.
It is a lot of work for the AST team but, as things stand at the moment, it is impossible to use Starlink AST in Fortran right now. I've been trying to switch from WCSLIB to AST in my Fortran 2018 code but had to give up.
Is Fortran not loved anymore? Surely this is not the case.
The text was updated successfully, but these errors were encountered: