! written by nbigen.py
! *** do not edit *** (use nbigen.py instead)
 
subroutine nbi_alloc_minb
 
  use nbi_com
  implicit NONE
  integer :: j
 
  !==============================================
  ! internal arrays
 
  if(allocated(cxpray)) then
     write(nonlin,*) '%nbi_alloc_minb: cxpray already allocated; exiting.'
     return
  endif
 
  allocate(cxpray(minb, mibs)); cxpray = zero
  allocate(fppray(minb, mibs)); fppray = zero
  allocate(goosay(minb, mibs)); goosay = zero
  allocate(nbndex(minb, mibs)); nbndex = 0
  do j=1,minb
     nbndex(j,1:mibs)=j
  enddo
  allocate(nbscay(minb, mibs)); nbscay = 0
  allocate(nbienay(minb, mibs)); nbienay = 0
  allocate(einjay(minb, mibs)); einjay = zero
  allocate(njavay(minb, mibs)); njavay = 0
  allocate(njavay_saw(minb, mibs)); njavay_saw = 0
  allocate(pmechay(minb, mibs)); pmechay = zero
  allocate(pphiay(minb, mibs)); pphiay = zero
  allocate(pinjay(minb, mibs)); pinjay = zero
  allocate(pmechay_saw(minb, mibs)); pmechay_saw = zero
  allocate(pphiay_saw(minb, mibs)); pphiay_saw = zero
  allocate(rmjionay(minb, mibs)); rmjionay = zero
  allocate(rmjionay_saw(minb, mibs)); rmjionay_saw = zero
  allocate(tdepay(minb, mibs)); tdepay = zero
  allocate(tfluxay(minb, mibs)); tfluxay = zero
  allocate(tfluxay_saw(minb, mibs)); tfluxay_saw = zero
  allocate(thay(minb, mibs)); thay = zero
  allocate(thay_saw(minb, mibs)); thay_saw = zero
  allocate(vay(minb, mibs)); vay = zero
  allocate(vay_saw(minb, mibs)); vay_saw = zero
  allocate(wghtay(minb, mibs)); wghtay = zero
  allocate(xiay(minb, mibs)); xiay = zero
  allocate(xiay_saw(minb, mibs)); xiay_saw = zero
  allocate(xistay(minb, mibs)); xistay = zero
  allocate(xistay_saw(minb, mibs)); xistay_saw = zero
  allocate(xksidy(minb, mibs)); xksidy = zero
  allocate(xksidy_saw(minb, mibs)); xksidy_saw = zero
  allocate(xmuay(minb, mibs)); xmuay = zero
  allocate(xmuay_saw(minb, mibs)); xmuay_saw = zero
  allocate(xzbmay(minb, mibs)); xzbmay = zero
  allocate(xzionay(minb, mibs)); xzionay = zero
  allocate(xzionay_saw(minb, mibs)); xzionay_saw = zero
 
 
end subroutine nbi_alloc_minb
