module groupm
   ! provides subroutine groupr for NJOY2016
   use locale
   implicit none
   private
   public groupr,gengpn,gengpg

   ! global variables

   ! particle group structure
   integer::ign,ngn
   real(kr),dimension(:),allocatable::egn

   ! gamma group structure
   integer::igg,ngg
   real(kr),dimension(:),allocatable::egg

   ! weighting function
   integer::iwt,jsigz,jtemp
   real(kr),dimension(:),allocatable::wght
   real(kr),dimension(:),allocatable::wtbuf
   integer::nfp,nfv,nfscr,nflmax
   real(kr)::felo,fehi,sigpot,alpha2,alpha3,beta,sam,gamma
   integer,parameter::nbuf=1000

   ! temperatures and background cross sections
   real(kr),dimension(:),allocatable::temp
   real(kr),dimension(:),allocatable::sigz
   integer::ntemp,nsigz

   ! input mat, legendre order, print control, smoothing option and run title
   integer::matb,lord,iprint,ismooth
   real(kr)::rtitle(17)
   character(4)::title(17)
   equivalence(title(1),rtitle(1))

   ! unit numbers
   integer::nendf,npend,nend2,nend3,nflx,npend2,ninwt
   integer::ngout1,ngout2,ntw

   ! auto reaction processing lists
   ! - lfs8(i) points to the "level number" from mf8.
   ! - mlfs8(i) is calculated and corresponds to NJOY's assumption
   !   of the ground state or isomer number.
   integer,parameter::maxr1=1000
   integer,parameter::maxr2=10000
   integer::mf4(maxr1),mf6(maxr1),mf12(maxr1),mf13(maxr1),mf18(maxr1),&
     mf4r(6,maxr1),mf6p(6,maxr1),mf10f(maxr2),mf10s(maxr2),mf10i(maxr2),&
     lfs8(maxr2),mlfs8(maxr2)
   integer::lastza,izatest
