maggrid Program

Variables

Type Attributes Name Initial
real(kind=real64), dimension(0:N_THETA, 0:NS, 0:NS) :: ALP_TABLE

Vector of lower-triangular matrices, where each matrix is of the form

\begin{bmatrix}
P_0^0    & \cdot    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_1^0    & P_1^1    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_2^0    & P_2^1    & P_2^2    & \cdots & \cdot       & \cdot       & \cdot  \\
\vdots   & \vdots   & \vdots   & \ddots & \vdots      & \vdots      & \vdots \\
P_{38}^0 & P_{38}^1 & P_{38}^2 & \cdots & P_{38}^{38} & \cdot       & \cdot  \\
P_{39}^0 & P_{39}^1 & P_{39}^2 & \cdots & P_{39}^{38} & P_{39}^{39} & \cdot  \\
P_{40}^0 & P_{40}^1 & P_{40}^2 & \cdots & P_{40}^{38} & P_{40}^{39} & P_{40}^{40}
\end{bmatrix}

where each P_ℓ^m is a matrix evaluated at an x given by the vector's index, and each signifies a zero entry in the matrix. DALP_TABLE is the first derivative D2ALP_TABLE is the second derivative

real(kind=real64), dimension(0:N_THETA, 0:NS, 0:NS) :: D2ALP_TABLE

Vector of lower-triangular matrices, where each matrix is of the form

\begin{bmatrix}
P_0^0    & \cdot    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_1^0    & P_1^1    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_2^0    & P_2^1    & P_2^2    & \cdots & \cdot       & \cdot       & \cdot  \\
\vdots   & \vdots   & \vdots   & \ddots & \vdots      & \vdots      & \vdots \\
P_{38}^0 & P_{38}^1 & P_{38}^2 & \cdots & P_{38}^{38} & \cdot       & \cdot  \\
P_{39}^0 & P_{39}^1 & P_{39}^2 & \cdots & P_{39}^{38} & P_{39}^{39} & \cdot  \\
P_{40}^0 & P_{40}^1 & P_{40}^2 & \cdots & P_{40}^{38} & P_{40}^{39} & P_{40}^{40}
\end{bmatrix}

where each P_ℓ^m is a matrix evaluated at an x given by the vector's index, and each signifies a zero entry in the matrix. DALP_TABLE is the first derivative D2ALP_TABLE is the second derivative

real(kind=real64), dimension(0:N_THETA, 0:NS, 0:NS) :: DALP_TABLE

Vector of lower-triangular matrices, where each matrix is of the form

\begin{bmatrix}
P_0^0    & \cdot    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_1^0    & P_1^1    & \cdot    & \cdots & \cdot       & \cdot       & \cdot  \\
P_2^0    & P_2^1    & P_2^2    & \cdots & \cdot       & \cdot       & \cdot  \\
\vdots   & \vdots   & \vdots   & \ddots & \vdots      & \vdots      & \vdots \\
P_{38}^0 & P_{38}^1 & P_{38}^2 & \cdots & P_{38}^{38} & \cdot       & \cdot  \\
P_{39}^0 & P_{39}^1 & P_{39}^2 & \cdots & P_{39}^{38} & P_{39}^{39} & \cdot  \\
P_{40}^0 & P_{40}^1 & P_{40}^2 & \cdots & P_{40}^{38} & P_{40}^{39} & P_{40}^{40}
\end{bmatrix}

where each P_ℓ^m is a matrix evaluated at an x given by the vector's index, and each signifies a zero entry in the matrix. DALP_TABLE is the first derivative D2ALP_TABLE is the second derivative

integer, parameter :: NS = 40
real(kind=real64) :: b(3)
real(kind=real64) :: bgrid(0:N_R,0:N_THETA,0:N_PHI,3)
real(kind=real64) :: bmag
integer :: chunk
real(kind=real64) :: cvtu(3)
real(kind=real64) :: dbbds
real(kind=real64) :: g(0:NS,0:NS)
real(kind=real64) :: gbgrid(0:N_R,0:N_THETA,0:N_PHI,3)
real(kind=real64) :: gbmag(3)
real(kind=real64) :: h(0:NS,0:NS)
integer :: i
integer :: id
integer :: j
integer :: k
real(kind=real64) :: rvec(3)
real(kind=real64) :: srfctrtl(NS,NS)
real(kind=real64) :: starttime
real(kind=real64) :: stoptime

Functions

function plgndr(l, m, x)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: l
integer, intent(in) :: m
real(kind=real64), intent(in) :: x

Return Value real(kind=real64)


Subroutines

subroutine factorialratio(fac_table)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(out) :: fac_table(NS,NS)

subroutine init_aplm(alp_arr, dalp_arr, d2alp_arr)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(out) :: alp_arr(0:N_THETA,0:NS,0:NS)

populate alp, dalp, d2alp with the associated legendre polynomials, and its first and second derivatives respectively

real(kind=real64), intent(out) :: dalp_arr(0:N_THETA,0:NS,0:NS)
real(kind=real64), intent(out) :: d2alp_arr(0:N_THETA,0:NS,0:NS)

subroutine magfield(rvec, b, bmag, cvtu, gbmag, dbbds, srfctrtl, g, h)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: rvec(3)
real(kind=real64), intent(out) :: b(3)
real(kind=real64), intent(out) :: bmag
real(kind=real64), intent(out) :: cvtu(3)
real(kind=real64), intent(out) :: gbmag(3)
real(kind=real64), intent(out) :: dbbds
real(kind=real64), intent(in) :: srfctrtl(NS,NS)
real(kind=real64), intent(in) :: g(0:NS,0:NS)
real(kind=real64), intent(in) :: h(0:NS,0:NS)