![]() Python import the fortran module as a library and it will remain in the memory between two calls. So I wonder if there is any wiser way to crack this problem. Here is a test code, and the actual fortran code is much more complicated, so it may be impossible for me to simply clear some variables.Īgain that I cannot simply use the integer::aīecause I have too many subroutines in my actual fortran code, so it is hard to check every variable declaration. But why would the variable values be saved between two calls of the module? Is there any way that I can reset the fortran module every time I call it in python? ![]() ![]() I understand that the fortran variable declarations would only be executed once. But some variable values in the fortran code seems to be inheritated between these two calls. I wrapeed up a fortran code using f2py and called the module twice in a python code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |