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