![]() |
Stellarator-Tools
|
Base class representing a vmec_equilibrium. More...
Public Member Functions | |
procedure | set_param (this, id, i_index, j_index, value, eq_comm, state_flags) |
Sets the value of a reconstruction equilibrium parameter. | |
procedure | set_magnetic_cache_response (this, response_object, state_flags) |
Set magnetic cache for plasma resonce. | |
procedure | set_magnetic_cache_point (this, use_axi, state_flags) |
Set magnetic cache initialy. | |
procedure | set_magnetic_cache_calc (this) |
Set magnetic cache initialy. | |
procedure | set_namelist (this) |
Sets namelist variables from the solved VMEC equilibrium. | |
procedure | get_type (this) |
Gets a discription of the equilibrium type. | |
procedure | get_param_id (this, param_name) |
Get the id for a reconstruction parameter. | |
procedure | get_param_value (this, id, i_index, j_index) |
Get the value of a reconstruction VMEC parameter. | |
procedure | get_param_name (this, id) |
Get the name of a reconstruction VMEC parameter. | |
procedure | get_gp_ne_num_hyper_param (this) |
Get the number of electron density gp kernel hyper parameters. | |
procedure | get_ne_af (this) |
Gets the electron density profile af array. | |
procedure | get_gp_ne_ij (this, i, j) |
Get the electron density gp kernel value for the two indicies. | |
procedure | get_gp_ne_pi (this, x_cart, i) |
Get the electron density gp kernel value for the position and index. | |
procedure | get_gp_ne_pp (this, x_cart, y_cart) |
Get the electron density gp kernel value for the position and position. | |
procedure | get_ne_cart (this, x_cart) |
Gets the electron density at a cartesian position. | |
procedure | get_ne_radial (this, s) |
Gets the electron density at a s position. | |
procedure | get_gp_te_num_hyper_param (this) |
Get the number of electron temperature gp kernel hyper parameters. | |
procedure | get_te_af (this) |
Gets the electron temperature profile af array. | |
procedure | get_gp_te_ij (this, i, j) |
Get the electron temperature gp kernel value for the two indicies. | |
procedure | get_gp_te_pi (this, x_cart, i) |
Get the electron temperature gp kernel value for the position and index. | |
procedure | get_gp_te_pp (this, x_cart, y_cart) |
Get the electron temperature gp kernel value for the position and position. | |
procedure | get_te_cart (this, x_cart) |
Gets the electron temperature at a cartesian position. | |
procedure | get_te_radial (this, s) |
Gets the electron temperature at a s position. | |
procedure | get_gp_ti_num_hyper_param (this) |
Get the number of ion temperature gp kernel hyper parameters. | |
procedure | get_ti_af (this) |
Gets the ion temperature profile af array. | |
procedure | get_gp_ti_ij (this, i, j) |
Get the ion temperature gp kernel value for the two indicies. | |
procedure | get_gp_ti_pi (this, x_cart, i) |
Get the ion temperature gp kernel value for the position and index. | |
procedure | get_gp_ti_pp (this, x_cart, y_cart) |
Get the ion temperature gp kernel value for the position and position. | |
procedure | get_ti_cart (this, x_cart) |
Gets the ion temperature at a cartesian position. | |
procedure | get_ti_radial (this, s) |
Gets the ion temperature at a s position. | |
procedure | get_gp_sxrem_num_hyper_param (this, index) |
Get the number of soft x-ray emission gp kernel hyper parameters. | |
procedure | get_sxrem_af (this, index) |
Gets the soft x-ray emissivity profile af array. | |
procedure | get_gp_sxrem_ij (this, i, j, index) |
Get the soft x-ray emissivity gp kernel value for the two indicies. | |
procedure | get_gp_sxrem_pi (this, x_cart, i, index) |
Get the soft x-ray emissivity gp kernel value for the position and index. | |
procedure | get_gp_sxrem_pp (this, x_cart, y_cart, index) |
Get the soft x-ray emissivity gp kernel value for the position and position. | |
procedure | get_sxrem_cart (this, x_cart, index) |
Gets the soft x-ray emissivity at a cartesian position. | |
procedure | get_sxrem_radial (this, s, index) |
Gets the soft x-ray emissivity at a s position. | |
procedure | get_p_cart (this, x_cart, normalize) |
Gets the plasma pressure at a cartesian position. | |
procedure | get_p_radial (this, s, normalize) |
Gets the plasma pressure at a s position. | |
procedure | get_b_vec (this, x_cart, cyl) |
Gets the magnetic field vector at a position. | |
procedure | get_int_b_dphi (this, s, theta) |
Gets the loop integrated magnetic field at a position. | |
procedure | get_suv (this, x_cart) |
Gets VMEC suv position. | |
procedure | get_s (this, x_cart) |
Gets VMEC s value at position. | |
procedure | get_flux (this, x_cart) |
Gets VMEC normalized flux value at position. | |
procedure | get_plasma_edge (this, phi, r, z) |
Gets the r and z positions of the outer surface at a toroidal angle. | |
procedure | get_magnetic_volume_rgrid (this) |
Get volume magnetic volume integration radial grid points. | |
procedure | get_magnetic_volume_zgrid (this) |
Get volume magnetic volume integration z grid points. | |
procedure | get_magnetic_volume_jrgrid (this) |
Get volume magnetic volume integration jr grid points. | |
procedure | get_magnetic_volume_jphigrid (this) |
Get volume magnetic volume integration jphi grid points. | |
procedure | get_magnetic_volume_jzgrid (this) |
Get volume magnetic volume integration jz grid points. | |
procedure | get_volume_int_element (this) |
Get volume integration element. | |
procedure | get_con_surface_krgrid (this) |
Get the conducting surface integration kr grid points. | |
procedure | get_con_surface_kphigrid (this) |
Get the conducting surface integration kphi grid points. | |
procedure | get_con_surface_kzgrid (this) |
Get the conducting surface integration kz grid points. | |
procedure | get_area_int_element (this) |
Get area integration element. | |
procedure | get_ext_currents (this, num_currents, scale_currents) |
Get external current. | |
procedure | get_b_vac (this, r_cyl) |
Gets the vacuum magnetic field vector at a position. | |
procedure | get_ext_b_plasma (this, position, axi_only) |
Get external plasma magnetic field. | |
procedure | get_grid_size (this) |
Get radial grid size. | |
procedure | get_grid_start (this) |
Get start of the radial grid. | |
procedure | get_grid_stop (this) |
Get radial grid size. | |
procedure | is_scaler_value (this, id) |
Checks if a parameter id is a scaler value. | |
procedure | is_1d_array (this, id) |
Checks if a parameter id is a 1d array. | |
procedure | is_2d_array (this, id) |
Checks if a parameter id is a 2d array. | |
procedure | is_recon_param (this, id) |
Checks if a parameter id is a reconstruction parameter. | |
procedure | is_using_point (this) |
Checks if the point magnetics are being used. | |
procedure | has_vacuum_field (this) |
Determines if vacuum field information is available. | |
procedure | is_in_plasma (this, x_cart) |
Determines if a point is inside the plasma or outside. | |
procedure | limit_path_to_boundary (this, path) |
Limit an integration path to the boundary. | |
procedure | gradient_descent (this, t, u, dx, x0) |
Gradient descent to minize the vmec_equilibrium::vmec_limit_chi. | |
procedure | converge (this, num_iter, iou, eq_comm, state_flags) |
Solves the VMEC equilibrium. | |
procedure | read_vac_file (this, index, eq_comm) |
Loads the vacuum magnetic field file. | |
procedure | save_state (this) |
Save the internal state of the equilibrium. | |
procedure | reset_state (this) |
Reset the internal state of the equilibrium. | |
procedure | write (this, iou) |
Write out the equilibrium to an output file. | |
procedure | write_input (this, current_step) |
Write the current valid input. | |
procedure | def_result (this, result_ncid, maxnsetps_dim_id) |
Define NetCDF variables for the result file. | |
procedure | write_init_data (this, result_ncid) |
Write inital data to NetCDF result file. | |
procedure | write_step_data (this, result_ncid, current_step) |
Write step data to NetCDF result file. | |
procedure | restart (this, result_ncid, current_step) |
Restart vmec from the result file. | |
procedure | sync_state (this, recon_comm) |
Syncronize the vmec state to children. | |
procedure | sync_child (this, index, recon_comm) |
Syncronize a child vmec state to the parent. | |
FINAL | vmec_destruct (this) |
Deconstruct a vmec_class object. | |
type(vmec_class) function, pointer | vmec_construct (file_name, wout_file_name, ne, te, ti, sxrem, phi_offset, z_offset, pol_rad_ratio, iou, eq_comm, recon_comm, state_flags, force_solve) |
Construct a vmec_class object. | |
![]() | |
procedure | set_param (this, id, i_index, j_index, value, eq_comm, state_flags) |
Sets the value of a reconstruction equilibrium parameter. | |
procedure | set_magnetic_cache_response (this, response_object, state_flags) |
Sets the magnetic cache of the equilibrium for the magnetic response. | |
procedure | set_magnetic_cache_point (this, use_axi, state_flags) |
Sets the magnetic cache of the equilibrium for points. | |
GENERIC | set_magnetic_cache set_magnetic_cache_response, set_magnetic_cache_point |
procedure | get_type (this) |
Checks if a parameter id is a reconstruction parameter. | |
procedure | get_param_id (this, param_name) |
Get the id for a reconstruction parameter. | |
procedure | get_param_name (this, id) |
Gets the name of a reconstruction equilibrium parameter. | |
procedure | get_param_value (this, id, i_index, j_index) |
Gets the value of a reconstruction equilibrium parameter. | |
procedure | get_gp_ne_num_hyper_param (this) |
Get the number of electron density gp kernel hyper parameters. | |
procedure | get_ne_af (this) |
Get the electron density profile af array. | |
procedure | get_gp_ne_ij (this, i, j) |
Get the electron density gp kernel value for the two indicies. | |
procedure | get_gp_ne_pi (this, x_cart, i) |
Get the electron density gp kernel value for the position and index. | |
procedure | get_gp_ne_pp (this, x_cart, y_cart) |
Get the electron density gp kernel value for the position and position. | |
GENERIC | get_gp_ne get_gp_ne_ij, get_gp_ne_pi, get_gp_ne_pp |
procedure | get_ne_cart (this, x_cart) |
Gets the electron density at a cartesian position. | |
procedure | get_ne_radial (this, s) |
Gets the electron density at a radial position. | |
GENERIC | get_ne get_ne_cart, get_ne_radial |
procedure | get_gp_te_num_hyper_param (this) |
Get the number of electron temperature gp kernel hyper parameters. | |
procedure | get_te_af (this) |
Get the electron temperature profile af array. | |
procedure | get_gp_te_ij (this, i, j) |
Get the electron temperature gp kernel value for the two indicies. | |
procedure | get_gp_te_pi (this, x_cart, i) |
Get the electron temperature gp kernel value for the position and index. | |
procedure | get_gp_te_pp (this, x_cart, y_cart) |
Get the electron temperature gp kernel value for the position and position. | |
GENERIC | get_gp_te get_gp_te_ij, get_gp_te_pi, get_gp_te_pp |
procedure | get_te_cart (this, x_cart) |
Gets the electron temperature at a cartesian position. | |
procedure | get_te_radial (this, s) |
Gets the electron temperature at a radial position. | |
GENERIC | get_te get_te_cart, get_te_radial |
procedure | get_gp_ti_num_hyper_param (this) |
Get the number of ion temperature gp kernel hyper parameters. | |
procedure | get_ti_af (this) |
Get the ion temperature profile af array. | |
procedure | get_gp_ti_ij (this, i, j) |
Get the ion temperature gp kernel value for the two indicies. | |
procedure | get_gp_ti_pi (this, x_cart, i) |
Get the ion temperature gp kernel value for the position and index. | |
procedure | get_gp_ti_pp (this, x_cart, y_cart) |
Get the ion temperature gp kernel value for the position and position. | |
GENERIC | get_gp_ti get_gp_ti_ij, get_gp_ti_pi, get_gp_ti_pp |
procedure | get_ti_cart (this, x_cart) |
Gets the ion temperature at a cartesian position. | |
procedure | get_ti_radial (this, s) |
Gets the ion temperature at a radial position. | |
GENERIC | get_ti get_ti_cart, get_ti_radial |
procedure | get_gp_sxrem_num_hyper_param (this, index) |
Get the number of soft x-ray emissivity gp kernel hyper parameters. | |
procedure | get_sxrem_af (this, index) |
Get the soft x-ray emissivity profile af array. | |
procedure | get_gp_sxrem_ij (this, i, j, index) |
Get the electron density gp kernel value for the two indicies. | |
procedure | get_gp_sxrem_pi (this, x_cart, i, index) |
Get the soft x-ray emissivity gp kernel value for the position and index. | |
procedure | get_gp_sxrem_pp (this, x_cart, y_cart, index) |
Get the soft x-ray emissivity gp kernel value for the position and position. | |
GENERIC | get_gp_sxrem get_gp_sxrem_ij, get_gp_sxrem_pi, get_gp_sxrem_pp |
procedure | get_sxrem_cart (this, x_cart, index) |
Gets the soft x-ray emissivity at a cartesian position. | |
procedure | get_sxrem_radial (this, s, index) |
Gets the soft x-ray emissivity at a radial position. | |
GENERIC | get_sxrem get_sxrem_cart, get_sxrem_radial |
procedure | get_p_cart (this, x_cart, normalize) |
Gets the plasma pressure at a cartesian position. | |
procedure | get_p_radial (this, s, normalize) |
Gets the plasma pressure at a radial position. | |
GENERIC | get_p get_p_cart, get_p_radial |
procedure | get_b_vec (this, x_cart, cyl) |
Gets the magnetic field vector at a position. | |
procedure | get_int_b_dphi (this, s, theta) |
Gets the loop integrated magnetic field at a position. | |
procedure | get_plasma_edge (this, phi, r, z) |
Gets the r and z positions of the outer surface at a toroidal angle. | |
procedure | get_magnetic_volume_rgrid (this) |
Get volume magnetic volume integration radial grid points. | |
procedure | get_magnetic_volume_zgrid (this) |
Get volume magnetic volume integration z grid points. | |
procedure | get_magnetic_volume_jrgrid (this) |
Get volume magnetic volume integration jr grid points. | |
procedure | get_magnetic_volume_jphigrid (this) |
Get volume magnetic volume integration jphi grid points. | |
procedure | get_magnetic_volume_jzgrid (this) |
Get volume magnetic volume integration jz grid points. | |
procedure | get_volume_int_element (this) |
Get volume integration element. | |
procedure | get_con_surface_krgrid (this) |
Get the conducting surface integration kr grid points. | |
procedure | get_con_surface_kphigrid (this) |
Get the conducting surface integration kphi grid points. | |
procedure | get_con_surface_kzgrid (this) |
Get the conducting surface integration kz grid points. | |
procedure | get_area_int_element (this) |
Get area integration element. | |
procedure | get_ext_currents (this, num_currents, scale_currents) |
Get external current. | |
procedure | get_ext_b_plasma (this, position, axi_only) |
Get external plasma magnetic field. | |
procedure | get_grid_size (this) |
Get radial grid size. | |
procedure | get_grid_start (this) |
Get start of the radial grid. | |
procedure | get_grid_stop (this) |
Get stop of the radial grid. | |
procedure | is_scaler_value (this, id) |
Checks if a parameter id is a scaler value. | |
procedure | is_2d_array (this, id) |
Checks if a parameter id is a 2d array. | |
procedure | is_recon_param (this, id) |
Checks if a parameter id is a reconstruction parameter. | |
procedure | is_using_point (this) |
Checks if the point magnetics are being used. | |
procedure | has_vacuum_field (this) |
Determines if vacuum field information is available. | |
procedure | is_in_plasma (this, x_cart) |
Determines if a point is inside the plasma or outside. | |
procedure | limit_path_to_boundary (this, path) |
Limit an integration path to the boundary. | |
procedure | converge (this, num_iter, iou, eq_comm, state_flags) |
Solves the equilibrium. | |
procedure | read_vac_file (this, index, eq_comm) |
Loads the vacuum magnetic field file. | |
procedure | save_state (this) |
Save the internal state of the equilibrium. | |
procedure | reset_state (this) |
Reset the internal state of the equilibrium. | |
procedure | write (this, iou) |
Write out the equilibrium to an output file. | |
procedure | write_input (this, current_step) |
Write out the equilibrium to an output file. | |
procedure | def_result (this, result_ncid, maxnsetps_dim_id) |
Define NetCDF variables for the result file. | |
procedure | write_init_data (this, result_ncid) |
Write inital data to NetCDF result file. | |
procedure | write_step_data (this, result_ncid, current_step) |
Write step data to NetCDF result file. | |
procedure | restart (this, result_ncid, current_step) |
Restart equilibrium. | |
procedure | sync_state (this, recon_comm) |
Syncronize the equilibrium state to children. | |
procedure | sync_child (this, index, recon_comm) |
Syncronize a child equilibrium state to the parent. | |
FINAL | equilibrium_destruct (this) |
Deconstruct a equilibrium_class object. | |
Public Attributes | |
character(len=path_length) | wout_file_name |
File name of the output of vmec. | |
character(len=path_length) | vmec_file_name |
File name of the vmec namelist inout file. | |
type(pprofile_class), pointer | ne => null() |
pprofile_T describing a flux surface constant electron denisty profile. | |
type(pprofile_class), pointer | te => null() |
pprofile_T describing a flux surface constant electron temperature profile. | |
type(pprofile_class), pointer | ti => null() |
pprofile_T describing a flux surface constant ion temperature profile. | |
type(pprofile_pointer), dimension(:), pointer | sxrem => null() |
pprofile_T describing a flux surface conatsnt soft x-ray emissivity profile. | |
real(rprec) | pol_rad_ratio |
Ratio of the poloidal grid points to the poloidal grid points. | |
type(vmec_magnetic_cache), pointer | magnetic_cache => null() |
Instance of a vmec_magnetic_cache object. | |
class(vmec_context_class), pointer | vmec_context_save => null() |
VMEC context. | |
real(rprec) | phi_offset = 0 |
Plasma phi offset. | |
real(rprec) | z_offset = 0 |
Plasma z offset. | |
integer | ns_index |
Index of the largest ns value. | |
![]() | |
logical | force_solve |
Controls if an equilibrium is forced to be resolved or not. | |
Base class representing a vmec_equilibrium.
Interface for the construction of vmec_class types using vmec_construct_full or vmec_construct_eq.
procedure vmec_equilibrium::vmec_class::converge | ( | class (vmec_class), intent(inout) | this, |
integer, intent(inout) | num_iter, | ||
integer, intent(in) | iou, | ||
integer, intent(in) | eq_comm, | ||
integer, intent(in) | state_flags | ||
) |
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.
[in,out] | this | A vmec_class instance. |
[in,out] | num_iter | Counter to track the number of iterations. |
[in] | iou | Input/Output unit of the runlog file. |
[in] | eq_comm | MPI communicator pool for VMEC. |
[in] | state_flags | Bitwise flags to indicate which parts of the model changed. |
procedure vmec_equilibrium::vmec_class::def_result | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | result_ncid | NetCDF file id of the result file. |
[in] | maxnsetps_dim_id | NetCDF dimension id of the number of steps dimension. |
procedure vmec_equilibrium::vmec_class::get_area_int_element | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_b_vac | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | r_cyl | Cartesian position to get the magnetic field vector at. |
procedure vmec_equilibrium::vmec_class::get_b_vec | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the magnetic field vector at. |
[in] | cyl | Flag that specifies if the bfield should be returned in cartesian or cylindical coordinates. |
procedure vmec_equilibrium::vmec_class::get_con_surface_kphigrid | ( | class (vmec_class), intent(in) | this | ) |
Get the conducting surface integration kphi grid points.
This method overrides equilibrium::equilibrium_get_con_surface_kphigrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_con_surface_krgrid | ( | class (vmec_class), intent(in) | this | ) |
Get the conducting surface integration kr grid points.
This method overrides equilibrium::equilibrium_get_con_surface_krgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_con_surface_kzgrid | ( | class (vmec_class), intent(in) | this | ) |
Get the conducting surface integration kz grid points.
This method overrides equilibrium::equilibrium_get_con_surface_kzgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_ext_b_plasma | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | position | Position to compute the fields at in cylindrical coordinates. |
[in] | axi_only | Gives only the axisymmtric component of the magnetic field. |
procedure vmec_equilibrium::vmec_class::get_ext_currents | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | num_currents | Forces the number of currents to return if greater than zero. |
[out] | scale_currents | Informs the caller that currents need to be scaled. |
procedure vmec_equilibrium::vmec_class::get_flux | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the s position at. |
procedure vmec_equilibrium::vmec_class::get_gp_ne_ij | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | i | ith profile position. |
[in] | j | jth profile position. |
procedure vmec_equilibrium::vmec_class::get_gp_ne_num_hyper_param | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_gp_ne_pi | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the electron density at. |
[in] | i | Profile position index. |
procedure vmec_equilibrium::vmec_class::get_gp_ne_pp | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | First cartesian position to get the electron density at. |
[in] | y_cart | Second cartesian position to get the electron density at. |
procedure vmec_equilibrium::vmec_class::get_gp_sxrem_ij | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | i | ith profile position. |
[in] | j | jth profile position. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_gp_sxrem_num_hyper_param | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_gp_sxrem_pi | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the soft x-ray emissivity at. |
[in] | i | Profile position index. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_gp_sxrem_pp | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | First cartesian position to get the soft x-ray emissivity at. |
[in] | y_cart | Second cartesian position to get the soft x-ray emissivity at. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_gp_te_ij | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | i | ith profile position. |
[in] | j | jth profile position. |
procedure vmec_equilibrium::vmec_class::get_gp_te_num_hyper_param | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_gp_te_pi | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the electron temperature at. |
[in] | i | Profile position index. |
procedure vmec_equilibrium::vmec_class::get_gp_te_pp | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | First cartesian position to get the electron temperature at. |
[in] | y_cart | Second cartesian position to get the electron temperature at. |
procedure vmec_equilibrium::vmec_class::get_gp_ti_ij | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | i | ith profile position. |
[in] | j | jth profile position. |
procedure vmec_equilibrium::vmec_class::get_gp_ti_num_hyper_param | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_gp_ti_pi | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the ion temperature at. |
[in] | i | Profile position index. |
procedure vmec_equilibrium::vmec_class::get_gp_ti_pp | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | First cartesian position to get the ion temperature at. |
[in] | y_cart | Second cartesian position to get the ion temperature at. |
procedure vmec_equilibrium::vmec_class::get_grid_size | ( | class (vmec_class), intent(in) | this | ) |
Get radial grid size.
This method overrides equilibrium::equilibrium_get_grid_size.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_grid_start | ( | class (vmec_class), intent(in) | this | ) |
Get start of the radial grid.
This method overrides equilibrium::equilibrium_get_grid_start.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_grid_stop | ( | class (vmec_class), intent(in) | this | ) |
Get radial grid size.
This method overrides equilibrium::equilibrium_get_grid_size.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_int_b_dphi | ( | class (vmec_class), intent(in) | this, |
real (rprec), intent(in) | s, | ||
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]
[in] | this | A vmec_class instance. |
[in] | s | S position to integrate about. |
[in] | theta | U angle to integrate about. |
procedure vmec_equilibrium::vmec_class::get_magnetic_volume_jphigrid | ( | class (vmec_class), intent(in) | this | ) |
Get volume magnetic volume integration jphi grid points.
This method overrides equilibrium::equilibrium_get_magnetic_volume_jphigrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_magnetic_volume_jrgrid | ( | class (vmec_class), intent(in) | this | ) |
Get volume magnetic volume integration jr grid points.
This method overrides equilibrium::equilibrium_get_magnetic_volume_jrgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_magnetic_volume_jzgrid | ( | class (vmec_class), intent(in) | this | ) |
Get volume magnetic volume integration jz grid points.
This method overrides equilibrium::equilibrium_get_magnetic_volume_jzgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_magnetic_volume_rgrid | ( | class (vmec_class), intent(in) | this | ) |
Get volume magnetic volume integration radial grid points.
This method overrides equilibrium::equilibrium_get_magnetic_volume_rgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_magnetic_volume_zgrid | ( | class (vmec_class), intent(in) | this | ) |
Get volume magnetic volume integration z grid points.
This method overrides equilibrium::equilibrium_get_magnetic_volume_zgrid.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_ne_af | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_ne_cart | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the electron density at. |
procedure vmec_equilibrium::vmec_class::get_ne_radial | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | s | Radial position to get the electron density at. |
procedure vmec_equilibrium::vmec_class::get_p_cart | ( | class (vmec_class), intent(in) | this, |
real (rprec), dimension(3), intent(in) | x_cart, | ||
logical, intent(in) | normalize | ||
) |
Gets the plasma pressure at a cartesian position.
This method overrides equilibrium::equilibrium_get_p.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the plasma pressure at. |
[in] | normalize | Normalize the pressure value. |
procedure vmec_equilibrium::vmec_class::get_p_radial | ( | class (vmec_class), intent(in) | this, |
real (rprec), intent(in) | s, | ||
logical, intent(in) | normalize | ||
) |
Gets the plasma pressure at a s position.
This method overrides equilibrium::equilibrium_get_p.
[in] | this | A vmec_class instance. |
[in] | s | Radial position to get the plasma pressure at. |
[in] | normalize | Normalize the pressure value. |
procedure vmec_equilibrium::vmec_class::get_param_id | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | param_name | Name of a reconstruction parameter. |
procedure vmec_equilibrium::vmec_class::get_param_name | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
procedure vmec_equilibrium::vmec_class::get_param_value | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
[in] | i_index | The ith index of the parameter. |
[in] | j_index | The jth index of the parameter. |
procedure vmec_equilibrium::vmec_class::get_plasma_edge | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | phi | Toroidal angle to determine the outer surface at. |
[in,out] | r | The radial postions of the other surface in a single toroidal angle. |
[in,out] | z | The Z postions of the other surface in a single toroidal angle. |
procedure vmec_equilibrium::vmec_class::get_s | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the s position at. |
procedure vmec_equilibrium::vmec_class::get_suv | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the s position at. |
procedure vmec_equilibrium::vmec_class::get_sxrem_af | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_sxrem_cart | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the soft x-ray emissivity at. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_sxrem_radial | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | s | Radial position to get the soft x-ray emissivity at. |
[in] | index | Index of the soft x-ray emissivity profile. |
procedure vmec_equilibrium::vmec_class::get_te_af | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_te_cart | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the electron temperature at. |
procedure vmec_equilibrium::vmec_class::get_te_radial | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | s | Radial position to get the electron temperature at. |
procedure vmec_equilibrium::vmec_class::get_ti_af | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_ti_cart | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | x_cart | Cartesian position to get the ion temperature at. |
procedure vmec_equilibrium::vmec_class::get_ti_radial | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | s | Radial position to get the ion temperature at. |
procedure vmec_equilibrium::vmec_class::get_type | ( | class (vmec_class), intent(in) | this | ) |
Gets a discription of the equilibrium type.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::get_volume_int_element | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::gradient_descent | ( | class (vmec_class), intent(in) | this, |
real (rprec), intent(in) | t, | ||
real (rprec), intent(in) | u, | ||
real (rprec), dimension(3), intent(in) | dx, | ||
real (rprec), dimension(3), intent(in) | x0 | ||
) |
Gradient descent to minize the vmec_equilibrium::vmec_limit_chi.
[in] | this | A model_class instance. |
[in] | t | The current value of t. |
[in] | u | The current value of u. |
[in] | dx | The dx consant. |
[in] | x0 | The x0 consant. |
procedure vmec_equilibrium::vmec_class::has_vacuum_field | ( | class (vmec_class), intent(in) | this | ) |
Determines if vacuum field information is available.
This method overrides equilibrium::equilibrium_has_vacuum_field.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::is_1d_array | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
procedure vmec_equilibrium::vmec_class::is_2d_array | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
procedure vmec_equilibrium::vmec_class::is_in_plasma | ( | class (vmec_class), intent(in) | this, |
real (rprec), dimension(3), intent(in) | x_cart | ||
) |
Determines if a point is inside the plasma or outside.
This method overrides equilibrium::equilibrium_is_in_plasma.
[in] | this | A model_class instance. |
[in] | x_cart | Cartesian position to check. |
procedure vmec_equilibrium::vmec_class::is_recon_param | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
procedure vmec_equilibrium::vmec_class::is_scaler_value | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
procedure vmec_equilibrium::vmec_class::is_using_point | ( | class (vmec_class), intent(in) | this | ) |
Checks if the point magnetics are being used.
This method overrides equilibrium::equilibrium_is_using_point.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::limit_path_to_boundary | ( | class (vmec_class), intent(in) | this, |
type (vertex), pointer | path | ||
) |
Limit an integration path to the boundary.
This method overrides equilibrium::equilibrium_limit_path_to_boundary.
The any point along the chord can be parameterized by
x_vec[t] = t*x_hat + x0_vec (1)
where
x_hat = (x1_vec - x0_vec)/h (2)
h = |x1_vec - x0_vec| = Sqrt[(x1_vec - x0_vec).(x1_vec - x0_vec)] (3)
The path along the cord t ranges from 0 to h.
The R, Phi,and Z components of x_vec become
r[t] = Sqrt[(t*(x1 - x0)/h + x0)^2 + (t*(y1 - y0)/h + y0)^2] (4)
ɸ[t] = ArcTan[t*(x1 - x0)/h + x0, t*(y1 - y0)/h + y0] (5)
z[t] = t*(z1 - z0)/h + z0 (6)
A chord intersects the boundary when
r[t] == r_vmec(1, u, ɸ[t]) (7)
z[t] == z_vmec(1, u, ɸ[t]) (8)
We can solve for t and u by finding the minimum of (9)
chi[t,u] = (r[t] - r_vmec(1, u, ɸ[t]))^2
There are two solutions to this function so we need to determine a good inital guess. For t use 0 for points closer to x0_vec and h for points closer to x1_vec. For use we assume one is close to the origin. For that point assume u = π. For farther points assume u = 0 or 2π.
To find the minimum we can use a gradient decent method. To do this we need the derivatives.
chi
[in] | this | A model_class instance. |
[in] | path | A chord path. |
procedure vmec_equilibrium::vmec_class::read_vac_file | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | index | Index of the changed current. |
[in] | eq_comm | MPI communicator pool for VMEC. |
procedure vmec_equilibrium::vmec_class::reset_state | ( | class (vmec_class), intent(inout) | this | ) |
Reset the internal state of the equilibrium.
Copies the saved VMEC state back to VMEC.
[in,out] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::restart | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | result_ncid | NetCDF file id of the result file. |
[in] | current_step | Step index to write variables to. |
procedure vmec_equilibrium::vmec_class::save_state | ( | class (vmec_class), intent(inout) | this | ) |
Save the internal state of the equilibrium.
Saves the VMEC state and the wout file.
[in,out] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::set_magnetic_cache_calc | ( | class (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.
[in,out] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::set_magnetic_cache_point | ( | class (vmec_class), intent(inout) | this, |
logical, intent(in) | use_axi, | ||
integer, intent(in) | state_flags | ||
) |
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.
[in,out] | this | A vmec_class instance. |
[in] | use_axi | Magnetics can subtract off axisymmetric components. |
[in] | state_flags | Bitwise flags to indicate which parts of the model changed. |
procedure vmec_equilibrium::vmec_class::set_magnetic_cache_response | ( | class (vmec_class), intent(inout) | this, |
type (magnetic_response_class), intent(in) | response_object, | ||
integer, intent(in) | state_flags | ||
) |
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.
[in,out] | this | A vmec_class instance. |
[in] | response_object | A magnetic_response::magnetic_response_class instance. |
[in] | state_flags | Bitwise flags to indicate which parts of the model changed. |
procedure vmec_equilibrium::vmec_class::set_namelist | ( | class (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.
[in] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::set_param | ( | class (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.
[in,out] | this | A vmec_class instance. |
[in] | id | ID of the parameter. |
[in] | i_index | The ith index of the parameter. |
[in] | j_index | The jth index of the parameter. |
[in] | value | The value of the parameter. |
[in] | eq_comm | MPI communicator for the child equilibrium processes. |
[in,out] | state_flags | Bitwise flags to indicate which parts of the model changed. |
procedure vmec_equilibrium::vmec_class::sync_child | ( | class (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.
[in,out] | this | A vmec_class instance. |
[in] | index | Reconstruction rank to sync. |
[in] | recon_comm | MPI communicator for the reconstruction processes. |
procedure vmec_equilibrium::vmec_class::sync_state | ( | class (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.
[in,out] | this | A vmec_class instance. |
[in] | recon_comm | MPI communicator for the reconstruction processes. |
type (vmec_class) function, pointer vmec_equilibrium::vmec_class::vmec_construct | ( | 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_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, | ||
logical, intent(in) | force_solve | ||
) |
Construct a vmec_class object.
Allocates memory and initializes a vmec_class object.
[in] | file_name | Filename of the vmec namelist input file. |
[in] | wout_file_name | Filename of the vmec wout input file. |
[in] | ne | pprofile_T for the electron density. |
[in] | te | pprofile_T for the electron temperature. |
[in] | ti | pprofile_T for the ion temperature. |
[in] | sxrem | pprofile_T for the soft x-ray emissivity. |
[in] | phi_offset | Initial phi offset of the plasma relative to the diagnostics in radians. |
[in] | z_offset | Initial Z offset of the plasma relative to the machine center. |
[in] | pol_rad_ratio | Ratio of poloidal grid to radial grid. Defines the gird sizes when computing magnetic diagnostics. |
[in] | iou | Input/output unit to log messages to. |
[in] | eq_comm | MPI communicator pool for VMEC. |
[in] | recon_comm | MPI communicator pool for reconstruction. |
[in,out] | state_flags | Bitwise flags to indicate which parts of the model changed. |
[in] | force_solve | If true, forces the equilbirum to resolve every time. |
[in] | force_solve | If true, forces the equilbirum to resolve every time. |
|
final |
Deconstruct a vmec_class object.
Deallocates memory and uninitializes a vmec_class object.
[in,out] | this | A vmec_class instance. |
procedure vmec_equilibrium::vmec_class::write | ( | class (vmec_class), intent(in) | this, |
integer, intent(in) | iou | ||
) |
Write out the equilibrium to an output file.
This method overrides equilibrium::equilibrium_write.
[in] | this | A vmec_class instance. |
[in] | iou | Input/output unit of the output file. |
procedure vmec_equilibrium::vmec_class::write_init_data | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | result_ncid | NetCDF file id of the result file. |
procedure vmec_equilibrium::vmec_class::write_input | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | current_step | Step number to append to input filename. |
procedure vmec_equilibrium::vmec_class::write_step_data | ( | class (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.
[in] | this | A vmec_class instance. |
[in] | result_ncid | NetCDF file id of the result file. |
[in] | current_step | Step index to write variables to. |