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

EXCH/mpse.f is broken #10

Open
bruceravel opened this issue Jun 24, 2014 · 5 comments
Open

EXCH/mpse.f is broken #10

bruceravel opened this issue Jun 24, 2014 · 5 comments

Comments

@bruceravel
Copy link
Contributor

In file EXCH/mpse.f, mpse.f does not compile with rank mismatches at lines 37 and 57. Variable edens is defined as rank 2 and called as rank 1. To get it to compile, I added ,1 as the second dimension in each case. That just cannot be right.

I suspect that Josh will have to be consulted on this one.

@newville
Copy link
Member

I'm confused. I see line 37 to be:

& SQRT(3.d0/((3 / (4_pi_edens(jIntrs+1,1))) ** third)**3)

and similar for line 57. I think that did already get changed from the original (I believe acceptable but non-recommended) edens(jintrs+1)

@bruceravel
Copy link
Contributor Author

Let me explain this a bit more clearly.

As delivered, line 37 was

&        SQRT(3.d0/((3 / (4*pi*edens(jIntrs+1))) ** third)**3)

and line 57 was

  RsInt = (3 / (4*pi*edens(jIntrs+1))) ** third

When compiling with the that file in that state, this happens with gfortran:

gfortran -o mpse.o -c -O3 -ffree-line-length-none mpse.f
mpse.f:37.41:

 &        SQRT(3.d0/((3 / (4*pi*edens(jIntrs+1))) ** third)**3)     
                                     1

Error: Rank mismatch in array reference at (1) (1/2)
mpse.f:57.30:

  RsInt = (3 / (4*pi*edens(jIntrs+1))) ** third                     
                          1

Error: Rank mismatch in array reference at (1) (1/2)
scons: *** [mpse.o] Error 1
scons: building terminated because of errors.

To get the file to compile, I modified those two lines to include the second index.

With the modification, the damn thing 💩 at least compiles. I think my modification should be transparent, but I don't really understand this bit of code. I don't seem to have access to the issue labels, or I would have used both of your neat, new ones.

@newville
Copy link
Member

But this change to edens(jIntrs+1, 1) IS in the master branch.

I think accessing an array declared ARRAY(i, j) as ARRAY(i) used to be
valid Fortran -- perhaps it's now deprecated? -- meaning ARRAY(i, 1). I'm
a little surprised gfortran calls that invalid. It's definitely bad
form, and should be made explicit.

@bruceravel
Copy link
Contributor Author

I am not certain what you are saying. edens(jIntrs+1, 1) IS in the master branch because I made that change in order to get the compilation to run to completion. I opened this issue because I wanted to document the change in a way that was up-front and obvious. You can close this issue if you would like.

@newville
Copy link
Member

OK. I guess I was confused by an issue on something that was already changed.

I think that the addition of the ', 1' is right, but then again maybe it should be edens(1, jintrs+1).....

I'm willing to leave the issue open until the code gets run. Then again, I'm not entirely that this code is actually called.

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