简体   繁体   中英

f2py wrapper compilation error: setting shape of array

I'm having a problem with compiling via f2py. I have an f90 module with several subroutines in it. It has been compiling fine up to this point for use in a python script. However, now when I try to compile it and build it, it complains with this error:

build/src.macosx-10.5-x86_64-2.7/PyCosmology/sims/fort/read_sim-f2pywrappers2.f90:355.17:

   allocate(d())
             1
Error: Shape specification for allocatable scalar at (1)

It also has two other errors, but these just result from d() not being allocated correctly here. You can see that the file it is compiling is the f2py wrapper. More strangely, when I actually look at the wrapper file that it points to, line 355 is in fact:

       allocate(d(s(1),s(2)))

so I have no idea why the compiler is telling me there are no shape specifiers in the allocate statement. And because of that, I have no idea how to fix it!

Note that I have changed the module a little since last it compiled correctly, but the array for which this error occurs I have not touched at all, neither have I touched the particular subroutine it exists in.

Figured it out.

I was trying to allocate to an integer. Sorry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM