V3FIT
Data Types | Functions/Subroutines | Variables
vmec_equilibrium Module Reference

Defines the base class of the type vmec_class. This module contains all the code necessary to interface V3FIT with VMEC. More...

Data Types

interface  runvmec
 Forward declare the interface for runvmec. More...
 
type  vmec_class
 Base class representing a vmec_equilibrium. More...
 
interface  vmec_construct
 Interface for the construction of vmec_class types using vmec_construct_full or vmec_construct_eq. More...
 
interface  vmec_get_gp_ne
 Interface for the vmec guassian process density profile values. More...
 
interface  vmec_get_gp_sxrem
 Interface for the vmec guassian process soft x-ray emissivity profile values. More...
 
interface  vmec_get_gp_te
 Interface for the vmec guassian process electron temperature profile values. More...
 
interface  vmec_get_gp_ti
 Interface for the vmec guassian process ion temperature profile values. More...
 
interface  vmec_get_ne
 Interface for the vmec density profile values. More...
 
interface  vmec_get_p
 Interface for the vmec pressure profile values. More...
 
interface  vmec_get_sxrem
 Interface for the vmec soft x-ray emissivity profile values. More...
 
interface  vmec_get_te
 Interface for the vmec electron temperature profile values. More...
 
interface  vmec_get_ti
 Interface for the vmec ion temperature profile values. More...
 
interface  vmec_get_ze
 Interface for the vmec zeff profile values. More...
 
type  vmec_magnetic_cache
 Object to cache data needed to compute magnetic signals. More...
 
interface  vmec_set_magnetic_cache
 Interface for the setting the vmec_magnetic_cache types using vmec_set_magnetic_cache_responce, vmec_set_magnetic_cache_point or vmec_set_magnetic_cache_calc. More...
 

Functions/Subroutines

type(vmec_class) function, pointer vmec_construct_eq (file_name, wout_file_name, iou, eq_comm, recon_comm, state_flags)
 Construct a vmec_class object. More...
 
type(vmec_class) function, pointer vmec_construct_full (file_name, wout_file_name, ne, te, ti, ze, sxrem, phi_offset, z_offset, pol_rad_ratio, iou, eq_comm, recon_comm, state_flags)
 Construct a vmec_class object. More...
 
subroutine vmec_destruct (this)
 Deconstruct a vmec_class object. More...
 
subroutine vmec_set_param (this, id, i_index, j_index, value, eq_comm, state_flags)
 Sets the value of a reconstruction equilibrium parameter. More...
 
subroutine vmec_set_magnetic_cache_responce (this, response_object)
 Set magnetic cache for plasma resonce. More...
 
subroutine vmec_set_magnetic_cache_point (this, use_axi)
 Set magnetic cache initialy. More...
 
subroutine vmec_set_magnetic_cache_calc (this)
 Set magnetic cache initialy. More...
 
subroutine vmec_set_namelist (this)
 Sets namelist variables from the solved VMEC equilibrium. More...
 
integer function vmec_get_param_id (this, param_name)
 Get the id for a reconstruction parameter. More...
 
real(rprec) function vmec_get_param_value (this, id, i_index, j_index)
 Get the value of a reconstruction VMEC parameter. More...
 
character(len=data_name_length) function vmec_get_param_name (this, id)
 Get the name of a reconstruction VMEC parameter. More...
 
integer function vmec_get_gp_ne_num_hyper_param (this)
 Get the number of electron density gp kernel hyper parameters. More...
 
real(rprec) function, dimension(:), pointer vmec_get_ne_af (this)
 Gets the electron density profile af array. More...
 
real(rprec) function vmec_get_gp_ne_ij (this, i, j)
 Get the electron density gp kernel value for the two indicies. More...
 
real(rprec) function vmec_get_gp_ne_pi (this, x_cart, i)
 Get the electron density gp kernel value for the position and index. More...
 
real(rprec) function vmec_get_gp_ne_pp (this, x_cart, y_cart)
 Get the electron density gp kernel value for the position and position. More...
 
real(rprec) function vmec_get_ne_cart (this, x_cart)
 Gets the electron density at a cartesian position. More...
 
real(rprec) function vmec_get_ne_radial (this, s)
 Gets the electron density at a s position. More...
 
integer function vmec_get_gp_te_num_hyper_param (this)
 Get the number of electron temperature gp kernel hyper parameters. More...
 
real(rprec) function, dimension(:), pointer vmec_get_te_af (this)
 Gets the electron temperature profile af array. More...
 
real(rprec) function vmec_get_gp_te_ij (this, i, j)
 Get the electron temperature gp kernel value for the two indicies. More...
 
real(rprec) function vmec_get_gp_te_pi (this, x_cart, i)
 Get the electron temperature gp kernel value for the position and index. More...
 
real(rprec) function vmec_get_gp_te_pp (this, x_cart, y_cart)
 Get the electron temperature gp kernel value for the position and position. More...
 
real(rprec) function vmec_get_te_cart (this, x_cart)
 Gets the electron temperature at a cartesian position. More...
 
real(rprec) function vmec_get_te_radial (this, s)
 Gets the electron temperature at a s position. More...
 
integer function vmec_get_gp_ti_num_hyper_param (this)
 Get the number of ion temperature gp kernel hyper parameters. More...
 
real(rprec) function, dimension(:), pointer vmec_get_ti_af (this)
 Gets the ion temperature profile af array. More...
 
real(rprec) function vmec_get_gp_ti_ij (this, i, j)
 Get the ion temperature gp kernel value for the two indicies. More...
 
real(rprec) function vmec_get_gp_ti_pi (this, x_cart, i)
 Get the ion temperature gp kernel value for the position and index. More...
 
real(rprec) function vmec_get_gp_ti_pp (this, x_cart, y_cart)
 Get the ion temperature gp kernel value for the position and position. More...
 
real(rprec) function vmec_get_ti_cart (this, x_cart)
 Gets the ion temperature at a cartesian position. More...
 
real(rprec) function vmec_get_ti_radial (this, s)
 Gets the ion temperature at a s position. More...
 
real(rprec) function vmec_get_ze_cart (this, x_cart)
 Gets the effective charge at a cartesian position. More...
 
real(rprec) function vmec_get_ze_radial (this, s)
 Gets the effective charge at a s position. More...
 
integer function vmec_get_gp_sxrem_num_hyper_param (this, index)
 Get the number of soft x-ray emission gp kernel hyper parameters. More...
 
real(rprec) function, dimension(:), pointer vmec_get_sxrem_af (this, index)
 Gets the soft x-ray emissivity profile af array. More...
 
real(rprec) function vmec_get_gp_sxrem_ij (this, i, j, index)
 Get the soft x-ray emissivity gp kernel value for the two indicies. More...
 
real(rprec) function vmec_get_gp_sxrem_pi (this, x_cart, i, index)
 Get the soft x-ray emissivity gp kernel value for the position and index. More...
 
real(rprec) function vmec_get_gp_sxrem_pp (this, x_cart, y_cart, index)
 Get the soft x-ray emissivity gp kernel value for the position and position. More...
 
real(rprec) function vmec_get_sxrem_cart (this, x_cart, index)
 Gets the soft x-ray emissivity at a cartesian position. More...
 
real(rprec) function vmec_get_sxrem_radial (this, s, index)
 Gets the soft x-ray emissivity at a s position. More...
 
real(rprec) function vmec_get_p_cart (this, x_cart)
 Gets the plasma pressure at a cartesian position. More...
 
real(rprec) function vmec_get_p_radial (this, s)
 Gets the plasma pressure at a s position. More...
 
real(rprec) function, dimension(3) vmec_get_b_vec (this, x_cart, cyl)
 Gets the magnetic field vector at a position. More...
 
real(rprec) function vmec_get_int_b_dphi (this, r, theta)
 Gets the loop integrated magnetic field at a position. More...
 
real(rprec) function, dimension(3) vmec_get_suv (this, x_cart)
 Gets VMEC suv position. More...
 
real(rprec) function vmec_get_s (this, x_cart)
 Gets VMEC s value at position. More...
 
real(rprec) function vmec_get_flux (this, x_cart)
 Gets VMEC normalized flux value at position. More...
 
integer function vmec_get_plasma_edge (this, phi, r, z)
 Gets the r and z positions of the outer surface at a toroidal angle. More...
 
real(rprec) function, dimension(:,:,:), pointer vmec_get_magnetic_volume_rgrid (this)
 Get volume magnetic volume integration radial grid points. More...
 
real(rprec) function, dimension(:,:,:), pointer vmec_get_magnetic_volume_zgrid (this)
 Get volume magnetic volume integration z grid points. More...
 
real(rprec) function, dimension(:,:,:), pointer vmec_get_magnetic_volume_jrgrid (this)
 Get volume magnetic volume integration jr grid points. More...
 
real(rprec) function, dimension(:,:,:), pointer vmec_get_magnetic_volume_jphigrid (this)
 Get volume magnetic volume integration jphi grid points. More...
 
real(rprec) function, dimension(:,:,:), pointer vmec_get_magnetic_volume_jzgrid (this)
 Get volume magnetic volume integration jz grid points. More...
 
real(rprec) function vmec_get_volume_int_element (this)
 Get volume integration element. More...
 
real(rprec) function, dimension(:,:), pointer vmec_get_con_surface_krgrid (this)
 Get the conducting surface integration kr grid points. More...
 
real(rprec) function, dimension(:,:), pointer vmec_get_con_surface_kphigrid (this)
 Get the conducting surface integration kphi grid points. More...
 
real(rprec) function, dimension(:,:), pointer vmec_get_con_surface_kzgrid (this)
 Get the conducting surface integration kz grid points. More...
 
real(rprec) function vmec_get_area_int_element (this)
 Get area integration element. More...
 
real(rprec) function, dimension(:), pointer vmec_get_ext_currents (this, num_currents, scale_currents)
 Get external current. More...
 
real(rprec) function, dimension(3) vmec_get_b_vac (this, r_cyl)
 Gets the vacuum magnetic field vector at a position. More...
 
real(rprec) function, dimension(3) vmec_get_ext_b_plasma (this, position, axi_only)
 Get external plasma magnetic field. More...
 
integer function vmec_get_grid_size (this)
 Get radial grid size. More...
 
real(rprec) function vmec_get_grid_start (this)
 Get start of the radial grid. More...
 
real(rprec) function vmec_get_grid_stop (this)
 Get radial grid size. More...
 
logical function vmec_is_scaler_value (this, id)
 Checks if a parameter id is a scaler value. More...
 
logical function vmec_is_1d_array (this, id)
 Checks if a parameter id is a 1d array. More...
 
logical function vmec_is_2d_array (this, id)
 Checks if a parameter id is a 2d array. More...
 
logical function vmec_is_recon_param (this, id)
 Checks if a parameter id is a reconstruction parameter. More...
 
logical function vmec_is_using_point (this)
 Checks if a the point magnetics are being used. More...
 
logical function vmec_converge (this, num_iter, iou, eq_comm)
 Solves the VMEC equilibrium. More...
 
subroutine vmec_read_vac_file (this, index, eq_comm)
 Loads the vacuum magnetic field file. More...
 
subroutine vmec_save_state (this)
 Save the internal state of the equilibrium. More...
 
subroutine vmec_reset_state (this)
 Reset the internal state of the equilibrium. More...
 
subroutine vmec_write (this, iou)
 Write out the equilibrium to an output file. More...
 
subroutine vmec_write_input (this, current_step)
 Write the current valid input. More...
 
subroutine vmec_def_result (this, result_ncid, maxnsetps_dim_id)
 Define NetCDF variables for the result file. More...
 
subroutine vmec_write_init_data (this, result_ncid)
 Write inital data to NetCDF result file. More...
 
subroutine vmec_write_step_data (this, result_ncid, current_step)
 Write step data to NetCDF result file. More...
 
subroutine vmec_restart (this, result_ncid, current_step)
 Restart vmec from the result file. More...
 
subroutine vmec_sync_state (this, recon_comm)
 Syncronize the vmec state to children. More...
 
subroutine vmec_sync_child (this, index, recon_comm)
 Syncronize a child vmec state to the parent. More...
 
subroutine vmec_reset_boundary (this)
 Reset the fixed boundary coefficients. More...
 

Variables

integer, parameter vmec_ac_id = 15
 1D Array of function current profile parameters. Defined in vmec_input.
 
integer, parameter vmec_ac_aux_s_id = 16
 1D Array of segment current profile s poitions. Defined in vmec_input.
 
integer, parameter vmec_ac_aux_f_id = 17
 1D Array of segment current profile f values. Defined in vmec_input.
 
integer, parameter vmec_ai_id = 18
 1D Array of function iotabar profile parameters. Defined in vmec_input.
 
integer, parameter vmec_ai_aux_s_id = 19
 1D Array of segment iotabar profile s poitions. Defined in vmec_input.
 
integer, parameter vmec_ai_aux_f_id = 20
 1D Array of segment iotabar profile f values. Defined in vmec_input.
 
integer, parameter vmec_am_id = 21
 1D Array of function pressure profile parameters. Defined in vmec_input.
 
integer, parameter vmec_am_aux_s_id = 22
 1D Array of segment pressure profile s poitions. Defined in vmec_input.
 
integer, parameter vmec_am_aux_f_id = 23
 1D Array of segment pressure profile f values. Defined in vmec_input.
 
integer, parameter vmec_bloat_id = 24
 Defined in vmec_input.
 
integer, parameter vmec_rbc_id = 25
 2D Array of outer boundary R cosine coeffiecents. Defined in vmec_input.
 
integer, parameter vmec_zbs_id = 26
 2D Array of outer boundary Z sine coeffiecents. Defined in vmec_input.
 
integer, parameter vmec_rbs_id = 27
 2D Array of outer boundary R sine coeffiecents. Defined in vmec_input.
 
integer, parameter vmec_zbc_id = 28
 2D Array of outer boundary Z cosine coeffiecents. Defined in vmec_input.
 
integer, parameter vmec_extcur_id = 29
 1D Array of external currents. Defined in vmec_input.
 
integer, parameter vmec_curtor_id = 30
 The toroidal current. Defined in vmec_input.
 
integer, parameter vmec_phiedge_id = 31
 The edge magnetic flux. Defined in vmec_input.
 
integer, parameter vmec_pres_scale_id = 32
 The scaling parameter for the pressure. Defined in vmec_input.
 
integer, parameter vmec_rmnc_id = 33
 2D Array of surface R cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_zmns_id = 34
 2D Array of surface Z sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_lmns_id = 35
 2D Array of surface lambda cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_gmnc_id = 36
 2D Array of surface g cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubsmns_id = 37
 2D Array of surface B_s sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubumnc_id = 38
 2D Array of surface B_u cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubvmnc_id = 39
 2D Array of surface B_v cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsupumnc_id = 40
 2D Array of surface B^u cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsupvmnc_id = 41
 2D Array of surface B^v cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_rmns_id = 42
 2D Array of surface R sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_zmnc_id = 43
 2D Array of surface Z cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_lmnc_id = 44
 2D Array of surface lambda sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_gmns_id = 45
 2D Array of surface g sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubsmnc_id = 46
 2D Array of surface B_s cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubumns_id = 47
 2D Array of surface B_u sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsubvmns_id = 48
 2D Array of surface B_v sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsupumns_id = 49
 2D Array of surface B^u sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_bsupvmns_id = 50
 2D Array of surface B^v sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_phi_id = 51
 Defined in read_wout_mod.
 
integer, parameter vmec_iotaf_id = 52
 1D Array of full grid iotabar. Defined in read_wout_mod.
 
integer, parameter vmec_iotas_id = 53
 1D Array of half grid iotabar. Defined in read_wout_mod.
 
integer, parameter vmec_raxis_cc_id = 54
 1D Array of magnetic axis R cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_raxis_cs_id = 55
 1D Array of magnetic axis R sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_zaxis_cc_id = 56
 1D Array of magnetic axis Z cosine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_zaxis_cs_id = 57
 1D Array of magnetic axis Z sine coeffiecents. Defined in read_wout_mod.
 
integer, parameter vmec_qfact_id = 58
 1D Array of full grid safety factor. Defined in read_wout_mod.
 
integer, parameter vmec_pp_ne_b_id = 59
 1D Array of function density profile parameters. Defined in pprofile_T.
 
integer, parameter vmec_pp_ne_as_id = 60
 1D Array of segment density profile s poitions. Defined in pprofile_T.
 
integer, parameter vmec_pp_ne_af_id = 61
 1D Array of segment density profile f values. Defined in pprofile_T.
 
integer, parameter vmec_pp_sxrem_b_id = 62
 1D Array of function sxrem profile parameters. Defined in pprofile_T.
 
integer, parameter vmec_pp_sxrem_as_id = 63
 1D Array of segment sxrem profile s poitions. Defined in pprofile_T.
 
integer, parameter vmec_pp_sxrem_af_id = 64
 1D Array of segment sxrem profile f values. Defined in pprofile_T.
 
integer, parameter vmec_pp_te_b_id = 65
 1D Array of function electron temperature profile parameters. Defined in pprofile_T.
 
integer, parameter vmec_pp_te_as_id = 66
 1D Array of segment electron temperature profile s poitions. Defined in pprofile_T.
 
integer, parameter vmec_pp_te_af_id = 67
 1D Array of segment electron temperature profile f values. Defined in pprofile_T.
 
integer, parameter vmec_pp_ti_b_id = 68
 1D Array of function ion temperature profile parameters. Defined in pprofile_T.
 
integer, parameter vmec_pp_ti_as_id = 69
 1D Array of segment ion temperature profile s poitions. Defined in pprofile_T.
 
integer, parameter vmec_pp_ti_af_id = 70
 1D Array of segment ion temperature profile f values. Defined in pprofile_T.
 
integer, parameter vmec_pp_ze_b_id = 71
 1D Array of function zeff profile parameters. Defined in pprofile_T.
 
integer, parameter vmec_pp_ze_as_id = 72
 1D Array of segment zeff profile s poitions. Defined in pprofile_T.
 
integer, parameter vmec_pp_ze_af_id = 73
 1D Array of segment zeff profile f values. Defined in pprofile_T.
 
integer, parameter vmec_vvc_smaleli_id = 74
 Internal inducance. Defined in v3f_vmec_comm. Computed in eqfor.
 
integer, parameter vmec_vvc_kappa_p_id = 75
 Mean elongation. Defined in v3f_vmec_comm. Computed in eqfor.
 
integer, parameter vmec_betatot_id = 76
 Total Beta. Defined in read_wout_mod.
 
integer, parameter vmec_betapol_id = 77
 Poloidal Beta. Defined in read_wout_mod.
 
integer, parameter vmec_betator_id = 78
 Toroidal Beta. Defined in read_wout_mod.
 
integer, parameter vmec_betaxis_id = 79
 Beta on axis. Defined in read_wout_mod.
 
integer, parameter vmec_jcuru_id = 80
 Poloidal current density. Defined in read_wout_mod.
 
integer, parameter vmec_jcurv_id = 81
 Toroidal current density. Defined in read_wout_mod.
 
integer, parameter vmec_jdotb_id = 82
 Current density in direction of b field. Defined in read_wout_mod.
 
integer, parameter vmec_phi_offset_id = 83
 Plasma Phi offset. This is a parameter to allow changing the phi angle of a quasi helical state in an RFP. Defined in vmec_equilibrium.
 
integer, parameter vmec_z_offset_id = 84
 Plasma z offset. This is a parameter to allow changing the vertical shift of the plasma.
 
integer, parameter magnetic_cache_vc_min_grid_points = 101
 Virtual casing grid points for vacuum field measurements.
 
real(rprec), parameter magnetic_cache_vc_grid_dim = 0.01
 Virtual casing grid dimension.
 

Detailed Description

Defines the base class of the type vmec_class. This module contains all the code necessary to interface V3FIT with VMEC.

Super Class:
equilibrium

Function/Subroutine Documentation

◆ vmec_construct_eq()

type (vmec_class) function, pointer vmec_equilibrium::vmec_construct_eq ( character (len=*), intent(in)  file_name,
character (len=*), intent(in)  wout_file_name,
integer, intent(in)  iou,
integer, intent(in)  eq_comm,
integer, intent(in)  recon_comm,
integer, intent(inout)  state_flags 
)

Construct a vmec_class object.

Allocates memory and initializes a vmec_class object. Runs vmec for one iteration to initialize all the input parameters. Defined in vmec_input.

Parameters
[in]file_nameFilename of the vmec namelist input file.
[in]wout_file_nameFilename of the vmec wout input file.
[in]iouInput/output unit to log messages to.
[in]eq_commMPI communicator pool for VMEC.
[in]recon_commMPI communicator pool for reconstruction.
[in,out]state_flagsBitwise flags to indicate which parts of the model changed.
Returns
A pointer to a constructed vmec_class object.

Definition at line 587 of file vmec_equilibrium.f.

◆ vmec_construct_full()

type (vmec_class) function, pointer vmec_equilibrium::vmec_construct_full ( character (len=*), intent(in)  file_name,
character (len=*), intent(in)  wout_file_name,
type (pprofile_class), pointer  ne,
type (pprofile_class), pointer  te,
type (pprofile_class), pointer  ti,
type (pprofile_class), pointer  ze,
type (pprofile_pointer), dimension(:), pointer  sxrem,
real (rprec), intent(in)  phi_offset,
real (rprec), intent(in)  z_offset,
real (rprec), intent(in)  pol_rad_ratio,
integer, intent(in)  iou,
integer, intent(in)  eq_comm,
integer, intent(in)  recon_comm,
integer, intent(inout)  state_flags 
)

Construct a vmec_class object.

Allocates memory and initializes a vmec_class object. Runs vmec for one iteration to initialize all the input parameters. Defined in vmec_input.

Parameters
[in]file_nameFilename of the vmec namelist input file.
[in]wout_file_nameFilename of the vmec wout input file.
[in]nepprofile_T for the electron density.
[in]tepprofile_T for the electron temperature.
[in]tipprofile_T for the ion temperature.
[in]zepprofile_T for Z effective.
[in]sxrempprofile_T for the soft x-ray emissivity.
[in]phi_offsetInitial phi offset of the plasma relative to the diagnostics in radians.
[in]z_offsetInitial Z offset of the plasma relative to the machine center.
[in]pol_rad_ratioRatio of poloidal grid to radial grid. Defines the gird sizes when computing magnetic diagnostics.
[in]iouInput/output unit to log messages to.
[in]eq_commMPI communicator pool for VMEC.
[in]recon_commMPI communicator pool for reconstruction.
[in,out]state_flagsBitwise flags to indicate which parts of the model changed.
Returns
A pointer to a constructed vmec_class object.

Definition at line 789 of file vmec_equilibrium.f.

◆ vmec_converge()

logical function vmec_equilibrium::vmec_converge ( type (vmec_class), intent(inout)  this,
integer, intent(inout)  num_iter,
integer, intent(in)  iou,
integer, intent(in)  eq_comm 
)

Solves the VMEC equilibrium.

This method overrides equilibrium::equilibrium_converge. Solves the vmec equilibrium and loads the resulting wout file in preparation of computing modeled signals.

Parameters
[in,out]thisA vmec_class instance.
[in,out]num_iterCounter to track the number of iterations.
[in]iouInput/Output unit of the runlog file.
[in]eq_commMPI communicator pool for VMEC.
Returns
True if the convergece was sucessful and false otherwise.
Todo:
FIXME: Put in error reporting here. For now leave this blank until I can figure how v3fit decides if vmec has converged.

Definition at line 5202 of file vmec_equilibrium.f.

◆ vmec_def_result()

subroutine vmec_equilibrium::vmec_def_result ( type (vmec_class), intent(in)  this,
integer, intent(in)  result_ncid,
integer, intent(in)  maxnsetps_dim_id 
)

Define NetCDF variables for the result file.

This method overrides equilibrium::equilibrium_def_result. Defines dimensions and variables for the VMEC contribution of the result file. Multi dimensional arrays need to be transposed so arrays appear in the correct order in non fortran languages.

Parameters
[in]thisA vmec_class instance.
[in]result_ncidNetCDF file id of the result file.
[in]maxnsetps_dim_idNetCDF dimension id of the number of steps dimension.

Definition at line 5706 of file vmec_equilibrium.f.

◆ vmec_destruct()

subroutine vmec_equilibrium::vmec_destruct ( type (vmec_class), pointer  this)

Deconstruct a vmec_class object.

Deallocates memory and uninitializes a vmec_class object.

Parameters
[in,out]thisA vmec_class instance.

Definition at line 845 of file vmec_equilibrium.f.

◆ vmec_get_area_int_element()

real (rprec) function vmec_equilibrium::vmec_get_area_int_element ( type (vmec_class), intent(in)  this)

Get area integration element.

This method overrides equilibrium::equilibrium_get_area_int_element. For vmec this is |J||e^s|*du*dv where J is the jacobian. A 1/J term is integrated into kr, kphi and kz. Since due to the resulting |J|/J term, the the sign of the jacobian must be taken into account.

See also
vmec_equilibrium::vmec_set_magnetic_cache_calc equation 3.
  • du = 2*Pi/number of u grid
  • dv = 2*Pi/number of field periods/number of toroidal planes
Parameters
[in]thisA vmec_class instance.
Returns
The area integration element.

Definition at line 4573 of file vmec_equilibrium.f.

◆ vmec_get_b_vac()

real (rprec) function, dimension(3) vmec_equilibrium::vmec_get_b_vac ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  r_cyl 
)

Gets the vacuum magnetic field vector at a position.

This interpolated the mgrid field on to the position. This should not be called if free boundary modes was not used.

Parameters
[in]thisA vmec_class instance.
[in]r_cylCartesian position to get the magnetic field vector at.
Returns
The vaccum magnetic field vector at x_cart.

Definition at line 4662 of file vmec_equilibrium.f.

◆ vmec_get_b_vec()

real (rprec) function, dimension(3) vmec_equilibrium::vmec_get_b_vec ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
logical, intent(in)  cyl 
)

Gets the magnetic field vector at a position.

This method overrides equilibrium::equilibrium_get_B_vec.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the magnetic field vector at.
[in]cylFlag that specifies if the bfield should be returned in cartesian or cylindical coordinates.
Returns
The magnetic field vector at x_cart.

Definition at line 3982 of file vmec_equilibrium.f.

◆ vmec_get_con_surface_kphigrid()

real (rprec) function, dimension(:,:), pointer vmec_equilibrium::vmec_get_con_surface_kphigrid ( type (vmec_class), intent(in)  this)

Get the conducting surface integration kphi grid points.

This method overrides equilibrium::equilibrium_get_con_surface_kphigrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4507 of file vmec_equilibrium.f.

◆ vmec_get_con_surface_krgrid()

real (rprec) function, dimension(:,:), pointer vmec_equilibrium::vmec_get_con_surface_krgrid ( type (vmec_class), intent(in)  this)

Get the conducting surface integration kr grid points.

This method overrides equilibrium::equilibrium_get_con_surface_krgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4477 of file vmec_equilibrium.f.

◆ vmec_get_con_surface_kzgrid()

real (rprec) function, dimension(:,:), pointer vmec_equilibrium::vmec_get_con_surface_kzgrid ( type (vmec_class), intent(in)  this)

Get the conducting surface integration kz grid points.

This method overrides equilibrium::equilibrium_get_con_surface_kzgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4537 of file vmec_equilibrium.f.

◆ vmec_get_ext_b_plasma()

real (rprec) function, dimension(3) vmec_equilibrium::vmec_get_ext_b_plasma ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  position,
logical, intent(in)  axi_only 
)

Get external plasma magnetic field.

This method overrides equilibrium::equilibrium_get_ext_b_plasma. The b field is returned in cyclindical coordinates. This function does not require shifting the plasma relative to the diagnostics. The plasma has already been shifted when computing the surface currents and prime position.

Parameters
[in]thisA vmec_class instance.
[in]positionPosition to compute the fields at in cylindrical coordinates.
[in]axi_onlyGives only the axisymmtric component of the magnetic field.
Returns
The external currents.

Definition at line 4792 of file vmec_equilibrium.f.

◆ vmec_get_ext_currents()

real (rprec) function, dimension(:), pointer vmec_equilibrium::vmec_get_ext_currents ( type (vmec_class), intent(in)  this,
integer, intent(in)  num_currents,
logical, intent(out)  scale_currents 
)

Get external current.

This method overrides equilibrium::equilibrium_get_ext_currents. The array memory containing the external currents is owned by VMEC. Return a pointer to it. if VMEC is run in fixed boundary mode, return a null() pointer.

Parameters
[in]thisA vmec_class instance.
[in]num_currentsForces the number of currents to return if greater than zero.
[out]scale_currentsInforms the caller that currents need to be scaled.
Returns
The external currents.

Definition at line 4611 of file vmec_equilibrium.f.

◆ vmec_get_flux()

real (rprec) function vmec_equilibrium::vmec_get_flux ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets VMEC normalized flux value at position.

Converts from cartesian coordinates to VMEC's flux coordinates.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the s position at.
Returns
The normalized flux position at x_cart.

Definition at line 4183 of file vmec_equilibrium.f.

◆ vmec_get_gp_ne_ij()

real (rprec) function vmec_equilibrium::vmec_get_gp_ne_ij ( type (vmec_class), intent(in)  this,
integer, intent(in)  i,
integer, intent(in)  j 
)

Get the electron density gp kernel value for the two indicies.

This method overrides equilibrium::equilibrium_get_gp_ne_ij. If no density profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]iith profile position.
[in]jjth profile position.
Returns
The value of the gp kernel function for i, j.

Definition at line 2874 of file vmec_equilibrium.f.

◆ vmec_get_gp_ne_num_hyper_param()

integer function vmec_equilibrium::vmec_get_gp_ne_num_hyper_param ( type (vmec_class), intent(in)  this)

Get the number of electron density gp kernel hyper parameters.

This method overrides equilibrium::equilibrium_get_gp_ne_num_hyper_param. If no density profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Number of kernel hyper parameters.

Definition at line 2804 of file vmec_equilibrium.f.

◆ vmec_get_gp_ne_pi()

real (rprec) function vmec_equilibrium::vmec_get_gp_ne_pi ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
integer, intent(in)  i 
)

Get the electron density gp kernel value for the position and index.

This method overrides equilibrium::equilibrium_get_gp_ne_pi. If no density profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the electron density at.
[in]iProfile position index.
Returns
The value of the gp kernel function for x_cart and i.

Definition at line 2911 of file vmec_equilibrium.f.

◆ vmec_get_gp_ne_pp()

real (rprec) function vmec_equilibrium::vmec_get_gp_ne_pp ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
real (rprec), dimension(3), intent(in)  y_cart 
)

Get the electron density gp kernel value for the position and position.

This method overrides equilibrium::equilibrium_get_gp_ne_pp. If no density profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartFirst cartesian position to get the electron density at.
[in]y_cartSecond cartesian position to get the electron density at.
Returns
The value of the gp kernel function for x_cart and y_cart.

Definition at line 2951 of file vmec_equilibrium.f.

◆ vmec_get_gp_sxrem_ij()

real (rprec) function vmec_equilibrium::vmec_get_gp_sxrem_ij ( type (vmec_class), intent(in)  this,
integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  index 
)

Get the soft x-ray emissivity gp kernel value for the two indicies.

This method overrides equilibrium::equilibrium_get_gp_sxrem_ij. If no soft x-ray emissivity profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]iith profile position.
[in]jjth profile position.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
The value of the gp kernel function for i, j.

Definition at line 3706 of file vmec_equilibrium.f.

◆ vmec_get_gp_sxrem_num_hyper_param()

integer function vmec_equilibrium::vmec_get_gp_sxrem_num_hyper_param ( type (vmec_class), intent(in)  this,
integer, intent(in)  index 
)

Get the number of soft x-ray emission gp kernel hyper parameters.

This method overrides equilibrium::equilibrium_get_gp_sxrem_num_hyper_param. If no soft x-ray emission profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
Number of kernel hyper parameters.

Definition at line 3630 of file vmec_equilibrium.f.

◆ vmec_get_gp_sxrem_pi()

real (rprec) function vmec_equilibrium::vmec_get_gp_sxrem_pi ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
integer, intent(in)  i,
integer, intent(in)  index 
)

Get the soft x-ray emissivity gp kernel value for the position and index.

This method overrides equilibrium::equilibrium_get_gp_sxrem_pi. If no soft x-ray emissivity profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the soft x-ray emissivity at.
[in]iProfile position index.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
The value of the gp kernel function for x_cart and i.

Definition at line 3748 of file vmec_equilibrium.f.

◆ vmec_get_gp_sxrem_pp()

real (rprec) function vmec_equilibrium::vmec_get_gp_sxrem_pp ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
real (rprec), dimension(3), intent(in)  y_cart,
integer, intent(in)  index 
)

Get the soft x-ray emissivity gp kernel value for the position and position.

This method overrides equilibrium::equilibrium_get_gp_sxrem_pp. If no soft x-ray emissivity profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartFirst cartesian position to get the soft x-ray emissivity at.
[in]y_cartSecond cartesian position to get the soft x-ray emissivity at.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
The value of the gp kernel function for x_cart and y_cart.

Definition at line 3794 of file vmec_equilibrium.f.

◆ vmec_get_gp_te_ij()

real (rprec) function vmec_equilibrium::vmec_get_gp_te_ij ( type (vmec_class), intent(in)  this,
integer, intent(in)  i,
integer, intent(in)  j 
)

Get the electron temperature gp kernel value for the two indicies.

This method overrides equilibrium::equilibrium_get_gp_te_ij. If no electron temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]iith profile position.
[in]jjth profile position.
Returns
The value of the gp kernel function for i, j.

Definition at line 3127 of file vmec_equilibrium.f.

◆ vmec_get_gp_te_num_hyper_param()

integer function vmec_equilibrium::vmec_get_gp_te_num_hyper_param ( type (vmec_class), intent(in)  this)

Get the number of electron temperature gp kernel hyper parameters.

This method overrides equilibrium::equilibrium_get_gp_te_num_hyper_param. If no electron temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Number of kernel hyper parameters.

Definition at line 3057 of file vmec_equilibrium.f.

◆ vmec_get_gp_te_pi()

real (rprec) function vmec_equilibrium::vmec_get_gp_te_pi ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
integer, intent(in)  i 
)

Get the electron temperature gp kernel value for the position and index.

This method overrides equilibrium::equilibrium_get_gp_te_pi. If no electron temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the electron temperature at.
[in]iProfile position index.
Returns
The value of the gp kernel function for x_cart and i.

Definition at line 3165 of file vmec_equilibrium.f.

◆ vmec_get_gp_te_pp()

real (rprec) function vmec_equilibrium::vmec_get_gp_te_pp ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
real (rprec), dimension(3), intent(in)  y_cart 
)

Get the electron temperature gp kernel value for the position and position.

This method overrides equilibrium::equilibrium_get_gp_te_pp. If no electron temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartFirst cartesian position to get the electron temperature at.
[in]y_cartSecond cartesian position to get the electron temperature at.
Returns
The value of the gp kernel function for x_cart and y_cart.

Definition at line 3207 of file vmec_equilibrium.f.

◆ vmec_get_gp_ti_ij()

real (rprec) function vmec_equilibrium::vmec_get_gp_ti_ij ( type (vmec_class), intent(in)  this,
integer, intent(in)  i,
integer, intent(in)  j 
)

Get the ion temperature gp kernel value for the two indicies.

This method overrides equilibrium::equilibrium_get_gp_ti_ij. If no ion profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]iith profile position.
[in]jjth profile position.
Returns
The value of the gp kernel function for i, j.

Definition at line 3382 of file vmec_equilibrium.f.

◆ vmec_get_gp_ti_num_hyper_param()

integer function vmec_equilibrium::vmec_get_gp_ti_num_hyper_param ( type (vmec_class), intent(in)  this)

Get the number of ion temperature gp kernel hyper parameters.

This method overrides equilibrium::equilibrium_get_gp_ti_num_hyper_param. If no ion temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Number of kernel hyper parameters.

Definition at line 3312 of file vmec_equilibrium.f.

◆ vmec_get_gp_ti_pi()

real (rprec) function vmec_equilibrium::vmec_get_gp_ti_pi ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
integer, intent(in)  i 
)

Get the ion temperature gp kernel value for the position and index.

This method overrides equilibrium::equilibrium_get_gp_ti_pi. If no ion temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the ion temperature at.
[in]iProfile position index.
Returns
The value of the gp kernel function for x_cart and i.

Definition at line 3420 of file vmec_equilibrium.f.

◆ vmec_get_gp_ti_pp()

real (rprec) function vmec_equilibrium::vmec_get_gp_ti_pp ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
real (rprec), dimension(3), intent(in)  y_cart 
)

Get the ion temperature gp kernel value for the position and position.

This method overrides equilibrium::equilibrium_get_gp_ti_pp. If no ion temperature profile was created zero is returned.

Parameters
[in]thisA vmec_class instance.
[in]x_cartFirst cartesian position to get the ion temperature at.
[in]y_cartSecond cartesian position to get the ion temperature at.
Returns
The value of the gp kernel function for x_cart and y_cart.

Definition at line 3460 of file vmec_equilibrium.f.

◆ vmec_get_grid_size()

integer function vmec_equilibrium::vmec_get_grid_size ( type (vmec_class), intent(in)  this)

Get radial grid size.

This method overrides equilibrium::equilibrium_get_grid_size.

Parameters
[in]thisA vmec_class instance.
Returns
Size of the radial grid.

Definition at line 4896 of file vmec_equilibrium.f.

◆ vmec_get_grid_start()

real (rprec) function vmec_equilibrium::vmec_get_grid_start ( type (vmec_class), intent(in)  this)

Get start of the radial grid.

This method overrides equilibrium::equilibrium_get_grid_start.

Parameters
[in]thisA vmec_class instance.
Returns
Start of the radial grid.

Definition at line 4923 of file vmec_equilibrium.f.

◆ vmec_get_grid_stop()

real (rprec) function vmec_equilibrium::vmec_get_grid_stop ( type (vmec_class), intent(in)  this)

Get radial grid size.

This method overrides equilibrium::equilibrium_get_grid_size.

Parameters
[in]thisA vmec_class instance.
Returns
Size of the radial grid.

Definition at line 4949 of file vmec_equilibrium.f.

◆ vmec_get_int_b_dphi()

real (rprec) function vmec_equilibrium::vmec_get_int_b_dphi ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  r,
real (rprec), intent(in)  theta 
)

Gets the loop integrated magnetic field at a position.

This method overrides equilibrium::equilibrium_get_Int_B_dphi. This computes Int[B*dl]

Parameters
[in]thisA vmec_class instance.
[in]rS position to integrate about.
[in]thetaU angle to integrate about.
Returns
The loop integrated magnetic field at x_cart.

Definition at line 4044 of file vmec_equilibrium.f.

◆ vmec_get_magnetic_volume_jphigrid()

real (rprec) function, dimension(:,:,:), pointer vmec_equilibrium::vmec_get_magnetic_volume_jphigrid ( type (vmec_class), intent(in)  this)

Get volume magnetic volume integration jphi grid points.

This method overrides equilibrium::equilibrium_get_magnetic_volume_jphigrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4379 of file vmec_equilibrium.f.

◆ vmec_get_magnetic_volume_jrgrid()

real (rprec) function, dimension(:,:,:), pointer vmec_equilibrium::vmec_get_magnetic_volume_jrgrid ( type (vmec_class), intent(in)  this)

Get volume magnetic volume integration jr grid points.

This method overrides equilibrium::equilibrium_get_magnetic_volume_jrgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4349 of file vmec_equilibrium.f.

◆ vmec_get_magnetic_volume_jzgrid()

real (rprec) function, dimension(:,:,:), pointer vmec_equilibrium::vmec_get_magnetic_volume_jzgrid ( type (vmec_class), intent(in)  this)

Get volume magnetic volume integration jz grid points.

This method overrides equilibrium::equilibrium_get_magnetic_volume_jzgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4409 of file vmec_equilibrium.f.

◆ vmec_get_magnetic_volume_rgrid()

real (rprec) function, dimension(:,:,:), pointer vmec_equilibrium::vmec_get_magnetic_volume_rgrid ( type (vmec_class), intent(in)  this)

Get volume magnetic volume integration radial grid points.

This method overrides equilibrium::equilibrium_get_magnetic_volume_rgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4289 of file vmec_equilibrium.f.

◆ vmec_get_magnetic_volume_zgrid()

real (rprec) function, dimension(:,:,:), pointer vmec_equilibrium::vmec_get_magnetic_volume_zgrid ( type (vmec_class), intent(in)  this)

Get volume magnetic volume integration z grid points.

This method overrides equilibrium::equilibrium_get_magnetic_volume_zgrid.

Parameters
[in]thisA vmec_class instance.
Returns
The radial grid points.

Definition at line 4319 of file vmec_equilibrium.f.

◆ vmec_get_ne_af()

real (rprec) function, dimension(:), pointer vmec_equilibrium::vmec_get_ne_af ( type (vmec_class), intent(in)  this)

Gets the electron density profile af array.

This method overrides equilibrium::equilibrium_get_ne_af. If no density profile was created a null pointer is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Pointer to the electron density profile af array.

Definition at line 2839 of file vmec_equilibrium.f.

◆ vmec_get_ne_cart()

real (rprec) function vmec_equilibrium::vmec_get_ne_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets the electron density at a cartesian position.

This method overrides equilibrium::equilibrium_get_ne. If no density profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the electron density at.
Returns
The electron density at x_cart.

Definition at line 2992 of file vmec_equilibrium.f.

◆ vmec_get_ne_radial()

real (rprec) function vmec_equilibrium::vmec_get_ne_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s 
)

Gets the electron density at a s position.

This method overrides equilibrium::equilibrium_get_ne. If no density profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the electron density at.
Returns
The electron density at s.

Definition at line 3022 of file vmec_equilibrium.f.

◆ vmec_get_p_cart()

real (rprec) function vmec_equilibrium::vmec_get_p_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets the plasma pressure at a cartesian position.

This method overrides equilibrium::equilibrium_get_p.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the plasma pressure at.
Returns
The plasma pressure at x_cart.

Definition at line 3910 of file vmec_equilibrium.f.

◆ vmec_get_p_radial()

real (rprec) function vmec_equilibrium::vmec_get_p_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s 
)

Gets the plasma pressure at a s position.

This method overrides equilibrium::equilibrium_get_p.

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the plasma pressure at.
Returns
The plasma pressure at s.

Definition at line 3939 of file vmec_equilibrium.f.

◆ vmec_get_param_id()

integer function vmec_equilibrium::vmec_get_param_id ( type (vmec_class), intent(in)  this,
character (len=*), intent(in)  param_name 
)

Get the id for a reconstruction parameter.

This method overrides equilibrium::equilibrium_get_param_id.

Parameters
[in]thisA vmec_class instance.
[in]param_nameName of a reconstruction parameter.
Returns
The id for a reconstruction parameter.

Definition at line 2045 of file vmec_equilibrium.f.

◆ vmec_get_param_name()

character(len=data_name_length) function vmec_equilibrium::vmec_get_param_name ( type (vmec_class), intent(in)  this,
integer, intent(in)  id 
)

Get the name of a reconstruction VMEC parameter.

This method overrides equilibrium::equilibrium_get_param_name.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
Returns
The name of the parameter.

Definition at line 2557 of file vmec_equilibrium.f.

◆ vmec_get_param_value()

real (rprec) function vmec_equilibrium::vmec_get_param_value ( type (vmec_class), intent(in)  this,
integer, intent(in)  id,
integer, intent(in)  i_index,
integer, intent(in)  j_index 
)

Get the value of a reconstruction VMEC parameter.

This method overrides equilibrium::equilibrium_get_param_value.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
[in]i_indexThe ith index of the parameter.
[in]j_indexThe jth index of the parameter.
Returns
The value of the parameter.

Definition at line 2295 of file vmec_equilibrium.f.

◆ vmec_get_plasma_edge()

integer function vmec_equilibrium::vmec_get_plasma_edge ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  phi,
real (rprec), dimension(:), pointer  r,
real (rprec), dimension(:), pointer  z 
)

Gets the r and z positions of the outer surface at a toroidal angle.

This method overrides equilibrium::equilibrium_get_plasma_edge.

Parameters
[in]thisA vmec_class instance.
[in]phiToroidal angle to determine the outer surface at.
[in,out]rThe radial postions of the other surface in a single toroidal angle.
[in,out]zThe Z postions of the other surface in a single toroidal angle.
Returns
The number of elements in the r and z arrays.

Definition at line 4227 of file vmec_equilibrium.f.

◆ vmec_get_s()

real (rprec) function vmec_equilibrium::vmec_get_s ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets VMEC s value at position.

Converts from cartesian coordinates to VMEC's flux coordinates.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the s position at.
Returns
The s position at x_cart.

Definition at line 4147 of file vmec_equilibrium.f.

◆ vmec_get_suv()

real (rprec) function, dimension(3) vmec_equilibrium::vmec_get_suv ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets VMEC suv position.

Converts from cartesian coordinates to vmec's flux coordinates.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the s position at.
Returns
The s position at x_cart.

Definition at line 4087 of file vmec_equilibrium.f.

◆ vmec_get_sxrem_af()

real (rprec) function, dimension(:), pointer vmec_equilibrium::vmec_get_sxrem_af ( type (vmec_class), intent(in)  this,
integer, intent(in)  index 
)

Gets the soft x-ray emissivity profile af array.

This method overrides equilibrium::equilibrium_get_sxrem_af. If no temperature profile was created a null pointer is returned.

Parameters
[in]thisA vmec_class instance.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
Pointer to the electron temperature profile af array.

Definition at line 3668 of file vmec_equilibrium.f.

◆ vmec_get_sxrem_cart()

real (rprec) function vmec_equilibrium::vmec_get_sxrem_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
integer, intent(in)  index 
)

Gets the soft x-ray emissivity at a cartesian position.

This method overrides equilibrium::equilibrium_get_sxrem. If no soft x-ray emissivity profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the soft x-ray emissivity at.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
The soft x-ray emissivity at x_cart.

Definition at line 3839 of file vmec_equilibrium.f.

◆ vmec_get_sxrem_radial()

real (rprec) function vmec_equilibrium::vmec_get_sxrem_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s,
integer, intent(in)  index 
)

Gets the soft x-ray emissivity at a s position.

This method overrides equilibrium::equilibrium_get_sxrem. If no soft x-ray emissivity profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the soft x-ray emissivity at.
[in]indexIndex of the soft x-ray emissivity profile.
Returns
The soft x-ray emissivity at s.

Definition at line 3873 of file vmec_equilibrium.f.

◆ vmec_get_te_af()

real (rprec) function, dimension(:), pointer vmec_equilibrium::vmec_get_te_af ( type (vmec_class), intent(in)  this)

Gets the electron temperature profile af array.

This method overrides equilibrium::equilibrium_get_te_af. If no electron temperature profile was created a null pointer is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Pointer to the electron temperature profile af array.

Definition at line 3092 of file vmec_equilibrium.f.

◆ vmec_get_te_cart()

real (rprec) function vmec_equilibrium::vmec_get_te_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets the electron temperature at a cartesian position.

This method overrides equilibrium::equilibrium_get_te. If no electron temperature profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the electron temperature at.
Returns
The electron temperature at x_cart.

Definition at line 3248 of file vmec_equilibrium.f.

◆ vmec_get_te_radial()

real (rprec) function vmec_equilibrium::vmec_get_te_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s 
)

Gets the electron temperature at a s position.

This method overrides equilibrium::equilibrium_get_te. If no electron temperature profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the electron temperature at.
Returns
The electron temperature at s.

Definition at line 3278 of file vmec_equilibrium.f.

◆ vmec_get_ti_af()

real (rprec) function, dimension(:), pointer vmec_equilibrium::vmec_get_ti_af ( type (vmec_class), intent(in)  this)

Gets the ion temperature profile af array.

This method overrides equilibrium::equilibrium_get_ti_af. If no ion temperature profile was created a null pointer is returned.

Parameters
[in]thisA vmec_class instance.
Returns
Pointer to the ion temperature profile af array.

Definition at line 3347 of file vmec_equilibrium.f.

◆ vmec_get_ti_cart()

real (rprec) function vmec_equilibrium::vmec_get_ti_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets the ion temperature at a cartesian position.

This method overrides equilibrium::equilibrium_get_ti. If no ion temperature profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the ion temperature at.
Returns
The ion temperature at x_cart.

Definition at line 3501 of file vmec_equilibrium.f.

◆ vmec_get_ti_radial()

real (rprec) function vmec_equilibrium::vmec_get_ti_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s 
)

Gets the ion temperature at a s position.

This method overrides equilibrium::equilibrium_get_ti. If no ion temperature profile was created, return zero.

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the ion temperature at.
Returns
The ion temperature at s.

Definition at line 3531 of file vmec_equilibrium.f.

◆ vmec_get_volume_int_element()

real (rprec) function vmec_equilibrium::vmec_get_volume_int_element ( type (vmec_class), intent(in)  this)

Get volume integration element.

This method overrides equilibrium::equilibrium_get_volume_int_element. For vmec this is J*ds*du*dv where J is the jacobian. The jacobian is integrated into Jr, Jphi and Jz but still need to account for the sign of the jacobian.

  • ds = 1/(ns - 1)
  • du = 2*Pi/number of flux surfaces
  • dv = 2*Pi/number of field periods/number of toroidal planes
Parameters
[in]thisA vmec_class instance.
Returns
The volume integration element.

Definition at line 4445 of file vmec_equilibrium.f.

◆ vmec_get_ze_cart()

real (rprec) function vmec_equilibrium::vmec_get_ze_cart ( type (vmec_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart 
)

Gets the effective charge at a cartesian position.

This method overrides equilibrium::equilibrium_get_ze. If no Zeff profile was created, return 1.0

Parameters
[in]thisA vmec_class instance.
[in]x_cartCartesian position to get the effective charge at.
Returns
The effective charge at x_cart.

Definition at line 3565 of file vmec_equilibrium.f.

◆ vmec_get_ze_radial()

real (rprec) function vmec_equilibrium::vmec_get_ze_radial ( type (vmec_class), intent(in)  this,
real (rprec), intent(in)  s 
)

Gets the effective charge at a s position.

This method overrides equilibrium::equilibrium_get_ze. If no Zeff profile was created, return 1.0

Parameters
[in]thisA vmec_class instance.
[in]sRadial position to get the effective charge at.
Returns
The effective charge at s.

Definition at line 3595 of file vmec_equilibrium.f.

◆ vmec_is_1d_array()

logical function vmec_equilibrium::vmec_is_1d_array ( type (vmec_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a 1d array.

This method overrides equilibrium::equilibrium_is_1d_array.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a 1d array and false if otherwise.

Definition at line 5020 of file vmec_equilibrium.f.

◆ vmec_is_2d_array()

logical function vmec_equilibrium::vmec_is_2d_array ( type (vmec_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a 2d array.

This method overrides equilibrium::equilibrium_is_2d_array.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a 2d array and false if otherwise.

Definition at line 5067 of file vmec_equilibrium.f.

◆ vmec_is_recon_param()

logical function vmec_equilibrium::vmec_is_recon_param ( type (vmec_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a reconstruction parameter.

This method overrides equilibrium::equilibrium_is_recon_param.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a reconstruction parameter and false if otherwise.

Definition at line 5113 of file vmec_equilibrium.f.

◆ vmec_is_scaler_value()

logical function vmec_equilibrium::vmec_is_scaler_value ( type (vmec_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a scaler value.

This method overrides equilibrium::equilibrium_is_scaler_value.

Parameters
[in]thisA vmec_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a scaler and false if otherwise.

Definition at line 4979 of file vmec_equilibrium.f.

◆ vmec_is_using_point()

logical function vmec_equilibrium::vmec_is_using_point ( type (vmec_class), intent(in)  this)

Checks if a the point magnetics are being used.

This method overrides equilibrium::equilibrium_is_using_point.

Parameters
[in]thisA vmec_class instance.
Returns
True if the point magnetic are being used.

Definition at line 5160 of file vmec_equilibrium.f.

◆ vmec_read_vac_file()

subroutine vmec_equilibrium::vmec_read_vac_file ( type (vmec_class), intent(in)  this,
integer, intent(in)  index,
integer, intent(in)  eq_comm 
)

Loads the vacuum magnetic field file.

Loads the vacuum magnetic field file. This will get on multiple processes to allow parallel loading of the mgrid file. The extcur array will need to be broadcast to the child processes.

Parameters
[in]thisA vmec_class instance.
[in]indexIndex of the changed current.
[in]eq_commMPI communicator pool for VMEC.

Definition at line 5395 of file vmec_equilibrium.f.

◆ vmec_reset_boundary()

subroutine vmec_equilibrium::vmec_reset_boundary ( type (vmec_class), intent(in)  this)

Reset the fixed boundary coefficients.

When changing the boundary coefficients, there is extra work that must be performed to set the VMEC state.

Parameters
[in]thisA vmec_class instance.

Definition at line 6132 of file vmec_equilibrium.f.

◆ vmec_reset_state()

subroutine vmec_equilibrium::vmec_reset_state ( type (vmec_class), intent(inout)  this)

Reset the internal state of the equilibrium.

Copies the saved VMEC state back to VMEC.

Parameters
[in,out]thisA vmec_class instance.

Definition at line 5486 of file vmec_equilibrium.f.

◆ vmec_restart()

subroutine vmec_equilibrium::vmec_restart ( type (vmec_class), intent(in)  this,
integer, intent(in)  result_ncid,
integer, intent(in)  current_step 
)

Restart vmec from the result file.

This method overrides equilibrium::equilibrium_restart.

Parameters
[in]thisA vmec_class instance.
[in]result_ncidNetCDF file id of the result file.
[in]current_stepStep index to write variables to.

Definition at line 5970 of file vmec_equilibrium.f.

◆ vmec_save_state()

subroutine vmec_equilibrium::vmec_save_state ( type (vmec_class), intent(inout)  this)

Save the internal state of the equilibrium.

Saves the VMEC state and the wout file.

Parameters
[in,out]thisA vmec_class instance.

Definition at line 5429 of file vmec_equilibrium.f.

◆ vmec_set_magnetic_cache_calc()

subroutine vmec_equilibrium::vmec_set_magnetic_cache_calc ( type (vmec_class), intent(inout)  this)

Set magnetic cache initialy.

After the equilibrium has been converged calculate the r, z, jr, jphi and jz on grid of s, u, v points.

Parameters
[in,out]thisA vmec_class instance.
Todo:
FIXME: There is no reason to recalculate the sin and cosin for the u component arrays every time. The v components can change if phi_offset is being reconstructed. The u components can be cached in the vmec_magnetic_cache and calculated once in vmec_set_magnetic_cache_responce.
Todo:
FIXME: There is no reason to recalculate the sin and cosin for the u component arrays every time. The v components can change if phi_offset is being reconstructed. The u components can be cached in the vmec_magnetic_cache and calculated once in vmec_set_magnetic_cache_responce.
Todo:
FIXME: There is no reason to recompute the sine and cosine for the u component arrays every time.
Todo:
FIXME: There is no reason to recalculate the sin and cosin for the u component arrays every time. The v components can change if phi_offset is being reconstructed. The u components can be cached in the vmec_magnetic_cache and calculated once in vmec_set_magnetic_cache_responce.
Todo:
FIXME: There is no reason to recompute the sine and cosine for the u component arrays every time.

Definition at line 1426 of file vmec_equilibrium.f.

◆ vmec_set_magnetic_cache_point()

subroutine vmec_equilibrium::vmec_set_magnetic_cache_point ( type (vmec_class), intent(inout)  this,
logical, intent(in)  use_axi 
)

Set magnetic cache initialy.

This method overrides equilibrium::equilibrium_set_magnetic_cache. This allocates a vmec_magnetic_cache structure. Point measurements require no array allocations.

Parameters
[in,out]thisA vmec_class instance.
[in]use_axiMagnetics can subtract off axisymmetric components.

Definition at line 1362 of file vmec_equilibrium.f.

◆ vmec_set_magnetic_cache_responce()

subroutine vmec_equilibrium::vmec_set_magnetic_cache_responce ( type (vmec_class), intent(inout)  this,
type (magnetic_response_class), intent(in)  response_object 
)

Set magnetic cache for plasma resonce.

This method overrides equilibrium::equilibrium_set_magnetic_cache. This allocates a vmec_magnetic_cache structure. Point measurements require no array allocations.

Parameters
[in,out]thisA vmec_class instance.
[in]response_objectA magnetic_response::magnetic_response_class instance.

Definition at line 1278 of file vmec_equilibrium.f.

◆ vmec_set_namelist()

subroutine vmec_equilibrium::vmec_set_namelist ( type (vmec_class), intent(in)  this)

Sets namelist variables from the solved VMEC equilibrium.

This method updates the boundary and magnetic axis coefficients in the namelist input file.

Parameters
[in]thisA vmec_class instance.

Definition at line 1987 of file vmec_equilibrium.f.

◆ vmec_set_param()

subroutine vmec_equilibrium::vmec_set_param ( type (vmec_class), intent(inout)  this,
integer, intent(in)  id,
integer, intent(in)  i_index,
integer, intent(in)  j_index,
real (rprec), intent(in)  value,
integer, intent(in)  eq_comm,
integer, intent(inout)  state_flags 
)

Sets the value of a reconstruction equilibrium parameter.

This method overrides equilibrium::equilibrium_set_param. When a VMEC parameter is changed, propagate the changes to the VMEC internal state and inform the caller that the equilibrium needs reconvergence.

Parameters
[in,out]thisA vmec_class instance.
[in]idID of the parameter.
[in]i_indexThe ith index of the parameter.
[in]j_indexThe jth index of the parameter.
[in]valueThe value of the parameter.
[in]eq_commMPI communicator for the child equilibrium processes.
[in,out]state_flagsBitwise flags to indicate which parts of the model changed.
Todo:
FIXME: Consider throwing a fatal error here instead of silently doing nothing.

Definition at line 1013 of file vmec_equilibrium.f.

◆ vmec_sync_child()

subroutine vmec_equilibrium::vmec_sync_child ( type (vmec_class), intent(inout)  this,
integer, intent(in)  index,
integer, intent(in)  recon_comm 
)

Syncronize a child vmec state to the parent.

Syncs data between a child and the parent process. If MPI support is not compiled in this subroutine reduces to a no op.

Parameters
[in,out]thisA vmec_class instance.
[in]indexReconstruction rank to sync.
[in]recon_commMPI communicator for the reconstruction processes.

Definition at line 6081 of file vmec_equilibrium.f.

◆ vmec_sync_state()

subroutine vmec_equilibrium::vmec_sync_state ( type (vmec_class), intent(inout)  this,
integer, intent(in)  recon_comm 
)

Syncronize the vmec state to children.

Syncs data between the parent and child processes. If MPI support is not compiled in this subroutine reduces to a no op.

Parameters
[in,out]thisA vmec_class instance.
[in]recon_commMPI communicator for the reconstruction processes.

Definition at line 6028 of file vmec_equilibrium.f.

◆ vmec_write()

subroutine vmec_equilibrium::vmec_write ( type (vmec_class), intent(in)  this,
integer, intent(in)  iou 
)

Write out the equilibrium to an output file.

This method overrides equilibrium::equilibrium_write.

Parameters
[in]thisA vmec_class instance.
[in]iouInput/output unit of the output file.

Definition at line 5549 of file vmec_equilibrium.f.

◆ vmec_write_init_data()

subroutine vmec_equilibrium::vmec_write_init_data ( type (vmec_class), intent(in)  this,
integer, intent(in)  result_ncid 
)

Write inital data to NetCDF result file.

This method overrides equilibrium::equilibrium_write_init_data.

Parameters
[in]thisA vmec_class instance.
[in]result_ncidNetCDF file id of the result file.

Definition at line 5819 of file vmec_equilibrium.f.

◆ vmec_write_input()

subroutine vmec_equilibrium::vmec_write_input ( type (vmec_class), intent(in)  this,
integer, intent(in)  current_step 
)

Write the current valid input.

This method overrides equilibrium::equilibrium_write_input. The boundary and other fixed parameters do not get updated as the reconstruction progresses. Need to update them manually if in free boundary mode.

Parameters
[in]thisA vmec_class instance.
[in]current_stepStep number to append to input filename.

Definition at line 5617 of file vmec_equilibrium.f.

◆ vmec_write_step_data()

subroutine vmec_equilibrium::vmec_write_step_data ( type (vmec_class), intent(in)  this,
integer, intent(in)  result_ncid,
integer, intent(in)  current_step 
)

Write step data to NetCDF result file.

This method overrides equilibrium::equilibrium_write_step_data.

Parameters
[in]thisA vmec_class instance.
[in]result_ncidNetCDF file id of the result file.
[in]current_stepStep index to write variables to.

Definition at line 5915 of file vmec_equilibrium.f.