trace Subroutine

public subroutine trace(x_init, y_init, phi_init, dphi, equi, x_end, y_end, phi_end, arclen, fluxexp, condition, stop_int, tracing_terminated, maxstep, istat)

Performs integration along field line. If condition is present, performs field line tracing while condition is true

Arguments

Type IntentOptional Attributes Name
real(kind=FP), intent(in) :: x_init

Start point (x-coordinate)

real(kind=FP), intent(in) :: y_init

Start point (y-coordinate)

real(kind=FP), intent(in) :: phi_init

Start point (phi-coordinate)

real(kind=FP), intent(in) :: dphi

Toroidal distance to be traced

class(equilibrium_t), intent(inout), target :: equi

Equilibrium defining the field line

real(kind=FP), intent(out), optional :: x_end

End point (x-coordinate)

real(kind=FP), intent(out), optional :: y_end

End point (y-coordinate)

real(kind=FP), intent(out), optional :: phi_end

Actual phi-coordinate end point of integration (relevant if condition is present)

real(kind=FP), intent(out), optional :: arclen

Length along field line

real(kind=FP), intent(out), optional :: fluxexp

Flux expansion, i.e. 1 / Btor integrated along fieldline

procedure(condition_interface), optional :: condition

Trace is performed until condition is true

logical, intent(in), optional :: stop_int

If = true, then the routine stops the integration once the condition is met. Otherwise, integration continues with integrand multiplied by zero. The default setting is false.

logical, intent(out), optional :: tracing_terminated

True, if given as an input, and the tracing was terminated due the fulfillment of the given condition. False by default.

real(kind=FP), intent(in), optional :: maxstep

Maximum stepsize for the integration

integer, intent(out), optional :: istat

PARALLAX error status of trace routine. If present, the trace routine will trigger a warning in case of error, and return an error code. If not present, the trace routine will trigger an error.