! written by nbigen.py
! *** do not edit *** (use nbigen.py instead)
 
subroutine nbi_get_dims(zdims,ierr)
 
  ! retrieve user settable dimensions.
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_dims), intent(out) :: zdims
  integer, intent(out) :: ierr
 
  ierr=0
  if(.not.nbidim_init) then
    write(nonlin,*) '?nbi_get_dims: dimensions not yet set.'
    ierr=1
    return
  endif
 
  zdims%mib = mib
  zdims%mj = mj
  zdims%mig = mig
  zdims%mis = mis
  zdims%mibs = mibs
  zdims%mimpt = mimpt
  zdims%mmini = mmini
  zdims%mtheta = mtheta
  zdims%miefi = miefi
  zdims%med2d = med2d
  zdims%mimxba = mimxba
  zdims%mimxbe = mimxbe
  zdims%mgyro = mgyro
  zdims%mimxba0 = mimxba0
  zdims%mimxbe0 = mimxbe0
  zdims%miboxm = miboxm
  zdims%mitubem = mitubem
  zdims%mituben = mituben
  zdims%mnkaep = mnkaep
 
end subroutine nbi_get_dims
 
subroutine nbi_get_sys(zblock)
 
  ! fetch values for input block: sys
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_sys), intent(out) :: zblock
 
  if(.not.init_sys) then
     write(nonlin,*) 'nbi_get_sys warning: block was never initialized.'
  endif
  zblock%runid = runid
  zblock%mission = mission
  zblock%workpath = workpath
  zblock%nonlin = nonlin
  zblock%nseed = nseed
  zblock%nlbout = nlbout
  zblock%lunnbx = lunnbx
  zblock%lunres = lunres
  zblock%mrstrt = mrstrt
  zblock%nclass = nclass
  zblock%only_io = only_io
  zblock%ref_namelist = ref_namelist
  zblock%quasi_check = quasi_check
  zblock%nltest_output = nltest_output
  zblock%BLK_MPI_BCAST_INT = BLK_MPI_BCAST_INT
  zblock%BLK_MPI_BCAST_R8 = BLK_MPI_BCAST_R8
 
end subroutine nbi_get_sys
 
subroutine nbi_get_times(zblock)
 
  ! fetch values for input block: times
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_times), intent(out) :: zblock
 
  if(.not.init_times) then
     write(nonlin,*) 'nbi_get_times warning: block was never initialized.'
  endif
  zblock%tbm1 = tbm1
  zblock%tbm2 = tbm2
 
end subroutine nbi_get_times
 
subroutine nbi_get_grid(zblock)
 
  ! fetch values for input block: grid
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_grid), intent(out) :: zblock
 
  if(.not.init_grid) then
     write(nonlin,*) 'nbi_get_grid warning: block was never initialized.'
  endif
  zblock%nzones = nzones
  zblock%nzone_fb = nzone_fb
  zblock%nlsym2b = nlsym2b
  zblock%nth0 = nth0
  zblock%xbmbnd = xbmbnd
  zblock%id_mcgrid = id_mcgrid
  zblock%nthets = nthets
  zblock%ebdmax = ebdmax
  zblock%xplasma_in_memory = xplasma_in_memory
  zblock%nznbma = nznbma
  zblock%nznbme = nznbme
  zblock%nznbma0 = nznbma0
  zblock%nznbme0 = nznbme0
  zblock%ngyro = ngyro
 
end subroutine nbi_get_grid
 
subroutine nbi_get_beams(zblock)
 
  ! fetch values for input block: beams
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_beams), intent(out) :: zblock
 
  if(.not.init_beams) then
     write(nonlin,*) 'nbi_get_beams warning: block was never initialized.'
  endif
  zblock%ngmax = ngmax
  zblock%backz = zero
  zblock%backz(1:ngmax) = backz(1:ngmax)
  zblock%aplasm = zero
  zblock%aplasm(1:ngmax) = aplasm(1:ngmax)
  zblock%nbeam = nbeam
  zblock%xzbeama = zero
  zblock%xzbeama(1:nbeam) = xzbeama(1:nbeam)
  zblock%abeama = zero
  zblock%abeama(1:nbeam) = abeama(1:nbeam)
  zblock%nlco = .FALSE.
  zblock%nlco(1:nbeam) = nlco(1:nbeam)
  zblock%ntrace = 0
  zblock%ntrace(1:nbeam) = ntrace(1:nbeam)
  zblock%rtcena = zero
  zblock%rtcena(1:nbeam) = rtcena(1:nbeam)
  zblock%xlbtna = zero
  zblock%xlbtna(1:nbeam) = xlbtna(1:nbeam)
  zblock%xybsca = zero
  zblock%xybsca(1:nbeam) = xybsca(1:nbeam)
  zblock%xbzeta = zero
  zblock%xbzeta(1:nbeam) = xbzeta(1:nbeam)
  zblock%nbshapa = 0
  zblock%nbshapa(1:nbeam) = nbshapa(1:nbeam)
  zblock%bmwidra = zero
  zblock%bmwidra(1:nbeam) = bmwidra(1:nbeam)
  zblock%bmwidza = zero
  zblock%bmwidza(1:nbeam) = bmwidza(1:nbeam)
  zblock%divra = zero
  zblock%divra(1:nbeam) = divra(1:nbeam)
  zblock%divza = zero
  zblock%divza(1:nbeam) = divza(1:nbeam)
  zblock%foclra = zero
  zblock%foclra(1:nbeam) = foclra(1:nbeam)
  zblock%foclza = zero
  zblock%foclza(1:nbeam) = foclza(1:nbeam)
  zblock%nbapsha = 0
  zblock%nbapsha(1:nbeam) = nbapsha(1:nbeam)
  zblock%rapedga = zero
  zblock%rapedga(1:nbeam) = rapedga(1:nbeam)
  zblock%xzpedga = zero
  zblock%xzpedga(1:nbeam) = xzpedga(1:nbeam)
  zblock%xlbapa = zero
  zblock%xlbapa(1:nbeam) = xlbapa(1:nbeam)
  zblock%xybapa = zero
  zblock%xybapa(1:nbeam) = xybapa(1:nbeam)
  zblock%xrapoffa = zero
  zblock%xrapoffa(1:nbeam) = xrapoffa(1:nbeam)
  zblock%xzapoffa = zero
  zblock%xzapoffa(1:nbeam) = xzapoffa(1:nbeam)
  zblock%nbapsh2 = 0
  zblock%nbapsh2(1:nbeam) = nbapsh2(1:nbeam)
  zblock%rapedg2 = zero
  zblock%rapedg2(1:nbeam) = rapedg2(1:nbeam)
  zblock%xzpedg2 = zero
  zblock%xzpedg2(1:nbeam) = xzpedg2(1:nbeam)
  zblock%xlbapa2 = zero
  zblock%xlbapa2(1:nbeam) = xlbapa2(1:nbeam)
  zblock%xrapoff2 = zero
  zblock%xrapoff2(1:nbeam) = xrapoff2(1:nbeam)
  zblock%xzapoff2 = zero
  zblock%xzapoff2(1:nbeam) = xzapoff2(1:nbeam)
 
end subroutine nbi_get_beams
 
subroutine nbi_get_impurity(zblock)
 
  ! fetch values for input block: impurity
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_impurity), intent(out) :: zblock
 
  if(.not.init_impurity) then
     write(nonlin,*) 'nbi_get_impurity warning: block was never initialized.'
  endif
  zblock%nrhix = nrhix
  zblock%xzimpx = zero
  zblock%xzimpx(1:nrhix) = xzimpx(1:nrhix)
  zblock%aimpx = zero
  zblock%aimpx(1:nrhix) = aimpx(1:nrhix)
 
end subroutine nbi_get_impurity
 
subroutine nbi_get_minority(zblock)
 
  ! fetch values for input block: minority
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_minority), intent(out) :: zblock
 
  if(.not.init_minority) then
     write(nonlin,*) 'nbi_get_minority warning: block was never initialized.'
  endif
  zblock%nmini = nmini
  zblock%xzmini = zero
  zblock%xzmini(1:nmini) = xzmini(1:nmini)
  zblock%amini = zero
  zblock%amini(1:nmini) = amini(1:nmini)
  zblock%nthrf = nthrf
 
end subroutine nbi_get_minority
 
subroutine nbi_get_powers(zblock)
 
  ! fetch values for input block: powers
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_powers), intent(out) :: zblock
 
  if(.not.init_powers) then
     write(nonlin,*) 'nbi_get_powers warning: block was never initialized.'
  endif
  zblock%einjmin = zero
  zblock%einjmin(1:nbeam) = einjmin(1:nbeam)
  zblock%einja = zero
  zblock%einja(1:nbeam) = einja(1:nbeam)
  zblock%pinja = zero
  zblock%pinja(1:nbeam) = pinja(1:nbeam)
  zblock%ffulla = zero
  zblock%ffulla(1:nbeam) = ffulla(1:nbeam)
  zblock%fhalfa = zero
  zblock%fhalfa(1:nbeam) = fhalfa(1:nbeam)
  zblock%orbrzv_toric_Prftot0 = zero
  zblock%orbrzv_toric_Prftot0(1:mibs) = orbrzv_toric_Prftot0(1:mibs)
  zblock%orbrzv_toric_frnm = orbrzv_toric_frnm
 
end subroutine nbi_get_powers
 
subroutine nbi_get_fusion(zblock)
 
  ! fetch values for input block: fusion
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_fusion), intent(out) :: zblock
 
  if(.not.init_fusion) then
     write(nonlin,*) 'nbi_get_fusion warning: block was never initialized.'
  endif
  zblock%nlfhe3 = nlfhe3
  zblock%nlfhe4 = nlfhe4
  zblock%nlfst = nlfst
  zblock%nlfsp = nlfsp
  zblock%nlfsp14 = nlfsp14
  zblock%nlusf3 = nlusf3
  zblock%xdatsf3 = xdatsf3
  zblock%nlusfa = nlusfa
  zblock%xdatsfa = xdatsfa
  zblock%nlusft = nlusft
  zblock%xdatsft = xdatsft
  zblock%nlusfp = nlusfp
  zblock%xdatsfp = xdatsfp
  zblock%nlusfp14 = nlusfp14
  zblock%xdatsp3 = xdatsp3
  zblock%plfhe3 = plfhe3
  zblock%plfhe4 = plfhe4
  zblock%plfst = plfst
  zblock%plfsp = plfsp
  zblock%plfsp14 = plfsp14
  zblock%nlfatom = nlfatom
 
end subroutine nbi_get_fusion
 
subroutine nbi_get_fpp(zblock)
 
  ! fetch values for input block: fpp
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_fpp), intent(out) :: zblock
 
  if(.not.init_fpp) then
     write(nonlin,*) 'nbi_get_fpp warning: block was never initialized.'
  endif
  zblock%nlbfpp = nlbfpp
 
end subroutine nbi_get_fpp
 
subroutine nbi_get_num(zblock)
 
  ! fetch values for input block: num
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_num), intent(out) :: zblock
 
  if(.not.init_num) then
     write(nonlin,*) 'nbi_get_num warning: block was never initialized.'
  endif
  zblock%cxsplt = cxsplt
  zblock%dxbsmoo = dxbsmoo
  zblock%dxbsm_nc = dxbsm_nc
  zblock%nptcls = nptcls
  zblock%nptclf = nptclf
  zblock%nptclh = nptclh
  zblock%NFAST_MAP = NFAST_MAP
  zblock%xpand_nptcl = xpand_nptcl
  zblock%frac_depmax = frac_depmax
  zblock%frac_dep_lim = frac_dep_lim
  zblock%frac_depmin = frac_depmin
  zblock%frac_orbrr = frac_orbrr
  zblock%nptcl_max = nptcl_max
  zblock%nltrk_dep0 = nltrk_dep0
  zblock%NLDEP0_GATHER = NLDEP0_GATHER
  zblock%ndep0 = ndep0
  zblock%NDEP0_MAX = NDEP0_MAX
  zblock%ndep_set_beam = ndep_set_beam
  zblock%ndep_set_ien = ndep_set_ien
  zblock%nbbcal = nbbcal
  zblock%ncx0 = ncx0
  zblock%nper_cx = nper_cx
  zblock%LEV_NBIDEP = LEV_NBIDEP
  zblock%LEV_TTNUK = LEV_TTNUK
  zblock%LEVMOD_HALO = LEVMOD_HALO
  zblock%NSPLT = NSPLT
  zblock%NSPLT_GEO = NSPLT_GEO
  zblock%NSPLT_KIN = NSPLT_KIN
  zblock%NSPLT_GEN = NSPLT_GEN
  zblock%nmimp = nmimp
  zblock%AIMP = AIMP
  zblock%XZIMP = XZIMP
  zblock%NTEST_MAX = NTEST_MAX
  zblock%BI_MAX_PL = BI_MAX_PL
  zblock%BI_MAX_PR = BI_MAX_PR
  zblock%wghta = wghta
  zblock%goocon = goocon
  zblock%NGOOCON_VPVBIN = NGOOCON_VPVBIN
  zblock%NGOOCON_EBIN = NGOOCON_EBIN
  zblock%NGOOCON_RBIN = NGOOCON_RBIN
  zblock%cxpcon = cxpcon
  zblock%fppcon = fppcon
  zblock%fdtnxy = fdtnxy
  zblock%nchdvp = nchdvp
  zblock%dtn = dtn
  zblock%dt_acc = dt_acc
  zblock%orbrzv_option = orbrzv_option
  zblock%orbrzv_rf_option = orbrzv_rf_option
  zblock%nlmcrf_on = nlmcrf_on
  zblock%orbrzv_nr = orbrzv_nr
  zblock%orbrzv_nz = orbrzv_nz
  zblock%orbrzv_zzerr_con = orbrzv_zzerr_con
 
end subroutine nbi_get_num
 
subroutine nbi_get_atomic(zblock)
 
  ! fetch values for input block: atomic
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_atomic), intent(out) :: zblock
 
  if(.not.init_atomic) then
     write(nonlin,*) 'nbi_get_atomic warning: block was never initialized.'
  endif
  zblock%nsmax = nsmax
  zblock%khalo = 0
  zblock%khalo(1:mis) = khalo(1:mis)
  zblock%dn0out = dn0out
  zblock%nmsigx = nmsigx
  zblock%nlminsv = nlminsv
  zblock%nlebei = nlebei
  zblock%nsigexc = nsigexc
  zblock%xdepmod = xdepmod
  zblock%nlbbcx = nlbbcx
  zblock%nbbcx_avg = nbbcx_avg
  zblock%nbbcx_bb = nbbcx_bb
  zblock%nbfallgr = nbfallgr
  zblock%nlbeamcx = nlbeamcx
  zblock%nlhvion = nlhvion
 
end subroutine nbi_get_atomic
 
subroutine nbi_get_collid(zblock)
 
  ! fetch values for input block: collid
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_collid), intent(out) :: zblock
 
  if(.not.init_collid) then
     write(nonlin,*) 'nbi_get_collid warning: block was never initialized.'
  endif
  zblock%xcfanbi = xcfanbi
  zblock%xdfanbi = xdfanbi
  zblock%xefanbi = xefanbi
  zblock%xcfafus = xcfafus
  zblock%xdfafus = xdfafus
  zblock%xefafus = xefafus
  zblock%nlbcde = nlbcde
  zblock%nlbcoh = nlbcoh
  zblock%nlbcpa = nlbcpa
  zblock%nlorbo = nlorbo
 
end subroutine nbi_get_collid
 
subroutine nbi_get_flr(zblock)
 
  ! fetch values for input block: flr
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_flr), intent(out) :: zblock
 
  if(.not.init_flr) then
     write(nonlin,*) 'nbi_get_flr warning: block was never initialized.'
  endif
  zblock%nlbflr = nlbflr
  zblock%nlfbmflr = nlfbmflr
  zblock%nlbgflr = nlbgflr
  zblock%gflr_min = gflr_min
  zblock%gflr_rl = gflr_rl
  zblock%gflr_ll = gflr_ll
  zblock%gflr_xv = zero
  zblock%gflr_xv(1:2) = gflr_xv(1:2)
  zblock%gflr_op = zero
  zblock%gflr_op(1:15) = gflr_op(1:15)
 
end subroutine nbi_get_flr
 
subroutine nbi_get_saw(zblock)
 
  ! fetch values for input block: saw
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_saw), intent(out) :: zblock
 
  if(.not.init_saw) then
     write(nonlin,*) 'nbi_get_saw warning: block was never initialized.'
  endif
  zblock%sawflag = sawflag
  zblock%nlsawb = nlsawb
  zblock%nlsawf = nlsawf
  zblock%xswfrac_allfast = xswfrac_allfast
  zblock%xswfrac_beam = xswfrac_beam
  zblock%xswfrac_fusn = xswfrac_fusn
  zblock%nmix_kdsaw = nmix_kdsaw
  zblock%fporcelli = fporcelli
 
end subroutine nbi_get_saw
 
subroutine nbi_get_adif(zblock)
 
  ! fetch values for input block: adif
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_adif), intent(out) :: zblock
 
  if(.not.init_adif) then
     write(nonlin,*) 'nbi_get_adif warning: block was never initialized.'
  endif
  zblock%nkaep = nkaep
  zblock%AEP_ASCALE = zero
  zblock%AEP_ASCALE(1:mnkaep) = AEP_ASCALE(1:mnkaep)
  zblock%AEP_USCALE = AEP_USCALE
  zblock%TAEP_FAC = zero
  zblock%TAEP_FAC(1:mnkaep) = TAEP_FAC(1:mnkaep)
  zblock%nmdifb = nmdifb
  zblock%nkdifb = nkdifb
  zblock%ndifbe = ndifbe
  zblock%fdifbe = zero
  zblock%fdifbe(1:ndifbe) = fdifbe(1:ndifbe)
  zblock%edifbe = zero
  zblock%edifbe(1:ndifbe) = edifbe(1:ndifbe)
  zblock%x_qlim0 = x_qlim0
  zblock%ndifbe_2d = ndifbe_2d
  zblock%dif2d_conv = dif2d_conv
  zblock%dif2d_dpa = dif2d_dpa
  zblock%ngradd_opt = ngradd_opt
 
end subroutine nbi_get_adif
 
subroutine nbi_get_ripple(zblock)
 
  ! fetch values for input block: ripple
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_ripple), intent(out) :: zblock
 
  if(.not.init_ripple) then
     write(nonlin,*) 'nbi_get_ripple warning: block was never initialized.'
  endif
  zblock%nrip = nrip
  zblock%taurip = taurip
  zblock%id_ripple = id_ripple
  zblock%id_ripple2 = id_ripple2
  zblock%ncoils = ncoils
  zblock%ncoils_2 = ncoils_2
  zblock%asrd = asrd
  zblock%bsrd = bsrd
 
end subroutine nbi_get_ripple
 
subroutine nbi_get_outcon(zblock)
 
  ! fetch values for input block: outcon
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_outcon), intent(out) :: zblock
 
  if(.not.init_outcon) then
     write(nonlin,*) 'nbi_get_outcon warning: block was never initialized.'
  endif
  zblock%nerngfi = nerngfi
  zblock%erngfi = zero
  zblock%erngfi(1:nerngfi,1:mibs) = erngfi(1:nerngfi,1:mibs)
  zblock%nsdbgb = nsdbgb
 
end subroutine nbi_get_outcon
 
subroutine nbi_get_fishbone(zblock)
 
  ! fetch values for input block: fishbone
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_fishbone), intent(out) :: zblock
 
  if(.not.init_fishbone) then
     write(nonlin,*) 'nbi_get_fishbone warning: block was never initialized.'
  endif
  zblock%nlfbon = nlfbon
  zblock%fbemin = fbemin
  zblock%fbemax = fbemax
  zblock%fvpvmn = fvpvmn
  zblock%fvpvmx = fvpvmx
  zblock%fbltim = fbltim
  zblock%fshper = fshper
  zblock%fshwid = fshwid
  zblock%tfshon = tfshon
  zblock%tfshof = tfshof
  zblock%xfishmin = xfishmin
  zblock%xfishmax = xfishmax
  zblock%nfbon_vpvopt = nfbon_vpvopt
  zblock%fbtrap_depth = fbtrap_depth
  zblock%nfbon_species = nfbon_species
 
end subroutine nbi_get_fishbone
 
subroutine nbi_get_box(zblock)
 
  ! fetch values for input block: box
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_box), intent(out) :: zblock
 
  if(.not.init_box) then
     write(nonlin,*) 'nbi_get_box warning: block was never initialized.'
  endif
  zblock%nbbox = nbbox
  zblock%nbsbox = 0
  zblock%nbsbox(1:nbbox) = nbsbox(1:nbbox)
  zblock%nsample_box = 0
  zblock%nsample_box(1:nbbox) = nsample_box(1:nbbox)
  zblock%xninja_box = zero
  zblock%xninja_box(1:nbbox) = xninja_box(1:nbbox)
  zblock%xninjs_box = zero
  zblock%xninjs_box(1:nbbox) = xninjs_box(1:nbbox)
  zblock%xninj_box = xninj_box
  zblock%nbebox = 0
  zblock%nbebox(1:nbbox) = nbebox(1:nbbox)
  zblock%nxbox = nxbox
  zblock%nybox = nybox
  zblock%nlbox = nlbox
  zblock%xboxhw = xboxhw
  zblock%yboxhw = yboxhw
  zblock%xlbox1 = xlbox1
  zblock%xlbox2 = xlbox2
  zblock%ndepbox = ndepbox
 
end subroutine nbi_get_box
 
subroutine nbi_get_tube(zblock)
 
  ! fetch values for input block: tube
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_tube), intent(out) :: zblock
 
  if(.not.init_tube) then
     write(nonlin,*) 'nbi_get_tube warning: block was never initialized.'
  endif
  zblock%nbtube = nbtube
  zblock%nbstube = 0
  zblock%nbstube(1:nbtube) = nbstube(1:nbtube)
  zblock%nbetube = 0
  zblock%nbetube(1:nbtube) = nbetube(1:nbtube)
  zblock%Rtube = zero
  zblock%Rtube(1:nbtube) = Rtube(1:nbtube)
  zblock%Ytube = zero
  zblock%Ytube(1:nbtube) = Ytube(1:nbtube)
  zblock%XZETAtube = zero
  zblock%XZETAtube(1:nbtube) = XZETAtube(1:nbtube)
  zblock%PHItube = zero
  zblock%PHItube(1:nbtube) = PHItube(1:nbtube)
  zblock%THETAtube = zero
  zblock%THETAtube(1:nbtube) = THETAtube(1:nbtube)
  zblock%LMIDtube = 0
  zblock%LMIDtube(1:nbtube) = LMIDtube(1:nbtube)
  zblock%XL1tube = zero
  zblock%XL1tube(1:nbtube) = XL1tube(1:nbtube)
  zblock%XL2tube = zero
  zblock%XL2tube(1:nbtube) = XL2tube(1:nbtube)
  zblock%NSEGtube = 0
  zblock%NSEGtube(1:nbtube) = NSEGtube(1:nbtube)
  zblock%RHOtube = RHOtube
  zblock%NDEPtube = NDEPtube
 
end subroutine nbi_get_tube
 
subroutine nbi_get_misc(zblock)
 
  ! fetch values for input block: misc
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_misc), intent(out) :: zblock
 
  if(.not.init_misc) then
     write(nonlin,*) 'nbi_get_misc warning: block was never initialized.'
  endif
  zblock%plhgt = plhgt
  zblock%nlcprb = nlcprb
  zblock%nlpsirz = nlpsirz
  zblock%edbfac = edbfac
  zblock%nmcurb = nmcurb
  zblock%nlfdep = nlfdep
 
end subroutine nbi_get_misc
 
subroutine nbi_get_profiles(zblock)
 
  ! fetch values for input block: profiles
 
  use nbi_com
  use nbi_types
  implicit NONE
 
  type (nbitype_profiles), intent(out) :: zblock
 
  if(.not.init_profiles) then
     write(nonlin,*) 'nbi_get_profiles warning: block was never initialized.'
  endif
  zblock%id_te = id_te
  zblock%id_ti = id_ti
  zblock%id_tifusn = id_tifusn
  zblock%id_ne = id_ne
  zblock%ng = ng
  zblock%id_nh = 0
  zblock%id_nh(1:ngmax) = id_nh(1:ngmax)
  zblock%id_nimp = 0
  zblock%id_nimp(1:nrhix) = id_nimp(1:nrhix)
  zblock%id_nrf = 0
  zblock%id_nrf(1:nmini) = id_nrf(1:nmini)
  zblock%id_eperpmin = 0
  zblock%id_eperpmin(1:nmini) = id_eperpmin(1:nmini)
  zblock%id_epllmin = 0
  zblock%id_epllmin(1:nmini) = id_epllmin(1:nmini)
  zblock%id_nfast = 0
  zblock%id_nfast(1:nsfast) = id_nfast(1:nsfast)
  zblock%id_eperpfast = 0
  zblock%id_eperpfast(1:nsfast) = id_eperpfast(1:nsfast)
  zblock%id_epllfast = 0
  zblock%id_epllfast(1:nsfast) = id_epllfast(1:nsfast)
  zblock%id_aimp = id_aimp
  zblock%id_zimp = id_zimp
  zblock%id_omega = id_omega
  zblock%id_epot = id_epot
  zblock%id_vpoh = id_vpoh
  zblock%id_curt = id_curt
  zblock%id_difb = id_difb
  zblock%id_velb = id_velb
  zblock%id_difb_bi = id_difb_bi
  zblock%id_velb_bi = id_velb_bi
  zblock%id_difb_fi = id_difb_fi
  zblock%id_velb_fi = id_velb_fi
  zblock%id_fd0 = 0
  zblock%id_fd0(1:nsfast) = id_fd0(1:nsfast)
  zblock%id_fdb = 0
  zblock%id_fdb(1:nsfast) = id_fdb(1:nsfast)
  zblock%id_fdp = 0
  zblock%id_fdp(1:nsfast) = id_fdp(1:nsfast)
  zblock%id_fdq = 0
  zblock%id_fdq(1:nsfast) = id_fdq(1:nsfast)
  zblock%id_fdr = 0
  zblock%id_fdr(1:nsfast) = id_fdr(1:nsfast)
  zblock%id_fds = 0
  zblock%id_fds(1:nsfast) = id_fds(1:nsfast)
  zblock%id_n0 = 0
  zblock%id_n0(1:nsmax,1:ngmax) = id_n0(1:nsmax,1:ngmax)
  zblock%id_t0 = 0
  zblock%id_t0(1:nsmax,1:ngmax) = id_t0(1:nsmax,1:ngmax)
  zblock%id_omeg0 = 0
  zblock%id_omeg0(1:nsmax,1:ngmax) = id_omeg0(1:nsmax,1:ngmax)
 
end subroutine nbi_get_profiles
 
