Poloidal and toroidal potentials at given depths

These are fortran unformatted files which store time series of poloidal and toroidal coefficients of different fields (magnetic field, velocity and temperature) at specific depths.

In the following, time(j) is the time during the \(j^{th}\) time step, time(N) being the last step. real and imag denote real and imaginary parts, respectively, of spherical harmonic coefficients. Also, the following notations will be used for the coefficients of potentials (note that scalar fields like temperature do not have a poloidal/toroidal decomposition):

Field

Poloidal

Toroidal

Magnetic

b

aj

Velocity

w

z

Temperature

s

First and second derivatives are denoted with a differential notation. e.g: dw is the first derivative of w, while ddb is the second derivative of b.

B_coeff_cmb.TAG

Note

This file is only written when l_cmb_field=.true.

This file contains time series of spherical harmonic coefficients for the poloidal potential of the magnetic field at the outer boundary (CMB) up to a spherical harmonic degree given by l_max_cmb. The detailed calculations are done in the subroutine write_Bcmb. The contents of the file look as follows:

  • Header The file header consists of the information: l_max_cmb, minc and the number of data points n_data.

  • Data Each chunk of data after the header has the same pattern of time followed by a list of real and imaginary values of coefficients.

Thus, on a whole, the structure of the file looks like follows:

!------------
! Line 1
!------------

l_max_cmb, minc, n_data

!------------------------------
...

!------------
! Line j + 1
!------------

time(j),
real(b(l=1,m=0)), imag(b(l=1,m=0)),
real(b(l=2,m=0)), imag(b(l=2,m=0)),
...
real(b(l=l_max_cmb,m=l_max_cmb)), imag(b(l=l_max_cmb,m=l_max_cmb)),

...

!-------------
! Line N + 1
!-------------

time(N),
real(b(l=1,m=0)), imag(b(l=1,m=0)),
real(b(l=2,m=0)), imag(b(l=2,m=0)),
...
real(b(l=l_max_cmb,m=l_max_cmb)), imag(b(l=l_max_cmb,m=l_max_cmb))

This file can be read using MagicCoeffCmb with the following options:

>>> # To stack the files B_cmb_coeff.testc to B_cmb_coeff.testf
>>> cmb = MagicCoeffCmb(tag='test[c-f]')
>>> # print Gauss coefficient for (\ell=10, m=3)
>>> print(cmb.glm[:, cmb.idx[10, 3]])

Coefficients at desired radii

The following files [B|V|T]_coeff_r#.TAG save coefficients at specified depths and are written by the subroutine write_coeff_r. See the section on CMB and radial coefficients in the ouput control namelist for details of specifying depth, using n_r_step or n_r_array and desired maximum degree of output l_max_r. A separate file for each desired radius is written, numbered suitably as [B|V|T]_coeff_r1.TAG, [B|V|T]_coeff_r2.TAG etc.

B_coeff_r#.TAG

Note

This file is only written when l_r_field=.true..

This file contains output of time series of the spherical harmonic coefficients of the poloidal and toroidal magnetic field potentials and the first and second derivatives of the poloidal potential coefficients in the order b, db, aj and ddb. The output is for a specific radius, \(r\) up to degree l_max_r.

  • Header The file header consists of the information: l_max_r, minc, the number of data points n_data and the radius, r.

  • Data Each chunk of data after the header contains the time at which the coefficients are stored, followed by the real and imaginary parts of: the poloidal coefficient b, it’s first derivative db, the toroidal coefficient aj and the second derivative of the poloidal coefficient ddb.

The complete structure of the file looks like follows:

!------------
! Line 1
!------------

l_max_r, minc, n_data, r

!-------------------------------------------
...

!------------
! Line j + 1
!------------

time(j),
real(b(lm=1)), imag(b(lm=1)),
real(b(lm=2)), imag(b(lm=2)),
...
real(b(lm=lm_max)), imag(b(lm=lm_max)),
real(db(lm=1)), imag(db(lm=1)),
real(db(lm=2)), imag(db(lm=2)),
...
real(db(lm=lm_max)), imag(db(lm=lm_max)),
real(aj(lm=1)), imag(aj(lm=1)),
real(aj(lm=2)), imag(aj(lm=2)),
...
real(aj(lm=lm_max)), imag(aj(lm=lm_max)),
real(ddb(lm=1)), imag(ddb(lm=1)),
real(ddb(lm=1)), imag(ddb(lm=1)),
...
real(ddb(lm=lm_max)), imag(ddb(lm=lm_max)),

...

!------------
! Line N + 1
!------------

time(N),
real(b(lm=1)), imag(b(lm=1)),
real(b(lm=2)), imag(b(lm=2)),
...
real(b(lm=lm_max)), imag(b(lm=lm_max)),
real(db(lm=1)), imag(db(lm=1)),
real(db(lm=2)), imag(db(lm=2)),
...
real(db(lm=lm_max)), imag(db(lm=lm_max)),
real(aj(lm=1)), imag(aj(lm=1)),
real(aj(lm=2)), imag(aj(lm=2)),
...
real(aj(lm=lm_max)), imag(aj(lm=lm_max)),
real(ddb(lm=1)), imag(ddb(lm=1)),
real(ddb(lm=1)), imag(ddb(lm=1)),
...
real(ddb(lm=lm_max)), imag(ddb(lm=lm_max)),

This file can be read using MagicCoeffR with the following options:

>>> # To stack the files B_coeff_r3.test* from the working directory
>>> cr = MagicCoeffR(tag='test*', field='B', r=3)
>>> # print the time and the poloidal potential for (\ell=3, m=3)
>>> print(cr.time, cr.wlm[:, cr.idx[3, 3])

V_coeff_r#.TAG

Note

This file is only written when l_r_field=.true.

This file contains output of time series of the spherical harmonic coefficients of the poloidal and toroidal velocity field potentials and the first derivatives of the poloidal potential coefficients in the order w, dw, and z. The output is for a specific radius, \(r\) up to degree l_max_r.

  • Header The file header consists of the information: l_max_r, minc, the number of data points n_data and the radius, r.

  • Data Each chunk of data after the header contains the time at which the coefficients are stored, followed by the real and imaginary parts of: the poloidal coefficient w, it’s first derivative dw and the toroidal coefficient z.

The complete structure of the file looks like follows:

!------------
! Line 1
!------------

l_max_r, minc, n_data, r

!----------------------------------
...

!------------
! Line j + 1
!------------

time(j),
real(w(lm=1)), imag(w(lm=1)),
real(w(lm=2)), imag(w(lm=2)),
...
real(w(lm=lm_max)), imag(w(lm=lm_max)),
real(dw(lm=1)), imag(dw(lm=1)),
real(dw(lm=2)), imag(dw(lm=2)),
...
real(dw(lm=lm_max)), imag(dw(lm=lm_max)),
real(z(lm=1)), imag(z(lm=1)),
real(z(lm=2)), imag(z(lm=2)),
...
real(z(lm=lm_max)), imag(z(lm=lm_max)),

...

!--------------
! Line N + 1
!--------------

time(N),
real(w(lm=1)), imag(w(lm=1)),
real(w(lm=2)), imag(w(lm=2)),
...
real(w(lm=lm_max)), imag(w(lm=lm_max)),
real(dw(lm=1)), imag(dw(lm=1)),
real(dw(lm=2)), imag(dw(lm=2)),
...
real(dw(lm=lm_max)), imag(dw(lm=lm_max)),
real(z(lm=1)), imag(z(lm=1)),
real(z(lm=2)), imag(z(lm=2)),
...
real(z(lm=lm_max)), imag(z(lm=lm_max))

This file can be read using MagicCoeffR with the following options:

>>> # To stack the files V_coeff_r3.test* from the working directory
>>> cr = MagicCoeffR(tag='test*', field='V', r=3)
>>> # print the poloidal and toroidal potentials for (\ell=6, m=0)
>>> print(cr.wlm[:, cr.idx[6, 0]], cr.zlm[:, cr.idx[6, 0]])

T_coeff_r#.TAG

Note

This file is only written when l_r_fieldT=.true.

This file contains output of time series of the spherical harmonic coefficients of the temperature (or entropy) field. The output is for a specific radius, \(r\) up to degree l_max_r.

  • Header The file header consists of the information: l_max_r, minc, the number of data points n_data and the radius, r.

  • Data Each chunk of data after the header contains the time at which the coefficients are stored, followed by the real and imaginary parts of the coefficient s.

The complete structure of the file looks like follows:

!------------
! Line 1
!------------

l_max_r, minc, n_data, r

!---------------------------------

...

!------------
! Line j + 1
!------------

time(j),
real(s(lm=0)), imag(s(lm=0)),
real(s(lm=1)), imag(s(lm=1)),
real(s(lm=2)), imag(s(lm=2)),
...
real(s(lm=lm_max)), imag(s(lm=lm_max)),

!------------
! Line N + 1
!------------

time(N),
real(s(lm=0)), imag(s(lm=0)),
real(s(lm=1)), imag(s(lm=1)),
real(s(lm=2)), imag(s(lm=2)),
...
real(s(lm=lm_max)), imag(s(lm=lm_max)),