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

Make sigz array in MATXSR allocatable like in GROUPR #274

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

kernie
Copy link
Contributor

@kernie kernie commented Nov 18, 2022

When having more than 15 sigz values processed in GROUPR, MATXSR would simply crash because of hard coded array sigz of size 15.

This was now adapted to the GROUPR method, where those arrays are allocatable.

This PR includes already #270 .

@kernie
Copy link
Contributor Author

kernie commented Nov 18, 2022

@whaeck I tested on my machine (Linux gfortran-12) without error... Can I get more error output?

@whaeck
Copy link
Member

whaeck commented Nov 21, 2022

When the CI fails it is often difficult to figure out why. I will give this a try on a machine that has gfortran-9 installed to see if I can replicate the issue.

As a side note: since the arrays that you made allocate-able are local in a function you should not have to deallocate them, but you may want to try an input file with two matxsr runs in them to verify it is fine (in the past I have been bitten when trying to reallocate an already allocated array in a previous module call). In this case I think we're fine but it's better to be sure.

@kernie
Copy link
Contributor Author

kernie commented Nov 21, 2022

Good point. I added statements to make sure those arrays aren't allocated.

@whaeck
Copy link
Member

whaeck commented Nov 21, 2022

Interesting: I've cloned your repo, compiled it with gcc 9.3 and am now running the tests. Test 3 fails (still waiting on test 30 to run) but also test 2 is failing (that's a ccccr test).

@whaeck
Copy link
Member

whaeck commented Nov 21, 2022

Even more interesting, for test 3 I get the following error message with gcc-9.3:

At line 1082 of file /users/wim/njoy-testing/NJOY2016/src/matxsr.f90
Fortran runtime error: Attempting to allocate already allocated variable 'sigz'

Error termination. Backtrace:
#0 0x2adb7173db8b in ???
#1 0x2adb7173f493 in ???
#2 0x401b34 in ???
#3 0x4016ec in ???
#4 0x2adb73334554 in __libc_start_main
at ../csu/libc-start.c:266
#5 0x40171c in ???
#6 0xffffffffffffffff in ???

I'll update to your latest change - which seems to have solved the issue - from what I can see int he current CI state.

@kernie
Copy link
Contributor Author

kernie commented Nov 21, 2022

So, you were right! Test 3 involves 2 materials and it seems the allocated arrays weren't deallocated even when they were out of scope.

@whaeck
Copy link
Member

whaeck commented Nov 21, 2022

I saw something like that happen before but I wasn't thinking it would actually be the reason behind the errors :-)

Test 2 still fails on my side though. I'll have to look into it some more. SInce it is a CCCCR related thing, it is independent of this PR though.

@kernie
Copy link
Contributor Author

kernie commented Nov 22, 2022

I checked test 2 with gfortran-12 and gfortran-9.5, both ran without error....

@whaeck
Copy link
Member

whaeck commented Nov 22, 2022

Test 2 failing is unrelated to this PR so I'm not worried about that in this context. I have to check a few more things, but this might be good to go.

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

Successfully merging this pull request may close these issues.

2 participants