Radial spectra rB[r|p]Spec.TAG

Note

This files are only written when l_rMagSpec=.true.

Those files contain the time-evolution of the poloidal (rBrSpec.TAG) and the toroidal (rBpSpec.TAG) magnetic energies for all radii including the inner core and for spherical harmonic degrees from \(\ell=1\) to \(\ell=6\). The calculations are done in the subroutines rBrSpec and rBpSpec, respectively. The outputs are stored as a fortran unformatted file which follows the following structure for rBrSpec.TAG:

!-------------
! Line N
!-------------

time[N],
(real(e_p(l=1,n_r),kind=outp),n_r=1,n_r_tot-1), ! Poloidal energy for \ell=0
(real(e_p(l=2,n_r),kind=outp),n_r=1,n_r_tot-1),
...
(real(e_p(l=6,n_r),kind=outp),n_r=1,n_r_tot-1)  ! Poloidal energy for \ell=6

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

time[N],
(real(e_p_ax(l=1,n_r),kind=outp),n_r=1,n_r_tot-1), ! Pol. energy for \ell=0, m=0
(real(e_p_ax(l=2,n_r),kind=outp),n_r=1,n_r_tot-1),
...
(real(e_p_ax(l=6,n_r),kind=outp),n_r=1,n_r_tot-1)

!-------------
! Line N+2
!-------------

time[N+1]
...

The rBpSpec.TAG files have exactly the same structure (just replacing the poloidal energy by its toroidal counterpart).

Warning

Be careful that in this file, n_r_tot is the total number of grid points (thus including the inner core).

Those files can be read using the python class MagicRSpec with the following options:

>>> # Read the files BrSpec.testa, BrSpec.testb and BrSpec.testc and stack them
>>> rsp = MagicRSpec(tag='test[a-c]', field='Br')
>>> # Print time and the time evolution of e_pol(\ell=4) at the 10th radial grid point
>>> print(rsp.time, rsp.e_pol[:, 10, 3])