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

Fix wrong memory addresses due to not accounted GROUPR offset #262

Merged
merged 7 commits into from
Sep 16, 2022

Conversation

kernie
Copy link
Contributor

@kernie kernie commented Sep 15, 2022

GROUPR writes gendf data in a compact way and let us know, what the offset is.

The dlayxs part of CCCR loops over the full energy group range in container variable a where it should loop only until the offset. Thereby, on chance uninitialized or invalid memory may be addressed and may lead at best to a crash or simply runs without error but resulting in values like 1.E+44 for delayed spectra.

This commit introduces the offset and corrects 2 loops. Moreover, a check is introduced if the requested memory fits into the a variable. The a size variable isiza was moved to a parameter statement and renamed to account for 4 byte and 8 byte equivalence'd variables.

GROUPR writes gendf data in a compact way and let us know, what the offset is.

The dlayxs part of CCCR loops over the full energy group range in container variable `a` where it should loop only until the offset. Thereby, on chance uninitialized or invalid memory may be addressed and may lead at best to a crash or simply runs without error but resulting in values like 1.E+44 for delayed spectra.

This commit introduces the offset and corrects 2 loops. Moreover,  a check is introduced if the requested memory fits into the `a` variable. The `a` size variable `isiza` was moved to a parameter statement and renamed to account for 4 byte and 8 byte equivalence'd variables.
@kernie
Copy link
Contributor Author

kernie commented Sep 15, 2022

To see the erroneous bevavior, one can take input.cccr_u232_361.txt with ENDF6 data of U-232. It uses the SHEM-361 group structure.

@kernie kernie marked this pull request as ready for review September 15, 2022 09:40
@whaeck whaeck self-requested a review September 15, 2022 16:22
Copy link
Member

@whaeck whaeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor questions that we should address before approving this.

I have asked @nathangibson14 to have a look if he has some time - but I think these changes are pretty straight forward.

src/ccccr.f90 Show resolved Hide resolved
ReleaseNotes.md Outdated Show resolved Hide resolved
src/ccccr.f90 Outdated Show resolved Hide resolved
tests/77/input Outdated Show resolved Hide resolved
tests/77/input Outdated Show resolved Hide resolved
Maarten Becker added 4 commits September 15, 2022 19:24
* Get low energy offset the NJOY way
* Let last loop in `subroutine dldata` go over full `ngn` (error introduced during this PR)
Copy link
Member

@whaeck whaeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go. I'm waiting for some feedback from @nathangibson14 before I merge but I think we won't need more changes here.

I did verify the specs for the delayed neutron data in the GENDF file and that -1 does indeed need to be taken into account. Putting the comment there makes it easier to understand as well.

@whaeck whaeck merged commit 6b0a3f3 into njoy:develop Sep 16, 2022
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