Modification of NJOY2016.65 for
JENDL-5 neutron, photoatomic, and charged particle sublibraries (Rev.2)
It is necessary to modify NJOY2016.65 in order to process JENDL-5 neutron,photoatomic, and charged particle sublibraries. Here we show the modifications ofNJOY2016.65. Note that only the heart module in NJOY2016.65 were used for
JENDL-5 neutron sublibrary because FRENDY was mainly used. You must use themodifications with your own responsibility.
1. Modification for JENDL-5 neutron sublibrary (1)We encountered the following errors.
***error in endf*** illegal TAB1, nbt(nr)/=np for mf/mt = 3/ 1 in acer processing ofNi58 etc.
***error in topfil***nxc.gt.nxcmax. in acer processing of Cu63 etc.
Abort trap: 6 in purr processing of Gd155 etc.
Our solutions for the errors are as follows.
(1) acefc.f90
line 27
integer,parameter::nxcmax=500--> integer,parameter::nxcmax=1000
line 1940
integer::nep,ll,iep,nb,nw,iend,nwmax,nin0,latng,i,np--> integer::nep,ll,iep,nb,nw,iend,nwmax,nin0,lang,i,np,nw2
line 2314
call tab2io(nin,0,0,b,nb,nw)--> call tab2io(nin,0,0,b,nb,nw2)
line 2337
call tab2io(0,nout,0,b,nb,nw)--> call tab2io(0,nout,0,b,nb,nw2)
line 3892
nned=50

--> nned=100(2) purr.f90
line 1101
nthr=140--> nthr=500
2. Modification for JENDL-5 neutron sublibrary (2)We encountered negative heating numbers due to energy balance problem. We
replaced heating numbers from the energy balance method with those from thekinematics method by modifying heart.f90 and setting the new input parameter kermato 1. We also modified heart.f90 based on Chinese researchers’ studies (Wen Yin, etal., Annals of Nuclear Energy 164 (2021) 108624, Shengli Chen, Nuclear Instrumentsand Methods in Physics Research B 513 (2022) 1–8).
(1) heatr.f90
line 37
real(kr)::emc2,tm,rtm--> real(kr)::emc2,tm,rtm
integer::kerma
line 98
!
--> !
!
!

(default from built-in table)(default from built-in table)
kerma
0/1=energy balance kerma/kinematics kerma(default=0)line 164read(nsysi,*) matd,npk,nqa,ntemp,local,iprint,break--> kerma=0
read(nsysi,*) matd,npk,nqa,ntemp,local,iprint,break,kerma
line 217
do i=1,npk
if (mtk(i).eq.443.and.kchk.eq.0) kchk=2
if (mtk(i).eq.301) isave=i
enddo--> do i=1,npk
if (mtk(i).eq.443.and.kchk.eq.0) kchk=2

if (mtk(i).eq.301) isave=i
enddo
do i=1,npk
if (mtk(i).eq.443) go to 100
enddo
if (kerma.eq.1) call error('heatr',&' no mt=443 in input!',' ')100 continueline 262
endif
if (ntemp.eq.0) ntemp=100--> endif
write(nsyso,'(&&'' kerma (0 e-balance, 1 kinematics) .... '',i10)')&kerma
if (ntemp.eq.0) ntemp=100
line 2944
if (irec.gt.0) pe=1--> if ((mth.ne.102).and.(irec.gt.0)) pe=1line 3228
xx=c(l)--> xx=abs(c(l))
line 5681
integer,parameter::nwscr=10000--> integer,parameter::nwscr=10000
integer::mt302,mt318,mt402,mt443
line 5702
do i=2,npk
if (mtp(i).ge.442) thennpkd=npkd-1
npktd=npktd-1
endif
enddo
--> do i=2,npk

if (mtp(i).ge.442) thennpkd=npkd-1
npktd=npktd-1
endif
enddo
mt443=0
mt318=0
mt402=0
mt443=0
if (kerma.eq.1) thendo i=2,npk
if (mtp(i).eq.302) mt302=(npk-1)*2+i
if (mtp(i).eq.318) mt318=(npk-1)*2+i
if (mtp(i).eq.402) mt402=(npk-1)*2+i
if (mtp(i).eq.443) mt443=i
enddo
endif
line 5784
118 continuei=i+2
scr(ibase+i-1)=c(1)scr(ibase+i)=c(inpk)--> 118 continuei=i+2
scr(ibase+i-1)=c(1)scr(ibase+i)=c(inpk)
if (kerma.eq.1) thenif (mth.eq.301) scr(ibase+i)=c(mt443)
if (mth.eq.302) scr(ibase+i)=c(mt302)
if (mth.eq.318) scr(ibase+i)=c(mt318)
if (mth.eq.402) scr(ibase+i)=c(mt402)
endifline 5815
call afend(0,nscr)
call repoz(nscr)--> call afend(0,nscr)
call repoz(nscr)

if (mt443.ne.0) thenwrite(strng,'(''mt=301 is replaced with mt=443! '')')
call mess('heatr',strng,' ')endif
if (mt302.ne.0) thenwrite(strng,'(''mt=302 is replaced with kinematics one! '')')
call mess('heatr',strng,' ')endif
if (mt318.ne.0) thenwrite(strng,'(''mt=318 is replaced with kinematics one! '')')
call mess('heatr',strng,' ')endif
if (mt402.ne.0) thenwrite(strng,'(''mt=402 is replaced with kinematics one! '')')
call mess('heatr',strng,' ')endif
3. Modification for JENDL-5 photoatomic sublibrary
We encountered the following errors.
forrtl: severe (408): fort: (2): Subscript #1 of the array XSS has value 999001 which isgreater than the upper bound of 999000 in acer processing of N.
forrtl: error (140): floating inexact in acer processing of Mg etc.
The first error occurred because the same energy exists in the ENDF-6 file. We fixed
this error by modifying util.f90 as follows(1) util.f90
line 377
if (x.ne.zero) thenaa=log10(abs(x))
ipwr=int(aa)if (aa.lt.zero) ipwr=ipwr-1
ipwr=ndig-1-ipwr
ii=nint(x*ten**ipwr+ten**(ndig-11))
if (ii.ge.10**ndig) thenii=ii/10
ipwr=ipwr-1
endifii=ii+idig
xx=ii*ten**(-ipwr)
endif--> if (x.ne.zero) thenaa=log10(abs(x))
ipwr=int(aa)if ((ndig.eq.9).and.(aa.gt.zero).and.(aa-ipwr.lt.1.0e-6_kr)) ipwr=ipwr-1
if (aa.lt.zero) ipwr=ipwr-1
ipwr=ndig-1-ipwr
ii=nint(x*ten**ipwr+ten**(ndig-11))
if (ii.gt.10**ndig) thenii=ii/10
ipwr=ipwr-1
endif
ii=ii+idig
xx=ii*ten**(-ipwr)
endif
The second error occurred because NJOY2016.65 requires atomic relaxation data,
which were not required in the old NJOY codes. We used JENDL-5 atomic relaxation
sublibrary in this processing.
4. Modification for JENDL-5 charged particle sublibrariesNJOY2016.65 produces ACE files of LAW=61 for JENDL-5 charged particle
sublibraries, where LAW=7 is adopted. Unfortunately MCNP6.2 and PHITS3.27
cannot treat charged particle ACE files of LAW=61 correctly, while they can docharged particle ACE files of LAW=67. NJOY2016.65 has a hidden function toproduce charged particle ACE files of LAW=67, but the function is not perfect. We
completed the hidden function as follows and produced charged particle ACE files ofLAW=67. We also changed the interpolation of 22 to 2 in file6 mt=5 to 2 for the Be9
proton ACE file because MCNP6.2 and PHITS3.27 do not support the interpolation of22.
(1) acer.f90
line 158!

NOTE: ismooth=0 is the default value in njoy99.

--> !
!
!

NOTE: ismooth=0 is the default value in njoy99.
convert law=7 sections to law=61 or law=67(0=law67, 1=law61, default=1)

no7

line 240
integer::newfor,iopp,ismooth--> integer::newfor,iopp,ismooth,no7
line 313
ismooth=1
read(nsysi,*) newfor,iopp,ismooth
write(nsyso,'(&&'' new formats .......................... '',i10/&&'' photon option ........................ '',i10/&&'' smoothing option ..................... '',i10)')&
newfor,iopp,ismooth--> ismooth=1
no7=0
read(nsysi,*) newfor,iopp,ismooth,no7
write(nsyso,'(&&'' new formats .......................... '',i10/&&'' photon option ........................ '',i10/&&'' smoothing option ..................... '',i10/&&’’ law7 option ..................... '',i10)')&
newfor,iopp,ismooth,no7
line 440
hk,izn,awn,matd,tempd,newfor,iopp,ismooth,thin)--> hk,izn,awn,matd,tempd,newfor,iopp,ismooth,no7,thin)(2) acefc.f90
line 90subroutine acetop(nendf,npend,ngend,nace,ndir,iprint,itype,mcnpx,&
suff,hk,izn,awn,matd,tempd,newfor,iopp,ismooth,thin)--> subroutine acetop(nendf,npend,ngend,nace,ndir,iprint,itype,mcnpx,&
suff,hk,izn,awn,matd,tempd,newfor,iopp,ismooth,no7,thin)line 99
integer::nendf,npend,ngend,nace,ndir,iprint,itype,matd,newfor,iopp,ismooth,i--> integer::nendf,npend,ngend,nace,ndir,iprint,itype,matd,newfor,iopp,ismooth,no7,iline 198
call topfil(nendf,mscr,matd,newfor)--> call topfil(nendf,mscr,matd,newfor,no7)
line 1919
subroutine topfil(nin,nout,matd,newfor)--> subroutine topfil(nin,nout,matd,newfor,no7)
line 1954!--this flag says convert law=7 to law=1integer::no7=1--> !--this flag says convert law=7 to law=67 or law=61
integer::no7line 2474
l=l+66--> l=l+300
line 5796
law=l2h--> law=l2h
ll=1+nw
do while (nb.ne.0)
call moreio(nin,0,0,scr(ll),nb,nw)
ll=ll+nw
enddo
line 5850
call acecpe(next,scr,nin,awr,awp,&spi,ne,lidp,ie,il,nes)--> if (mth.eq.2) thencall acecpe(next,scr,nin,awr,awp,&spi,ne,lidp,ie,il,nes)else
call acensd(ir,next,scr,nin,ltt3,lttn,&ltt,last,law,ne,ie,il,iso,newfor)
endif
line 6288

real(kr),parameter::rmin=1.e-30_kr--> real(kr),parameter::rmin=1.e-30_kr
real(kr),parameter::zero=0line 6299
call tab1io(nin,0,0,scr,nb,nw)--> call tab1io(nin,0,0,scr,nb,nw)
ll=1+nw
do while (nb.ne.0)
call moreio(nin,0,0,scr(ll),nb,nw)
ll=ll+nw
enddo
line 6342
iint=nint(scr(8))--> iint=nint(scr(8))
if (iint.eq.22) iint=2
line 6365renorm=1/xss(next+3*n)--> renorm=1.0
if (xss(next+3*n).ne.zero) renorm=1/xss(next+3*n)line 7763
intmu=l1h--> intmu=scr(jscr+7)
line 7777
intep=nint(scr(jscr+7))--> intep=nint(scr(jscr+7))
if (intep.gt.2) intep=2
line 7803
renorm=1/xss(nexd+3*npep)--> renorm=1.0
if (xss(nexd+3*npep).ne.zero) renorm=1/xss(nexd+3*npep)
line 9019
integer::next,matd,nin

-> integer::next,matd,nin,newfor
line 9890
intx=nint(scr(lld+7))--> intx=nint(scr(lld+7))
if (intx.eq.22) intx=2line 9891
xss(na+ie)=scr(lld+1)--> xss(na+ie)=scr(lld+1)/emev
line 10582
intmu=l1h--> intmu=scr(ll+7)
if (intmu.eq.22) intmu=2
line 10602
intep=nint(scr(ll+7))--> intep=nint(scr(ll+7))
if (intep.eq.22) intep=2
line 10754
do while (mtt.ne.mt)
ir=ir+1
mtt=nint(xss(mtr+ir-1))
k=nint(xss(lsig+ir-1))+sig-1
n=nint(xss(k+1))
iaa=nint(xss(k))
q=xss(lqr+ir-1)
enddo--> do while (mtt.le.mt)
ir=ir+1
mtt=nint(xss(mtr+ir-1))
k=nint(xss(lsig+ir-1))+sig-1
n=nint(xss(k+1))
iaa=nint(xss(k))
q=xss(lqr+ir-1)
if (ir.eq.nprod) exit
enddo

line 13814
nrr=nint(xss(l))
call write_integer(nout,l)! NR
if (nrr.gt.0) thencall write_integer_list(nout,l,2*nrr) ! NBT, INT (each NR
endif
ne=nint(xss(l))
call write_integer(nout,l)! NE
call write_real_list(nout,l,ne)! E (NE values)
ielocator=lcall write_integer_list(nout,l,ne)! L (NE values)
do j=1,necall advance_to_locator(nout,l,dlwh+nint(xss(ielocator))call write_integer(nout,l)! INTMU
nmu=nint(xss(l))
call write_integer(nout,l)! NMU
call write_real_list(nout,l,nmu)! MU (NMU values)
oelocator=lcall write_integer_list(nout,l,nmu) ! L (NMU values)
do k=1,nmu
call advance_to_locator(nout,l,dlwh+nint(xss(oelocator))-1)
call write_integer(nout,l)! INTEP
nep=nint(xss(l))
call write_integer(nout,l)! NPEP
call write_real_list(nout,l,3*nep) ! Eout, PDF, CDF (each NMU values)
oelocator=oelocator+1
enddo
ielocator=ielocator+1
enddo--> do j=1,necall write_integer(nout,l)! INTMU
nmu=nint(xss(l))
call write_integer(nout,l)! NMU
call write_real_list(nout,l,nmu)! MU (NMU values)
oelocator=lcall write_integer_list(nout,l,nmu) ! L (NMU values)
do k=1,nmu

call write_integer(nout,l)! INTEP
nep=nint(xss(l))
call write_integer(nout,l)! NPEP
call write_real_list(nout,l,3*nep) ! Eout, PDF, CDF (each NMU values)
oelocator=oelocator+1
enddo
enddo
line 19394
intmu=nint(a7(loci))--> intmu=nint(a7(loci))
if (intmu.eq.22) intmu=2
line 19410
intmu=nint(a7(loci))--> intmu=nint(a7(loci))
if (intmu.eq.22) intmu=2(3) gaspr.f90
line 273
if (mth.gt.200.or.mth.eq.0) then--> if (mth.gt.202.or.mth.eq.0) thenline 287
if (mth.gt.200.and.mth.lt.mpmin) go to 245--> if (mth.gt.202.and.mth.lt.mpmin) go to 245
line 475
if (mth.gt.200.and.mth.lt.mpmin) go to 310--> if (mth.gt.202.and.mth.lt.mpmin) go to 310
line 950
if (nint(a(j+3)).eq.3.and.nint(a(j+4)).gt.200) idone=1--> if (nint(a(j+3)).eq.3.and.nint(a(j+4)).gt.202) idone=1
line 1038
if (mth.gt.200.or.mth.eq.0) then--> if (mth.gt.202.or.mth.eq.0) then