boozer_field_t Derived Type

type, public, extends(field_t) :: boozer_field_t

Field in Boozer coordinates, loadable from several file formats.

Call one init_from_* loader, then fix_to_surface before any evaluation. Only one Boozer field can be active at a time (singleton — the splines live in module-global state). Calling a loader a second time aborts.


Inherits

type~~boozer_field_t~~InheritsGraph type~boozer_field_t boozer_field_t type~field_t field_t type~boozer_field_t->type~field_t

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .false.
logical, public :: fixed_to_surface = .false.
real(kind=dp), public :: fixed_stor
real(kind=dp), public :: nfp
real(kind=dp), public :: psi_tor_edge
real(kind=dp), public :: R

Type-Bound Procedures

procedure, public :: init_from_vmec

  • private subroutine init_from_vmec(self, vmec_file, radial_spline_order, angular_spline_order, grid_refinement)

    Load Boozer-coordinate splines from a VMEC wout netCDF file.

    Reasonable defaults: radial_spline_order=5, angular_spline_order=5, grid_refinement=6.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(inout) :: self
    character(len=*), intent(in) :: vmec_file

    path to VMEC .nc file

    integer, intent(in), optional :: radial_spline_order
    integer, intent(in), optional :: angular_spline_order
    integer, intent(in), optional :: grid_refinement

procedure, public :: init_from_boozmn

  • private subroutine init_from_boozmn(self, boozmn_file)

    Load Boozer-coordinate splines from a booz_xform boozmn netCDF file.

    The boozmn file fixes its own grid and spline orders.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(inout) :: self
    character(len=*), intent(in) :: boozmn_file

procedure, public :: init_from_chartmap

  • private subroutine init_from_chartmap(self, chartmap_file)

    Load Boozer-coordinate splines from an extended chartmap netCDF file.

    The chartmap carries its own grid and spline orders.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(inout) :: self
    character(len=*), intent(in) :: chartmap_file

procedure, public :: evaluate

  • private subroutine evaluate(self, x, bmod, sqrtg, bder, hcovar, hctrvr, hcurl)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: x(3)
    real(kind=dp), intent(out) :: bmod
    real(kind=dp), intent(out) :: sqrtg
    real(kind=dp), intent(out) :: bder(3)
    real(kind=dp), intent(out) :: hcovar(3)
    real(kind=dp), intent(out) :: hctrvr(3)
    real(kind=dp), intent(out) :: hcurl(3)

procedure, public :: get_iota

  • private subroutine get_iota(self, stor, iota)

    Return the rotational transform iota at flux surface stor.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: stor

    normalized toroidal flux s, range [0, 1]

    real(kind=dp), intent(out) :: iota

procedure, public :: get_covariant_components

  • private subroutine get_covariant_components(self, B_theta_covariant, B_phi_covariant)

    Return covariant B_theta and B_phi for the surface fixed by fix_to_surface.

    These are flux-surface constants in Boozer coordinates, angle-independent, SI: T*m.

    Requires fix_to_surface to have been called first.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(out) :: B_theta_covariant
    real(kind=dp), intent(out) :: B_phi_covariant

procedure, public :: fix_to_surface

  • private subroutine fix_to_surface(self, stor)

    Fix the field to the flux surface at normalized toroidal flux stor.

    Must be called before any compute_* call or get_covariant_components.

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(inout) :: self
    real(kind=dp), intent(in) :: stor

    normalized toroidal flux s, range [0, 1]

procedure, public :: compute_B_sqrtg_dB_dx

  • private subroutine compute_B_sqrtg_dB_dx(self, theta, phi, B_mod, sqrtg, dB_dx)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: theta
    real(kind=dp), intent(in) :: phi
    real(kind=dp), intent(out) :: B_mod
    real(kind=dp), intent(out) :: sqrtg
    real(kind=dp), intent(out) :: dB_dx(3)

procedure, public :: compute_B_and_dB_dx

  • private subroutine compute_B_and_dB_dx(self, theta, phi, B_mod, dB_dx)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: theta
    real(kind=dp), intent(in) :: phi
    real(kind=dp), intent(out) :: B_mod
    real(kind=dp), intent(out) :: dB_dx(3)

procedure, public :: compute_B_mod

  • private subroutine compute_B_mod(self, theta, phi, B_mod)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: theta
    real(kind=dp), intent(in) :: phi
    real(kind=dp), intent(out) :: B_mod

procedure, public :: compute_nabla_s

  • private subroutine compute_nabla_s(self, theta, phi, nabla_s)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self
    real(kind=dp), intent(in) :: theta
    real(kind=dp), intent(in) :: phi
    real(kind=dp), intent(out) :: nabla_s

procedure, public :: rel_accuracy_B

  • private function rel_accuracy_B(self)

    Arguments

    Type IntentOptional Attributes Name
    class(boozer_field_t), intent(in) :: self

    Return Value real(kind=dp)