Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Data passing w/ mixed programming f2008+python.

$
0
0

I would like to have your suggestions for the following task.

I'm developing a F2008 code that has to call a python script (specifically a special function in the mpmath lib) which will generate an array of data values that I want to transfer back to the fortran exec.

I can easily come up with a couple of  possible alternatives, all of which require the use of the intrinsic execute_command_line.  I can easily execute the python code with it, but how to transfer the results?

The simpler (and dumber, I guess) alternative is to write the results into a file and than load it into the F2008 code.

Another possibility is to call a C code which in turn calls the python script.  A third alternative would be to use f2py in order to avoid calling a C procedure, but I don't know if this is feasible...

Anyone can give me a tip here?

Thanks.


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>