Stellarator-Tools
check_fields.f File Reference

Utility to check fields written from mgrid. More...

Functions/Subroutines

program check_fields
 Checks mgrid fields against analytic values.
 
subroutine check_int (ncid, name, value, error)
 check an expected int value. More...
 
subroutine check_real (ncid, name, value, tolarance, error)
 check an expected real value. More...
 
subroutine check_real_2d (ncid, name, value, tolarance, i, j, error)
 check an expected real value. More...
 
subroutine check_real_2d_all (ncid, name, value, tolarance, error)
 check an expected real value. More...
 
real(dp) function bz_axis (z)
 Compute the field at a Z away from the center. More...
 

Detailed Description

Utility to check fields written from mgrid.

Function/Subroutine Documentation

◆ bz_axis()

real (dp) function bz_axis ( real (dp), intent(in)  z)

Compute the field at a Z away from the center.

The magnetic field at a point R=0, Z is given by

B_z = mu0/2 R^2*I/(z^2 + R^2)^3/2

Parameters
[in]zNetCDF file reference. @erturns The B_z at point z.

◆ check_int()

subroutine check_int ( integer, intent(in)  ncid,
character (len=*), intent(in)  name,
integer, intent(in)  value,
integer, intent(inout)  error 
)

check an expected int value.

Checks an integer value for the expected result.

Parameters
[in]ncidNetCDF file reference.
[in]nameName of the
[in]valueExpected value.
[in,out]errorCurrent error condition.

◆ check_real()

subroutine check_real ( integer, intent(in)  ncid,
character (len=*), intent(in)  name,
real (dp), intent(in)  value,
real (dp), intent(in)  tolarance,
integer, intent(inout)  error 
)

check an expected real value.

Checks an real value for the expected result with in the tolarance.

Parameters
[in]ncidNetCDF file reference.
[in]nameName of the
[in]valueExpected value.
[in]tolaranceExpected value.
[in,out]errorCurrent error condition.

◆ check_real_2d()

subroutine check_real_2d ( integer, intent(in)  ncid,
character (len=*), intent(in)  name,
real (dp), intent(in)  value,
real (dp), intent(in)  tolarance,
integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(inout)  error 
)

check an expected real value.

Checks an real value for the expected result with in the tolarance.

Parameters
[in]ncidNetCDF file reference.
[in]nameName of the
[in]valueExpected value.
[in]tolaranceExpected value.
[in]iR index value.
[in]jZ index value.
[in,out]errorCurrent error condition.

◆ check_real_2d_all()

subroutine check_real_2d_all ( integer, intent(in)  ncid,
character (len=*), intent(in)  name,
real (dp), intent(in)  value,
real (dp), intent(in)  tolarance,
integer, intent(inout)  error 
)

check an expected real value.

Checks an real value for the expected result with in the tolarance at all index points.

Parameters
[in]ncidNetCDF file reference.
[in]nameName of the
[in]valueExpected value.
[in]tolaranceExpected value.
[in]iR index value.
[in]jZ index value.
[in,out]errorCurrent error condition.