8000 Added nza again by whaeck · Pull Request #141 · njoy/NJOY2016 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added nza again #141

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

Merged
merged 4 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Release Notes—NJOY2016
Given here are some release notes for NJOY2016. Each release is made through a formal [Pull Request](https://github.com/njoy/NJOY2016/pulls) made on GitHub. There are links in this document that point to each of those Pull Requests, where you can see in great details the changes that were made. Often the Pull Requests are made in response to an [issue](https://github.com/njoy/NJOY2016/issues). In such cases, links to those issues are also given.

## [NJOY2016.53](https://github.com/njoy/NJOY2016/pull/141)
In an initial proposal for NJOY2016.51, the number of za values to be read (the nza variable) was explicitly requested in the input. This was removed in favor of reading 16 values by default and then determining how many were given. This proves problematic for NJOY21. As a result, specifying nza is now mandatory again.

## [NJOY2016.52](https://github.com/njoy/NJOY2016/pull/139)
An error was corrected in the calculation of the Coulomb elastic scattering cross section for incident charged particles. The issue was detected when producing an ACE file for alpha on alpha with ACER but the error also existed in GROUPR. All instances have been corrected. Tests were added for 5 cases to detect this issue in the future.

Expand Down
7 changes: 3 additions & 4 deletions docs/testDescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ title: NJOY2016 Test Descriptions

[[input](https://raw.githubusercontent.com/njoy/NJOY2016/master/tests/13/input)]

This case demonstrates the modern MCNP formats using <sup>61</sup>Ni from ENDF/B-VI. Note that `ACER` is run twice, once to prepare the ACE file, and again to do consistency checking and to prepare detailed [plots](https://raw.githubusercontent.com/njoy/NJOY2016/master/docs/tests/13/referenceTape36.pdf).
This case demonstrates the modern MCNP formats using <sup>61</sup>Ni from ENDF/B-VI. Note that `ACER` is run twice, once to prepare the ACE file, and again to do consistency checking and to prepare detailed [plots](https://raw.githubusercontent.com/njoy/NJOY2016/master/docs/tests/13/referenceTape36.pdf).

## Test Problem 14

Expand Down Expand Up @@ -125,7 +125,7 @@ title: NJOY2016 Test Descriptions
## Test Problem 21

[[input](https://raw.githubusercontent.com/njoy/NJOY2016/master/tests/21/input)]

This test case was developed to check if NaNs were "calculated" in `PURR`. This problem was discovered by Dave Brown and Paul Romano and was fixed in [Pull Request 18](https://github.com/njoy/NJOY2016/pull/18). This test was created in an attempt to prevent this from happening again. (No guarantees.)

## Test Problem 22
Expand Down Expand Up @@ -232,7 +232,7 @@ title: NJOY2016 Test Descriptions

[[input](https://raw.githubusercontent.com/njoy/NJOY2016/master/tests/45/input)]

This test was added following an issue identified in `GASPR` concerning the charged particle production cros ssections when the original ENDF tape does not contain the summation cross section when individual levels are present. This lead to double counting of these levels. This test was added to detect this problem in the future.
This test was added following an issue identified in `GASPR` concerning the charged particle production cross sections when the original ENDF tape does not contain the summation cross section when individual levels are present. This lead to double counting of these levels. This test was added to detect this problem in the future.

## Test Problem 46

Expand Down Expand Up @@ -272,4 +272,3 @@ title: NJOY2016 Test Descriptions
- test 52: LAW=5 LTP=1 for identical particles with a spin s = 0.5 (as expected, this remains the same before and after the fix)
- test 53: LAW=5 LTP=1 for identical particles with a spin s = 1 (this changes due to the fix but the original file does no have NaN values, as expected)
- test 54: LAW=5 LTP=1 for different particles (as expected, this remains the same before and after the fix)

27 changes: 14 additions & 13 deletions src/acer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ subroutine acer
! matd material to be processed
! tempd temperature desired (kelvin) (default=300)
! card 6
! newfor use new cummulative angle distributions,
! newfor use new cumulative angle distributions,
! law 61, and outgoing particle distributions.
! (0=no, 1=yes, default=1)
! iopp detailed photons (0=no, 1=yes, default=1)
Expand Down Expand Up @@ -174,6 +174,7 @@ subroutine acer
! matd material to be processed
! tempd temperature desired (kelvin) (default=300)
! tname thermal zaid name ( 6 char max, def=za)
! nza number of moderator component za values (default=3, max=16)
! card 8a
! iza moderator component za values (up to a maximum of 16 values,
! must be terminated by /)
Expand Down Expand Up @@ -358,14 +359,22 @@ subroutine acer
else if (iopt.eq.2) then
tempd=300
tscr=' '
nza=16
read(nsysi,*) matd,tempd,tscr
nza=3
Copy link
Member

Choose a reason for hiding this comment

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

I still don't like the default to be 3. While there wasn't an nza parameter previously, it was effectively defaulted to 1 as only 1 was required.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is to keep backwards compatible behaviour. If a user has an input like this:

    4025 296 'zrzrh' /
    40090 0 0 /

and we use nza=1 by default, then the last two zeros may be read as the next input (the mt numbers, number of bins, etc.). Setting nza by default equal to 3 solves this potential issue for old input.

Copy link
Member

Choose a reason for hiding this comment

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

To provide a counter argument what if the old input is this:

4025 296 'lwtr' /
1001 /

I think providing a single ZA is more common (which is why it was the default).

Copy link
Member Author

Choose a reason for hiding this comment

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

Why do we argue about this? It's a detail.

Anyway, in the case you bring up, the code will read it properly and reset nza to 1. Test 25 covers this behaviour and it passes with the current implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I didn't realize that it would read correctly (i.e., adding two extra zeros.) If that works, then we are good.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have to mimic the old implementation, in which these values were stored in three different variables and in which the second and third one were defaulted to zero (and that allows a user to add two zeros on the line). It's annoying but that's what it was before.

read(nsysi,*) matd,tempd,tscr,nza
nch=0
do i=1,6
if (tscr(i:i).ne.' ') nch=i
enddo
tname=' '
if (nch.gt.0) tname(7-nch:6)=tscr(1:nch)
write(nsyso,'(&
&'' mat to be processed .................. '',i10/&
&'' temperature .......................... '',1p,e10.3/&
&'' thermal name ......................... '',4x,a6)')&
matd,tempd,tname
if (nza.lt.1.or.nza.gt.16) then
call error('acer','between 1 and 16 za value must be given.',' ')
endif
do i=1,nza
izn(i)=0
enddo
Expand All @@ -377,17 +386,9 @@ subroutine acer
endif
enddo
write(nsyso,'(&
&'' mat to be processed .................. '',i10/&
&'' temperature .......................... '',1p,e10.3/&
&'' thermal name ......................... '',4x,a6/&
&'' number moderator component za values . '',i10)')&
matd,tempd,tname,nza
write(nsyso,'(&
&'' number moderator component za values . '',i10/&
&'' iza ................................ '',i10/&
&(40x,i10))') (izn(i),i=1,nza)
if (nza.eq.zero) then
call error('acer','at least one za value must be given.',' ')
endif
&(40x,i10))') nza,(izn(i),i=1,nza)
do i=1,nza
if (izn(i).le.zero) then
call error('acer','found invalid za numbers in izn.',' ')
Expand Down
5 changes: 2 additions & 3 deletions src/vers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module version
! These values are updated during the NJOY revision-control process.
implicit none
private
character(8),public::vers='2016.52'
character(8),public::vday='02Nov19'
character(8),public::vers='2016.53'
character(8),public::vday='07Nov19'
end module version

2 changes: 1 addition & 1 deletion tests/49/input
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ acer
-31 -25 0 71 61
2 0 1 .80/
'Zr in ZrH at 296k ' /
4025 296 'zrzrh' /
4025 296 'zrzrh' 6 /
40090 40091 40092 40094 40096 /
227 80 228 0 1 1.00022 2/
stop
0