module xstraln_calls

  use xstraln_params


  INTERFACE XSTRALN_SETUP

    ! source file: xstraln_setup_r8.f90
     subroutine xstraln_setup_r8(ztol,ierr)

       implicit NONE

       REAL*8, intent(in) :: ztol     ! relative accuracy tolerance for inverse maps
       integer, intent(out) :: ierr     ! completion code, 0=OK

     end subroutine xstraln_setup_r8

  END INTERFACE   ! XSTRALN_SETUP

  INTERFACE XSTRALN_DLGRID

     ! source file: xstraln_dlgrid_r8.f90
     subroutine xstraln_dlgrid_r8(zdlmin,zdlmax)

       implicit NONE

       REAL*8, intent(out) :: zdlmin  ! min (R,Z) grid spacing (m)
       REAL*8, intent(out) :: zdlmax  ! max (R,Z) grid spacing (m)

     end subroutine xstraln_dlgrid_r8

  END INTERFACE   ! XSTRALN_DLGRID

  INTERFACE XS_RZGET

     ! source file: xs_rzget_r8.f90
     subroutine xs_rzget1_r8(zphi,zth,zrho,zscale,zr,zz,iwarn)

       implicit NONE

       REAL*8, intent(in) :: zphi,zth,zrho   ! input coordinates
       REAL*8, intent(in) :: zscale          ! scale factor for output
       REAL*8, intent(out) :: zr,zz          ! (R,Z) output (scaled)
       integer, intent(out) :: iwarn       ! warning set if (zrho) out of range

     end subroutine xs_rzget1_r8
     subroutine xs_rzget_r8(ivec,zphi,zth,zrho,zscale,zr,zz,iwarn)

       implicit NONE

       integer, intent(in) :: ivec         ! vector dimension
       REAL*8, intent(in) :: zphi(ivec),zth(ivec),zrho(ivec) ! input coordinates
       REAL*8, intent(in) :: zscale          ! scale factor for output
       REAL*8, intent(out) :: zr(ivec),zz(ivec) ! (R,Z) output (scaled)
       integer, intent(out) :: iwarn(ivec) ! warning set if (zrho) out of range

     end subroutine xs_rzget_r8

  END INTERFACE   ! XS_RZGET

  INTERFACE XS_FXGET

      ! source file: xs_fxget_r8.f90
     subroutine xs_fxget1_r8(zscalrz,zphi,zri,zzi,zrho,zth,iwarn)

       implicit NONE

       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi,zri,zzi         ! (cyl.) coordinates
       REAL*8, intent(out) :: zrho,zth            ! (mag.) coordinates returned
       integer, intent(out) :: iwarn            ! out-of-range warning flag

     end subroutine xs_fxget1_r8
     subroutine xs_fxget_r8(ivec,zscalrz,zphi,zri,zzi,zrho,zth,iwarn)

       implicit NONE

       integer, intent(in) :: ivec              ! vector dimension
       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi(ivec),zri(ivec),zzi(ivec)    ! (cyl.) coordinates
       REAL*8, intent(out) :: zrho(ivec),zth(ivec)   ! (mag.) coordinates returned
       integer, intent(out) :: iwarn(ivec)      ! out-of-range warning flag

     end subroutine xs_fxget_r8

  END INTERFACE   ! XS_FXGET

  INTERFACE XS_FRZ

     ! source file: xs_frz_r8.f90
     subroutine xs_frz1_r8(id,zscalrz,zphi,zr,zz,zscalf,zf,iwarn)

       implicit NONE

       integer, intent(in) :: id                ! lookup function id
       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi,zr,zz           ! (cyl.) coordinates
       REAL*8, intent(in) :: zscalf               ! factor to scale units of output
       REAL*8, intent(out) :: zf                  ! output item
       integer, intent(out) :: iwarn            ! out-of-range warning flag

     end subroutine xs_frz1_r8
     subroutine xs_frz_r8(id,ivec,zscalrz,zphi,zri,zzi,zscalf,zf,iwarn)

       implicit NONE

       integer, intent(in) :: id                ! lookup function id
       integer, intent(in) :: ivec              ! vector dimension
       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi(ivec),zri(ivec),zzi(ivec)    ! (cyl.) coordinates
       REAL*8, intent(in) :: zscalf               ! factor to scale units of output
       REAL*8, intent(out) :: zf(ivec)            ! output item
       integer, intent(out) :: iwarn(ivec)      ! out-of-range warning flag

     end subroutine xs_frz_r8

  END INTERFACE   ! XS_FRZ

  INTERFACE XS_BRZ

     ! source file: xs_brz_r8.f90
     subroutine xs_brz1_r8(zscalrz,zphi,zr,zz,zscalb,br,bz,bphi,iwarn)

       implicit NONE

       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi,zr,zz           ! (cyl.) coordinates (m)*zscalrz
       REAL*8, intent(in) :: zscalb               ! factor to scale units of output
       REAL*8, intent(out) :: br,bz,bphi          ! output [BR,BZ,Bphi] (T)/zscalb
       integer, intent(out) :: iwarn            ! out-of-range warning flag

     end subroutine xs_brz1_r8
     subroutine xs_brz_r8(ivec,zscalrz,zphi,zri,zzi,zscalb,br,bz,bphi,iwarn)

       implicit NONE

       integer, intent(in) :: ivec              ! vector dimension
       REAL*8, intent(in) :: zscalrz              ! factor to convert (R,Z) -> meters
       REAL*8, intent(in) :: zphi(ivec),zri(ivec),zzi(ivec)    ! (cyl.) coordinates
       REAL*8, intent(in) :: zscalb               ! factor to scale units of output
       REAL*8, intent(out) :: br(ivec),bz(ivec),bphi(ivec) ! output [BR,BZ,Bphi]
       integer, intent(out) :: iwarn(ivec)      ! out-of-range warning flag

     end subroutine xs_brz_r8

  END INTERFACE   ! XS_BRZ

end module xstraln_calls
