Comments (5)
Hmm, I know exactly what's happening. The code is trying to parse the contents of the angle( ... )
and it is only prepared to see an integer or a reference to another variable there. A quick fix is to use angle(SIZE(n, 1), SIZE(n,2))
I believe, but I can look more into it this evening!
If you're interested in knowing how it works, the lines of code that parse out the assumed shapes of objects are here:
https://github.com/tchlux/fmodpy/blob/1.3.3/fmodpy/parsing/argument.py#L561-L591
from fmodpy.
Thanks for the fast reply :)
I went through the code a few times and i think i now have at least some understanding of what it does.
You seem to use ","
as the identifier to differentiate between SIZE(array)
and SIZE(array,axis)
. In the case above, there is ","
in size()
but no axis
.
A quick fix (maybe?) could be to change
if "," not in argument:
(L581) to
if "," not in argument or ")," not in argument:
But that's not so general I think.
from fmodpy.
Good find! Yeah, but this code actually needs to translate the contents of SIZE(...)
into viable Python code. That means wherever parentheses are used as indices they need to replaced by squared brackets. And any integer indices need to be shifted by -1
. For efficiency's sake, if there are constant expressions then I should be actually computing their value and subtracting one from that (as in your case above).
So this is a little bit more involved of a fix to handle a reasonable number of cases. It might be a little while before I push a fix. For now, I would recommend using the SIZE(<array>, <axis>)
formulation to make things work as is.
from fmodpy.
Okay, implemented a fix! 😁 Version 1.3.4
is now up and you can see the new logic in the code here:
https://github.com/tchlux/fmodpy/blob/1.3.4/fmodpy/parsing/argument.py#L570-L611
I tested it on the exact code block you have above and it appears to produce a correct result. However, I'll mention I think this is slightly less efficient on the Python wrapper side than doing SIZE(n, 1)
and SIZE(n, 2)
, since accessing indices in the shape is faster than slicing and measuring the size.
from fmodpy.
Thanks! I'll have a look at it.
I switched to SIZE(n,1)
etc. because I think that it also looks a bit cleaner and is faster to understand than SIZE(n(:,1))
.
from fmodpy.
Related Issues (9)
- Convertible? HOT 1
- Encountered unrecognized line while parsing Module HOT 16
- Building conda package from source code on pypi HOT 4
- Undefined Symbol Error HOT 3
- Compilation of fortran file fails: cannot open shared object file HOT 3
- Support for OpenMP or Co-array Fortran HOT 3
- Linking to OpenBLAS for BLAS and LAPACK on Windows HOT 15
- Question about wrong type of return value(in python) for allocatable real64 arrays(fortran). HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmodpy.