bnorm_ncsx_c09r00_free.pngThe BNORM code calculates the Fourier coefficients of the magnetic field normal to the VMEC surface.

It achieves this by utilizing the covariant magnetic field on the VMEC surface to construct a surface current. It creates input files for the NESCOIL program.


The purpose of this code is to calculate the Fourier components of outward normal components of the magnetic field. This information is passed to the NESCOIL routine. The code achieves this by first using the covariant magnetic field to construct a surface current density

This surface current is then used to construct the vector potential everywhere on VMEC surface. The calculation of the vector potential requires special treatment for singularities. At a given point x the vector potential due to all other points on the surface is calculated. Then a subroutine is called to handle contribution to the vector potential by the point x. The curl of this vector potential then provides the normal component of the magnetic field on the VMEC surface.


BNORM is a component of the STELLOPT suite of codes. It is contained within the '' file. Compilation of the STELLOPT suite is discussed on the STELLOPT Compilation Page.

Input Data Format

The BNORM code takes the VMEC 'wout' file as it's only input file.


To run BNORM with a given input file simply pass the name of the VMEC output file to BNORM like so (input file named input.test):
yourmachine:0005> ~/bin/xbnorm wout.test >& bnorm_log.test &
yourmachine:0005> ~/bin/xbrnom wout.test 0.3 >& bnorm_log.test &
Here we've redirected screen output (trapping error messages) to 'bnorm_log.test' and put the process in the background. The code takes one optional parameter, the coil separation in generalized units.

Output Data Format

The BNORM code outputs two files the 'bnorm.suffix' file and 'nescin.suffix' file (where suffix is the suffix of the VMEC 'wout' file). The first file contains the Fourier coefficients of the normal B-Field. The second file is the input file for the NESCOIL code.

The 'bnorm' file has a list of the m, n, and bnormal Fourier coefficients. For information on the 'nescin' file please see the NESCOIL page.


There are no specific routines to visualize the data in the 'bnorm' file. However, the matlabVMEC routines should allow a user to plot the values stored in the 'bnorm' file. The bnorm values are calculated from the covariant components of the magnetic field from VMEC. Thus, the Fourier coefficients should have the same parity (cosine) as the covariant components.


After running VMEC, simply call the code with the VMEC 'wout' file as it's input parameter as explained above. This should produce the 'bnorm' and 'nescin' files.