mtrx Module



Functions

public function cartesian2spherical(x) result(r)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x(3)

Return Value real(kind=real64), (3)

public function dmrtx(sintheta, costheta, sinphi, cosphi, dtheta, dphi)

calculate martix from polar spheric to xyz coordinates

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: sintheta
real(kind=real64), intent(in) :: costheta
real(kind=real64), intent(in) :: sinphi
real(kind=real64), intent(in) :: cosphi
real(kind=real64), intent(in) :: dtheta
real(kind=real64), intent(in) :: dphi

Return Value real(kind=real64), (3,3)

public function dmxptr(gm, dgm)

calculate matrix for xyz' ellipsoid coordinate Kwon to spheric

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: gm
real(kind=real64), intent(in) :: dgm

Return Value real(kind=real64), (3,3)

public function mbtr(uax1, uax2, uax3) result(b2r)

calculate martix from magnetic to polar spheric coordinates

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: uax1(3)
real(kind=real64), intent(in) :: uax2(3)
real(kind=real64), intent(in) :: uax3(3)

Return Value real(kind=real64), (3,3)

public function mrtx(sintheta, costheta, sinphi, cosphi)

calculate martix from polar spheric to xyz coordinates

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: sintheta
real(kind=real64), intent(in) :: costheta
real(kind=real64), intent(in) :: sinphi
real(kind=real64), intent(in) :: cosphi

Return Value real(kind=real64), (3,3)

public function mxptr(gm) result(xptr)

calculate matrix for xyz' ellipsoid coordinate Kwon to spheric

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: gm

Return Value real(kind=real64), (3,3)

public function norm2(arr)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: arr(:)

Return Value real(kind=real64)

public function spherical2cartesian(r) result(x)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: r(3)

Return Value real(kind=real64), (3)

public function trilinear(phic, x) result(phi)

trilinear interpolation

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: phic(2,2,2)

the value of phi at the corner of cubic box of side 1

real(kind=real64), intent(in) :: x(3)

location inside the cube (0<=x<=1) or outside x<0 x>1

Return Value real(kind=real64)

interpolated phi

public function trilineardif(phic, x) result(dphi)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: phic(2,2,2)

phic the value of phi at the corner of cubic box of side 1

real(kind=real64), intent(in) :: x(3)

location inside the cube (0<=x<=1) or outside x<0 x>1

Return Value real(kind=real64), (3)

dphi(1)=dphi/dx, dphi(2)=dphi/dy, dphi(3)=dphi/dz