! written by nbigen.py
! *** do not edit *** (use nbigen.py instead)
 
subroutine nbi_alloc_init
 
  use nbi_com
  implicit NONE
 
  !==============================================
  ! input arrays
 
  if(allocated(backz)) then
     write(nonlin,*) '%nbi_alloc: backz already allocated; exiting.'
     return
  endif
 
  allocate(backz(mig))
  backz = 0.0_fp
  allocate(aplasm(mig))
  aplasm = 0.0_fp
  allocate(xzbeama(mib))
  xzbeama = 0.0_fp
  allocate(abeama(mib))
  abeama = 0.0_fp
  allocate(nlco(mib))
  nlco = .TRUE.
  allocate(ntrace(mib))
  ntrace = 0
  allocate(rtcena(mib))
  rtcena = 0.0_fp
  allocate(xlbtna(mib))
  xlbtna = 0.0_fp
  allocate(xybsca(mib))
  xybsca = 0.0_fp
  allocate(xbzeta(mib))
  xbzeta = 0.0_fp
  allocate(nbshapa(mib))
  nbshapa = 1
  allocate(bmwidra(mib))
  bmwidra = 0.0_fp
  allocate(bmwidza(mib))
  bmwidza = 0.0_fp
  allocate(divra(mib))
  divra = 0.0_fp
  allocate(divza(mib))
  divza = 0.0_fp
  allocate(foclra(mib))
  foclra = 1.0e+6_fp
  allocate(foclza(mib))
  foclza = 1.0e+6_fp
  allocate(nbapsha(mib))
  nbapsha = 1
  allocate(rapedga(mib))
  rapedga = 0.0_fp
  allocate(xzpedga(mib))
  xzpedga = 0.0_fp
  allocate(xlbapa(mib))
  xlbapa = 0.0_fp
  allocate(xybapa(mib))
  xybapa = 0.0_fp
  allocate(xrapoffa(mib))
  xrapoffa = 0.0_fp
  allocate(xzapoffa(mib))
  xzapoffa = 0.0_fp
  allocate(nbapsh2(mib))
  nbapsh2 = 1
  allocate(rapedg2(mib))
  rapedg2 = 0.0_fp
  allocate(xzpedg2(mib))
  xzpedg2 = 0.0_fp
  allocate(xlbapa2(mib))
  xlbapa2 = 0.0_fp
  allocate(xrapoff2(mib))
  xrapoff2 = 0.0_fp
  allocate(xzapoff2(mib))
  xzapoff2 = 0.0_fp
  allocate(xzimpx(mimpt))
  xzimpx = 0.0_fp
  allocate(aimpx(mimpt))
  aimpx = 0.0_fp
  allocate(xzmini(mmini))
  xzmini = 0.0_fp
  allocate(amini(mmini))
  amini = 0.0_fp
  allocate(einjmin(mib))
  einjmin = 0.0_fp
  allocate(einja(mib))
  einja = 0.0_fp
  allocate(pinja(mib))
  pinja = 0.0_fp
  allocate(ffulla(mib))
  ffulla = 0.98_fp
  allocate(fhalfa(mib))
  fhalfa = 0.01_fp
  allocate(orbrzv_toric_Prftot0(mibs))
  orbrzv_toric_Prftot0 = 0.0_fp
  allocate(khalo(mis))
  khalo =  -1
  allocate(gflr_xv(2))
  gflr_xv =  (/1.5_fp, 0.4_fp/)
  allocate(gflr_op(15))
  gflr_op =  (/0._fp,1.e-4_fp,1.e-5_fp,0._fp,3._fp,10._fp,1._fp,0.2_fp,0.05_fp,1._fp,2._fp,0._fp,0._fp,0._fp,0._fp/)
  allocate(AEP_ASCALE(mnkaep))
  AEP_ASCALE =  0.0_fp
  allocate(TAEP_FAC(mnkaep))
  TAEP_FAC =  0.0_fp
  allocate(fdifbe(20))
  fdifbe = 1.0_fp
  allocate(edifbe(20))
  edifbe = 0.0_fp
  allocate(erngfi(miefi,mibs))
  erngfi = 0.0_fp
  allocate(nbsbox(miboxm))
  nbsbox = 0
  allocate(nsample_box(miboxm))
  nsample_box = 0
  allocate(xninja_box(miboxm))
  xninja_box = 0
  allocate(xninjs_box(miboxm))
  xninjs_box = 0
  allocate(nbebox(miboxm))
  nbebox = 1
  allocate(nbstube(mitubem))
  nbstube = 0
  allocate(nbetube(mitubem))
  nbetube = 1
  allocate(Rtube(mitubem))
  Rtube = 0.
  allocate(Ytube(mitubem))
  Ytube = 0.
  allocate(XZETAtube(mitubem))
  XZETAtube = 0.
  allocate(PHItube(mitubem))
  PHItube = 0.
  allocate(THETAtube(mitubem))
  THETAtube = 0.
  allocate(LMIDtube(mitubem))
  LMIDtube = 0
  allocate(XL1tube(mitubem))
  XL1tube = 0.
  allocate(XL2tube(mitubem))
  XL2tube = 0.
  allocate(NSEGtube(mitubem))
  NSEGtube = 100
  allocate(id_nh(mig))
  id_nh = 0
  allocate(id_nimp(mimpt))
  id_nimp = 0
  allocate(id_nrf(mmini))
  id_nrf = 0
  allocate(id_eperpmin(mmini))
  id_eperpmin = 0
  allocate(id_epllmin(mmini))
  id_epllmin = 0
  allocate(id_nfast(mibs))
  id_nfast = 0
  allocate(id_eperpfast(mibs))
  id_eperpfast = 0
  allocate(id_epllfast(mibs))
  id_epllfast = 0
  allocate(id_fd0(mibs))
  id_fd0 = 0
  allocate(id_fdb(mibs))
  id_fdb = 0
  allocate(id_fdp(mibs))
  id_fdp = 0
  allocate(id_fdq(mibs))
  id_fdq = 0
  allocate(id_fdr(mibs))
  id_fdr = 0
  allocate(id_fds(mibs))
  id_fds = 0
  allocate(id_n0(mis,mig))
  id_n0 = 0
  allocate(id_t0(mis,mig))
  id_t0 = 0
  allocate(id_omeg0(mis,mig))
  id_omeg0 = 0
  !==============================================
  ! internal arrays
 
  allocate(flag_cursaw(mibs)); flag_cursaw = .FALSE.
  allocate(dxsm_kdsaw(mj,mibs)); dxsm_kdsaw = zero
  allocate(dxwt_kdsaw(mj,mibs)); dxwt_kdsaw = zero
  allocate(wsum_kdspre(mibs)); wsum_kdspre = zero
  allocate(wsum_kdspost(mibs)); wsum_kdspost = zero
  allocate(wts_ien(3,mib)); wts_ien = zero
  allocate(ebb_relx_co(mj,3,mib,mibs)); ebb_relx_co = zero
  allocate(rms_ebbx_co(mj,3,mib,mibs)); rms_ebbx_co = zero
  allocate(ebb_relx_cnt(mj,3,mib,mibs)); ebb_relx_cnt = zero
  allocate(rms_ebbx_cnt(mj,3,mib,mibs)); rms_ebbx_cnt = zero
  allocate(bnb_ienx(mj,2,mibs)); bnb_ienx = zero
  allocate(ebb_relx_fn(mj,3,mib,mibs)); ebb_relx_fn = zero
  allocate(rms_ebbx_fn(mj,3,mib,mibs)); rms_ebbx_fn = zero
  allocate(bnb_fnx(mj,mibs)); bnb_fnx = zero
  allocate(orb_code_error(mibs)); orb_code_error = zero
  allocate(dep_code_error(mibs)); dep_code_error = zero
  allocate(xnorbs(mibs)); xnorbs = zero
  allocate(dt_adj0_sums(mibs)); dt_adj0_sums = zero
  allocate(xnum_dt_adj0(mibs)); xnum_dt_adj0 = zero
  allocate(xmcloss_o(mibs)); xmcloss_o = zero
  allocate(xmcloss_d(mibs)); xmcloss_d = zero
  allocate(weinjav(mibs)); weinjav = zero
  allocate(ennew(mibs)); ennew = zero
  allocate(ewghtdep(mibs)); ewghtdep = zero
  allocate(ewghtdep0(mibs)); ewghtdep0 = zero
  allocate(wghtdep(mibs)); wghtdep = zero
  allocate(zidep0(mibs)); zidep0 = zero
  allocate(zitrk0(mibs)); zitrk0 = zero
  allocate(xhwdep0(mibs)); xhwdep0 = zero
  allocate(sfrac_survive(3,mib)); sfrac_survive = zero
  allocate(wfrac_survive(3,mib)); wfrac_survive = zero
  allocate(frac_survive(3,mib)); frac_survive = zero
  allocate(frac_sur_inv(3,mib)); frac_sur_inv = zero
  allocate(bldistrib(3,mib)); bldistrib = zero
  allocate(wtqbxfs(mj,mibs)); wtqbxfs = zero
  allocate(abeams(mibs)); abeams = zero
  allocate(aimpj(mj)); aimpj = zero
  allocate(allame(mj, mimaxz, mibs)); allame = zero
  allocate(allamh(mig, mj, mimaxz, mibs)); allamh = zero
  allocate(allamx(mj, mimaxz, mibs)); allamx = zero
  allocate(aratii(mtbl, miz)); aratii = zero
  allocate(bdenssp(mj, mibs)); bdenssp = zero
  allocate(be0cx(mj, mibs)); be0cx = zero
  allocate(bi1g1x(mmaxion)); bi1g1x = zero
  allocate(bi1ovb(mmaxion)); bi1ovb = zero
  allocate(bi1phi1x(mmaxion)); bi1phi1x = zero
  allocate(bi1psi1x(mmaxion)); bi1psi1x = zero
  allocate(bi2g2x(mmaxion)); bi2g2x = zero
  allocate(bi2phi2x(mmaxion)); bi2phi2x = zero
  allocate(bi2psi2x(mmaxion)); bi2psi2x = zero
  allocate(bi2x2t(mmaxion)); bi2x2t = zero
  allocate(bi2y2t(mmaxion)); bi2y2t = zero
  allocate(bia(mmaxion)); bia = zero
  allocate(bib2ts(mmaxion)); bib2ts = zero
  allocate(bib2xi(mmaxion)); bib2xi = zero
  allocate(bibdts(mmaxion)); bibdts = zero
  allocate(bibdxi(mmaxion)); bibdxi = zero
  allocate(bibtsx(mmaxion)); bibtsx = zero
  allocate(bicos(mmaxion)); bicos = zero
  allocate(bidb(mmaxion)); bidb = zero
  allocate(bidphi(mmaxion)); bidphi = zero
  allocate(bidpph(mmaxion)); bidpph = zero
  allocate(bidqdx(mmaxion)); bidqdx = zero
  allocate(bidt(mmaxion)); bidt = zero
  allocate(bidtc(mmaxion)); bidtc = zero
  allocate(bidte(mmaxion)); bidte = zero
  allocate(bidts(mmaxion)); bidts = zero
  allocate(bidvpa(mmaxion)); bidvpa = zero
  allocate(bidx(mmaxion)); bidx = zero
  allocate(bidxdt(mmaxion)); bidxdt = zero
  allocate(bidxi(mmaxion)); bidxi = zero
  allocate(bidy(mmaxion)); bidy = zero
  allocate(bidydt(mmaxion)); bidydt = zero
  allocate(big(mmaxion)); big = zero
  allocate(bijac(mmaxion)); bijac = zero
  allocate(bijdts(mmaxion)); bijdts = zero
  allocate(bijdxi(mmaxion)); bijdxi = zero
  allocate(bike(mmaxion)); bike = zero
  allocate(biksid(mmaxion)); biksid = zero
  allocate(bim(mmaxion)); bim = zero
  allocate(bimodb(mmaxion)); bimodb = zero
  allocate(bimu(mmaxion)); bimu = zero
  allocate(biphi(mmaxion)); biphi = zero
  allocate(bipphi(mmaxion)); bipphi = zero
  allocate(bipsi(mmaxion)); bipsi = zero
  allocate(biq(mmaxion)); biq = zero
  allocate(bisin(mmaxion)); bisin = zero
  allocate(bite(mmaxion)); bite = zero
  allocate(bith2t(mmaxion)); bith2t = zero
  allocate(bithdt(mmaxion)); bithdt = zero
  allocate(bithst(mmaxion)); bithst = zero
  allocate(bitime(mmaxion)); bitime = zero
  allocate(biv(mmaxion)); biv = zero
  allocate(bivp2t(mmaxion)); bivp2t = zero
  allocate(bivpar(mmaxion)); bivpar = zero
  allocate(bivpdt(mmaxion)); bivpdt = zero
  allocate(bivprp(mmaxion)); bivprp = zero
  allocate(bixi(mmaxion)); bixi = zero
  allocate(bixi2t(mmaxion)); bixi2t = zero
  allocate(bixidt(mmaxion)); bixidt = zero
  allocate(biz(mmaxion)); biz = zero
  allocate(bmnmx(mtbl)); bmnmx = zero
  allocate(rmnmx(mtbl)); rmnmx = zero
  allocate(bpbmnmx(mtbl)); bpbmnmx = zero
  allocate(btbmnmx(mtbl)); btbmnmx = zero
  allocate(drmnmx(mtbl)); drmnmx = zero
  allocate(psmnmx(mtbl)); psmnmx = zero
  allocate(bmaxm(mj)); bmaxm = zero
  allocate(bminm(mj)); bminm = zero
  allocate(rbminm(mj)); rbminm = zero
  allocate(rbmaxm(mj)); rbmaxm = zero
  allocate(thbminm(mj)); thbminm = zero
  allocate(thbmaxm(mj)); thbmaxm = zero
  allocate(bntots(mibs)); bntots = zero
  allocate(cloge(mj)); cloge = zero
  allocate(curt(mj)); curt = zero
  allocate(den0mn(mig, mj, mis)); den0mn = zero
  allocate(difb(mj)); difb = zero
  allocate(velb(mj)); velb = zero
  allocate(difb_bi(mj)); difb_bi = zero
  allocate(velb_bi(mj)); velb_bi = zero
  allocate(difb_fi(mj)); difb_fi = zero
  allocate(velb_fi(mj)); velb_fi = zero
  allocate(wgvdx(mj,mibs)); wgvdx = zero
  allocate(edifbe_2d(med2d)); edifbe_2d = zero
  allocate(difbe_2d_fd0(mj,med2d,mibs)); difbe_2d_fd0 = zero
  allocate(difbe_2d_fdb(mj,med2d,mibs)); difbe_2d_fdb = zero
  allocate(difbe_2d_fdp(mj,med2d,mibs)); difbe_2d_fdp = zero
  allocate(difbe_2d_fdq(mj,med2d,mibs)); difbe_2d_fdq = zero
  allocate(difbe_2d_fdr(mj,med2d,mibs)); difbe_2d_fdr = zero
  allocate(difbe_2d_fds(mj,med2d,mibs)); difbe_2d_fds = zero
  allocate(wx_fd0(6)); wx_fd0 = zero
  allocate(wx_fdb(6)); wx_fdb = zero
  allocate(wx_fdp(6)); wx_fdp = zero
  allocate(wx_fdq(6)); wx_fdq = zero
  allocate(wx_fdr(6)); wx_fdr = zero
  allocate(wx_fds(6)); wx_fds = zero
  allocate(dravizc(mj)); dravizc = zero
  allocate(dvolzc(mj)); dvolzc = zero
  allocate(dvolzc_r8(mj)); dvolzc_r8 = zero
  allocate(dareazc(mj)); dareazc = zero
  allocate(dareazc_r8(mj)); dareazc_r8 = zero
  allocate(dxi(mjeqv, miz)); dxi = zero
  allocate(dxizb(mjeqv)); dxizb = zero
  allocate(dxizc(mjeqv)); dxizc = zero
  allocate(ebdlina(mibs)); ebdlina = zero
  allocate(ebdmaxa(mibs)); ebdmaxa = zero
  allocate(efbm(mimxbe, mibs)); efbm = zero
  allocate(efbmb(mimxbe1, mibs)); efbmb = zero
  allocate(einjs(mibs)); einjs = zero
  allocate(vmins(mibs)); vmins = zero
  allocate(eirefs(mibs)); eirefs = zero
  allocate(xmrefs(mibs)); xmrefs = zero
  allocate(en0mn(mig, mj, mis)); en0mn = zero
  allocate(evol0(mig, mj)); evol0 = zero
  allocate(ewall0(mig, mj)); ewall0 = zero
  allocate(fbz(mj, miz)); fbz = zero
  allocate(dt_adj0s(mibs)); dt_adj0s = zero
  allocate(vtaub(4,mj)); vtaub = zero
  allocate(vtaubmin(mj)); vtaubmin = zero
  allocate(gb1zc(mj)); gb1zc = zero
  allocate(gb2zc(mj)); gb2zc = zero
  allocate(gncfhzc(mj)); gncfhzc = zero
  allocate(gr2zc(mj)); gr2zc = zero
  allocate(grizc(mj)); grizc = zero
  allocate(gr2izc(mj)); gr2izc = zero
  allocate(hvsigi(mj, mimaxz, mibs)); hvsigi = zero
  allocate(lsbeama(mib)); lsbeama = 0
  allocate(lsbeamr(mireact)); lsbeamr = 0
  allocate(mrfmini(mibs)); mrfmini = 0
  allocate(nadrbox(miboxm)); nadrbox = 0
  allocate(nbbsp(mireact, 2)); nbbsp = 0
  allocate(nbouta(10)); nbouta = 0
  allocate(nlbba(mireact)); nlbba = .FALSE.
  allocate(nlfbmfpp(mibs)); nlfbmfpp = .FALSE.
  allocate(nlfprod(mibs)); nlfprod = .FALSE.
  allocate(nlheavy(mibs)); nlheavy = .FALSE.
  allocate(nmmbinv(mtbl)); nmmbinv = 0
  allocate(nmmjac(mtbl)); nmmjac = 0
  allocate(nrfmini(mibs)); nrfmini = 0
  allocate(nuse(mibs)); nuse = 0
  allocate(puseyp(mibs)); puseyp = zero
  allocate(ntotptp(mibs)); ntotptp = 0
  allocate(nnewp(mibs)); nnewp = 0
  allocate(nznblea(mibs)); nznblea = 0
  allocate(nznbmea(mibs)); nznbmea = 0
  allocate(omegag(mj)); omegag = zero
  allocate(omega_ExB(mj)); omega_ExB = zero
  allocate(omg0mn(mig, mj, mis)); omg0mn = zero
  allocate(ovol0(mig, mj)); ovol0 = zero
  allocate(owall0(mig, mj)); owall0 = zero
  allocate(phibsce(mib)); phibsce = zero
  allocate(phiprg(mj)); phiprg = zero
  allocate(plflxg(mj)); plflxg = zero
  allocate(plflxi(mtbl)); plflxi = zero
  allocate(qgeo(mj)); qgeo = zero
  allocate(rhbs(mj, miz, mibs)); rhbs = zero
  allocate(rhi(mj, miz)); rhi = zero
  allocate(rhimom(mj, miz, 5)); rhimom = zero
  allocate(rhix(mj, miz, mimpt)); rhix = zero
  allocate(rhmin(mj, miz, mibs)); rhmin = zero
  allocate(rhob(mj, mig, miz)); rhob = zero
  allocate(rhoel(mj, miz)); rhoel = zero
  allocate(rmjrmp(mtbl, miz)); rmjrmp = zero
  allocate(rmnrmp(mtbl, miz)); rmnrmp = zero
  allocate(splg(4, mtbl)); splg = zero
  allocate(splimhd(4, mtbl)); splimhd = zero
  allocate(spliot(4,mtbl)); spliot = zero
  allocate(splphi(4, mtbl)); splphi = zero
  allocate(te(mj, miz)); te = zero
  allocate(thbmxm(mj,2)); thbmxm = zero
  allocate(thntns(mj,mireact)); thntns = zero
  allocate(ti(mj, miz)); ti = zero
  allocate(timin(mj, miz, mibs)); timin = zero
  allocate(tmjsm(mj)); tmjsm = zero
  allocate(vcrit(mj, mibs)); vcrit = zero
  allocate(vcrit3(mj, mibs)); vcrit3 = zero
  allocate(viflr(3)); viflr = zero
  allocate(vmin3(mj, mibs)); vmin3 = zero
  allocate(voln0(mig, mj)); voln0 = zero
  allocate(vpoh(mj)); vpoh = zero
  allocate(vpvn00(mib, 3, mj)); vpvn00 = zero
  allocate(walln0(mig, mj)); walln0 = zero
  allocate(walln0x(mig, mj)); walln0x = zero
  allocate(wtrap(mj, mibs)); wtrap = zero
  allocate(wtrap0(mj, mibs)); wtrap0 = zero
  allocate(wtrape(mj, miefi, mibs)); wtrape = zero
  allocate(xbjaco(2,2)); xbjaco = zero
  allocate(xi(mjeqv, miz)); xi = zero
  allocate(xi_r8(mjeqv, miz)); xi_r8 = zero
  allocate(xizb(mjeqv)); xizb = zero
  allocate(xizb_r8(mjeqv)); xizb_r8 = zero
  allocate(xizc(mjeqv)); xizc = zero
  allocate(xizc_r8(mjeqv)); xizc_r8 = zero
  allocate(xninja(mib)); xninja = zero
  allocate(xzbeams(mibs)); xzbeams = zero
  allocate(xzeffc(mj, miz)); xzeffc = zero
  allocate(xzimpj(mj)); xzimpj = zero
  allocate(ympx(mtbl)); ympx = zero
  allocate(nlreact(mireact,mibs)); nlreact = .FALSE.
  allocate(ndatspl(minspl)); ndatspl = 0
  allocate(XN_DEP(mibs)); XN_DEP = zero
  allocate(XN_ORB(mibs)); XN_ORB = zero
  allocate(XP_DEP(mibs)); XP_DEP = zero
  allocate(XP_ORB(mibs)); XP_ORB = zero
  allocate(XPH_DEP(mibs)); XPH_DEP = zero
  allocate(XPH_ORB(mibs)); XPH_ORB = zero
  allocate(ebcons(mibs)); ebcons = zero
  allocate(enolds(mibs)); enolds = zero
  allocate(ereact(mireact,mibs)); ereact = zero
  allocate(cfa(mj,mibs,4)); cfa = zero
  allocate(dfa(mj,mibs,4)); dfa = zero
  allocate(efa(mj,mibs,4)); efa = zero
  allocate(exc0bb(mj, 3, mibs)); exc0bb = zero
  allocate(exc0bx(mj, 3, mibs)); exc0bx = zero
  allocate(exc0cx(mj, 3, mibs)); exc0cx = zero
  allocate(exc0ie(mj, 3, mibs)); exc0ie = zero
  allocate(exc0ii(mj, 3, mibs)); exc0ii = zero
  allocate(exc0iz(mj, 3, mibs)); exc0iz = zero
  allocate(excrbb(mj, mibs)); excrbb = zero
  allocate(excrbx(mj, mibs)); excrbx = zero
  allocate(excrcx(mj, mibs)); excrcx = zero
  allocate(excrie(mj, mibs)); excrie = zero
  allocate(excrii(mj, mibs)); excrii = zero
  allocate(excriz(mj, mibs)); excriz = zero
  allocate(wttmf(mj,mibs)); wttmf = zero
  allocate(vmin(mj,mibs)); vmin = zero
  allocate(bv0cx(mj,mibs)); bv0cx = zero
  allocate(fpixbts(mj,mibs)); fpixbts = zero
  allocate(fpixbts_ntr(mj,mibs)); fpixbts_ntr = zero
  allocate(fpixbts_dep(mj,mibs)); fpixbts_dep = zero
  allocate(tirsaws(mj, mibs)); tirsaws = zero
  allocate(tirtots(mj, mibs)); tirtots = zero
  allocate(tirtots_ntr(mj, mibs)); tirtots_ntr = zero
  allocate(tirtots_dep(mj, mibs)); tirtots_dep = zero
  allocate(fbdepco(mj,mibs)); fbdepco = zero
  allocate(fbdepct(mj,mibs)); fbdepct = zero
  allocate(xwght0(mibs)); xwght0 = zero
  allocate(wghtsave(mibs)); wghtsave = zero
  allocate(wkill(mibs)); wkill = zero
  allocate(wnkill(mibs)); wnkill = zero
  allocate(wghtakil(mibs)); wghtakil = zero
  allocate(wnlight(mibs)); wnlight = zero
  allocate(wnlkill(mibs)); wnlkill = zero
  allocate(wndoubl(mibs)); wndoubl = zero
  allocate(wbav(mj,mibs)); wbav = zero
  allocate(wbav_kill(mj,mibs)); wbav_kill = zero
  allocate(pljbbm(mj)); pljbbm = zero
  allocate(pljbbms(mj, mibs)); pljbbms = zero
  allocate(pljbbm_nb(mj, mib)); pljbbm_nb = zero
  allocate(pljbcct(mj,mibs)); pljbcct = zero
  allocate(pljbfi(mj)); pljbfi = zero
  allocate(taubpa(mj,20,mibs)); taubpa = zero
  allocate(taubsl(mj,20,mibs)); taubsl = zero
  allocate(taubpa_tmp(mj,20,mibs)); taubpa_tmp = zero
  allocate(taubsl_tmp(mj,20,mibs)); taubsl_tmp = zero
  allocate(tausl_avg(mibs)); tausl_avg = zero
  allocate(tuben0(mituben,mitubem)); tuben0 = zero
  allocate(tubedot(mituben,mitubem)); tubedot = zero
  allocate(tubes0(mitubem)); tubes0 = zero
  allocate(itube_try(mitubem)); itube_try = 0
  allocate(XPOS(minbplt)); XPOS = zero
  allocate(YPOS(minbplt)); YPOS = zero
  allocate(mibs2use(mibs)); mibs2use = 0
  !==============================================
  ! output arrays
 
  ! ... block: fusion .........
  allocate(bbntns(mj,mireact)); bbntns = zero
  allocate(io_bbntns(mireact)); io_bbntns = 0
  allocate(io_bbntns_name(mireact)); io_bbntns_name = ' '
  allocate(bbntnt(mj)); bbntnt = zero
  allocate(btntns(mj,mireact)); btntns = zero
  allocate(io_btntns(mireact)); io_btntns = 0
  allocate(io_btntns_name(mireact)); io_btntns_name = ' '
  allocate(btntrs(mj,mireact)); btntrs = zero
  allocate(io_btntrs(mireact)); io_btntrs = 0
  allocate(io_btntrs_name(mireact)); io_btntrs_name = ' '
  allocate(btntws(mj,mireact)); btntws = zero
  allocate(io_btntws(mireact)); io_btntws = 0
  allocate(io_btntws_name(mireact)); io_btntws_name = ' '
  allocate(btntnt(mj)); btntnt = zero
  allocate(rbntnt(mj)); rbntnt = zero
  allocate(bbnta(mireact)); bbnta = zero
  allocate(btnta(mireact)); btnta = zero
  allocate(sftot(mireact)); sftot = zero
  ! ... block: density .........
  allocate(bdenss(mj,mibs)); bdenss = zero
  allocate(io_bdenss(mibs)); io_bdenss = 0
  allocate(io_bdenss_name(mibs)); io_bdenss_name = ' '
  allocate(mc_dens(mj,mibs)); mc_dens = zero
  allocate(io_mc_dens(mibs)); io_mc_dens = 0
  allocate(io_mc_dens_name(mibs)); io_mc_dens_name = ' '
  allocate(bdenssw(mj,mibs)); bdenssw = zero
  allocate(io_bdenssw(mibs)); io_bdenssw = 0
  allocate(io_bdenssw_name(mibs)); io_bdenssw_name = ' '
  allocate(udenspl(mj,mibs)); udenspl = zero
  allocate(io_udenspl(mibs)); io_udenspl = 0
  allocate(io_udenspl_name(mibs)); io_udenspl_name = ' '
  allocate(udenspp(mj,mibs)); udenspp = zero
  allocate(io_udenspp(mibs)); io_udenspp = 0
  allocate(io_udenspp_name(mibs)); io_udenspp_name = ' '
  allocate(udensplw(mj,mibs)); udensplw = zero
  allocate(io_udensplw(mibs)); io_udensplw = 0
  allocate(io_udensplw_name(mibs)); io_udensplw_name = ' '
  allocate(udensppw(mj,mibs)); udensppw = zero
  allocate(io_udensppw(mibs)); io_udensppw = 0
  allocate(io_udensppw_name(mibs)); io_udensppw_name = ' '
  ! ... block: deposition .........
  allocate(bdepb(mj,3,mib)); bdepb = zero
  allocate(io_bdepb(3,mib)); io_bdepb = 0
  allocate(io_bdepb_name(3,mib)); io_bdepb_name = ' '
  allocate(bdepb_nb(mj,mib)); bdepb_nb = zero
  allocate(io_bdepb_nb(mib)); io_bdepb_nb = 0
  allocate(io_bdepb_nb_name(mib)); io_bdepb_nb_name = ' '
  allocate(bdepe(mj,3,mibs)); bdepe = zero
  allocate(io_bdepe(3,mibs)); io_bdepe = 0
  allocate(io_bdepe_name(3,mibs)); io_bdepe_name = ' '
  allocate(bdeps(mj, mibs)); bdeps = zero
  allocate(io_bdeps(mibs)); io_bdeps = 0
  allocate(io_bdeps_name(mibs)); io_bdeps_name = ' '
  allocate(sdep_oa(mj,mibs)); sdep_oa = zero
  allocate(io_sdep_oa(mibs)); io_sdep_oa = 0
  allocate(io_sdep_oa_name(mibs)); io_sdep_oa_name = ' '
  allocate(SDEP_OAUC(mibs)); SDEP_OAUC = zero
  allocate(mc_newdens(mj,mibs)); mc_newdens = zero
  allocate(io_mc_newdens(mibs)); io_mc_newdens = 0
  allocate(io_mc_newdens_name(mibs)); io_mc_newdens_name = ' '
  allocate(einjav(mibs)); einjav = zero
  allocate(sbbidpe(mj, 3, mibs)); sbbidpe = zero
  allocate(io_sbbidpe(3,mibs)); io_sbbidpe = 0
  allocate(io_sbbidpe_name(3,mibs)); io_sbbidpe_name = ' '
  allocate(sbbidps(mj, mibs)); sbbidps = zero
  allocate(io_sbbidps(mibs)); io_sbbidps = 0
  allocate(io_sbbidps_name(mibs)); io_sbbidps_name = ' '
  allocate(sbbxdpe(mj, 3, mibs)); sbbxdpe = zero
  allocate(io_sbbxdpe(3,mibs)); io_sbbxdpe = 0
  allocate(io_sbbxdpe_name(3,mibs)); io_sbbxdpe_name = ' '
  allocate(sbbxdps(mj, mibs)); sbbxdps = zero
  allocate(io_sbbxdps(mibs)); io_sbbxdps = 0
  allocate(io_sbbxdps_name(mibs)); io_sbbxdps_name = ' '
  allocate(sbcxdpe(mj, mig, 3, mibs)); sbcxdpe = zero
  allocate(io_sbcxdpe(mig,3,mibs)); io_sbcxdpe = 0
  allocate(io_sbcxdpe_name(mig,3,mibs)); io_sbcxdpe_name = ' '
  allocate(sbcxdps(mj, mig, mibs)); sbcxdps = zero
  allocate(io_sbcxdps(mig,mibs)); io_sbcxdps = 0
  allocate(io_sbcxdps_name(mig,mibs)); io_sbcxdps_name = ' '
  allocate(sbedepe(mj, 3, mibs)); sbedepe = zero
  allocate(io_sbedepe(3,mibs)); io_sbedepe = 0
  allocate(io_sbedepe_name(3,mibs)); io_sbedepe_name = ' '
  allocate(sbedeps(mj, mibs)); sbedeps = zero
  allocate(io_sbedeps(mibs)); io_sbedeps = 0
  allocate(io_sbedeps_name(mibs)); io_sbedeps_name = ' '
  allocate(sbiedepe(mj, 3, mibs)); sbiedepe = zero
  allocate(io_sbiedepe(3,mibs)); io_sbiedepe = 0
  allocate(io_sbiedepe_name(3,mibs)); io_sbiedepe_name = ' '
  allocate(sbiedeps(mj, mibs)); sbiedeps = zero
  allocate(io_sbiedeps(mibs)); io_sbiedeps = 0
  allocate(io_sbiedeps_name(mibs)); io_sbiedeps_name = ' '
  allocate(sbildepe(mj, 3, mibs)); sbildepe = zero
  allocate(io_sbildepe(3,mibs)); io_sbildepe = 0
  allocate(io_sbildepe_name(3,mibs)); io_sbildepe_name = ' '
  allocate(sbildeps(mj, mibs)); sbildeps = zero
  allocate(io_sbildeps(mibs)); io_sbildeps = 0
  allocate(io_sbildeps_name(mibs)); io_sbildeps_name = ' '
  allocate(sbizdepe(mj, 3, mibs)); sbizdepe = zero
  allocate(io_sbizdepe(3,mibs)); io_sbizdepe = 0
  allocate(io_sbizdepe_name(3,mibs)); io_sbizdepe_name = ' '
  allocate(sbizdeps(mj, mibs)); sbizdeps = zero
  allocate(io_sbizdeps(mibs)); io_sbizdeps = 0
  allocate(io_sbizdeps_name(mibs)); io_sbizdeps_name = ' '
  ! ... block: nclass .........
  allocate(bnb_ien(mj, 3, mib)); bnb_ien = zero
  allocate(io_bnb_ien(3,mib)); io_bnb_ien = 0
  allocate(io_bnb_ien_name(3,mib)); io_bnb_ien_name = ' '
  allocate(bdens_nb(mj, mib)); bdens_nb = zero
  allocate(io_bdens_nb(mib)); io_bdens_nb = 0
  allocate(io_bdens_nb_name(mib)); io_bdens_nb_name = ' '
  allocate(pbe_ien(mj, 3, mib)); pbe_ien = zero
  allocate(io_pbe_ien(3,mib)); io_pbe_ien = 0
  allocate(io_pbe_ien_name(3,mib)); io_pbe_ien_name = ' '
  allocate(pbi_ien(mj, 3, mib)); pbi_ien = zero
  allocate(io_pbi_ien(3,mib)); io_pbi_ien = 0
  allocate(io_pbi_ien_name(3,mib)); io_pbi_ien_name = ' '
  allocate(upb_ien(mj, 3, mib)); upb_ien = zero
  allocate(io_upb_ien(3,mib)); io_upb_ien = 0
  allocate(io_upb_ien_name(3,mib)); io_upb_ien_name = ' '
  allocate(bpshna(mib,3)); bpshna = zero
  allocate(ein_ien(3, mib)); ein_ien = zero
  allocate(dei_ien(3, mib)); dei_ien = zero
  allocate(bnbs_ien(mj, 3, mibs)); bnbs_ien = zero
  allocate(io_bnbs_ien(3,mibs)); io_bnbs_ien = 0
  allocate(io_bnbs_ien_name(3,mibs)); io_bnbs_ien_name = ' '
  allocate(pbes_ien(mj, 3, mibs)); pbes_ien = zero
  allocate(io_pbes_ien(3,mibs)); io_pbes_ien = 0
  allocate(io_pbes_ien_name(3,mibs)); io_pbes_ien_name = ' '
  allocate(pbis_ien(mj, 3, mibs)); pbis_ien = zero
  allocate(io_pbis_ien(3,mibs)); io_pbis_ien = 0
  allocate(io_pbis_ien_name(3,mibs)); io_pbis_ien_name = ' '
  allocate(upbs_ien(mj, 3, mibs)); upbs_ien = zero
  allocate(io_upbs_ien(3,mibs)); io_upbs_ien = 0
  allocate(io_upbs_ien_name(3,mibs)); io_upbs_ien_name = ' '
  ! ... block: n0_fast .........
  allocate(bn00t(3,mj)); bn00t = zero
  allocate(io_bn00t(3)); io_bn00t = 0
  allocate(io_bn00t_name(3)); io_bn00t_name = ' '
  allocate(bn00ts(3,mj,mibs)); bn00ts = zero
  allocate(io_bn00ts(3,mibs)); io_bn00ts = 0
  allocate(io_bn00ts_name(3,mibs)); io_bn00ts_name = ' '
  allocate(bn00(mib, 3, mj)); bn00 = zero
  allocate(io_bn00(mib,3)); io_bn00 = 0
  allocate(io_bn00_name(mib,3)); io_bn00_name = ' '
  allocate(bn0tot(mj, mibs)); bn0tot = zero
  allocate(io_bn0tot(mibs)); io_bn0tot = 0
  allocate(io_bn0tot_name(mibs)); io_bn0tot_name = ' '
  allocate(bn0cx(mj, mibs)); bn0cx = zero
  allocate(io_bn0cx(mibs)); io_bn0cx = 0
  allocate(io_bn0cx_name(mibs)); io_bn0cx_name = ' '
  ! ... block: trap_fraction .........
  allocate(btrap(mj, mibs)); btrap = zero
  allocate(io_btrap(mibs)); io_btrap = 0
  allocate(io_btrap_name(mibs)); io_btrap_name = ' '
  allocate(btrap0(mj, mibs)); btrap0 = zero
  allocate(io_btrap0(mibs)); io_btrap0 = 0
  allocate(io_btrap0_name(mibs)); io_btrap0_name = ' '
  allocate(tbtrap(mibs)); tbtrap = zero
  allocate(tbtrap0(mibs)); tbtrap0 = zero
  ! ... block: erngfi_output .........
  allocate(btrape(mj, miefi, mibs)); btrape = zero
  allocate(io_btrape(miefi,mibs)); io_btrape = 0
  allocate(io_btrape_name(miefi,mibs)); io_btrape_name = ' '
  allocate(densfi(mj, miefi, mibs)); densfi = zero
  allocate(io_densfi(miefi,mibs)); io_densfi = 0
  allocate(io_densfi_name(miefi,mibs)); io_densfi_name = ' '
  ! ... block: average_energies .........
  allocate(ebapl2s(mj,mibs)); ebapl2s = zero
  allocate(io_ebapl2s(mibs)); io_ebapl2s = 0
  allocate(io_ebapl2s_name(mibs)); io_ebapl2s_name = ' '
  allocate(ebapp2s(mj,mibs)); ebapp2s = zero
  allocate(io_ebapp2s(mibs)); io_ebapp2s = 0
  allocate(io_ebapp2s_name(mibs)); io_ebapp2s_name = ' '
  allocate(ebapl2sw(mj,mibs)); ebapl2sw = zero
  allocate(io_ebapl2sw(mibs)); io_ebapl2sw = 0
  allocate(io_ebapl2sw_name(mibs)); io_ebapl2sw_name = ' '
  allocate(ebapp2sw(mj,mibs)); ebapp2sw = zero
  allocate(io_ebapp2sw(mibs)); io_ebapp2sw = 0
  allocate(io_ebapp2sw_name(mibs)); io_ebapp2sw_name = ' '
  allocate(ebavps(mj,mibs)); ebavps = zero
  allocate(io_ebavps(mibs)); io_ebavps = 0
  allocate(io_ebavps_name(mibs)); io_ebavps_name = ' '
  ! ... block: excited_states .........
  allocate(excit0(mj, 3, mibs)); excit0 = zero
  allocate(io_excit0(3,mibs)); io_excit0 = 0
  allocate(io_excit0_name(3,mibs)); io_excit0_name = ' '
  allocate(excitr(mj, mibs)); excitr = zero
  allocate(io_excitr(mibs)); io_excitr = 0
  allocate(io_excitr_name(mibs)); io_excitr_name = ' '
  ! ... block: mc_statistics .........
  allocate(nmc(mj,mibs)); nmc = zero
  allocate(io_nmc(mibs)); io_nmc = 0
  allocate(io_nmc_name(mibs)); io_nmc_name = ' '
  allocate(wnmc(mj,mibs)); wnmc = zero
  allocate(io_wnmc(mibs)); io_wnmc = 0
  allocate(io_wnmc_name(mibs)); io_wnmc_name = ' '
  allocate(nmctot(mibs)); nmctot = 0
  allocate(wnmctot(mibs)); wnmctot = zero
  allocate(naeptot(mibs)); naeptot = 0
  allocate(nstep_aep(mnkaep,mibs)); nstep_aep = 0
  allocate(nmcloss(mibs)); nmcloss = 0
  allocate(nnew(mibs)); nnew = 0
  allocate(xncx0_orb(mibs)); xncx0_orb = zero
  ! ... block: rotation .........
  allocate(omegabs(mj,mibs)); omegabs = zero
  allocate(io_omegabs(mibs)); io_omegabs = 0
  allocate(io_omegabs_name(mibs)); io_omegabs_name = ' '
  allocate(omegabsw(mj,mibs)); omegabsw = zero
  allocate(io_omegabsw(mibs)); io_omegabsw = 0
  allocate(io_omegabsw_name(mibs)); io_omegabsw_name = ' '
  ! ... block: compression .........
  allocate(pbcprs(mj)); pbcprs = zero
  allocate(pbcprss(mj, mibs)); pbcprss = zero
  allocate(io_pbcprss(mibs)); io_pbcprss = 0
  allocate(io_pbcprss_name(mibs)); io_pbcprss_name = ' '
  ! ... block: powers .........
  allocate(pbdfbes(mj, mibs)); pbdfbes = zero
  allocate(io_pbdfbes(mibs)); io_pbdfbes = 0
  allocate(io_pbdfbes_name(mibs)); io_pbdfbes_name = ' '
  allocate(pbdfbis(mj, mibs)); pbdfbis = zero
  allocate(io_pbdfbis(mibs)); io_pbdfbis = 0
  allocate(io_pbdfbis_name(mibs)); io_pbdfbis_name = ' '
  allocate(pbe(mj)); pbe = zero
  allocate(pbes(mj, mibs)); pbes = zero
  allocate(io_pbes(mibs)); io_pbes = 0
  allocate(io_pbes_name(mibs)); io_pbes_name = ' '
  allocate(pbi(mj)); pbi = zero
  allocate(pbis(mj, mibs)); pbis = zero
  allocate(io_pbis(mibs)); io_pbis = 0
  allocate(io_pbis_name(mibs)); io_pbis_name = ' '
  allocate(pbohs(mj, mibs)); pbohs = zero
  allocate(io_pbohs(mibs)); io_pbohs = 0
  allocate(io_pbohs_name(mibs)); io_pbohs_name = ' '
  allocate(pbephis(mj, mibs)); pbephis = zero
  allocate(io_pbephis(mibs)); io_pbephis = 0
  allocate(io_pbephis_name(mibs)); io_pbephis_name = ' '
  allocate(pbephis_ntr(mj, mibs)); pbephis_ntr = zero
  allocate(io_pbephis_ntr(mibs)); io_pbephis_ntr = 0
  allocate(io_pbephis_ntr_name(mibs)); io_pbephis_ntr_name = ' '
  allocate(pbephis_dep(mj, mibs)); pbephis_dep = zero
  allocate(io_pbephis_dep(mibs)); io_pbephis_dep = 0
  allocate(io_pbephis_dep_name(mibs)); io_pbephis_dep_name = ' '
  allocate(pbth(mj)); pbth = zero
  allocate(pbths(mj, mibs)); pbths = zero
  allocate(io_pbths(mibs)); io_pbths = 0
  allocate(io_pbths_name(mibs)); io_pbths_name = ' '
  allocate(pbe_nb(mj, mib)); pbe_nb = zero
  allocate(io_pbe_nb(mib)); io_pbe_nb = 0
  allocate(io_pbe_nb_name(mib)); io_pbe_nb_name = ' '
  allocate(pbi_nb(mj, mib)); pbi_nb = zero
  allocate(io_pbi_nb(mib)); io_pbi_nb = 0
  allocate(io_pbi_nb_name(mib)); io_pbi_nb_name = ' '
  allocate(pbth_nb(mj, mib)); pbth_nb = zero
  allocate(io_pbth_nb(mib)); io_pbth_nb = 0
  allocate(io_pbth_nb_name(mib)); io_pbth_nb_name = ' '
  allocate(pbtot_nb(mj, mib)); pbtot_nb = zero
  allocate(io_pbtot_nb(mib)); io_pbtot_nb = 0
  allocate(io_pbtot_nb_name(mib)); io_pbtot_nb_name = ' '
  allocate(pbthr2s(mj, mibs)); pbthr2s = zero
  allocate(io_pbthr2s(mibs)); io_pbthr2s = 0
  allocate(io_pbthr2s_name(mibs)); io_pbthr2s_name = ' '
  allocate(pfe(mj)); pfe = zero
  allocate(pfi(mj)); pfi = zero
  allocate(orbrzv_Prf(mj, mibs)); orbrzv_Prf = zero
  allocate(io_orbrzv_Prf(mibs)); io_orbrzv_Prf = 0
  allocate(io_orbrzv_Prf_name(mibs)); io_orbrzv_Prf_name = ' '
  allocate(orbrzv_toric_Prf(mj, mibs)); orbrzv_toric_Prf = zero
  allocate(io_orbrzv_toric_Prf(mibs)); io_orbrzv_toric_Prf = 0
  allocate(io_orbrzv_toric_Prf_name(mibs)); io_orbrzv_toric_Prf_name = ' '
  ! ... block: currents .........
  allocate(curjbeam(mj)); curjbeam = zero
  allocate(curjfusi(mj)); curjfusi = zero
  allocate(curjs(mj, mibs)); curjs = zero
  allocate(io_curjs(mibs)); io_curjs = 0
  allocate(io_curjs_name(mibs)); io_curjs_name = ' '
  allocate(ucurjs(mj, mibs)); ucurjs = zero
  allocate(io_ucurjs(mibs)); io_ucurjs = 0
  allocate(io_ucurjs_name(mibs)); io_ucurjs_name = ' '
  allocate(ucurjco(mj)); ucurjco = zero
  allocate(ucurjctr(mj)); ucurjctr = zero
  allocate(ucurjnb(mj, mib)); ucurjnb = zero
  allocate(io_ucurjnb(mib)); io_ucurjnb = 0
  allocate(io_ucurjnb_name(mib)); io_ucurjnb_name = ' '
  allocate(curjnb(mj, mib)); curjnb = zero
  allocate(io_curjnb(mib)); io_curjnb = 0
  allocate(io_curjnb_name(mib)); io_curjnb_name = ' '
  allocate(xjbfac(mj)); xjbfac = zero
  allocate(xjbfacs(mj, mibs)); xjbfacs = zero
  allocate(io_xjbfacs(mibs)); io_xjbfacs = 0
  allocate(io_xjbfacs_name(mibs)); io_xjbfacs_name = ' '
  ! ... block: neutral_sources .........
  allocate(sbcx0s(mj,mibs)); sbcx0s = zero
  allocate(io_sbcx0s(mibs)); io_sbcx0s = 0
  allocate(io_sbcx0s_name(mibs)); io_sbcx0s_name = ' '
  allocate(sorbn0(mj,mig)); sorbn0 = zero
  allocate(io_sorbn0(mig)); io_sorbn0 = 0
  allocate(io_sorbn0_name(mig)); io_sorbn0_name = ' '
  allocate(sorbn0s(mj,mig,mibs)); sorbn0s = zero
  allocate(io_sorbn0s(mig,mibs)); io_sorbn0s = 0
  allocate(io_sorbn0s_name(mig,mibs)); io_sorbn0s_name = ' '
  allocate(sorbn0s_dep(mj,mig,mibs)); sorbn0s_dep = zero
  allocate(io_sorbn0s_dep(mig,mibs)); io_sorbn0s_dep = 0
  allocate(io_sorbn0s_dep_name(mig,mibs)); io_sorbn0s_dep_name = ' '
  allocate(sn0s3dh(mj,mig,mibs)); sn0s3dh = zero
  allocate(io_sn0s3dh(mig,mibs)); io_sn0s3dh = 0
  allocate(io_sn0s3dh_name(mig,mibs)); io_sn0s3dh_name = ' '
  ! ... block: recapture .........
  allocate(sbcxrbs(mj, mibs)); sbcxrbs = zero
  allocate(io_sbcxrbs(mibs)); io_sbcxrbs = 0
  allocate(io_sbcxrbs_name(mibs)); io_sbcxrbs_name = ' '
  allocate(sbcxres(mj, mibs)); sbcxres = zero
  allocate(io_sbcxres(mibs)); io_sbcxres = 0
  allocate(io_sbcxres_name(mibs)); io_sbcxres_name = ' '
  allocate(sbcxris(mj, mibs)); sbcxris = zero
  allocate(io_sbcxris(mibs)); io_sbcxris = 0
  allocate(io_sbcxris_name(mibs)); io_sbcxris_name = ' '
  allocate(sbcxrls(mj, mibs)); sbcxrls = zero
  allocate(io_sbcxrls(mibs)); io_sbcxrls = 0
  allocate(io_sbcxrls_name(mibs)); io_sbcxrls_name = ' '
  allocate(sbcxrxs(mig, mj, mibs)); sbcxrxs = zero
  allocate(io_sbcxrxs(mig,mibs)); io_sbcxrxs = 0
  allocate(io_sbcxrxs_name(mig,mibs)); io_sbcxrxs_name = ' '
  allocate(sbcxrzs(mj, mibs)); sbcxrzs = zero
  allocate(io_sbcxrzs(mibs)); io_sbcxrzs = 0
  allocate(io_sbcxrzs_name(mibs)); io_sbcxrzs_name = ' '
  ! ... block: neutral_sinks .........
  allocate(sinb0i(mj,mig)); sinb0i = zero
  allocate(io_sinb0i(mig)); io_sinb0i = 0
  allocate(io_sinb0i_name(mig)); io_sinb0i_name = ' '
  allocate(sinb0is(mj,mig,mibs)); sinb0is = zero
  allocate(io_sinb0is(mig,mibs)); io_sinb0is = 0
  allocate(io_sinb0is_name(mig,mibs)); io_sinb0is_name = ' '
  allocate(sinbn0(mj,mig)); sinbn0 = zero
  allocate(io_sinbn0(mig)); io_sinbn0 = 0
  allocate(io_sinbn0_name(mig)); io_sinbn0_name = ' '
  allocate(sinbn0s(mj,mig,mibs)); sinbn0s = zero
  allocate(io_sinbn0s(mig,mibs)); io_sinbn0s = 0
  allocate(io_sinbn0s_name(mig,mibs)); io_sinbn0s_name = ' '
  ! ... block: sources .........
  allocate(sorbe(mj)); sorbe = zero
  allocate(sorbes(mj,mibs)); sorbes = zero
  allocate(io_sorbes(mibs)); io_sorbes = 0
  allocate(io_sorbes_name(mibs)); io_sorbes_name = ' '
  allocate(sorbes_ntr(mj,mibs)); sorbes_ntr = zero
  allocate(io_sorbes_ntr(mibs)); io_sorbes_ntr = 0
  allocate(io_sorbes_ntr_name(mibs)); io_sorbes_ntr_name = ' '
  allocate(sorbes_dep(mj,mibs)); sorbes_dep = zero
  allocate(io_sorbes_dep(mibs)); io_sorbes_dep = 0
  allocate(io_sorbes_dep_name(mibs)); io_sorbes_dep_name = ' '
  allocate(sorbh(mj,mig)); sorbh = zero
  allocate(io_sorbh(mig)); io_sorbh = 0
  allocate(io_sorbh_name(mig)); io_sorbh_name = ' '
  allocate(sorbhs(mj,mig,mibs)); sorbhs = zero
  allocate(io_sorbhs(mig,mibs)); io_sorbhs = 0
  allocate(io_sorbhs_name(mig,mibs)); io_sorbhs_name = ' '
  allocate(sorbhs_ntr(mj,mig,mibs)); sorbhs_ntr = zero
  allocate(io_sorbhs_ntr(mig,mibs)); io_sorbhs_ntr = 0
  allocate(io_sorbhs_ntr_name(mig,mibs)); io_sorbhs_ntr_name = ' '
  allocate(sorbhs_dep(mj,mig,mibs)); sorbhs_dep = zero
  allocate(io_sorbhs_dep(mig,mibs)); io_sorbhs_dep = 0
  allocate(io_sorbhs_dep_name(mig,mibs)); io_sorbhs_dep_name = ' '
  allocate(sorbth(mj)); sorbth = zero
  allocate(sorbths(mj,mibs)); sorbths = zero
  allocate(io_sorbths(mibs)); io_sorbths = 0
  allocate(io_sorbths_name(mibs)); io_sorbths_name = ' '
  ! ... block: fokker_planck .........
  allocate(taubpa0(mj,mibs)); taubpa0 = zero
  allocate(io_taubpa0(mibs)); io_taubpa0 = 0
  allocate(io_taubpa0_name(mibs)); io_taubpa0_name = ' '
  allocate(taubpaco1(mj,mibs)); taubpaco1 = zero
  allocate(io_taubpaco1(mibs)); io_taubpaco1 = 0
  allocate(io_taubpaco1_name(mibs)); io_taubpaco1_name = ' '
  allocate(taubpaco2(mj,mibs)); taubpaco2 = zero
  allocate(io_taubpaco2(mibs)); io_taubpaco2 = 0
  allocate(io_taubpaco2_name(mibs)); io_taubpaco2_name = ' '
  allocate(taubpaco3(mj,mibs)); taubpaco3 = zero
  allocate(io_taubpaco3(mibs)); io_taubpaco3 = 0
  allocate(io_taubpaco3_name(mibs)); io_taubpaco3_name = ' '
  allocate(taubpactr1(mj,mibs)); taubpactr1 = zero
  allocate(io_taubpactr1(mibs)); io_taubpactr1 = 0
  allocate(io_taubpactr1_name(mibs)); io_taubpactr1_name = ' '
  allocate(taubpactr2(mj,mibs)); taubpactr2 = zero
  allocate(io_taubpactr2(mibs)); io_taubpactr2 = 0
  allocate(io_taubpactr2_name(mibs)); io_taubpactr2_name = ' '
  allocate(taubpactr3(mj,mibs)); taubpactr3 = zero
  allocate(io_taubpactr3(mibs)); io_taubpactr3 = 0
  allocate(io_taubpactr3_name(mibs)); io_taubpactr3_name = ' '
  allocate(taubsl0(mj,mibs)); taubsl0 = zero
  allocate(io_taubsl0(mibs)); io_taubsl0 = 0
  allocate(io_taubsl0_name(mibs)); io_taubsl0_name = ' '
  allocate(taubslco1(mj,mibs)); taubslco1 = zero
  allocate(io_taubslco1(mibs)); io_taubslco1 = 0
  allocate(io_taubslco1_name(mibs)); io_taubslco1_name = ' '
  allocate(taubslco2(mj,mibs)); taubslco2 = zero
  allocate(io_taubslco2(mibs)); io_taubslco2 = 0
  allocate(io_taubslco2_name(mibs)); io_taubslco2_name = ' '
  allocate(taubslco3(mj,mibs)); taubslco3 = zero
  allocate(io_taubslco3(mibs)); io_taubslco3 = 0
  allocate(io_taubslco3_name(mibs)); io_taubslco3_name = ' '
  allocate(taubslctr1(mj,mibs)); taubslctr1 = zero
  allocate(io_taubslctr1(mibs)); io_taubslctr1 = 0
  allocate(io_taubslctr1_name(mibs)); io_taubslctr1_name = ' '
  allocate(taubslctr2(mj,mibs)); taubslctr2 = zero
  allocate(io_taubslctr2(mibs)); io_taubslctr2 = 0
  allocate(io_taubslctr2_name(mibs)); io_taubslctr2_name = ' '
  allocate(taubslctr3(mj,mibs)); taubslctr3 = zero
  allocate(io_taubslctr3(mibs)); io_taubslctr3 = 0
  allocate(io_taubslctr3_name(mibs)); io_taubslctr3_name = ' '
  allocate(paxfrc(mj,mibs)); paxfrc = zero
  allocate(io_paxfrc(mibs)); io_paxfrc = 0
  allocate(io_paxfrc_name(mibs)); io_paxfrc_name = ' '
  allocate(pbxfrc(mj,mibs)); pbxfrc = zero
  allocate(io_pbxfrc(mibs)); io_pbxfrc = 0
  allocate(io_pbxfrc_name(mibs)); io_pbxfrc_name = ' '
  ! ... block: radial_current .........
  allocate(tirabd(mj)); tirabd = zero
  allocate(tirabds(mj, mibs)); tirabds = zero
  allocate(io_tirabds(mibs)); io_tirabds = 0
  allocate(io_tirabds_name(mibs)); io_tirabds_name = ' '
  allocate(tirfsh(mj)); tirfsh = zero
  allocate(tirfshs(mj, mibs)); tirfshs = zero
  allocate(io_tirfshs(mibs)); io_tirfshs = 0
  allocate(io_tirfshs_name(mibs)); io_tirfshs_name = ' '
  allocate(tirorb(mj)); tirorb = zero
  allocate(tirorbs(mj, mibs)); tirorbs = zero
  allocate(io_tirorbs(mibs)); io_tirorbs = 0
  allocate(io_tirorbs_name(mibs)); io_tirorbs_name = ' '
  allocate(tirrip(mj)); tirrip = zero
  allocate(tirrips(mj, mibs)); tirrips = zero
  allocate(io_tirrips(mibs)); io_tirrips = 0
  allocate(io_tirrips_name(mibs)); io_tirrips_name = ' '
  allocate(difbx(mj, mibs)); difbx = zero
  allocate(io_difbx(mibs)); io_difbx = 0
  allocate(io_difbx_name(mibs)); io_difbx_name = ' '
  allocate(velbx(mj, mibs)); velbx = zero
  allocate(io_velbx(mibs)); io_velbx = 0
  allocate(io_velbx_name(mibs)); io_velbx_name = ' '
  ! ... block: torques .........
  allocate(tqbsum(mj)); tqbsum = zero
  allocate(tqbcx(mj)); tqbcx = zero
  allocate(tqbcxs(mj, mibs)); tqbcxs = zero
  allocate(io_tqbcxs(mibs)); io_tqbcxs = 0
  allocate(io_tqbcxs_name(mibs)); io_tqbcxs_name = ' '
  allocate(tqbcxs_dep(mj, mibs)); tqbcxs_dep = zero
  allocate(io_tqbcxs_dep(mibs)); io_tqbcxs_dep = 0
  allocate(io_tqbcxs_dep_name(mibs)); io_tqbcxs_dep_name = ' '
  allocate(tqbe(mj)); tqbe = zero
  allocate(tqbes(mj, mibs)); tqbes = zero
  allocate(io_tqbes(mibs)); io_tqbes = 0
  allocate(io_tqbes_name(mibs)); io_tqbes_name = ' '
  allocate(tqbi(mj)); tqbi = zero
  allocate(tqbis(mj, mibs)); tqbis = zero
  allocate(io_tqbis(mibs)); io_tqbis = 0
  allocate(io_tqbis_name(mibs)); io_tqbis_name = ' '
  allocate(tqbco_nb(mj, mib)); tqbco_nb = zero
  allocate(io_tqbco_nb(mib)); io_tqbco_nb = 0
  allocate(io_tqbco_nb_name(mib)); io_tqbco_nb_name = ' '
  allocate(tqbth_nb(mj, mib)); tqbth_nb = zero
  allocate(io_tqbth_nb(mib)); io_tqbth_nb = 0
  allocate(io_tqbth_nb_name(mib)); io_tqbth_nb_name = ' '
  allocate(tqtot_nb(mj, mib)); tqtot_nb = zero
  allocate(io_tqtot_nb(mib)); io_tqtot_nb = 0
  allocate(io_tqtot_nb_name(mib)); io_tqtot_nb_name = ' '
  allocate(tqbth(mj)); tqbth = zero
  allocate(tqbths(mj, mibs)); tqbths = zero
  allocate(io_tqbths(mibs)); io_tqbths = 0
  allocate(io_tqbths_name(mibs)); io_tqbths_name = ' '
  allocate(tqbxf(mj)); tqbxf = zero
  allocate(tqbxfs(mj, mibs)); tqbxfs = zero
  allocate(io_tqbxfs(mibs)); io_tqbxfs = 0
  allocate(io_tqbxfs_name(mibs)); io_tqbxfs_name = ' '
  allocate(tqdifb(mj)); tqdifb = zero
  allocate(tqdifbs(mj,mibs)); tqdifbs = zero
  allocate(io_tqdifbs(mibs)); io_tqdifbs = 0
  allocate(io_tqdifbs_name(mibs)); io_tqdifbs_name = ' '
  allocate(tqjxb(mj)); tqjxb = zero
  allocate(tqjxbs(mj, mibs)); tqjxbs = zero
  allocate(io_tqjxbs(mibs)); io_tqjxbs = 0
  allocate(io_tqjxbs_name(mibs)); io_tqjxbs_name = ' '
  allocate(tqjxbs_ntr(mj, mibs)); tqjxbs_ntr = zero
  allocate(io_tqjxbs_ntr(mibs)); io_tqjxbs_ntr = 0
  allocate(io_tqjxbs_ntr_name(mibs)); io_tqjxbs_ntr_name = ' '
  allocate(tqjxb_nb(mj, mib)); tqjxb_nb = zero
  allocate(io_tqjxb_nb(mib)); io_tqjxb_nb = 0
  allocate(io_tqjxb_nb_name(mib)); io_tqjxb_nb_name = ' '
  allocate(tqjxbnb_ntr(mj, mib)); tqjxbnb_ntr = zero
  allocate(io_tqjxbnb_ntr(mib)); io_tqjxbnb_ntr = 0
  allocate(io_tqjxbnb_ntr_name(mib)); io_tqjxbnb_ntr_name = ' '
  allocate(tqjxbs_dep(mj, mibs)); tqjxbs_dep = zero
  allocate(io_tqjxbs_dep(mibs)); io_tqjxbs_dep = 0
  allocate(io_tqjxbs_dep_name(mibs)); io_tqjxbs_dep_name = ' '
  allocate(tqjxb_nb_dep(mj, mib)); tqjxb_nb_dep = zero
  allocate(io_tqjxb_nb_dep(mib)); io_tqjxb_nb_dep = 0
  allocate(io_tqjxb_nb_dep_name(mib)); io_tqjxb_nb_dep_name = ' '
  allocate(tqohb(mj)); tqohb = zero
  allocate(tqohbs(mj, mibs)); tqohbs = zero
  allocate(io_tqohbs(mibs)); io_tqohbs = 0
  allocate(io_tqohbs_name(mibs)); io_tqohbs_name = ' '
  allocate(tqrpl(mj)); tqrpl = zero
  allocate(tqrpls(mj, mibs)); tqrpls = zero
  allocate(io_tqrpls(mibs)); io_tqrpls = 0
  allocate(io_tqrpls_name(mibs)); io_tqrpls_name = ' '
  ! ... block: frantic .........
  allocate(nbi_den0mn(mig, mj, mis)); nbi_den0mn = zero
  allocate(io_nbi_den0mn(mig,mis)); io_nbi_den0mn = 0
  allocate(io_nbi_den0mn_name(mig,mis)); io_nbi_den0mn_name = ' '
  allocate(nbi_en0mn(mig, mj, mis)); nbi_en0mn = zero
  allocate(io_nbi_en0mn(mig,mis)); io_nbi_en0mn = 0
  allocate(io_nbi_en0mn_name(mig,mis)); io_nbi_en0mn_name = ' '
  allocate(nbi_omg0mn(mig, mj, mis)); nbi_omg0mn = zero
  allocate(io_nbi_omg0mn(mig,mis)); io_nbi_omg0mn = 0
  allocate(io_nbi_omg0mn_name(mig,mis)); io_nbi_omg0mn_name = ' '
  allocate(nbi_snimn(mig, mj, mis)); nbi_snimn = zero
  allocate(io_nbi_snimn(mig,mis)); io_nbi_snimn = 0
  allocate(io_nbi_snimn_name(mig,mis)); io_nbi_snimn_name = ' '
  allocate(nbi_outflx(mig, mis)); nbi_outflx = zero
  allocate(nbi_eescav(mig, mis)); nbi_eescav = zero
  allocate(nbi_cexflx(mig, mis)); nbi_cexflx = zero
  allocate(nbi_snemn(2,mj, mis)); nbi_snemn = zero
  allocate(io_nbi_snemn(2,mis)); io_nbi_snemn = 0
  allocate(io_nbi_snemn_name(2,mis)); io_nbi_snemn_name = ' '
  allocate(nbi_scxmn(mj, mis)); nbi_scxmn = zero
  allocate(io_nbi_scxmn(mis)); io_nbi_scxmn = 0
  allocate(io_nbi_scxmn_name(mis)); io_nbi_scxmn_name = ' '
  allocate(nbi_pcxmn(mj, mis)); nbi_pcxmn = zero
  allocate(io_nbi_pcxmn(mis)); io_nbi_pcxmn = 0
  allocate(io_nbi_pcxmn_name(mis)); io_nbi_pcxmn_name = ' '
  allocate(nbi_pnimn(mj, mis)); nbi_pnimn = zero
  allocate(io_nbi_pnimn(mis)); io_nbi_pnimn = 0
  allocate(io_nbi_pnimn_name(mis)); io_nbi_pnimn_name = ' '
  allocate(nbi_tqcxmn(mj, mis)); nbi_tqcxmn = zero
  allocate(io_nbi_tqcxmn(mis)); io_nbi_tqcxmn = 0
  allocate(io_nbi_tqcxmn_name(mis)); io_nbi_tqcxmn_name = ' '
  allocate(nbi_tqnimn(mj, mis)); nbi_tqnimn = zero
  allocate(io_nbi_tqnimn(mis)); io_nbi_tqnimn = 0
  allocate(io_nbi_tqnimn_name(mis)); io_nbi_tqnimn_name = ' '
  allocate(nbi_pfcxmn(mj, mis)); nbi_pfcxmn = zero
  allocate(io_nbi_pfcxmn(mis)); io_nbi_pfcxmn = 0
  allocate(io_nbi_pfcxmn_name(mis)); io_nbi_pfcxmn_name = ' '
  allocate(nbi_pfnimn(mj, mis)); nbi_pfnimn = zero
  allocate(io_nbi_pfnimn(mis)); io_nbi_pfnimn = 0
  allocate(io_nbi_pfnimn_name(mis)); io_nbi_pfnimn_name = ' '
  allocate(nbi_sflx0m(2,mj, mis)); nbi_sflx0m = zero
  allocate(io_nbi_sflx0m(2,mis)); io_nbi_sflx0m = 0
  allocate(io_nbi_sflx0m_name(2,mis)); io_nbi_sflx0m_name = ' '
  allocate(nbi_pflx0m(2,mj, mis)); nbi_pflx0m = zero
  allocate(io_nbi_pflx0m(2,mis)); io_nbi_pflx0m = 0
  allocate(io_nbi_pflx0m_name(2,mis)); io_nbi_pflx0m_name = ' '
  allocate(nbi_tqflx0(mj, mis)); nbi_tqflx0 = zero
  allocate(io_nbi_tqflx0(mis)); io_nbi_tqflx0 = 0
  allocate(io_nbi_tqflx0_name(mis)); io_nbi_tqflx0_name = ' '
  allocate(nbi_pb0mn(mj, mis)); nbi_pb0mn = zero
  allocate(io_nbi_pb0mn(mis)); io_nbi_pb0mn = 0
  allocate(io_nbi_pb0mn_name(mis)); io_nbi_pb0mn_name = ' '
  allocate(nbi_pscmn(mj, mis)); nbi_pscmn = zero
  allocate(io_nbi_pscmn(mis)); io_nbi_pscmn = 0
  allocate(io_nbi_pscmn_name(mis)); io_nbi_pscmn_name = ' '
  allocate(nbi_tqb0mn(mj, mis)); nbi_tqb0mn = zero
  allocate(io_nbi_tqb0mn(mis)); io_nbi_tqb0mn = 0
  allocate(io_nbi_tqb0mn_name(mis)); io_nbi_tqb0mn_name = ' '
  allocate(nbi_tqscmn(mj, mis)); nbi_tqscmn = zero
  allocate(io_nbi_tqscmn(mis)); io_nbi_tqscmn = 0
  allocate(io_nbi_tqscmn_name(mis)); io_nbi_tqscmn_name = ' '
  ! ... block: hi_z_beams .........
  allocate(xzbmav(mj,mibs)); xzbmav = zero
  allocate(io_xzbmav(mibs)); io_xzbmav = 0
  allocate(io_xzbmav_name(mibs)); io_xzbmav_name = ' '
  ! ... block: cptimes .........
  ! ... block: power_balance .........
  allocate(bpcxers(mibs)); bpcxers = zero
  allocate(bpcxi0s(mibs)); bpcxi0s = zero
  allocate(bpcxins(mibs)); bpcxins = zero
  allocate(bpcxots(mibs)); bpcxots = zero
  allocate(bpcxris(mibs)); bpcxris = zero
  allocate(bpcxrxs(mibs)); bpcxrxs = zero
  allocate(bpcxx0s(mibs)); bpcxx0s = zero
  allocate(bperrs(mibs)); bperrs = zero
  allocate(PBAEPMS(mj,mnkaep,mibs)); PBAEPMS = zero
  allocate(io_PBAEPMS(mnkaep,mibs)); io_PBAEPMS = 0
  allocate(io_PBAEPMS_name(mnkaep,mibs)); io_PBAEPMS_name = ' '
  allocate(bpfshs(mibs)); bpfshs = zero
  allocate(bpls(mibs)); bpls = zero
  allocate(bpls_dep(mibs)); bpls_dep = zero
  allocate(bpohs(mibs)); bpohs = zero
  allocate(bprpls(mibs)); bprpls = zero
  allocate(bpshins(mibs)); bpshins = zero
  allocate(bpsts(mibs)); bpsts = zero
  allocate(bpths(mibs)); bpths = zero
  allocate(bpprma(mib)); bpprma = zero
  allocate(pinjs(mibs)); pinjs = zero
  allocate(pinjs_res(mibs)); pinjs_res = zero
  allocate(pbdepmc(mibs)); pbdepmc = zero
  allocate(PBDEPBA(mibs)); PBDEPBA = zero
  allocate(bpephis(mibs)); bpephis = zero
  allocate(orbrzv_Prftot(mibs)); orbrzv_Prftot = zero
  allocate(orbrzv_toric_Prftot(mibs)); orbrzv_toric_Prftot = zero
  allocate(orbrzv_toric_ufrnm(mibs)); orbrzv_toric_ufrnm = zero
  ! ... block: momentum_balance .........
  allocate(bph0was(mibs)); bph0was = zero
  allocate(bphcks(mibs)); bphcks = zero
  allocate(bphcols(mibs)); bphcols = zero
  allocate(bphcons(mibs)); bphcons = zero
  allocate(bphcxls(mibs)); bphcxls = zero
  allocate(bphinjs(mibs)); bphinjs = zero
  allocate(bphdepsgc(mibs)); bphdepsgc = zero
  allocate(bphdeps(mibs)); bphdeps = zero
  allocate(bphshins(mibs)); bphshins = zero
  allocate(bphdpba(mibs)); bphdpba = zero
  allocate(bphdfbs(mibs)); bphdfbs = zero
  allocate(bpherrs(mibs)); bpherrs = zero
  allocate(bphfshs(mibs)); bphfshs = zero
  allocate(bphjxbs(mibs)); bphjxbs = zero
  allocate(bphjxbs_ntr(mibs)); bphjxbs_ntr = zero
  allocate(bphjxbs_dep(mibs)); bphjxbs_dep = zero
  allocate(bphohbs(mibs)); bphohbs = zero
  allocate(bpholds(mibs)); bpholds = zero
  allocate(bphorbs(mibs)); bphorbs = zero
  allocate(bphorbs_dep(mibs)); bphorbs_dep = zero
  allocate(bphrcas(mibs)); bphrcas = zero
  allocate(bphrpls(mibs)); bphrpls = zero
  allocate(bphsts(mibs)); bphsts = zero
  allocate(bphths(mibs)); bphths = zero
  ! ... block: torque_work .........
  allocate(bptcols(mibs)); bptcols = zero
  allocate(bptdfbs(mibs)); bptdfbs = zero
  allocate(bpthros(mibs)); bpthros = zero
  allocate(bpthsfs(mibs)); bpthsfs = zero
  allocate(bpjxbs(mibs)); bpjxbs = zero
  allocate(bpjxbs_ntr(mibs)); bpjxbs_ntr = zero
  allocate(bpjxbs_dep(mibs)); bpjxbs_dep = zero
  allocate(bpthafs(mibs)); bpthafs = zero
  ! ... block: particle_balance .........
  allocate(bxflws(mibs)); bxflws = zero
  allocate(bxflws_dep(mibs)); bxflws_dep = zero
  allocate(bxflws_prompt(mibs)); bxflws_prompt = zero
  allocate(bxfshs(mibs)); bxfshs = zero
  allocate(bxrpls(mibs)); bxrpls = zero
  allocate(sbcxxs(mibs)); sbcxxs = zero
  allocate(sfcx0mc(mibs)); sfcx0mc = zero
  allocate(sfcxmc1d(mj,mibs)); sfcxmc1d = zero
  allocate(io_sfcxmc1d(mibs)); io_sfcxmc1d = 0
  allocate(io_sfcxmc1d_name(mibs)); io_sfcxmc1d_name = ' '
  allocate(sfcxbal(mibs)); sfcxbal = zero
  allocate(sfcxesc(mibs)); sfcxesc = zero
  allocate(sfcxrmc(mibs)); sfcxrmc = zero
  allocate(sfcxrr(mibs)); sfcxrr = zero
  allocate(sfdbbcx(mibs)); sfdbbcx = zero
  allocate(sfdbbiz(mibs)); sfdbbiz = zero
  allocate(sfdepba(mibs)); sfdepba = zero
  allocate(sfdepcx(mibs)); sfdepcx = zero
  allocate(sfdepiz(mibs)); sfdepiz = zero
  allocate(sfdepmc(mibs)); sfdepmc = zero
  allocate(sfdeprr(mibs)); sfdeprr = zero
  allocate(sfdepsc(mibs)); sfdepsc = zero
  allocate(sfdtbmc(mibs)); sfdtbmc = zero
  allocate(sforbal(mibs)); sforbal = zero
  allocate(sforbrr(mibs)); sforbrr = zero
  allocate(sfrbbcx(mibs)); sfrbbcx = zero
  allocate(sfrbbiz(mibs)); sfrbbiz = zero
  allocate(sfshine(mibs)); sfshine = zero
  allocate(sfxrccx(mibs)); sfxrccx = zero
  allocate(sfxrciz(mibs)); sfxrciz = zero
  allocate(sfxrcsc(mibs)); sfxrcsc = zero
  allocate(snbcxos(mibs)); snbcxos = zero
  allocate(snbcxs(mibs)); snbcxs = zero
  allocate(snbxbb0(mibs)); snbxbb0 = zero
  allocate(snbxbb1(mibs)); snbxbb1 = zero
  allocate(snbxtot(mibs)); snbxtot = zero
  allocate(snbx1d(mj,mibs)); snbx1d = zero
  allocate(io_snbx1d(mibs)); io_snbx1d = 0
  allocate(io_snbx1d_name(mibs)); io_snbx1d_name = ' '
  allocate(snbxv0(mibs)); snbxv0 = zero
  allocate(snbxw0(mibs)); snbxw0 = zero
  allocate(xysbcxs(mibs)); xysbcxs = zero
  allocate(xninjs(mibs)); xninjs = zero
  allocate(xninjea(mibs)); xninjea = zero
 
end subroutine nbi_alloc_init
