!******************** start file fmodbx.for ; group fmodbi ******************
!-----------------------------------------------------------------------
!  fmodbx
!  return 1/mod(b) as a function of location coords (xi,theta)
!   ** units ** tesla**-1
!
!  (converted from gauss**-1 as final step)
!
!  rga oct00 - removed levgb = 1,2
!
!  levgb.gt.1:  return spline interpolated quantitiy
!               using coeffs from bob mccann's magcf as in
!               the generalized orbit routines (orbg, orbgxy)
!
real(fp) function fmodbx(zxi,zth)
  !
  use iso_c_binding, only: fp => c_double
  use nbi_com
  real(fp) :: zth,zxi
  !
  !  ** evaluate 1/b in genl geometry **
  !   use coding as in orbg.forb
  !
  bixi(1)=zxi
  bithst(1)=zth
  !
  call bintrp
  !
  fmodbx=bi1ovb(1)*1.e4_fp
  !
  return
end function fmodbx
!******************** end file fmodbx.for ; group fmodbi ******************
