geometry_vmec_read_netCDF_file Module


            INTERPOLATE QUANTITIES ON THE RADIAL GRID               !


Variables

Type Visibility Attributes Name Initial
logical, private, parameter :: debug = .false.
logical, private :: lasym
integer, private :: nfp
integer, private :: isigng
integer, private :: ns
integer, private :: mnmax
integer, private :: mnmax_nyq
integer, private :: mpol
integer, private :: ntor
real, private :: Aminor
real, private, dimension(:), allocatable :: xm
real, private, dimension(:), allocatable :: xn
real, private, dimension(:), allocatable :: xm_nyq
real, private, dimension(:), allocatable :: xn_nyq
real, private, dimension(:, :), allocatable :: rmnc
real, private, dimension(:, :), allocatable :: rmns
real, private, dimension(:, :), allocatable :: lmnc
real, private, dimension(:, :), allocatable :: lmns
real, private, dimension(:, :), allocatable :: zmnc
real, private, dimension(:, :), allocatable :: zmns
real, private, dimension(:, :), allocatable :: bmnc
real, private, dimension(:, :), allocatable :: bmns
real, private, dimension(:, :), allocatable :: gmnc
real, private, dimension(:, :), allocatable :: gmns
real, private, dimension(:, :), allocatable :: bsupumnc
real, private, dimension(:, :), allocatable :: bsupumns
real, private, dimension(:, :), allocatable :: bsupvmnc
real, private, dimension(:, :), allocatable :: bsupvmns
real, private, dimension(:, :), allocatable :: bsubumnc
real, private, dimension(:, :), allocatable :: bsubumns
real, private, dimension(:, :), allocatable :: bsubvmnc
real, private, dimension(:, :), allocatable :: bsubvmns
real, private, dimension(:, :), allocatable :: bsubsmnc
real, private, dimension(:, :), allocatable :: bsubsmns
real, private, dimension(:), allocatable :: phi
real, private, dimension(:), allocatable :: phip
real, private, dimension(:), allocatable :: iotas
real, private, dimension(:), allocatable :: iotaf
real, private, dimension(:), allocatable :: presf
real, private, dimension(2) :: weight_full
real, private, dimension(2) :: weight_half
integer, private, dimension(2) :: index_full
integer, private, dimension(2) :: index_half

Subroutines

private subroutine read_vmec_equilibrium(vmec_filename, verbose, ierr)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: vmec_filename
logical, intent(in) :: verbose
integer, intent(out) :: ierr

public subroutine calculate_vmec_geometry(vmec_filename, nalpha, alpha0, nzgrid, zeta_center, rectangular_cross_section, number_of_field_periods_inputfile, s_inputfile, vmec_surface_option, verbose, s, safety_factor_q, shat, L_reference, B_reference, nfp_out, sign_toroidal_flux, alpha, zeta, bmag, b_dot_grad_zeta, grad_alpha_grad_alpha, grad_alpha_grad_psit, grad_psit_grad_psit, gds23_psitalpha, gds24_psitalpha, gds25_psitalpha, gds26_psitalpha, gbdrift_alpha, gbdrift0_psit, cvdrift_alpha, cvdrift0_psit, theta, B_sub_zeta, B_sub_theta, psit_displacement_fac, gradzeta_gradpsit_R2overB2, gradzeta_gradalpha_R2overB2, b_dot_grad_zeta_RR, ierr)

Use R(ialpha,izeta) and Z(ialpha,izeta), to compute X = R * cos(zeta) Y = R * sin(zeta)

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: vmec_filename

On exit, = psi_toroidal / psi_{toroidal,edge} holds the flux surface that was actually used for the geometry,

Read more…
integer, intent(in) :: nalpha
real, intent(in) :: alpha0
integer, intent(in) :: nzgrid
real, intent(in) :: zeta_center
logical, intent(in) :: rectangular_cross_section
real, intent(in) :: number_of_field_periods_inputfile
real, intent(in) :: s_inputfile
integer, intent(in) :: vmec_surface_option
logical, intent(in) :: verbose
real, intent(out) :: s
real, intent(out) :: safety_factor_q
real, intent(out) :: shat
real, intent(out) :: L_reference
real, intent(out) :: B_reference
real, intent(out) :: nfp_out
integer, intent(out) :: sign_toroidal_flux
real, intent(out), dimension(:) :: alpha

VMEC variables of interest: ns = number of flux surfaces used by VMEC nfp = number of field periods, e.g. 5 for W7-X, 4 for HSX iotas = rotational transform (1/q) on the half grid. iotaf = rotational transform on the full grid. presf = pressure on the full grid.

Read more…
real, intent(out), dimension(-nzgrid:) :: zeta
real, intent(out), dimension(:, -nzgrid:) :: bmag
real, intent(out), dimension(:, -nzgrid:) :: b_dot_grad_zeta
real, intent(out), dimension(:, -nzgrid:) :: grad_alpha_grad_alpha
real, intent(out), dimension(:, -nzgrid:) :: grad_alpha_grad_psit
real, intent(out), dimension(:, -nzgrid:) :: grad_psit_grad_psit
real, intent(out), dimension(:, -nzgrid:) :: gds23_psitalpha
real, intent(out), dimension(:, -nzgrid:) :: gds24_psitalpha
real, intent(out), dimension(:, -nzgrid:) :: gds25_psitalpha
real, intent(out), dimension(:, -nzgrid:) :: gds26_psitalpha
real, intent(out), dimension(:, -nzgrid:) :: gbdrift_alpha
real, intent(out), dimension(:, -nzgrid:) :: gbdrift0_psit
real, intent(out), dimension(:, -nzgrid:) :: cvdrift_alpha
real, intent(out), dimension(:, -nzgrid:) :: cvdrift0_psit
real, intent(out), dimension(:, -nzgrid:) :: theta
real, intent(out), dimension(:, -nzgrid:) :: B_sub_zeta
real, intent(out), dimension(:, -nzgrid:) :: B_sub_theta
real, intent(out), dimension(:, -nzgrid:) :: psit_displacement_fac
real, intent(out), dimension(:, -nzgrid:) :: gradzeta_gradpsit_R2overB2
real, intent(out), dimension(:, -nzgrid:) :: gradzeta_gradalpha_R2overB2
real, intent(out), dimension(:, -nzgrid:) :: b_dot_grad_zeta_RR
integer, intent(out) :: ierr

private subroutine radial_interpolation(quantity, interpolated_quantity, grid)

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(:) :: quantity
real, intent(out) :: interpolated_quantity
character(len=4), intent(in) :: grid

private subroutine calculate_theta(nzgrid, zeta, nalpha, alpha, iota, theta, ierr)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nzgrid
real, intent(in), dimension(-nzgrid:) :: zeta
integer, intent(in) :: nalpha
real, intent(in), dimension(:) :: alpha
real, intent(in) :: iota
real, intent(out), dimension(:, -nzgrid:) :: theta
integer, intent(inout) :: ierr