From 715fd2794d1d2f634bce01c8d1e22fc24b8b1aae Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Mon, 28 Oct 2019 17:42:27 -0600 Subject: [PATCH] Removed unused variable, solved issue #91 and #135 (array not large enough to contain data), added error message for future reference --- src/acepa.f90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/acepa.f90 b/src/acepa.f90 index 6e3d3bdd..dccbb884 100644 --- a/src/acepa.f90 +++ b/src/acepa.f90 @@ -24,6 +24,7 @@ module acepa ! main container array for ace data real(kr),dimension(:),allocatable::xss integer,parameter::nxss=999000 + integer,parameter::nwscr=50000 contains @@ -42,7 +43,7 @@ subroutine acepho(nin,nlax,nace,ndir,matd,mcnpx,iprint,itype,& real(kr)::awn(16) character(70)::hk ! internals - integer::nb,nw,nwscr,l,iza,idis,iinc,icoh,iabs,ipair,next + integer::nb,nw,l,iza,idis,iinc,icoh,iabs,ipair,next integer::i,ip,ir,nr,np,iz real(kr)::e,enext,s,v,vnext,v2,en,heat,siginc,zaid,tot character(8)::hdt @@ -70,7 +71,6 @@ subroutine acepho(nin,nlax,nace,ndir,matd,mcnpx,iprint,itype,& jxsd=0 !--allocate scratch storage - nwscr=10000 allocate(scr(nwscr)) !--allocate main container array @@ -518,7 +518,7 @@ subroutine alax(nin,nlax,matd,fluor,ener,abs,heat,a,nes) real(kr)::a(*) ! internals integer::loc(50) - integer::iz,nw,nb,nss,ll,iss,ntr,kk,idis,i,jj,n,mm + integer::iz,nw,nb,nss,ll,iss,ntr,idis,i,jj,n,mm real(kr)::e,en,sig,slo,shi,ek,rhok,sum1,sum2 real(kr)::el2,pl2,el3,pl3,tot,y,phi,rholt,elav,denom real(kr)::wt,ylt,flt,sum11,sum12,sum21,sum22,phik @@ -545,17 +545,20 @@ subroutine alax(nin,nlax,matd,fluor,ener,abs,heat,a,nes) ll=1 do iss=1,nss loc(iss)=ll + if (ll.gt.nwscr) call error('alax',& + 'storage exceeded for the atomic relaxation data',' ') call listio(nlax,0,0,a(ll),nb,nw) ntr=n2h ll=ll+nw do while (nb.ne.0) + if (ll.gt.nwscr) call error('alax',& + 'storage exceeded for the atomic relaxation data',' ') call moreio(nlax,0,0,a(ll),nb,nw) ll=ll+nw enddo enddo !--read in the photoionization cross section for the material - kk=ll call openz(nin,0) call tpidio(nin,0,0,a(ll),nb,nw) 210 call contio(nin,0,0,a(ll),nb,nw)