-
Notifications
You must be signed in to change notification settings - Fork 27
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 the FORTRAN directly #121
Comments
Some pointers for future reference ... F2PYhttps://docs.scipy.org/doc/numpy/f2py/
f90wraphttps://github.com/jameskermode/f90wrap
F2x
|
Would be great! The actual wrapping would probably be easy, but the current state of the MAGICC source code is far from being modularized... |
I spent quite some time back in the days to make magicc be understood by f2py and f90wrap. failed. A main problem is the all-over use of global variables. The MOD_DATASTORE module exemplifies this. It is loaded in most of the subroutines, exposing almost all variables as global within each subroutine. |
We're a long way off this but I thought I'd start the conversation so we at least have somewhere we can record our thoughts.
Is your feature request related to a problem? Please describe.
At the moment pymagicc runs the binary then reads the output files. This is obviously slow and it would be much better to just compile the FORTRAN into modules that can be called from Python.
Describe the solution you'd like
A way to call the different MAGICC modules (once we modulise it), as written in FORTRAN, from Python and run the whole thing in memory rather than using all this input/output code.
Describe alternatives you've considered
Stick with the current way forever. I don't think this is a very good alternative.
Additional context
I have no idea how we pull this off. This resource from numpy (https://docs.scipy.org/doc/numpy-1.10.0/user/c-info.python-as-glue.html) seems like a good starting point but others probably know more (@rgieseke @lewisjared @swillner). It obviously also depends on the FORTRAN becoming modularised. As I said, this issue is intended more as a sandbox for resources/planning than putting anything into production right now.
The text was updated successfully, but these errors were encountered: