! written by nbigen.py
! *** do not edit *** (use nbigen.py instead)
 
subroutine nbo_outputs_write(icdf)
 
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call nbo_out_fusion_def(icdf)
  call nbo_out_density_def(icdf)
  call nbo_out_deposition_def(icdf)
  call nbo_out_nclass_def(icdf)
  call nbo_out_n0_fast_def(icdf)
  call nbo_out_trap_fraction_def(icdf)
  call nbo_out_erngfi_output_def(icdf)
  call nbo_out_average_energies_def(icdf)
  call nbo_out_excited_states_def(icdf)
  call nbo_out_mc_statistics_def(icdf)
  call nbo_out_rotation_def(icdf)
  call nbo_out_compression_def(icdf)
  call nbo_out_powers_def(icdf)
  call nbo_out_currents_def(icdf)
  call nbo_out_neutral_sources_def(icdf)
  call nbo_out_recapture_def(icdf)
  call nbo_out_neutral_sinks_def(icdf)
  call nbo_out_sources_def(icdf)
  call nbo_out_fokker_planck_def(icdf)
  call nbo_out_radial_current_def(icdf)
  call nbo_out_torques_def(icdf)
  call nbo_out_frantic_def(icdf)
  call nbo_out_hi_z_beams_def(icdf)
  call nbo_out_cptimes_def(icdf)
  call nbo_out_power_balance_def(icdf)
  call nbo_out_momentum_balance_def(icdf)
  call nbo_out_torque_work_def(icdf)
  call nbo_out_particle_balance_def(icdf)
 
  call nbo_out_fusion_wr(icdf)
  call nbo_out_density_wr(icdf)
  call nbo_out_deposition_wr(icdf)
  call nbo_out_nclass_wr(icdf)
  call nbo_out_n0_fast_wr(icdf)
  call nbo_out_trap_fraction_wr(icdf)
  call nbo_out_erngfi_output_wr(icdf)
  call nbo_out_average_energies_wr(icdf)
  call nbo_out_excited_states_wr(icdf)
  call nbo_out_mc_statistics_wr(icdf)
  call nbo_out_rotation_wr(icdf)
  call nbo_out_compression_wr(icdf)
  call nbo_out_powers_wr(icdf)
  call nbo_out_currents_wr(icdf)
  call nbo_out_neutral_sources_wr(icdf)
  call nbo_out_recapture_wr(icdf)
  call nbo_out_neutral_sinks_wr(icdf)
  call nbo_out_sources_wr(icdf)
  call nbo_out_fokker_planck_wr(icdf)
  call nbo_out_radial_current_wr(icdf)
  call nbo_out_torques_wr(icdf)
  call nbo_out_frantic_wr(icdf)
  call nbo_out_hi_z_beams_wr(icdf)
  call nbo_out_cptimes_wr(icdf)
  call nbo_out_power_balance_wr(icdf)
  call nbo_out_momentum_balance_wr(icdf)
  call nbo_out_torque_work_wr(icdf)
  call nbo_out_particle_balance_wr(icdf)
 
end subroutine nbo_outputs_write
 
subroutine nbo_outputs_read(icdf,ierr)
 
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  call nbo_out_fusion_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_density_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_deposition_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_nclass_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_n0_fast_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_trap_fraction_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_erngfi_output_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_average_energies_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_excited_states_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_mc_statistics_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_rotation_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_compression_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_powers_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_currents_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_neutral_sources_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_recapture_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_neutral_sinks_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_sources_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_fokker_planck_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_radial_current_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_torques_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_frantic_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_hi_z_beams_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_cptimes_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_power_balance_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_momentum_balance_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_torque_work_rd(icdf,ierr)
  if(ierr.ne.0) return
  call nbo_out_particle_balance_rd(icdf,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_outputs_read
 
subroutine nbo_outputs_avg_all(icdf,zwght,ierr)
 
  use iso_c_binding, only: fp => c_double
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! weight factor
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbo_out_fusion_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_density_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_deposition_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_nclass_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_n0_fast_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_trap_fraction_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_erngfi_output_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_average_energies_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_excited_states_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_mc_statistics_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_rotation_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_compression_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_powers_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_currents_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_neutral_sources_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_recapture_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_neutral_sinks_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_sources_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_fokker_planck_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_radial_current_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_torques_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_frantic_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_hi_z_beams_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_cptimes_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_power_balance_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_momentum_balance_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_torque_work_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
  call nbo_out_particle_balance_avg(icdf,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_outputs_avg_all
 
subroutine nbo_out_fusion_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bbntot',bbntot)
  call cdf_define(icdf,'bbnta',bbnta)
  call cdf_define(icdf,'btneut',btneut)
  call cdf_define(icdf,'rbneut',rbneut)
  call cdf_define(icdf,'btnta',btnta)
  call cdf_define(icdf,'sftot',sftot)
 
end subroutine nbo_out_fusion_def
 
subroutine nbo_out_density_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_density_def
 
subroutine nbo_out_deposition_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'SDEP_OAUC',SDEP_OAUC)
  call cdf_define(icdf,'einjav',einjav)
  call cdf_define(icdf,'frac_cur_ndep0',frac_cur_ndep0)
  call cdf_define(icdf,'ndep0_use',ndep0_use)
  call cdf_define(icdf,'nbs_step',nbs_step)
  call cdf_define(icdf,'n_outtim',n_outtim)
 
end subroutine nbo_out_deposition_def
 
subroutine nbo_out_nclass_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bpshna',bpshna)
  call cdf_define(icdf,'ein_ien',ein_ien)
  call cdf_define(icdf,'dei_ien',dei_ien)
 
end subroutine nbo_out_nclass_def
 
subroutine nbo_out_n0_fast_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_n0_fast_def
 
subroutine nbo_out_trap_fraction_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'tbtrap',tbtrap)
  call cdf_define(icdf,'tbtrap0',tbtrap0)
 
end subroutine nbo_out_trap_fraction_def
 
subroutine nbo_out_erngfi_output_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_erngfi_output_def
 
subroutine nbo_out_average_energies_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_average_energies_def
 
subroutine nbo_out_excited_states_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_excited_states_def
 
subroutine nbo_out_mc_statistics_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'nmctot',nmctot)
  call cdf_define(icdf,'wnmctot',wnmctot)
  call cdf_define(icdf,'naeptot',naeptot)
  call cdf_define(icdf,'nstep_aep',nstep_aep)
  call cdf_define(icdf,'nmcloss',nmcloss)
  call cdf_define(icdf,'nnew',nnew)
  call cdf_define(icdf,'xncx0_orb',xncx0_orb)
 
end subroutine nbo_out_mc_statistics_def
 
subroutine nbo_out_rotation_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_rotation_def
 
subroutine nbo_out_compression_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_compression_def
 
subroutine nbo_out_powers_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_powers_def
 
subroutine nbo_out_currents_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_currents_def
 
subroutine nbo_out_neutral_sources_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_neutral_sources_def
 
subroutine nbo_out_recapture_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_recapture_def
 
subroutine nbo_out_neutral_sinks_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_neutral_sinks_def
 
subroutine nbo_out_sources_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_sources_def
 
subroutine nbo_out_fokker_planck_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_fokker_planck_def
 
subroutine nbo_out_radial_current_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_radial_current_def
 
subroutine nbo_out_torques_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_torques_def
 
subroutine nbo_out_frantic_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'nbi_outflx',nbi_outflx)
  call cdf_define(icdf,'nbi_eescav',nbi_eescav)
  call cdf_define(icdf,'nbi_cexflx',nbi_cexflx)
 
end subroutine nbo_out_frantic_def
 
subroutine nbo_out_hi_z_beams_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
 
end subroutine nbo_out_hi_z_beams_def
 
subroutine nbo_out_cptimes_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'CPBPS',CPBPS)
  call cdf_define(icdf,'CPBSTART',CPBSTART)
  call cdf_define(icdf,'CPBDEP',CPBDEP)
  call cdf_define(icdf,'CPBORB',CPBORB)
  call cdf_define(icdf,'CPBFIN',CPBFIN)
  call cdf_define(icdf,'CPBMAX',CPBMAX)
  call cdf_define(icdf,'CPBMIN',CPBMIN)
  call cdf_define(icdf,'CPBROOT',CPBROOT)
 
end subroutine nbo_out_cptimes_def
 
subroutine nbo_out_power_balance_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bpcxers',bpcxers)
  call cdf_define(icdf,'bpcxi0s',bpcxi0s)
  call cdf_define(icdf,'bpcxins',bpcxins)
  call cdf_define(icdf,'bpcxots',bpcxots)
  call cdf_define(icdf,'bpcxris',bpcxris)
  call cdf_define(icdf,'bpcxrxs',bpcxrxs)
  call cdf_define(icdf,'bpcxx0s',bpcxx0s)
  call cdf_define(icdf,'bperr',bperr)
  call cdf_define(icdf,'bperrs',bperrs)
  call cdf_define(icdf,'bpfshs',bpfshs)
  call cdf_define(icdf,'bpls',bpls)
  call cdf_define(icdf,'bpls_dep',bpls_dep)
  call cdf_define(icdf,'bpohs',bpohs)
  call cdf_define(icdf,'bprpls',bprpls)
  call cdf_define(icdf,'bpshins',bpshins)
  call cdf_define(icdf,'bpsts',bpsts)
  call cdf_define(icdf,'bpths',bpths)
  call cdf_define(icdf,'pftota',pftota)
  call cdf_define(icdf,'bpprma',bpprma)
  call cdf_define(icdf,'pinjs',pinjs)
  call cdf_define(icdf,'pinjs_res',pinjs_res)
  call cdf_define(icdf,'pbdepmc',pbdepmc)
  call cdf_define(icdf,'PBDEPBA',PBDEPBA)
  call cdf_define(icdf,'bpephis',bpephis)
  call cdf_define(icdf,'orbrzv_Prftot',orbrzv_Prftot)
  call cdf_define(icdf,'orbrzv_toric_Prftot',orbrzv_toric_Prftot)
  call cdf_define(icdf,'orbrzv_toric_ufrnm',orbrzv_toric_ufrnm)
 
end subroutine nbo_out_power_balance_def
 
subroutine nbo_out_momentum_balance_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bph0was',bph0was)
  call cdf_define(icdf,'bphcks',bphcks)
  call cdf_define(icdf,'bphcols',bphcols)
  call cdf_define(icdf,'bphcons',bphcons)
  call cdf_define(icdf,'bphcxls',bphcxls)
  call cdf_define(icdf,'bphinjs',bphinjs)
  call cdf_define(icdf,'bphdepsgc',bphdepsgc)
  call cdf_define(icdf,'bphdeps',bphdeps)
  call cdf_define(icdf,'bphshins',bphshins)
  call cdf_define(icdf,'bphdpba',bphdpba)
  call cdf_define(icdf,'bphdfbs',bphdfbs)
  call cdf_define(icdf,'bpherr',bpherr)
  call cdf_define(icdf,'bpherrs',bpherrs)
  call cdf_define(icdf,'bphfshs',bphfshs)
  call cdf_define(icdf,'bphjxbs',bphjxbs)
  call cdf_define(icdf,'bphjxbs_ntr',bphjxbs_ntr)
  call cdf_define(icdf,'bphjxbs_dep',bphjxbs_dep)
  call cdf_define(icdf,'bphohbs',bphohbs)
  call cdf_define(icdf,'bpholds',bpholds)
  call cdf_define(icdf,'bphorbs',bphorbs)
  call cdf_define(icdf,'bphorbs_dep',bphorbs_dep)
  call cdf_define(icdf,'bphrcas',bphrcas)
  call cdf_define(icdf,'bphrpls',bphrpls)
  call cdf_define(icdf,'bphsts',bphsts)
  call cdf_define(icdf,'bphths',bphths)
 
end subroutine nbo_out_momentum_balance_def
 
subroutine nbo_out_torque_work_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bptcols',bptcols)
  call cdf_define(icdf,'bptdfbs',bptdfbs)
  call cdf_define(icdf,'bpthros',bpthros)
  call cdf_define(icdf,'bpthsfs',bpthsfs)
  call cdf_define(icdf,'bpjxbs',bpjxbs)
  call cdf_define(icdf,'bpjxbs_ntr',bpjxbs_ntr)
  call cdf_define(icdf,'bpjxbs_dep',bpjxbs_dep)
  call cdf_define(icdf,'bpthafs',bpthafs)
 
end subroutine nbo_out_torque_work_def
 
subroutine nbo_out_particle_balance_def(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  call cdf_define(icdf,'bxflws',bxflws)
  call cdf_define(icdf,'bxflws_dep',bxflws_dep)
  call cdf_define(icdf,'bxflws_prompt',bxflws_prompt)
  call cdf_define(icdf,'bxfshs',bxfshs)
  call cdf_define(icdf,'bxrpls',bxrpls)
  call cdf_define(icdf,'sbcxxs',sbcxxs)
  call cdf_define(icdf,'sfcx0mc',sfcx0mc)
  call cdf_define(icdf,'sfcxbal',sfcxbal)
  call cdf_define(icdf,'sfcxesc',sfcxesc)
  call cdf_define(icdf,'sfcxrmc',sfcxrmc)
  call cdf_define(icdf,'sfcxrr',sfcxrr)
  call cdf_define(icdf,'sfdbbcx',sfdbbcx)
  call cdf_define(icdf,'sfdbbiz',sfdbbiz)
  call cdf_define(icdf,'sfdepba',sfdepba)
  call cdf_define(icdf,'sfdepcx',sfdepcx)
  call cdf_define(icdf,'sfdepiz',sfdepiz)
  call cdf_define(icdf,'sfdepmc',sfdepmc)
  call cdf_define(icdf,'sfdeprr',sfdeprr)
  call cdf_define(icdf,'sfdepsc',sfdepsc)
  call cdf_define(icdf,'sfdtbmc',sfdtbmc)
  call cdf_define(icdf,'sforbal',sforbal)
  call cdf_define(icdf,'sforbrr',sforbrr)
  call cdf_define(icdf,'sfrbbcx',sfrbbcx)
  call cdf_define(icdf,'sfrbbiz',sfrbbiz)
  call cdf_define(icdf,'sfshine',sfshine)
  call cdf_define(icdf,'sfxrccx',sfxrccx)
  call cdf_define(icdf,'sfxrciz',sfxrciz)
  call cdf_define(icdf,'sfxrcsc',sfxrcsc)
  call cdf_define(icdf,'snbcxos',snbcxos)
  call cdf_define(icdf,'snbcxs',snbcxs)
  call cdf_define(icdf,'snbxbb0',snbxbb0)
  call cdf_define(icdf,'snbxbb1',snbxbb1)
  call cdf_define(icdf,'snbxtot',snbxtot)
  call cdf_define(icdf,'snbxv0',snbxv0)
  call cdf_define(icdf,'snbxw0',snbxw0)
  call cdf_define(icdf,'xysbcxs',xysbcxs)
  call cdf_define(icdf,'xninjs',xninjs)
  call cdf_define(icdf,'xninjea',xninjea)
  call cdf_define(icdf,'sftota',sftota)
 
end subroutine nbo_out_particle_balance_def
 
subroutine nbo_out_fusion_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_fusion_wr: icdf=0.'
  call cdf_write(icdf,'bbntot',bbntot)
  call cdf_write(icdf,'bbnta',bbnta)
  call cdf_write(icdf,'btneut',btneut)
  call cdf_write(icdf,'rbneut',rbneut)
  call cdf_write(icdf,'btnta',btnta)
  call cdf_write(icdf,'sftot',sftot)
 
end subroutine nbo_out_fusion_wr
 
subroutine nbo_out_density_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_density_wr: icdf=0.'
 
end subroutine nbo_out_density_wr
 
subroutine nbo_out_deposition_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_deposition_wr: icdf=0.'
  call cdf_write(icdf,'SDEP_OAUC',SDEP_OAUC)
  call cdf_write(icdf,'einjav',einjav)
  call cdf_write(icdf,'frac_cur_ndep0',frac_cur_ndep0)
  call cdf_write(icdf,'ndep0_use',ndep0_use)
  call cdf_write(icdf,'nbs_step',nbs_step)
  call cdf_write(icdf,'n_outtim',n_outtim)
 
end subroutine nbo_out_deposition_wr
 
subroutine nbo_out_nclass_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_nclass_wr: icdf=0.'
  call cdf_write(icdf,'bpshna',bpshna)
  call cdf_write(icdf,'ein_ien',ein_ien)
  call cdf_write(icdf,'dei_ien',dei_ien)
 
end subroutine nbo_out_nclass_wr
 
subroutine nbo_out_n0_fast_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_n0_fast_wr: icdf=0.'
 
end subroutine nbo_out_n0_fast_wr
 
subroutine nbo_out_trap_fraction_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_trap_fraction_wr: icdf=0.'
  call cdf_write(icdf,'tbtrap',tbtrap)
  call cdf_write(icdf,'tbtrap0',tbtrap0)
 
end subroutine nbo_out_trap_fraction_wr
 
subroutine nbo_out_erngfi_output_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_erngfi_output_wr: icdf=0.'
 
end subroutine nbo_out_erngfi_output_wr
 
subroutine nbo_out_average_energies_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_average_energies_wr: icdf=0.'
 
end subroutine nbo_out_average_energies_wr
 
subroutine nbo_out_excited_states_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_excited_states_wr: icdf=0.'
 
end subroutine nbo_out_excited_states_wr
 
subroutine nbo_out_mc_statistics_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_mc_statistics_wr: icdf=0.'
  call cdf_write(icdf,'nmctot',nmctot)
  call cdf_write(icdf,'wnmctot',wnmctot)
  call cdf_write(icdf,'naeptot',naeptot)
  call cdf_write(icdf,'nstep_aep',nstep_aep)
  call cdf_write(icdf,'nmcloss',nmcloss)
  call cdf_write(icdf,'nnew',nnew)
  call cdf_write(icdf,'xncx0_orb',xncx0_orb)
 
end subroutine nbo_out_mc_statistics_wr
 
subroutine nbo_out_rotation_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_rotation_wr: icdf=0.'
 
end subroutine nbo_out_rotation_wr
 
subroutine nbo_out_compression_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_compression_wr: icdf=0.'
 
end subroutine nbo_out_compression_wr
 
subroutine nbo_out_powers_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_powers_wr: icdf=0.'
 
end subroutine nbo_out_powers_wr
 
subroutine nbo_out_currents_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_currents_wr: icdf=0.'
 
end subroutine nbo_out_currents_wr
 
subroutine nbo_out_neutral_sources_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_neutral_sources_wr: icdf=0.'
 
end subroutine nbo_out_neutral_sources_wr
 
subroutine nbo_out_recapture_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_recapture_wr: icdf=0.'
 
end subroutine nbo_out_recapture_wr
 
subroutine nbo_out_neutral_sinks_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_neutral_sinks_wr: icdf=0.'
 
end subroutine nbo_out_neutral_sinks_wr
 
subroutine nbo_out_sources_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_sources_wr: icdf=0.'
 
end subroutine nbo_out_sources_wr
 
subroutine nbo_out_fokker_planck_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_fokker_planck_wr: icdf=0.'
 
end subroutine nbo_out_fokker_planck_wr
 
subroutine nbo_out_radial_current_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_radial_current_wr: icdf=0.'
 
end subroutine nbo_out_radial_current_wr
 
subroutine nbo_out_torques_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_torques_wr: icdf=0.'
 
end subroutine nbo_out_torques_wr
 
subroutine nbo_out_frantic_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_frantic_wr: icdf=0.'
  call cdf_write(icdf,'nbi_outflx',nbi_outflx)
  call cdf_write(icdf,'nbi_eescav',nbi_eescav)
  call cdf_write(icdf,'nbi_cexflx',nbi_cexflx)
 
end subroutine nbo_out_frantic_wr
 
subroutine nbo_out_hi_z_beams_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_hi_z_beams_wr: icdf=0.'
 
end subroutine nbo_out_hi_z_beams_wr
 
subroutine nbo_out_cptimes_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_cptimes_wr: icdf=0.'
  call cdf_write(icdf,'CPBPS',CPBPS)
  call cdf_write(icdf,'CPBSTART',CPBSTART)
  call cdf_write(icdf,'CPBDEP',CPBDEP)
  call cdf_write(icdf,'CPBORB',CPBORB)
  call cdf_write(icdf,'CPBFIN',CPBFIN)
  call cdf_write(icdf,'CPBMAX',CPBMAX)
  call cdf_write(icdf,'CPBMIN',CPBMIN)
  call cdf_write(icdf,'CPBROOT',CPBROOT)
 
end subroutine nbo_out_cptimes_wr
 
subroutine nbo_out_power_balance_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_power_balance_wr: icdf=0.'
  call cdf_write(icdf,'bpcxers',bpcxers)
  call cdf_write(icdf,'bpcxi0s',bpcxi0s)
  call cdf_write(icdf,'bpcxins',bpcxins)
  call cdf_write(icdf,'bpcxots',bpcxots)
  call cdf_write(icdf,'bpcxris',bpcxris)
  call cdf_write(icdf,'bpcxrxs',bpcxrxs)
  call cdf_write(icdf,'bpcxx0s',bpcxx0s)
  call cdf_write(icdf,'bperr',bperr)
  call cdf_write(icdf,'bperrs',bperrs)
  call cdf_write(icdf,'bpfshs',bpfshs)
  call cdf_write(icdf,'bpls',bpls)
  call cdf_write(icdf,'bpls_dep',bpls_dep)
  call cdf_write(icdf,'bpohs',bpohs)
  call cdf_write(icdf,'bprpls',bprpls)
  call cdf_write(icdf,'bpshins',bpshins)
  call cdf_write(icdf,'bpsts',bpsts)
  call cdf_write(icdf,'bpths',bpths)
  call cdf_write(icdf,'pftota',pftota)
  call cdf_write(icdf,'bpprma',bpprma)
  call cdf_write(icdf,'pinjs',pinjs)
  call cdf_write(icdf,'pinjs_res',pinjs_res)
  call cdf_write(icdf,'pbdepmc',pbdepmc)
  call cdf_write(icdf,'PBDEPBA',PBDEPBA)
  call cdf_write(icdf,'bpephis',bpephis)
  call cdf_write(icdf,'orbrzv_Prftot',orbrzv_Prftot)
  call cdf_write(icdf,'orbrzv_toric_Prftot',orbrzv_toric_Prftot)
  call cdf_write(icdf,'orbrzv_toric_ufrnm',orbrzv_toric_ufrnm)
 
end subroutine nbo_out_power_balance_wr
 
subroutine nbo_out_momentum_balance_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_momentum_balance_wr: icdf=0.'
  call cdf_write(icdf,'bph0was',bph0was)
  call cdf_write(icdf,'bphcks',bphcks)
  call cdf_write(icdf,'bphcols',bphcols)
  call cdf_write(icdf,'bphcons',bphcons)
  call cdf_write(icdf,'bphcxls',bphcxls)
  call cdf_write(icdf,'bphinjs',bphinjs)
  call cdf_write(icdf,'bphdepsgc',bphdepsgc)
  call cdf_write(icdf,'bphdeps',bphdeps)
  call cdf_write(icdf,'bphshins',bphshins)
  call cdf_write(icdf,'bphdpba',bphdpba)
  call cdf_write(icdf,'bphdfbs',bphdfbs)
  call cdf_write(icdf,'bpherr',bpherr)
  call cdf_write(icdf,'bpherrs',bpherrs)
  call cdf_write(icdf,'bphfshs',bphfshs)
  call cdf_write(icdf,'bphjxbs',bphjxbs)
  call cdf_write(icdf,'bphjxbs_ntr',bphjxbs_ntr)
  call cdf_write(icdf,'bphjxbs_dep',bphjxbs_dep)
  call cdf_write(icdf,'bphohbs',bphohbs)
  call cdf_write(icdf,'bpholds',bpholds)
  call cdf_write(icdf,'bphorbs',bphorbs)
  call cdf_write(icdf,'bphorbs_dep',bphorbs_dep)
  call cdf_write(icdf,'bphrcas',bphrcas)
  call cdf_write(icdf,'bphrpls',bphrpls)
  call cdf_write(icdf,'bphsts',bphsts)
  call cdf_write(icdf,'bphths',bphths)
 
end subroutine nbo_out_momentum_balance_wr
 
subroutine nbo_out_torque_work_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_torque_work_wr: icdf=0.'
  call cdf_write(icdf,'bptcols',bptcols)
  call cdf_write(icdf,'bptdfbs',bptdfbs)
  call cdf_write(icdf,'bpthros',bpthros)
  call cdf_write(icdf,'bpthsfs',bpthsfs)
  call cdf_write(icdf,'bpjxbs',bpjxbs)
  call cdf_write(icdf,'bpjxbs_ntr',bpjxbs_ntr)
  call cdf_write(icdf,'bpjxbs_dep',bpjxbs_dep)
  call cdf_write(icdf,'bpthafs',bpthafs)
 
end subroutine nbo_out_torque_work_wr
 
subroutine nbo_out_particle_balance_wr(icdf)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
 
  if(icdf.eq.0) write(nonlin,*) &
       'nbo_out_particle_balance_wr: icdf=0.'
  call cdf_write(icdf,'bxflws',bxflws)
  call cdf_write(icdf,'bxflws_dep',bxflws_dep)
  call cdf_write(icdf,'bxflws_prompt',bxflws_prompt)
  call cdf_write(icdf,'bxfshs',bxfshs)
  call cdf_write(icdf,'bxrpls',bxrpls)
  call cdf_write(icdf,'sbcxxs',sbcxxs)
  call cdf_write(icdf,'sfcx0mc',sfcx0mc)
  call cdf_write(icdf,'sfcxbal',sfcxbal)
  call cdf_write(icdf,'sfcxesc',sfcxesc)
  call cdf_write(icdf,'sfcxrmc',sfcxrmc)
  call cdf_write(icdf,'sfcxrr',sfcxrr)
  call cdf_write(icdf,'sfdbbcx',sfdbbcx)
  call cdf_write(icdf,'sfdbbiz',sfdbbiz)
  call cdf_write(icdf,'sfdepba',sfdepba)
  call cdf_write(icdf,'sfdepcx',sfdepcx)
  call cdf_write(icdf,'sfdepiz',sfdepiz)
  call cdf_write(icdf,'sfdepmc',sfdepmc)
  call cdf_write(icdf,'sfdeprr',sfdeprr)
  call cdf_write(icdf,'sfdepsc',sfdepsc)
  call cdf_write(icdf,'sfdtbmc',sfdtbmc)
  call cdf_write(icdf,'sforbal',sforbal)
  call cdf_write(icdf,'sforbrr',sforbrr)
  call cdf_write(icdf,'sfrbbcx',sfrbbcx)
  call cdf_write(icdf,'sfrbbiz',sfrbbiz)
  call cdf_write(icdf,'sfshine',sfshine)
  call cdf_write(icdf,'sfxrccx',sfxrccx)
  call cdf_write(icdf,'sfxrciz',sfxrciz)
  call cdf_write(icdf,'sfxrcsc',sfxrcsc)
  call cdf_write(icdf,'snbcxos',snbcxos)
  call cdf_write(icdf,'snbcxs',snbcxs)
  call cdf_write(icdf,'snbxbb0',snbxbb0)
  call cdf_write(icdf,'snbxbb1',snbxbb1)
  call cdf_write(icdf,'snbxtot',snbxtot)
  call cdf_write(icdf,'snbxv0',snbxv0)
  call cdf_write(icdf,'snbxw0',snbxw0)
  call cdf_write(icdf,'xysbcxs',xysbcxs)
  call cdf_write(icdf,'xninjs',xninjs)
  call cdf_write(icdf,'xninjea',xninjea)
  call cdf_write(icdf,'sftota',sftota)
 
end subroutine nbo_out_particle_balance_wr
 
subroutine nbo_out_fusion_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bbntot',bbntot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bbnta',bbnta,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'btneut',btneut,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'rbneut',rbneut,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'btnta',btnta,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sftot',sftot,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_fusion_rd
 
subroutine nbo_out_density_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_density_rd
 
subroutine nbo_out_deposition_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'SDEP_OAUC',SDEP_OAUC,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'einjav',einjav,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'frac_cur_ndep0',frac_cur_ndep0,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'ndep0_use',ndep0_use,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nbs_step',nbs_step,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'n_outtim',n_outtim,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_deposition_rd
 
subroutine nbo_out_nclass_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bpshna',bpshna,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'ein_ien',ein_ien,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'dei_ien',dei_ien,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_nclass_rd
 
subroutine nbo_out_n0_fast_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_n0_fast_rd
 
subroutine nbo_out_trap_fraction_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'tbtrap',tbtrap,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'tbtrap0',tbtrap0,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_trap_fraction_rd
 
subroutine nbo_out_erngfi_output_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_erngfi_output_rd
 
subroutine nbo_out_average_energies_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_average_energies_rd
 
subroutine nbo_out_excited_states_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_excited_states_rd
 
subroutine nbo_out_mc_statistics_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'nmctot',nmctot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'wnmctot',wnmctot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'naeptot',naeptot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nstep_aep',nstep_aep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nmcloss',nmcloss,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nnew',nnew,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'xncx0_orb',xncx0_orb,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_mc_statistics_rd
 
subroutine nbo_out_rotation_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_rotation_rd
 
subroutine nbo_out_compression_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_compression_rd
 
subroutine nbo_out_powers_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_powers_rd
 
subroutine nbo_out_currents_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_currents_rd
 
subroutine nbo_out_neutral_sources_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_neutral_sources_rd
 
subroutine nbo_out_recapture_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_recapture_rd
 
subroutine nbo_out_neutral_sinks_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_neutral_sinks_rd
 
subroutine nbo_out_sources_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_sources_rd
 
subroutine nbo_out_fokker_planck_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_fokker_planck_rd
 
subroutine nbo_out_radial_current_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_radial_current_rd
 
subroutine nbo_out_torques_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_torques_rd
 
subroutine nbo_out_frantic_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'nbi_outflx',nbi_outflx,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nbi_eescav',nbi_eescav,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'nbi_cexflx',nbi_cexflx,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_frantic_rd
 
subroutine nbo_out_hi_z_beams_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
 
end subroutine nbo_out_hi_z_beams_rd
 
subroutine nbo_out_cptimes_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'CPBPS',CPBPS,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBSTART',CPBSTART,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBDEP',CPBDEP,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBORB',CPBORB,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBFIN',CPBFIN,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBMAX',CPBMAX,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBMIN',CPBMIN,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'CPBROOT',CPBROOT,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_cptimes_rd
 
subroutine nbo_out_power_balance_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bpcxers',bpcxers,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxi0s',bpcxi0s,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxins',bpcxins,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxots',bpcxots,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxris',bpcxris,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxrxs',bpcxrxs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpcxx0s',bpcxx0s,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bperr',bperr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bperrs',bperrs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpfshs',bpfshs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpls',bpls,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpls_dep',bpls_dep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpohs',bpohs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bprpls',bprpls,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpshins',bpshins,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpsts',bpsts,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpths',bpths,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'pftota',pftota,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpprma',bpprma,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'pinjs',pinjs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'pinjs_res',pinjs_res,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'pbdepmc',pbdepmc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'PBDEPBA',PBDEPBA,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpephis',bpephis,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'orbrzv_Prftot',orbrzv_Prftot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'orbrzv_toric_Prftot',orbrzv_toric_Prftot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'orbrzv_toric_ufrnm',orbrzv_toric_ufrnm,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_power_balance_rd
 
subroutine nbo_out_momentum_balance_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bph0was',bph0was,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphcks',bphcks,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphcols',bphcols,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphcons',bphcons,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphcxls',bphcxls,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphinjs',bphinjs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphdepsgc',bphdepsgc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphdeps',bphdeps,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphshins',bphshins,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphdpba',bphdpba,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphdfbs',bphdfbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpherr',bpherr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpherrs',bpherrs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphfshs',bphfshs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphjxbs',bphjxbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphjxbs_ntr',bphjxbs_ntr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphjxbs_dep',bphjxbs_dep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphohbs',bphohbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpholds',bpholds,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphorbs',bphorbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphorbs_dep',bphorbs_dep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphrcas',bphrcas,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphrpls',bphrpls,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphsts',bphsts,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bphths',bphths,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_momentum_balance_rd
 
subroutine nbo_out_torque_work_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bptcols',bptcols,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bptdfbs',bptdfbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpthros',bpthros,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpthsfs',bpthsfs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpjxbs',bpjxbs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpjxbs_ntr',bpjxbs_ntr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpjxbs_dep',bpjxbs_dep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bpthafs',bpthafs,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_torque_work_rd
 
subroutine nbo_out_particle_balance_rd(icdf,ierr)
 
  use nbi_com
  use ezcdf
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr=0
 
  call cdf_read(icdf,'bxflws',bxflws,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bxflws_dep',bxflws_dep,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bxflws_prompt',bxflws_prompt,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bxfshs',bxfshs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'bxrpls',bxrpls,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sbcxxs',sbcxxs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfcx0mc',sfcx0mc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfcxbal',sfcxbal,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfcxesc',sfcxesc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfcxrmc',sfcxrmc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfcxrr',sfcxrr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdbbcx',sfdbbcx,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdbbiz',sfdbbiz,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdepba',sfdepba,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdepcx',sfdepcx,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdepiz',sfdepiz,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdepmc',sfdepmc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdeprr',sfdeprr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdepsc',sfdepsc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfdtbmc',sfdtbmc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sforbal',sforbal,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sforbrr',sforbrr,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfrbbcx',sfrbbcx,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfrbbiz',sfrbbiz,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfshine',sfshine,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfxrccx',sfxrccx,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfxrciz',sfxrciz,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sfxrcsc',sfxrcsc,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbcxos',snbcxos,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbcxs',snbcxs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbxbb0',snbxbb0,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbxbb1',snbxbb1,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbxtot',snbxtot,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbxv0',snbxv0,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'snbxw0',snbxw0,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'xysbcxs',xysbcxs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'xninjs',xninjs,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'xninjea',xninjea,ierr)
  if(ierr.ne.0) return
  call cdf_read(icdf,'sftota',sftota,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_particle_balance_rd
 
subroutine nbo_out_fusion_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bbntot',bbntot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bbnta',bbnta,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'btneut',btneut,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'rbneut',rbneut,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'btnta',btnta,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sftot',sftot,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_fusion_avg
 
subroutine nbo_out_density_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_density_avg
 
subroutine nbo_out_deposition_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'SDEP_OAUC',SDEP_OAUC,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'einjav',einjav,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'frac_cur_ndep0',frac_cur_ndep0,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'ndep0_use',ndep0_use,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nbs_step',nbs_step,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'n_outtim',n_outtim,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_deposition_avg
 
subroutine nbo_out_nclass_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bpshna',bpshna,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'ein_ien',ein_ien,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'dei_ien',dei_ien,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_nclass_avg
 
subroutine nbo_out_n0_fast_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_n0_fast_avg
 
subroutine nbo_out_trap_fraction_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'tbtrap',tbtrap,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'tbtrap0',tbtrap0,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_trap_fraction_avg
 
subroutine nbo_out_erngfi_output_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_erngfi_output_avg
 
subroutine nbo_out_average_energies_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_average_energies_avg
 
subroutine nbo_out_excited_states_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_excited_states_avg
 
subroutine nbo_out_mc_statistics_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'nmctot',nmctot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'wnmctot',wnmctot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'naeptot',naeptot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nstep_aep',nstep_aep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nmcloss',nmcloss,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nnew',nnew,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'xncx0_orb',xncx0_orb,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_mc_statistics_avg
 
subroutine nbo_out_rotation_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_rotation_avg
 
subroutine nbo_out_compression_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_compression_avg
 
subroutine nbo_out_powers_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_powers_avg
 
subroutine nbo_out_currents_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_currents_avg
 
subroutine nbo_out_neutral_sources_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_neutral_sources_avg
 
subroutine nbo_out_recapture_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_recapture_avg
 
subroutine nbo_out_neutral_sinks_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_neutral_sinks_avg
 
subroutine nbo_out_sources_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_sources_avg
 
subroutine nbo_out_fokker_planck_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_fokker_planck_avg
 
subroutine nbo_out_radial_current_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_radial_current_avg
 
subroutine nbo_out_torques_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_torques_avg
 
subroutine nbo_out_frantic_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'nbi_outflx',nbi_outflx,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nbi_eescav',nbi_eescav,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'nbi_cexflx',nbi_cexflx,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_frantic_avg
 
subroutine nbo_out_hi_z_beams_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
 
end subroutine nbo_out_hi_z_beams_avg
 
subroutine nbo_out_cptimes_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'CPBPS',CPBPS,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBSTART',CPBSTART,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBDEP',CPBDEP,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBORB',CPBORB,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBFIN',CPBFIN,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBMAX',CPBMAX,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBMIN',CPBMIN,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'CPBROOT',CPBROOT,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_cptimes_avg
 
subroutine nbo_out_power_balance_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bpcxers',bpcxers,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxi0s',bpcxi0s,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxins',bpcxins,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxots',bpcxots,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxris',bpcxris,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxrxs',bpcxrxs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpcxx0s',bpcxx0s,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bperr',bperr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bperrs',bperrs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpfshs',bpfshs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpls',bpls,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpls_dep',bpls_dep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpohs',bpohs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bprpls',bprpls,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpshins',bpshins,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpsts',bpsts,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpths',bpths,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'pftota',pftota,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpprma',bpprma,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'pinjs',pinjs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'pinjs_res',pinjs_res,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'pbdepmc',pbdepmc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'PBDEPBA',PBDEPBA,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpephis',bpephis,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'orbrzv_Prftot',orbrzv_Prftot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'orbrzv_toric_Prftot',orbrzv_toric_Prftot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'orbrzv_toric_ufrnm',orbrzv_toric_ufrnm,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_power_balance_avg
 
subroutine nbo_out_momentum_balance_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bph0was',bph0was,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphcks',bphcks,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphcols',bphcols,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphcons',bphcons,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphcxls',bphcxls,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphinjs',bphinjs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphdepsgc',bphdepsgc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphdeps',bphdeps,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphshins',bphshins,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphdpba',bphdpba,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphdfbs',bphdfbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpherr',bpherr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpherrs',bpherrs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphfshs',bphfshs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphjxbs',bphjxbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphjxbs_ntr',bphjxbs_ntr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphjxbs_dep',bphjxbs_dep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphohbs',bphohbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpholds',bpholds,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphorbs',bphorbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphorbs_dep',bphorbs_dep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphrcas',bphrcas,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphrpls',bphrpls,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphsts',bphsts,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bphths',bphths,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_momentum_balance_avg
 
subroutine nbo_out_torque_work_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bptcols',bptcols,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bptdfbs',bptdfbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpthros',bpthros,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpthsfs',bpthsfs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpjxbs',bpjxbs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpjxbs_ntr',bpjxbs_ntr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpjxbs_dep',bpjxbs_dep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bpthafs',bpthafs,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_torque_work_avg
 
subroutine nbo_out_particle_balance_avg(icdf,zwght,ierr)
 
  use nbi_com
  use nbi_out_avg ! helper routines
  implicit NONE
  integer, intent(in) :: icdf  ! NetCDF file id
  real(fp), intent(in) :: zwght  ! time avg weight
  integer, intent(out) :: ierr ! Completion code, 0=OK
 
  ierr = 0
 
  call nbi_out_avg_sub(icdf,'bxflws',bxflws,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bxflws_dep',bxflws_dep,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bxflws_prompt',bxflws_prompt,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bxfshs',bxfshs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'bxrpls',bxrpls,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sbcxxs',sbcxxs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfcx0mc',sfcx0mc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfcxbal',sfcxbal,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfcxesc',sfcxesc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfcxrmc',sfcxrmc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfcxrr',sfcxrr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdbbcx',sfdbbcx,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdbbiz',sfdbbiz,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdepba',sfdepba,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdepcx',sfdepcx,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdepiz',sfdepiz,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdepmc',sfdepmc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdeprr',sfdeprr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdepsc',sfdepsc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfdtbmc',sfdtbmc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sforbal',sforbal,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sforbrr',sforbrr,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfrbbcx',sfrbbcx,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfrbbiz',sfrbbiz,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfshine',sfshine,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfxrccx',sfxrccx,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfxrciz',sfxrciz,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sfxrcsc',sfxrcsc,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbcxos',snbcxos,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbcxs',snbcxs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbxbb0',snbxbb0,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbxbb1',snbxbb1,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbxtot',snbxtot,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbxv0',snbxv0,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'snbxw0',snbxw0,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'xysbcxs',xysbcxs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'xninjs',xninjs,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'xninjea',xninjea,zwght,ierr)
  if(ierr.ne.0) return
  call nbi_out_avg_sub(icdf,'sftota',sftota,zwght,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_out_particle_balance_avg
 
subroutine nbo_names_write(ilun)
 
  use nbi_com
  use nbo_ascii_mod
  implicit NONE
 
  integer, intent(in) :: ilun  ! I/O unit number
  logical  :: ilio  ! I/O FRANTIC block
 
  ! block: fusion
 
  call nbo_wr_aname(ilun,'io_bbntns',io_bbntns_name)
  call nbo_wr_aname(ilun,'io_bbntnt',io_bbntnt_name)
  call nbo_wr_aname(ilun,'io_btntns',io_btntns_name)
  call nbo_wr_aname(ilun,'io_btntrs',io_btntrs_name)
  call nbo_wr_aname(ilun,'io_btntws',io_btntws_name)
  call nbo_wr_aname(ilun,'io_btntnt',io_btntnt_name)
  call nbo_wr_aname(ilun,'io_rbntnt',io_rbntnt_name)
 
  ! block: density
 
  call nbo_wr_aname(ilun,'io_bdenss',io_bdenss_name)
  call nbo_wr_aname(ilun,'io_mc_dens',io_mc_dens_name)
  call nbo_wr_aname(ilun,'io_bdenssw',io_bdenssw_name)
  call nbo_wr_aname(ilun,'io_udenspl',io_udenspl_name)
  call nbo_wr_aname(ilun,'io_udenspp',io_udenspp_name)
  call nbo_wr_aname(ilun,'io_udensplw',io_udensplw_name)
  call nbo_wr_aname(ilun,'io_udensppw',io_udensppw_name)
 
  ! block: deposition
 
  call nbo_wr_aname(ilun,'io_bdepb',io_bdepb_name)
  call nbo_wr_aname(ilun,'io_bdepb_nb',io_bdepb_nb_name)
  call nbo_wr_aname(ilun,'io_bdepe',io_bdepe_name)
  call nbo_wr_aname(ilun,'io_bdeps',io_bdeps_name)
  call nbo_wr_aname(ilun,'io_sdep_oa',io_sdep_oa_name)
  call nbo_wr_aname(ilun,'io_mc_newdens',io_mc_newdens_name)
  call nbo_wr_aname(ilun,'io_sbbidpe',io_sbbidpe_name)
  call nbo_wr_aname(ilun,'io_sbbidps',io_sbbidps_name)
  call nbo_wr_aname(ilun,'io_sbbxdpe',io_sbbxdpe_name)
  call nbo_wr_aname(ilun,'io_sbbxdps',io_sbbxdps_name)
  call nbo_wr_aname(ilun,'io_sbcxdpe',io_sbcxdpe_name)
  call nbo_wr_aname(ilun,'io_sbcxdps',io_sbcxdps_name)
  call nbo_wr_aname(ilun,'io_sbedepe',io_sbedepe_name)
  call nbo_wr_aname(ilun,'io_sbedeps',io_sbedeps_name)
  call nbo_wr_aname(ilun,'io_sbiedepe',io_sbiedepe_name)
  call nbo_wr_aname(ilun,'io_sbiedeps',io_sbiedeps_name)
  call nbo_wr_aname(ilun,'io_sbildepe',io_sbildepe_name)
  call nbo_wr_aname(ilun,'io_sbildeps',io_sbildeps_name)
  call nbo_wr_aname(ilun,'io_sbizdepe',io_sbizdepe_name)
  call nbo_wr_aname(ilun,'io_sbizdeps',io_sbizdeps_name)
 
  ! block: nclass
 
  call nbo_wr_aname(ilun,'io_bnb_ien',io_bnb_ien_name)
  call nbo_wr_aname(ilun,'io_bdens_nb',io_bdens_nb_name)
  call nbo_wr_aname(ilun,'io_pbe_ien',io_pbe_ien_name)
  call nbo_wr_aname(ilun,'io_pbi_ien',io_pbi_ien_name)
  call nbo_wr_aname(ilun,'io_upb_ien',io_upb_ien_name)
  call nbo_wr_aname(ilun,'io_bnbs_ien',io_bnbs_ien_name)
  call nbo_wr_aname(ilun,'io_pbes_ien',io_pbes_ien_name)
  call nbo_wr_aname(ilun,'io_pbis_ien',io_pbis_ien_name)
  call nbo_wr_aname(ilun,'io_upbs_ien',io_upbs_ien_name)
 
  ! block: n0_fast
 
  call nbo_wr_aname(ilun,'io_bn00t',io_bn00t_name)
  call nbo_wr_aname(ilun,'io_bn00ts',io_bn00ts_name)
  call nbo_wr_aname(ilun,'io_bn00',io_bn00_name)
  call nbo_wr_aname(ilun,'io_bn0tot',io_bn0tot_name)
  call nbo_wr_aname(ilun,'io_bn0cx',io_bn0cx_name)
 
  ! block: trap_fraction
 
  call nbo_wr_aname(ilun,'io_btrap',io_btrap_name)
  call nbo_wr_aname(ilun,'io_btrap0',io_btrap0_name)
 
  ! block: erngfi_output
 
  call nbo_wr_aname(ilun,'io_btrape',io_btrape_name)
  call nbo_wr_aname(ilun,'io_densfi',io_densfi_name)
 
  ! block: average_energies
 
  call nbo_wr_aname(ilun,'io_ebapl2s',io_ebapl2s_name)
  call nbo_wr_aname(ilun,'io_ebapp2s',io_ebapp2s_name)
  call nbo_wr_aname(ilun,'io_ebapl2sw',io_ebapl2sw_name)
  call nbo_wr_aname(ilun,'io_ebapp2sw',io_ebapp2sw_name)
  call nbo_wr_aname(ilun,'io_ebavps',io_ebavps_name)
 
  ! block: excited_states
 
  call nbo_wr_aname(ilun,'io_excit0',io_excit0_name)
  call nbo_wr_aname(ilun,'io_excitr',io_excitr_name)
 
  ! block: mc_statistics
 
  call nbo_wr_aname(ilun,'io_nmc',io_nmc_name)
  call nbo_wr_aname(ilun,'io_wnmc',io_wnmc_name)
 
  ! block: rotation
 
  call nbo_wr_aname(ilun,'io_omegabs',io_omegabs_name)
  call nbo_wr_aname(ilun,'io_omegabsw',io_omegabsw_name)
 
  ! block: compression
 
  call nbo_wr_aname(ilun,'io_pbcprs',io_pbcprs_name)
  call nbo_wr_aname(ilun,'io_pbcprss',io_pbcprss_name)
 
  ! block: powers
 
  call nbo_wr_aname(ilun,'io_pbdfbes',io_pbdfbes_name)
  call nbo_wr_aname(ilun,'io_pbdfbis',io_pbdfbis_name)
  call nbo_wr_aname(ilun,'io_pbe',io_pbe_name)
  call nbo_wr_aname(ilun,'io_pbes',io_pbes_name)
  call nbo_wr_aname(ilun,'io_pbi',io_pbi_name)
  call nbo_wr_aname(ilun,'io_pbis',io_pbis_name)
  call nbo_wr_aname(ilun,'io_pbohs',io_pbohs_name)
  call nbo_wr_aname(ilun,'io_pbephis',io_pbephis_name)
  call nbo_wr_aname(ilun,'io_pbephis_ntr',io_pbephis_ntr_name)
  call nbo_wr_aname(ilun,'io_pbephis_dep',io_pbephis_dep_name)
  call nbo_wr_aname(ilun,'io_pbth',io_pbth_name)
  call nbo_wr_aname(ilun,'io_pbths',io_pbths_name)
  call nbo_wr_aname(ilun,'io_pbe_nb',io_pbe_nb_name)
  call nbo_wr_aname(ilun,'io_pbi_nb',io_pbi_nb_name)
  call nbo_wr_aname(ilun,'io_pbth_nb',io_pbth_nb_name)
  call nbo_wr_aname(ilun,'io_pbtot_nb',io_pbtot_nb_name)
  call nbo_wr_aname(ilun,'io_pbthr2s',io_pbthr2s_name)
  call nbo_wr_aname(ilun,'io_pfe',io_pfe_name)
  call nbo_wr_aname(ilun,'io_pfi',io_pfi_name)
  call nbo_wr_aname(ilun,'io_orbrzv_Prf',io_orbrzv_Prf_name)
  call nbo_wr_aname(ilun,'io_orbrzv_toric_Prf',io_orbrzv_toric_Prf_name)
 
  ! block: currents
 
  call nbo_wr_aname(ilun,'io_curjbeam',io_curjbeam_name)
  call nbo_wr_aname(ilun,'io_curjfusi',io_curjfusi_name)
  call nbo_wr_aname(ilun,'io_curjs',io_curjs_name)
  call nbo_wr_aname(ilun,'io_ucurjs',io_ucurjs_name)
  call nbo_wr_aname(ilun,'io_ucurjco',io_ucurjco_name)
  call nbo_wr_aname(ilun,'io_ucurjctr',io_ucurjctr_name)
  call nbo_wr_aname(ilun,'io_ucurjnb',io_ucurjnb_name)
  call nbo_wr_aname(ilun,'io_curjnb',io_curjnb_name)
  call nbo_wr_aname(ilun,'io_xjbfac',io_xjbfac_name)
  call nbo_wr_aname(ilun,'io_xjbfacs',io_xjbfacs_name)
 
  ! block: neutral_sources
 
  call nbo_wr_aname(ilun,'io_sbcx0s',io_sbcx0s_name)
  call nbo_wr_aname(ilun,'io_sorbn0',io_sorbn0_name)
  call nbo_wr_aname(ilun,'io_sorbn0s',io_sorbn0s_name)
  call nbo_wr_aname(ilun,'io_sorbn0s_dep',io_sorbn0s_dep_name)
  call nbo_wr_aname(ilun,'io_sn0s3dh',io_sn0s3dh_name)
 
  ! block: recapture
 
  call nbo_wr_aname(ilun,'io_sbcxrbs',io_sbcxrbs_name)
  call nbo_wr_aname(ilun,'io_sbcxres',io_sbcxres_name)
  call nbo_wr_aname(ilun,'io_sbcxris',io_sbcxris_name)
  call nbo_wr_aname(ilun,'io_sbcxrls',io_sbcxrls_name)
  call nbo_wr_aname(ilun,'io_sbcxrxs',io_sbcxrxs_name)
  call nbo_wr_aname(ilun,'io_sbcxrzs',io_sbcxrzs_name)
 
  ! block: neutral_sinks
 
  call nbo_wr_aname(ilun,'io_sinb0i',io_sinb0i_name)
  call nbo_wr_aname(ilun,'io_sinb0is',io_sinb0is_name)
  call nbo_wr_aname(ilun,'io_sinbn0',io_sinbn0_name)
  call nbo_wr_aname(ilun,'io_sinbn0s',io_sinbn0s_name)
 
  ! block: sources
 
  call nbo_wr_aname(ilun,'io_sorbe',io_sorbe_name)
  call nbo_wr_aname(ilun,'io_sorbes',io_sorbes_name)
  call nbo_wr_aname(ilun,'io_sorbes_ntr',io_sorbes_ntr_name)
  call nbo_wr_aname(ilun,'io_sorbes_dep',io_sorbes_dep_name)
  call nbo_wr_aname(ilun,'io_sorbh',io_sorbh_name)
  call nbo_wr_aname(ilun,'io_sorbhs',io_sorbhs_name)
  call nbo_wr_aname(ilun,'io_sorbhs_ntr',io_sorbhs_ntr_name)
  call nbo_wr_aname(ilun,'io_sorbhs_dep',io_sorbhs_dep_name)
  call nbo_wr_aname(ilun,'io_sorbth',io_sorbth_name)
  call nbo_wr_aname(ilun,'io_sorbths',io_sorbths_name)
 
  ! block: fokker_planck
 
  call nbo_wr_aname(ilun,'io_taubpa0',io_taubpa0_name)
  call nbo_wr_aname(ilun,'io_taubpaco1',io_taubpaco1_name)
  call nbo_wr_aname(ilun,'io_taubpaco2',io_taubpaco2_name)
  call nbo_wr_aname(ilun,'io_taubpaco3',io_taubpaco3_name)
  call nbo_wr_aname(ilun,'io_taubpactr1',io_taubpactr1_name)
  call nbo_wr_aname(ilun,'io_taubpactr2',io_taubpactr2_name)
  call nbo_wr_aname(ilun,'io_taubpactr3',io_taubpactr3_name)
  call nbo_wr_aname(ilun,'io_taubsl0',io_taubsl0_name)
  call nbo_wr_aname(ilun,'io_taubslco1',io_taubslco1_name)
  call nbo_wr_aname(ilun,'io_taubslco2',io_taubslco2_name)
  call nbo_wr_aname(ilun,'io_taubslco3',io_taubslco3_name)
  call nbo_wr_aname(ilun,'io_taubslctr1',io_taubslctr1_name)
  call nbo_wr_aname(ilun,'io_taubslctr2',io_taubslctr2_name)
  call nbo_wr_aname(ilun,'io_taubslctr3',io_taubslctr3_name)
  call nbo_wr_aname(ilun,'io_paxfrc',io_paxfrc_name)
  call nbo_wr_aname(ilun,'io_pbxfrc',io_pbxfrc_name)
 
  ! block: radial_current
 
  call nbo_wr_aname(ilun,'io_tirabd',io_tirabd_name)
  call nbo_wr_aname(ilun,'io_tirabds',io_tirabds_name)
  call nbo_wr_aname(ilun,'io_tirfsh',io_tirfsh_name)
  call nbo_wr_aname(ilun,'io_tirfshs',io_tirfshs_name)
  call nbo_wr_aname(ilun,'io_tirorb',io_tirorb_name)
  call nbo_wr_aname(ilun,'io_tirorbs',io_tirorbs_name)
  call nbo_wr_aname(ilun,'io_tirrip',io_tirrip_name)
  call nbo_wr_aname(ilun,'io_tirrips',io_tirrips_name)
  call nbo_wr_aname(ilun,'io_difbx',io_difbx_name)
  call nbo_wr_aname(ilun,'io_velbx',io_velbx_name)
 
  ! block: torques
 
  call nbo_wr_aname(ilun,'io_tqbsum',io_tqbsum_name)
  call nbo_wr_aname(ilun,'io_tqbcx',io_tqbcx_name)
  call nbo_wr_aname(ilun,'io_tqbcxs',io_tqbcxs_name)
  call nbo_wr_aname(ilun,'io_tqbcxs_dep',io_tqbcxs_dep_name)
  call nbo_wr_aname(ilun,'io_tqbe',io_tqbe_name)
  call nbo_wr_aname(ilun,'io_tqbes',io_tqbes_name)
  call nbo_wr_aname(ilun,'io_tqbi',io_tqbi_name)
  call nbo_wr_aname(ilun,'io_tqbis',io_tqbis_name)
  call nbo_wr_aname(ilun,'io_tqbco_nb',io_tqbco_nb_name)
  call nbo_wr_aname(ilun,'io_tqbth_nb',io_tqbth_nb_name)
  call nbo_wr_aname(ilun,'io_tqtot_nb',io_tqtot_nb_name)
  call nbo_wr_aname(ilun,'io_tqbth',io_tqbth_name)
  call nbo_wr_aname(ilun,'io_tqbths',io_tqbths_name)
  call nbo_wr_aname(ilun,'io_tqbxf',io_tqbxf_name)
  call nbo_wr_aname(ilun,'io_tqbxfs',io_tqbxfs_name)
  call nbo_wr_aname(ilun,'io_tqdifb',io_tqdifb_name)
  call nbo_wr_aname(ilun,'io_tqdifbs',io_tqdifbs_name)
  call nbo_wr_aname(ilun,'io_tqjxb',io_tqjxb_name)
  call nbo_wr_aname(ilun,'io_tqjxbs',io_tqjxbs_name)
  call nbo_wr_aname(ilun,'io_tqjxbs_ntr',io_tqjxbs_ntr_name)
  call nbo_wr_aname(ilun,'io_tqjxb_nb',io_tqjxb_nb_name)
  call nbo_wr_aname(ilun,'io_tqjxbnb_ntr',io_tqjxbnb_ntr_name)
  call nbo_wr_aname(ilun,'io_tqjxbs_dep',io_tqjxbs_dep_name)
  call nbo_wr_aname(ilun,'io_tqjxb_nb_dep',io_tqjxb_nb_dep_name)
  call nbo_wr_aname(ilun,'io_tqohb',io_tqohb_name)
  call nbo_wr_aname(ilun,'io_tqohbs',io_tqohbs_name)
  call nbo_wr_aname(ilun,'io_tqrpl',io_tqrpl_name)
  call nbo_wr_aname(ilun,'io_tqrpls',io_tqrpls_name)
 
  ! block: frantic
 
  ilio = (LEVMOD_HALO.eq.1) 
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_den0mn',io_nbi_den0mn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_en0mn',io_nbi_en0mn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_omg0mn',io_nbi_omg0mn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_snimn',io_nbi_snimn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_snemn',io_nbi_snemn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_scxmn',io_nbi_scxmn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pcxmn',io_nbi_pcxmn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pnimn',io_nbi_pnimn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_tqcxmn',io_nbi_tqcxmn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_tqnimn',io_nbi_tqnimn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pfcxmn',io_nbi_pfcxmn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pfnimn',io_nbi_pfnimn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_sflx0m',io_nbi_sflx0m_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pflx0m',io_nbi_pflx0m_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_tqflx0',io_nbi_tqflx0_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pb0mn',io_nbi_pb0mn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_pscmn',io_nbi_pscmn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_tqb0mn',io_nbi_tqb0mn_name)
  if(ilio) call nbo_wr_aname(ilun,'io_nbi_tqscmn',io_nbi_tqscmn_name)
 
  ! block: hi_z_beams
 
  call nbo_wr_aname(ilun,'io_xzbmav',io_xzbmav_name)
 
  ! block: cptimes
 
 
  ! block: power_balance
 
  call nbo_wr_aname(ilun,'io_PBAEPMS',io_PBAEPMS_name)
 
  ! block: momentum_balance
 
 
  ! block: torque_work
 
 
  ! block: particle_balance
 
  call nbo_wr_aname(ilun,'io_sfcxmc1d',io_sfcxmc1d_name)
  call nbo_wr_aname(ilun,'io_snbx1d',io_snbx1d_name)
 
end subroutine nbo_names_write
subroutine nbo_names_read(ilun,ierr)
 
  use nbi_com
  use nbo_ascii_mod
  implicit NONE
 
  integer, intent(in) :: ilun  ! I/O unit number
  logical  :: ilio  ! I/O FRANTIC block
  integer, intent(out) :: ierr ! status code, 0=OK
 
  ! block: fusion
 
  call nbo_rd_aname(ilun,'io_bbntns',io_bbntns_name,io_bbntns,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bbntnt',io_bbntnt_name,io_bbntnt,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_btntns',io_btntns_name,io_btntns,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_btntrs',io_btntrs_name,io_btntrs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_btntws',io_btntws_name,io_btntws,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_btntnt',io_btntnt_name,io_btntnt,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_rbntnt',io_rbntnt_name,io_rbntnt,ierr)
  if(ierr.ne.0) return
 
  ! block: density
 
  call nbo_rd_aname(ilun,'io_bdenss',io_bdenss_name,io_bdenss,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_mc_dens',io_mc_dens_name,io_mc_dens,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bdenssw',io_bdenssw_name,io_bdenssw,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_udenspl',io_udenspl_name,io_udenspl,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_udenspp',io_udenspp_name,io_udenspp,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_udensplw',io_udensplw_name,io_udensplw,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_udensppw',io_udensppw_name,io_udensppw,ierr)
  if(ierr.ne.0) return
 
  ! block: deposition
 
  call nbo_rd_aname(ilun,'io_bdepb',io_bdepb_name,io_bdepb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bdepb_nb',io_bdepb_nb_name,io_bdepb_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bdepe',io_bdepe_name,io_bdepe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bdeps',io_bdeps_name,io_bdeps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sdep_oa',io_sdep_oa_name,io_sdep_oa,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_mc_newdens',io_mc_newdens_name,io_mc_newdens,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbbidpe',io_sbbidpe_name,io_sbbidpe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbbidps',io_sbbidps_name,io_sbbidps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbbxdpe',io_sbbxdpe_name,io_sbbxdpe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbbxdps',io_sbbxdps_name,io_sbbxdps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxdpe',io_sbcxdpe_name,io_sbcxdpe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxdps',io_sbcxdps_name,io_sbcxdps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbedepe',io_sbedepe_name,io_sbedepe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbedeps',io_sbedeps_name,io_sbedeps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbiedepe',io_sbiedepe_name,io_sbiedepe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbiedeps',io_sbiedeps_name,io_sbiedeps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbildepe',io_sbildepe_name,io_sbildepe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbildeps',io_sbildeps_name,io_sbildeps,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbizdepe',io_sbizdepe_name,io_sbizdepe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbizdeps',io_sbizdeps_name,io_sbizdeps,ierr)
  if(ierr.ne.0) return
 
  ! block: nclass
 
  call nbo_rd_aname(ilun,'io_bnb_ien',io_bnb_ien_name,io_bnb_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bdens_nb',io_bdens_nb_name,io_bdens_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbe_ien',io_pbe_ien_name,io_pbe_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbi_ien',io_pbi_ien_name,io_pbi_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_upb_ien',io_upb_ien_name,io_upb_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bnbs_ien',io_bnbs_ien_name,io_bnbs_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbes_ien',io_pbes_ien_name,io_pbes_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbis_ien',io_pbis_ien_name,io_pbis_ien,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_upbs_ien',io_upbs_ien_name,io_upbs_ien,ierr)
  if(ierr.ne.0) return
 
  ! block: n0_fast
 
  call nbo_rd_aname(ilun,'io_bn00t',io_bn00t_name,io_bn00t,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bn00ts',io_bn00ts_name,io_bn00ts,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bn00',io_bn00_name,io_bn00,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bn0tot',io_bn0tot_name,io_bn0tot,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_bn0cx',io_bn0cx_name,io_bn0cx,ierr)
  if(ierr.ne.0) return
 
  ! block: trap_fraction
 
  call nbo_rd_aname(ilun,'io_btrap',io_btrap_name,io_btrap,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_btrap0',io_btrap0_name,io_btrap0,ierr)
  if(ierr.ne.0) return
 
  ! block: erngfi_output
 
  call nbo_rd_aname(ilun,'io_btrape',io_btrape_name,io_btrape,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_densfi',io_densfi_name,io_densfi,ierr)
  if(ierr.ne.0) return
 
  ! block: average_energies
 
  call nbo_rd_aname(ilun,'io_ebapl2s',io_ebapl2s_name,io_ebapl2s,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ebapp2s',io_ebapp2s_name,io_ebapp2s,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ebapl2sw',io_ebapl2sw_name,io_ebapl2sw,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ebapp2sw',io_ebapp2sw_name,io_ebapp2sw,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ebavps',io_ebavps_name,io_ebavps,ierr)
  if(ierr.ne.0) return
 
  ! block: excited_states
 
  call nbo_rd_aname(ilun,'io_excit0',io_excit0_name,io_excit0,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_excitr',io_excitr_name,io_excitr,ierr)
  if(ierr.ne.0) return
 
  ! block: mc_statistics
 
  call nbo_rd_aname(ilun,'io_nmc',io_nmc_name,io_nmc,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_wnmc',io_wnmc_name,io_wnmc,ierr)
  if(ierr.ne.0) return
 
  ! block: rotation
 
  call nbo_rd_aname(ilun,'io_omegabs',io_omegabs_name,io_omegabs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_omegabsw',io_omegabsw_name,io_omegabsw,ierr)
  if(ierr.ne.0) return
 
  ! block: compression
 
  call nbo_rd_aname(ilun,'io_pbcprs',io_pbcprs_name,io_pbcprs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbcprss',io_pbcprss_name,io_pbcprss,ierr)
  if(ierr.ne.0) return
 
  ! block: powers
 
  call nbo_rd_aname(ilun,'io_pbdfbes',io_pbdfbes_name,io_pbdfbes,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbdfbis',io_pbdfbis_name,io_pbdfbis,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbe',io_pbe_name,io_pbe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbes',io_pbes_name,io_pbes,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbi',io_pbi_name,io_pbi,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbis',io_pbis_name,io_pbis,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbohs',io_pbohs_name,io_pbohs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbephis',io_pbephis_name,io_pbephis,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbephis_ntr',io_pbephis_ntr_name,io_pbephis_ntr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbephis_dep',io_pbephis_dep_name,io_pbephis_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbth',io_pbth_name,io_pbth,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbths',io_pbths_name,io_pbths,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbe_nb',io_pbe_nb_name,io_pbe_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbi_nb',io_pbi_nb_name,io_pbi_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbth_nb',io_pbth_nb_name,io_pbth_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbtot_nb',io_pbtot_nb_name,io_pbtot_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbthr2s',io_pbthr2s_name,io_pbthr2s,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pfe',io_pfe_name,io_pfe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pfi',io_pfi_name,io_pfi,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_orbrzv_Prf',io_orbrzv_Prf_name,io_orbrzv_Prf,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_orbrzv_toric_Prf',io_orbrzv_toric_Prf_name,io_orbrzv_toric_Prf,ierr)
  if(ierr.ne.0) return
 
  ! block: currents
 
  call nbo_rd_aname(ilun,'io_curjbeam',io_curjbeam_name,io_curjbeam,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_curjfusi',io_curjfusi_name,io_curjfusi,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_curjs',io_curjs_name,io_curjs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ucurjs',io_ucurjs_name,io_ucurjs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ucurjco',io_ucurjco_name,io_ucurjco,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ucurjctr',io_ucurjctr_name,io_ucurjctr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_ucurjnb',io_ucurjnb_name,io_ucurjnb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_curjnb',io_curjnb_name,io_curjnb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_xjbfac',io_xjbfac_name,io_xjbfac,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_xjbfacs',io_xjbfacs_name,io_xjbfacs,ierr)
  if(ierr.ne.0) return
 
  ! block: neutral_sources
 
  call nbo_rd_aname(ilun,'io_sbcx0s',io_sbcx0s_name,io_sbcx0s,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbn0',io_sorbn0_name,io_sorbn0,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbn0s',io_sorbn0s_name,io_sorbn0s,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbn0s_dep',io_sorbn0s_dep_name,io_sorbn0s_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sn0s3dh',io_sn0s3dh_name,io_sn0s3dh,ierr)
  if(ierr.ne.0) return
 
  ! block: recapture
 
  call nbo_rd_aname(ilun,'io_sbcxrbs',io_sbcxrbs_name,io_sbcxrbs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxres',io_sbcxres_name,io_sbcxres,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxris',io_sbcxris_name,io_sbcxris,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxrls',io_sbcxrls_name,io_sbcxrls,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxrxs',io_sbcxrxs_name,io_sbcxrxs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sbcxrzs',io_sbcxrzs_name,io_sbcxrzs,ierr)
  if(ierr.ne.0) return
 
  ! block: neutral_sinks
 
  call nbo_rd_aname(ilun,'io_sinb0i',io_sinb0i_name,io_sinb0i,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sinb0is',io_sinb0is_name,io_sinb0is,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sinbn0',io_sinbn0_name,io_sinbn0,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sinbn0s',io_sinbn0s_name,io_sinbn0s,ierr)
  if(ierr.ne.0) return
 
  ! block: sources
 
  call nbo_rd_aname(ilun,'io_sorbe',io_sorbe_name,io_sorbe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbes',io_sorbes_name,io_sorbes,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbes_ntr',io_sorbes_ntr_name,io_sorbes_ntr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbes_dep',io_sorbes_dep_name,io_sorbes_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbh',io_sorbh_name,io_sorbh,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbhs',io_sorbhs_name,io_sorbhs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbhs_ntr',io_sorbhs_ntr_name,io_sorbhs_ntr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbhs_dep',io_sorbhs_dep_name,io_sorbhs_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbth',io_sorbth_name,io_sorbth,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_sorbths',io_sorbths_name,io_sorbths,ierr)
  if(ierr.ne.0) return
 
  ! block: fokker_planck
 
  call nbo_rd_aname(ilun,'io_taubpa0',io_taubpa0_name,io_taubpa0,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpaco1',io_taubpaco1_name,io_taubpaco1,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpaco2',io_taubpaco2_name,io_taubpaco2,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpaco3',io_taubpaco3_name,io_taubpaco3,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpactr1',io_taubpactr1_name,io_taubpactr1,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpactr2',io_taubpactr2_name,io_taubpactr2,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubpactr3',io_taubpactr3_name,io_taubpactr3,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubsl0',io_taubsl0_name,io_taubsl0,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslco1',io_taubslco1_name,io_taubslco1,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslco2',io_taubslco2_name,io_taubslco2,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslco3',io_taubslco3_name,io_taubslco3,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslctr1',io_taubslctr1_name,io_taubslctr1,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslctr2',io_taubslctr2_name,io_taubslctr2,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_taubslctr3',io_taubslctr3_name,io_taubslctr3,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_paxfrc',io_paxfrc_name,io_paxfrc,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_pbxfrc',io_pbxfrc_name,io_pbxfrc,ierr)
  if(ierr.ne.0) return
 
  ! block: radial_current
 
  call nbo_rd_aname(ilun,'io_tirabd',io_tirabd_name,io_tirabd,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirabds',io_tirabds_name,io_tirabds,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirfsh',io_tirfsh_name,io_tirfsh,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirfshs',io_tirfshs_name,io_tirfshs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirorb',io_tirorb_name,io_tirorb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirorbs',io_tirorbs_name,io_tirorbs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirrip',io_tirrip_name,io_tirrip,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tirrips',io_tirrips_name,io_tirrips,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_difbx',io_difbx_name,io_difbx,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_velbx',io_velbx_name,io_velbx,ierr)
  if(ierr.ne.0) return
 
  ! block: torques
 
  call nbo_rd_aname(ilun,'io_tqbsum',io_tqbsum_name,io_tqbsum,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbcx',io_tqbcx_name,io_tqbcx,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbcxs',io_tqbcxs_name,io_tqbcxs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbcxs_dep',io_tqbcxs_dep_name,io_tqbcxs_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbe',io_tqbe_name,io_tqbe,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbes',io_tqbes_name,io_tqbes,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbi',io_tqbi_name,io_tqbi,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbis',io_tqbis_name,io_tqbis,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbco_nb',io_tqbco_nb_name,io_tqbco_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbth_nb',io_tqbth_nb_name,io_tqbth_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqtot_nb',io_tqtot_nb_name,io_tqtot_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbth',io_tqbth_name,io_tqbth,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbths',io_tqbths_name,io_tqbths,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbxf',io_tqbxf_name,io_tqbxf,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqbxfs',io_tqbxfs_name,io_tqbxfs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqdifb',io_tqdifb_name,io_tqdifb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqdifbs',io_tqdifbs_name,io_tqdifbs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxb',io_tqjxb_name,io_tqjxb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxbs',io_tqjxbs_name,io_tqjxbs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxbs_ntr',io_tqjxbs_ntr_name,io_tqjxbs_ntr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxb_nb',io_tqjxb_nb_name,io_tqjxb_nb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxbnb_ntr',io_tqjxbnb_ntr_name,io_tqjxbnb_ntr,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxbs_dep',io_tqjxbs_dep_name,io_tqjxbs_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqjxb_nb_dep',io_tqjxb_nb_dep_name,io_tqjxb_nb_dep,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqohb',io_tqohb_name,io_tqohb,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqohbs',io_tqohbs_name,io_tqohbs,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqrpl',io_tqrpl_name,io_tqrpl,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_tqrpls',io_tqrpls_name,io_tqrpls,ierr)
  if(ierr.ne.0) return
 
  ! block: frantic
 
  ilio = (LEVMOD_HALO.eq.1) 
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_den0mn',io_nbi_den0mn_name,io_nbi_den0mn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_en0mn',io_nbi_en0mn_name,io_nbi_en0mn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_omg0mn',io_nbi_omg0mn_name,io_nbi_omg0mn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_snimn',io_nbi_snimn_name,io_nbi_snimn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_snemn',io_nbi_snemn_name,io_nbi_snemn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_scxmn',io_nbi_scxmn_name,io_nbi_scxmn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pcxmn',io_nbi_pcxmn_name,io_nbi_pcxmn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pnimn',io_nbi_pnimn_name,io_nbi_pnimn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_tqcxmn',io_nbi_tqcxmn_name,io_nbi_tqcxmn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_tqnimn',io_nbi_tqnimn_name,io_nbi_tqnimn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pfcxmn',io_nbi_pfcxmn_name,io_nbi_pfcxmn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pfnimn',io_nbi_pfnimn_name,io_nbi_pfnimn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_sflx0m',io_nbi_sflx0m_name,io_nbi_sflx0m,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pflx0m',io_nbi_pflx0m_name,io_nbi_pflx0m,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_tqflx0',io_nbi_tqflx0_name,io_nbi_tqflx0,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pb0mn',io_nbi_pb0mn_name,io_nbi_pb0mn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_pscmn',io_nbi_pscmn_name,io_nbi_pscmn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_tqb0mn',io_nbi_tqb0mn_name,io_nbi_tqb0mn,ierr)
  if(ierr.ne.0) return
  if(ilio) call nbo_rd_aname(ilun,'io_nbi_tqscmn',io_nbi_tqscmn_name,io_nbi_tqscmn,ierr)
  if(ierr.ne.0) return
 
  ! block: hi_z_beams
 
  call nbo_rd_aname(ilun,'io_xzbmav',io_xzbmav_name,io_xzbmav,ierr)
  if(ierr.ne.0) return
 
  ! block: cptimes
 
 
  ! block: power_balance
 
  call nbo_rd_aname(ilun,'io_PBAEPMS',io_PBAEPMS_name,io_PBAEPMS,ierr)
  if(ierr.ne.0) return
 
  ! block: momentum_balance
 
 
  ! block: torque_work
 
 
  ! block: particle_balance
 
  call nbo_rd_aname(ilun,'io_sfcxmc1d',io_sfcxmc1d_name,io_sfcxmc1d,ierr)
  if(ierr.ne.0) return
  call nbo_rd_aname(ilun,'io_snbx1d',io_snbx1d_name,io_snbx1d,ierr)
  if(ierr.ne.0) return
 
end subroutine nbo_names_read
