There is an interesting popular article about magnetars in Quanta Magazine (see this). The article tells about the latest findings of Zhou and Vink and colleagues (see this) giving hints about the mechanism generating the huge magnetic fields of magnetars.
Neutron stars have surface magnetic field of order 10^{8} Tesla. Magnetars have surface magnetic field stronger by a factor 1000  of order 10^{11} Tesla. The mechanism giving rise to so strong magnetic fields at the surface of neutron star is poorly understood. Dynamo mechanism is the first option. The rapidly rotating currents at the surface of neutron star would generate the magnetic field. Second model assumes that some stars simply have strong magnetic fields and the strength of these magnetic fields can vary even by factor of order 1000. Magnetars and neutron stars would inherit these magnetic fields. The model should also explain why some stars should have so strong magnetic fields  what is the mechanism generating them. In Maxwellian world currents would be needed in any case and some kind of dynamo model suggests itself.
Dynamo model requires very rapid rotation with rotation frequency measured using millisecond as a natural unit. The fast rotation rate predicts that magnetars are produced in more energetic explosions than neutron stars. The empirical findings however support the view that there is no difference between supernovas producing magnetars and neutron stars. Therefore it would seem that the model assuming inherited magnetic fields is favored.
What says TGD? TGD view about magnetic fields differs from Maxwellian view and this allows to understand the huge magnetic without dynamo mechanism and could give a justification for the inheritance model.
 TGD predicts that magnetic field decomposes to topological field quanta  flux tubes and sheets  magnetic flux tubes carry quantized magnetic flux. Flux tubes can have as cross section either open disk (or disk with holes) or closed surface not possible in Minkowskian spacetime. The cross section can be sphere or sphere with handles.
 If the cross section is disk a current at its boundaries is needed to create the flux. If the cross section is closed surface, no current is needed and magnetic flux is stable against dissipation and flux tube itself is stable against pinching by flux conservation. These monopole fluxes could explain the fact that there are magnetic fields in cosmological scales not possible in Maxwellian theory since the currents should be random in cosmological scales.
This also solves the maintenance problem of the Earth's magnetic field. Its monopole part would stable and 2/5 of the entire magnetic field B_{E}=.5 Gauss from TGD based model of quantum biology involving endogenous magnetic field B_{end}=.2 Gauss identifiable in terms of monopole flux.
The model for the formation of astrophysical objects in various scales such as galaxies and stars and even planets and also for quantum biology relies crucially on monopole fluxes.
 The proposal (see this) is that stars correspond tangles formed to long monopole flux tube. Reconnection could of course give rise to closed short flux tubes and one would have kind of spaghetti.
The interior of Sun would contain flux tubes containing dark nuclei as nucleon sequences and one ends up to a modification of the model of nuclear fusion based on the excitation of dark nuclei (see darkcore). The model solvs a 10 year old anomaly of nuclear physics of solar core discovered by Asplund et al. From the TGD based model of "cold fusion" one obtains the estimate that the flux tube radius is of order electron Compton length, and thus about h_{eff}/h_{0}≈ m_{p}/m_{e}∼ 2000 times longer than proton Compton length. This has been assumed also in the TGD based model of stars (see this).
 The final states of stars could correspond to a volume filling spaghettis of flux tube analogous to blackhole. They would be characterized by the radius of the flux tube, which would naturally correspond to a padic length scale L(k)∝ 2^{k/2}: one could speak of various kinds of blackhole like entities (BHEs). There radius of the flux tube would be scaled up by the value of effective Planck constant h_{eff}=n× h_{0} so that one would have n∝ 2^{k/2} in good approximation.
 The padic length scales L(k), with k prime are good candidates for padic lengths scales. Most interesting candidates correspond to Mersenne primes and Gaussian Mersennes M_{G,k}= (1+i)^{k}1. Ordinary blackhole could correspond to a flux tube with radius of order Compton of proton corresponding to the padic length scale L(107).
For neutron star the first guess would be as the padic length scale L(127) of electron from the model of Sun.
L(113) assignable to nuclei and corresponding to Gaussian Mersenne is also a good candidate for magnetar's padic length scale. L(109) assigned to deuteron would correspond to an object very near to blackhole corresponding to L(107) (see this). Also the surface and interior of BHE would carry enormous monopole fluxes 32 times stronger than for magnetars.
The are just guesses but bringing in quantized monopole fluxes together with padic length scale hypothesis allows to develop a quantitative picture.
Consider first the flux quantization hypothesis more precisely.
 The observation that to the vision about monopole magnetic fields and hierarchy of Planck constants now derivable from adelic physics was that the irradiation of vertebrate brain by ELF frequencies induces physiological and behavioral effects which look like quantal. As if cyclotron transitions in endogenous magnetic field B_{end}= 2B_{E}/5≈ 0.2 Gauss would have been in question. The energies of photons involved are however ridiculously small and cannot have any effects. The proposal was that the effective value of Planck constant is quantized: h_{eff}=nh_{0} and can have very large values in living matter. The energies E=h_{eff}f of photons could thus be over thermal threshold and have effects. The matter with nonstandard value of h_{eff} would correspond to dark matter.
 One can make the picture more quantitative by considering the quantization of flux. The radius r of a flux tube carrying unit magnetic flux is known as magnetic length r^{2}= Φ_{0}/eπ B , where Φ_{0} corresponds to minimal quantized flux Φ_{0} =BS= Bπ r^{2}= n× hbar/eB for flux tube having disk D^{2} as cross section. If B_{end} is ordinary Maxwellian flux one obtains for B_{end}=0.2 Gauss r= 5.8 μm which is rather near to L(169)= 5× 10^{6} μm Cell membrane length scale L(151)= 10 nm corresponds to the scaling B_{end}→ 2^{18}B_{end}≈ 5 Tesla and 1 Tesla corresponds to the magnetic length r=2.23 × L(151).
One can argue that one must have quantization of flux as multiples of h_{eff}. The geometric interpretation is that ℏ_{eff}=nℏ_{0} corresponds to nsheeted structure (Galois covering) and the above quantization gives flux for a single sheet. The total flux as sum of these fluxes is indeed proportional to ℏ_{eff}.
 For monopole flux tubes disk D^{2} is replaced with sphere S^{2} and the area S=π× r^{2} in magnetic flux is replaced with S=4π r^{2}. This means scaling r→ r/2 for the magnetic length. The padic length scale becomes L(167), which corresponds to Gaussian Mersenne is indeed the scale that might have hoped whereas the ordinary flux quantization giving L(169) was a disappointment. This gives a solution to a longstanding puzzle why L(169) instead of L(167) and additional support for monopole flux tubes in living matter. As a matter of fact, there are four Gaussian Mersennes corresponding to k∈ {151,157,163,167} giving rise to 4 padic length scales in the range [10 nm, 2.5 μm] in the biologically most important length scale range. This is a number theoretic miracle.
It is useful to list some numbers for monopole flux by using the scaling ∝ 1/L^{2}(k)∝ 2^{k/2} to get a quantitative grasp about the situation for magnetars and other final states of stars.
 For monopole flux L(151) corresponds to 2^{16}B_{end}(k=167) ≈ 1.28 Tesla. For ordinary flux it corresponds to 2.56 Tesla. A good mnemonic is that Tesla corresponds to r= 1.13× L(151).
 For neutron star one has B∼ 10^{8} Tesla. For monopole flux this would correspond for ordinary flux magnetic length r≈ 1.13 pm roughly 2.8L_{e}, where L_{e}= .4 pm is electron Compton length. Note that the corresponding padic length scales is L(127)=2.5 pm ≈ 2.2r so that also interpretation in terms of L(125) can be considered. For nonmonopole flux one would have roughly r=2.26 pm. Neutron star would be formed when all flux tubes become dark flux tubes and perhaps form single connected volume filling structure.
 For magnetar one has magnetic field about B=10^{11} Tesla roughly 1000 times stronger than for neutron star. For monopole flux this would give r= 30 fm to be compared with the nuclear padic length scale L(113)= 20 fm. Could the padic length scale L(109)= 2L(107)= 5 fm correspond to a state rather near to blackhole? L(109) would would have 16 times stronger surface magnetic field B≈ .45 × 10^{12} Tesla than magnetar. For the TGD counterpart of ordinary blackhole having k=107 the surface magnetic field B≈ 1.8 × 10^{12} Tesla would be 32 times stronger than for magnetar.
All these estimates are order of magnitude estimates and padic lengths scale hypothesis only says something about scales.
See the chapter Cosmic string model for the formation of galaxies and stars or the article with the same title, or the shorter article Magnetars as a support for the notion of monopole flux tube.
