-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
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.
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. |
There was a problem hiding this 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.
* Get low energy offset the NJOY way * Let last loop in `subroutine dldata` go over full `ngn` (error introduced during this PR)
There was a problem hiding this 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.
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. Thea
size variableisiza
was moved to a parameter statement and renamed to account for 4 byte and 8 byte equivalence'd variables.