Skip to content

Commit

Permalink
Merge pull request #127 from njoy/fix/acer-iza
Browse files Browse the repository at this point in the history
Fix/acer iza
  • Loading branch information
whaeck authored Oct 31, 2019
2 parents e778142 + 8a21b38 commit e40a0d0
Show file tree
Hide file tree
Showing 8 changed files with 272,651 additions and 24 deletions.
6 changes: 6 additions & 0 deletions docs/testDescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,9 @@ title: NJOY2016 Test Descriptions

This test is added following issues in processing photoatomic data in `ACER` (see issues [\#91](https://github.com/njoy/NJOY2016/issues/91) and [\#135](https://github.com/njoy/NJOY2016/issues/135)). The problems were caused by truncation to 7 significant digits (knowing that the ENDF/B-VIII.0 files often go to 9 significant digits) and array sizes that were too small for the current data. This test was added to detect this problem in the future.

## Test Problem 49

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

This test is added following the change in how additional za values are handled in `ACER`. Previously, only 3 were allowed even though thermal scattering ACE file sometimes need more of them (e.g. Zr in ZrH). The user can now specify up to 16 values (the actual number of za values that the ACE file can store). The changes were made to be backwards compatible (test 25 ensures this).

41 changes: 27 additions & 14 deletions src/acer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ subroutine acer
! tempd temperature desired (kelvin) (default=300)
! tname thermal zaid name ( 6 char max, def=za)
! card 8a
! iza01 moderator component za value
! iza02 moderator component za value (def=0)
! iza03 moderator component za value (def=0)
! iza moderator component za values (up to a maximum of 16 values,
! must be terminated by /)
! card 9
! mti mt for thermal incoherent data
! nbint number of bins for incoherent scattering
Expand Down Expand Up @@ -234,7 +233,7 @@ subroutine acer

! internals
integer::nendf,npend,ngend,nace,ndir
integer::iopt,iprint,itype,nxtra
integer::iopt,iprint,itype,nxtra,nza
integer::matd
real(kr)::tempd
integer::newfor,iopp,ismooth
Expand All @@ -245,7 +244,6 @@ subroutine acer
integer::izn(16)
real(kr)::awn(16)
character(6)::tname,tscr
integer::iza01,iza02,iza03
integer::mti,nbint,mte,ielas,nmix,iwt
real(kr)::emax
real(kr)::time,zaid
Expand Down Expand Up @@ -360,24 +358,41 @@ subroutine acer
else if (iopt.eq.2) then
tempd=300
tscr=' '
nza=16
read(nsysi,*) matd,tempd,tscr
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)
iza02=0
iza03=0
read(nsysi,*) iza01,iza02,iza03
do i=1,nza
izn(i)=0
enddo
read(nsysi,*) (izn(i),i=1,nza)
do i=nza,1,-1
if (izn(i).ne.zero) then
nza=i
exit
endif
enddo
write(nsyso,'(&
&'' mat to be processed .................. '',i10/&
&'' temperature .......................... '',1p,e10.3/&
&'' thermal name ......................... '',4x,a6/&
&'' iza01 ................................ '',i10/&
&'' iza02 ................................ '',i10/&
&'' iza03 ................................ '',i10)')&
matd,tempd,tname,iza01,iza02,iza03
&'' number moderator component za values . '',i10)')&
matd,tempd,tname,nza
write(nsyso,'(&
&'' 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
do i=1,nza
if (izn(i).le.zero) then
call error('acer','found invalid za numbers in izn.',' ')
endif
enddo
mti=0
nbint=0
mte=0
Expand Down Expand Up @@ -426,7 +441,6 @@ subroutine acer
!--prepare thermal ace data
else if (iopt.eq.2) then
call acesix(npend,nace,ndir,matd,tempd,tname,suff,hk,izn,awn,&
iza01,iza02,iza03,&
mti,nbint,mte,ielas,nmix,emax,iwt,iprint,mcnpx)

!--prepare dosimetry data
Expand Down Expand Up @@ -504,4 +518,3 @@ subroutine acer
end subroutine acer

end module acem

13 changes: 5 additions & 8 deletions src/aceth.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module aceth
contains

subroutine acesix(nin,nace,ndir,matd,tempd,tname,suff,&
hk,izn,awn,iza01,iza02,iza03,&
hk,izn,awn,&
mti,nbin,mte,ielas,nmix,emax,iwt,iprint,mcnpx)
!-------------------------------------------------------------------
! Convert thermal matrices in njoy MF6 format to various ACE
Expand All @@ -41,7 +41,7 @@ subroutine acesix(nin,nace,ndir,matd,tempd,tname,suff,&
use util ! provides openz,repoz,mess,error,closz
use endf ! provides endf routines and variables
! externals
integer::nin,nace,ndir,matd,iza01,iza02,iza03
integer::nin,nace,ndir,matd
integer::mti,nbin,mte,ielas,nmix,iwt,iprint,mcnpx
real(kr)::tempd,suff,emax
integer::izn(16)
Expand Down Expand Up @@ -513,7 +513,7 @@ subroutine acesix(nin,nace,ndir,matd,tempd,tname,suff,&
290 continue

!--write ace format thermal tape
call thrlod(nout,matd,tempd,tname,suff,izn,iza01,iza02,iza03,&
call thrlod(nout,matd,tempd,tname,suff,izn,&
nbin,nang,nmix,iwt,mcnpx)
if (iprint.gt.0) call thrprt(hk)
itype=1
Expand Down Expand Up @@ -634,7 +634,7 @@ subroutine thrfix(itype,nin,nout,ndir,iprint,nplot,mcnpx,suff,&
return
end subroutine thrfix

subroutine thrlod(nin,matd,tempd,tname,suff,izn,iza01,iza02,iza03,&
subroutine thrlod(nin,matd,tempd,tname,suff,izn,&
nbini,nang,nmix,iwt,mcnpx)
!-------------------------------------------------------------------
! write a thermal output tape in ace format.
Expand All @@ -643,7 +643,7 @@ subroutine thrlod(nin,matd,tempd,tname,suff,izn,iza01,iza02,iza03,&
use util ! provides date,repoz
use mainio ! provides nsyso
! externals
integer::nin,matd,iza01,iza02,iza03,nbini,nang,nmix,iwt,mcnpx
integer::nin,matd,nbini,nang,nmix,iwt,mcnpx
real(kr)::tempd,suff
integer::izn(16)
character(6)::tname
Expand All @@ -666,9 +666,6 @@ subroutine thrlod(nin,matd,tempd,tname,suff,izn,iza01,iza02,iza03,&
endif
call dater(hdt)
hd=' '//hdt
izn(1)=iza01
izn(2)=iza02
izn(3)=iza03
ncl=0
idpni=3
ifeng=0
Expand Down
4 changes: 2 additions & 2 deletions src/vers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module version
! These values are updated during the NJOY revision-control process.
implicit none
private
character(8),public::vers='2016.50'
character(8),public::vday='29Oct19'
character(8),public::vers='2016.51'
character(8),public::vday='01Nov19'
end module version

14 changes: 14 additions & 0 deletions tests/49/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/input"
"${CMAKE_CURRENT_BINARY_DIR}/input" COPYONLY )

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/referenceTape71"
"${CMAKE_CURRENT_BINARY_DIR}/referenceTape71" COPYONLY )

configure_file("${RESOURCES}/n-040_Zr_090-ENDF8.0.endf"
"${CMAKE_CURRENT_BINARY_DIR}/tape20" COPYONLY )
configure_file("${RESOURCES}/tsl-ZrinZrH-ENDF8.0.endf"
"${CMAKE_CURRENT_BINARY_DIR}/tape30" COPYONLY )

add_test( NAME "Test49"
COMMAND ${PYTHON_EXECUTABLE} "../execute.py"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" )
33 changes: 33 additions & 0 deletions tests/49/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
moder
20 -21
moder
30 -31
reconr
-21 -22
'pendf tape for ENDF/B-VIII 40-Zr-90'/
4025 0 0/
.001/
0/
broadr
-21 -22 -23
4025 1/
.001/
296 /
0/
heatr
-21 -23 -24/
4025 4/
302 402 443 444 /
thermr
30 -24 -25
58 4025 20 1 2 0 0 1 227 1 /
296 /
.001 1.00022/
acer
-31 -25 0 71 61
2 0 1 .80/
'Zr in ZrH at 296k ' /
4025 296 'zrzrh' /
40090 40091 40092 40094 40096 /
227 80 228 0 1 1.00022 2/
stop
Loading

0 comments on commit e40a0d0

Please sign in to comment.