Skip to content
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

Compilation with -finit-local-zero fails #9

Open
bruceravel opened this issue Jun 24, 2014 · 1 comment
Open

Compilation with -finit-local-zero fails #9

bruceravel opened this issue Jun 24, 2014 · 1 comment

Comments

@bruceravel
Copy link
Contributor

Using gfortran's -finit-local-zero flag seems like a good idea. Read about it here.

However, FMS/fmstot.f fails with this error:

gfortran -o FMS/fmstot.o -c -O3 -ffree-line-length-none -finit-local-zero FMS/fmstot.f
FMS/fmstot.f:45.26:

 complex*16 dck, bmat                                              
                    1

Error: Automatic array 'bmat' at (1) cannot have an initializer
FMS/fmstot.f:43.34:

 complex gtr(ipmin:ipmax,nex),gtrloc(ipmin:ipmax,nex) !KJ I added i
                             1

Error: Automatic array 'gtr' at (1) cannot have an initializer
FMS/fmstot.f:43.58:

 complex gtr(ipmin:ipmax,nex),gtrloc(ipmin:ipmax,nex) !KJ I added i
                                                     1

Error: Automatic array 'gtrloc' at (1) cannot have an initializer
scons: *** [FMS/fmstot.o] Error 1

@newville
Copy link
Member

Worse: when ffmod3() calls fmstot() it doesn't even pass in the last 4 arguments added by !KJ. So, I think this is in the cannot-ever-work category anyway.

So, I wonder if we really need the FMS code. It appears that ffmod3() will segfault.

Guessing: It looks like the compilation complaint must be due to passing in two array bounds ipmin:ipmax in the subroutine call. That seems a little weird, because it is definitely OK (and -finit-local-zero doesn't complain) when one array bound is given as an array dimension -- this happens all over the place. So, I don't know of a quick solution But that declaration of bmat:
complex*16 bmat(-lx:lx,0:1,8, -lx:lx,0:1,8,ipmin:ipmax)

is pretty wild: 7 dimensions, most not starting at 1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants