Stellarator-Tools
diagnostic_dot Module Reference

Module for opening and reading a diagnostic dot file. The file format for these files are documented in Magnetic Diagnostic Dot File. More...

Data Types

type  diagnostic_dot_coil
 A single coil. A coil set is structured as a singly linked list. More...
 

Functions/Subroutines

type(diagnostic_dot_coil) function, pointer diagnostic_dot_construct (filename)
 Construct the coil diagnostics. More...
 
subroutine diagnostic_dot_destruct (list)
 Deconstruct a diagnostic_dot_coil list. More...
 
subroutine diagnostic_dot_error (subject, line, line_number, caller)
 Report error. More...
 
character(len=diagnostic_dot_id_name) function diagnostic_dot_parse_name (iou, line, line_number, caller)
 Parse a name. More...
 
real(rprec) function diagnostic_dot_parse_real (iou, line, line_number, caller)
 Parse a real. More...
 
real(rprec) function, dimension(3) diagnostic_dot_parse_node (iou, line, line_number, status)
 Parse a node. More...
 
real(rprec) function, dimension(4) diagnostic_dot_parse_node4 (iou, line, line_number, status)
 Parse a node with sensitivity. More...
 
type(diagnostic_dot_coil) function, pointer diagnostic_dot_parse_s_rogowski (iou, line, line_number)
 Parse coils defined by filaments connected in series. More...
 
type(diagnostic_dot_coil) function, pointer diagnostic_dot_parse_filaments (iou, line, line_number, is_rogowski, units)
 Parse coils defined by filaments. More...
 
type(diagnostic_dot_coil) function, pointer diagnostic_dot_parse_probe (iou, line, line_number, is_tokamak, units)
 Parse a circular flux loop or magnetic probe. More...
 
type(diagnostic_dot_coil) function, pointer diagnostic_dot_parse_point (iou, line, line_number, units, is_cart)
 Parse a point field measurement. More...
 

Variables

integer, parameter diagnostic_dot_line_len = 200
 Maximum line length.
 
integer, parameter diagnostic_dot_id_name = 30
 Maximum id name.
 

Detailed Description

Module for opening and reading a diagnostic dot file. The file format for these files are documented in Magnetic Diagnostic Dot File.

Function/Subroutine Documentation

◆ diagnostic_dot_construct()

type (diagnostic_dot_coil) function, pointer diagnostic_dot::diagnostic_dot_construct ( character (len=*), intent(in)  filename)

Construct the coil diagnostics.

Allocates memory and initializes all the diagnostic coils by parseing the diagnostic dot file.

Parameters
[in]filenameFile name of the diagnostic dot file.
Returns
A pointer to the constructed coil.

◆ diagnostic_dot_destruct()

subroutine diagnostic_dot::diagnostic_dot_destruct ( type (diagnostic_dot_coil), pointer  list)

Deconstruct a diagnostic_dot_coil list.

Deallocates memory and uninitializes a diagnostic_dot_coil list.

Parameters
[in,out]thisA diagnostic_dot_coil list.

◆ diagnostic_dot_error()

subroutine diagnostic_dot::diagnostic_dot_error ( character (len=*), intent(in)  subject,
character (len=*), intent(in)  line,
integer, intent(in)  line_number,
character (len=*), intent(in)  caller 
)

Report error.

Errors are formatted the the subject, line, line_number and calling function. This subroutine does not return so there is no need for profiling information.

Parameters
[in]subjectDescription of what caused the error.
[in]lineThe current line of the file.
[in]line_numberThe current line number of the file.
[in]callerName of the calling function.

◆ diagnostic_dot_parse_filaments()

type (diagnostic_dot_coil) function, pointer diagnostic_dot::diagnostic_dot_parse_filaments ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
logical, intent(in)  is_rogowski,
character (len=*), intent(in)  units 
)

Parse coils defined by filaments.

Parses a diagnostic flux loop. Flux loops are defined by an id and an arbitrary number of nodes. Rogowski coils are defined by an id. Next is the number of turn and area. The guild center is defined as an arbitrary number of nodes.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[in]is_rogowskiParse the filaments as a rogowski coil.
[in]unitsUnits the coil measures in.
Returns
A constructed diagnostic_dot_coil instance.

◆ diagnostic_dot_parse_name()

character (len=diagnostic_dot_id_name) function diagnostic_dot::diagnostic_dot_parse_name ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
character (len=*), intent(in)  caller 
)

Parse a name.

Reads a name and from the diagnostic dot file.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[in]callerName of the calling function.
Returns
A name.

◆ diagnostic_dot_parse_node()

real (rprec) function, dimension(3) diagnostic_dot::diagnostic_dot_parse_node ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
integer, intent(out)  status 
)

Parse a node.

Reads a single node and from the diagnostic dot file. Node may be arbitrary in length. Leave error handling up to the caller.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[out]statusThe result of the read attempt.
Returns
A real.

◆ diagnostic_dot_parse_node4()

real (rprec) function, dimension(4) diagnostic_dot::diagnostic_dot_parse_node4 ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
integer, intent(out)  status 
)

Parse a node with sensitivity.

Reads a single node and from the diagnostic dot file. Node may be arbitrary in length. Leave error handling up to the caller. The node contains a sensisitivity value for the calibration as well.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[out]statusThe result of the read attempt.
Returns
A real.

◆ diagnostic_dot_parse_point()

type (diagnostic_dot_coil) function, pointer diagnostic_dot::diagnostic_dot_parse_point ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
character (len=*), intent(in)  units,
logical, intent(in)  is_cart 
)

Parse a point field measurement.

Parses point measurement probe. Point measurements are defined as a point and direction. The direction should be normalized. The phi_offset model is easiest to use when dealing with cyclindical coordinates. Convert all points to cyclindical coordinates for internal purposes.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[in]unitsUnits the coil measures in.
[in]is_cartTrue is point and vector defined in cylindrical coordinates.
Returns
A constructed diagnostic_dot_coil instance.

◆ diagnostic_dot_parse_probe()

type (diagnostic_dot_coil) function, pointer diagnostic_dot::diagnostic_dot_parse_probe ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
logical, intent(in)  is_tokamak,
character (len=*), intent(in)  units 
)

Parse a circular flux loop or magnetic probe.

Parses a diagnostic flux loop or magnetic probe. Flux loops and probes are defined by an id, the radius, the center and the normal vector. Since this has a fixed number of reads, the next line must be read before the function returns.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[in]is_tokamakParse the probe as a tokamak coil.
[in]unitsUnits the coil measures in.
Returns
A constructed diagnostic_dot_coil instance.

◆ diagnostic_dot_parse_real()

real (rprec) function diagnostic_dot::diagnostic_dot_parse_real ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number,
character (len=*), intent(in)  caller 
)

Parse a real.

Reads a single real and from the diagnostic dot file.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
[in]callerName of the calling function.
Returns
A real.

◆ diagnostic_dot_parse_s_rogowski()

type (diagnostic_dot_coil) function, pointer diagnostic_dot::diagnostic_dot_parse_s_rogowski ( integer  iou,
character (len=diagnostic_dot_line_len), intent(out)  line,
integer, intent(inout)  line_number 
)

Parse coils defined by filaments connected in series.

Parses a diagnostic rogowski defined as a collection of partial rogowskis connected in series.

Parameters
[in]iouFile handle of diagnostic dot file.
[out]lineOn exit contains the current line of the file.
[in,out]line_numberThe current line number of the file.
Returns
A constructed diagnostic_dot_coil instance.