Supporting Material Code description: The first versions of the Versatile Electron Radiation Belt (VERB) code included only radial diffusion [e.g. Shprits et al., 2005; 2006a; Shprits et al., 2008] or performed 2D pitch angle and energy simulations [Shprits et al., 2006b]. The VERB-3D code models the diffusion in the space of adiabatic invariants by solving the modified 3D Fokker-Plank diffusion equation that incorporates energy diffusion, pitch-angle diffusion (pitch-angle is the angle between the magnetic field and particle’s velocity), mixed pitch-angle and energy diffusion, and radial diffusion for the drift and bounce-averaged particle phase space density, f. DL* L* L* 2 f* L , J ,J 1 f f p 2 D pp ( y, p ) D py ( y , p ) 2 p p y , L p y , L y p , L 1 f f T ( y ) y Dyy ( y, p ) Dyp ( y , p ) T ( y ) y y p , L y p , L p 2 f L* t L* (S1) f y,L , where y is the sine of the equatorial pitch angle, L* is defined as a radial distance in the equatorial plane from the center of the Earth to the field line of interest if the field is adiabatically changed to a symmetric dipole field, μ and J are the first and second adiabatic invariants, p is the particle’s momentum, <Dpp>, <Dpy>, and <Dyy> are the bounce- and MLTaveraged components of the diffusion tensor, T(y)=1.3802-0.3198 (y+y1/2) is the function that shows how bounce frequency depends on the pitch-angle, and is the characteristic loss timescale that is assumed to be infinite outside the loss cone and equal to a quarter bounce time inside the loss cone. VERB 3D was first presented in Shprits et al., [2008] and compared to observations by Shprits et al. [2009]. Subbotin and Shprits [2009] presented a detailed description and numerical verification of the two-grid numerical approach used in the VERB-3D code. Subbotin et al. [2010] presented an updated version of the code that included mixed diffusion terms. The long-term modeling results have a good agreement with observations for energetic and relativistic electrons (100 keV - ~1 MeV). The simulation performed with the range of L* from 1 to 5.5 up to 7 [Subbotin et al., 2010; 2011a; Kim et al., 2012; Drozdov et al., 2015]. The locations of the inner and outer edge of the outer radiation belt, and the location of peak flux in different models that include different scattering mechanisms were tested using the mean absolute percentage error during periods of different geomagnetic activity [Kim et al., 2012]. The VERB code was also used to model the dynamics of the specific event for ultra-relativistic electrons [Shprits et al., 2013]. The simulations have been performed in 1-D, 2-D and 3-D modes with and without mixed terms. The different types of waves may be included: lightning, VLF waves from anthropogenic transmitters, hiss, chorus, and EMIC. Advective transport has been tested using initial condition as a step function and sin function. The diffusion has been tested on the analytical solution of the bell curve. A dipole field approximation was used in this study. Only day-side chorus, night-side chorus, and hiss waves were used. Radial diffusion was parameterized following Brautigam and Albert [2000]. At each time step, convective transport and local diffusion are calculated at each MLT and radial distance, and radial diffusion is calculated at each MLT as a function of L. For future applications in a non-dipole field, the same approach can be used by converting DL*L* to DLL by using the Jacobian transformation as derived from the non-dipolar field geometry. In a future version of the code, when the magnetic field changes, PSD will be transported radially for each MLT on the computational grid in such a way that it will conserve all of the three adiabatic invariants V, K, and L (and therefore conserves μ, J, and L). This remapping will account for adiabatic changes. We use parallel implementation of the Alternating Direction Implicit (ADI) method with additional stability to calculate local diffusion at each MLT and radial distance [Shin and Kim, 2008]. This method has been compared with the Bulk method of Subbotin et al. [2010] and gives similar results when the time step is relatively small. Radial diffusion is calculated implicitly using tridiagonal numerical solutions [Press et al., 2002]. The VERB-4D code solves Eq. (2) as described in the main part of the manuscript. The grid in , L, V, K (25;29;61;60) is uniform in all variables except for V. The grid in V is uniform in logarithm to better resolve lower energies. The current version of the VERB-4D code uses a Volland-Stern electric field model with parameterization of Maynard and Chen [1975]. Convection is calculated using a 9th order upwind numerical scheme, with a Universal Limiter (the ULTIMATE method guarantees that monotonic profiles stay monotonic) and Distinguishing algorithm that preserves peaks [Leonard, 1991; Leonard and Niknafs, 1991]. The boundary conditions used in the code are shown in the table below. A periodic boundary in MLT ensures that flux values on both sides of midnight are the same and particles are neither lost nor generated at the boundary. The outer boundary of fluxes may be set up from statistical averages, as used in previous studies [e.g. Shprits et al., 2013], which was used to create Figure 3. We use exponential peace wise fits to the following table of energy and flux values following Subbotin et al. [2011b]. E, MeV = [10-5, 10-4, 10-3, 10-2, 10-1, 2 10-1, 1, 3, 10] Flux, #/cm/s/sr/keV= [3 109, 2 107, 9 106, 3 105, 1 104, 2 103, 70 , 3 10-3, 1 10-3] GOES observations were used for the boundary conditions for comparison with Van Allen Probes in Figure 4 of the main part of the paper. The outer radial boundary condition serves as a source or loss of particles. In this study the outer boundary condition is set up at L = 6.6, while at the inner boundary we assume that there is an absence of electrons at the top of the atmosphere. Zero PSD at the lower boundary for the radial diffusion operator does not affect the solution, as particles are lost before they reach low L-shells. The lower energy boundary for the energy diffusion is set up from the initial condition which is obtained by solving the steady state radial diffusion equation. The upper boundary condition is set to zero at multi-MeV energies. Since this boundary is far from the energies of interest in this study, this boundary does not create any additional loss. Table 1. Boundary Conditions for the VERB 4D simulations Lower boundary Range Upper boundary MLT, Φ Periodic 0 MLT < Φ < 24 MLT Periodic Radial Distance, R Zero PSD 1 RE < R < 6.6. RE GOES observations 10 keV < E < 10 MeV Zero PSD 0.3o < α < 89.7o Zero PSD gradient Energy, E Pitch-angle, α Upper boundary in energy is held constant at 0. Lower boundary is data driven, see text for details. Zero Diffusion coefficients are computed using the Full Diffusion Code (FDC) [Shprits and Ni, 2009], which accounts for Landau and multiple order resonances. Momentum diffusion is responsible for the acceleration of electrons, pitch-angle scattering produces a loss of electrons to the atmosphere, and radial diffusion redistributes relativistic electron phase space density by accelerating electrons during inward transport and decelerating them during outward transport. Equation S1 accounts for simultaneous acceleration by both Ultra Low Frequency (ULF) and Very Low Frequency (VLF) waves. The time of calculation depends on the number of time steps, the size of the grid, and the type of simulation. The presented simulations are much faster than a wall clock and currently take approximately 12 hours on 16 CPU for the entire simulated period presented in the manuscript. Execution time may significantly decrease if the code is run on a large computer cluster. The code can be run on a regular PC and can be compiled for Windows, MAC OS, and Linux. In addition, the code has been executed on the UCLA Hoffman II computer cluster. Long-term simulations may take several gigabytes of hard drive space, depending on the size of the grid and time resolution required. The code does provide the option to output files only at a desired interval to reduce the use of storage and to increase computation time. The simulation speed can be increased using the multi-thread calculation option that is included in the model. The parallelization can be implemented when solving convection, radial diffusion and local diffusion on each step. The code is documented using the Doxygen system, and version control is maintained by a dedicated GitLab server. The input errors are checked during code operation, while the output errors are displayed as a warning and can be tracked with a generated log file. The code is written on C++, and MATLAB scripts were written to support the code input/output and visualization. References: Brautigam, D. H. and J. M. Albert (2000), Radial diffusion analysis of outer radiation belt electrons during the October 9, 1990, magnetic storm, J. Geophys. Res., 105(A1), doi:10.1029/1999ja900344. Drozdov, A., Y. Y. Shprits, K. G. Orlova, A. C. Kellerman, D. A. Subbotin, D. N. Baker, H. E. Spence, and G. D. Reeves (2015), Energetic, relativistic, and ultrarelativistic electrons: Comparison of long-term VERB code simulations with Van Allen Probes measurements, J. Geophys. Res. Space Physics, 120, doi:10.1002/2014JA020637. Kim, K.-C., Y. Shprits, D. Subbotin, and B. Ni (2012), Relativistic radiation belt electron responses to GEM magnetic storms: Comparison of CRRES observations with 3-D VERB simulations, J. Geophys. Res. Space Phys, 117(A8), doi:10.1029/2011JA017460. Leonard B. P. and H. S. Nikanafs (1991), Sharp monotonic resolution of discontinuities without clipping of narrow extrema, Department of Mechanical Engineering, The University of Akron, Akron, OH 44325-3903, U.S.A. Leonard , B.P. (1991), The ULTIMATE conservative difference scheme applied to unsteady onedimensional advection, Computer Methods in Applied Mechanics and Engineering 88, 1, 17–74, doi:10.1016/0045-7825(91)90232-U. Maynard, N. C. and A. J. Chen (1975), Isolated cold plasma regions: Observations and their relation to possible production mechanisms, J. Geophys. Res., 80(7), 1009–1013, doi:10.1029/JA080i007p01009. Press, W. H., B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling (1992), Numerical Recipes in C, 2nd ed., Cambridge Univ. Press, Cambridge, U. K. Shin J. and S. S. Kim (2008), Alternating direction implicit method for two-dimensional Fokker-Planck equation of dense spherical stellar systems, Kyung Hee University, Dept. of Astronomy & Space Science, Yongin, Kyungki 446-701, Korea. Shprits, Y. Y. , R. M. Thorne, G. D. Reeves, and R. Friedel (2005), Radial diffusion modeling with empirical lifetimes: Comparison with CRRES observations, Annales Geophys., 23, 4, 1467-1471. Shprits, Y. Y. , R. M. Thorne, R. Friedel, G. D. Reeves, J. Fennell, D. N. Baker, and S. G. Kanekal (2006a), Outward radial diffusion driven by losses at magnetopause, J. Geophys. Res., 111, A11214, doi:10.1029/2006JA011657. Shprits, Y. Y., W. Li, and R. M. Thorne (2006b), Controlling effect of the pitch angle scattering rates near the edge of the loss cone on electron lifetimes, J. Geophys. Res., 111, A12206, doi:10.1029/2006JA011758. Shprits, Y. Y., D. Subbotin, B. Ni (2009), Evolution of electron fluxes in the outer radiation belt computed with the VERB code, J. Geophys. Res., 114, A11209, doi:10.1029/2008JA013784. Shprits, Y. Y., S. R. Elkington, N. P. Meredith, and D. A. Subbotin (2008), Review of modeling of losses and sources of relativistic electrons in the outer radiation belts: I. Radial transport, J. Atmos. Sol. Terr. Phys., 70, 14, 1679-1693, doi:10.1016/j.jastp.2008.06.008. Shprits, Y. Y., D. Subbotin, A. Y. Drozdov, M. E. Usanova, A. C. Kellerman, K. G. Orlova, D. N. Baker, D. L. Turner, and K.-C. Kim (2013), Unusual stable trapping of the ultrarelativistic electrons in the Van Allen radiation belts, Nature Physics, doi:10.1038/nphys2760. Subbotin, D. A. and Y. Y. Shprits (2009), Three-dimensional modeling of the radiation belts using the Versatile Electron Radiation Belt (VERB) code, Space Weather, 7, S10001, doi:10.1029/2008SW000452. Subbotin, D., Y. Y. Shprits, B. Ni (2010), Three-dimensional VERB radiation belt simulations including mixed diffusion, J. Geophys. Res., 115, A03205, doi:10.1029/2009JA015070. Subbotin, D. A., Y. Y. Shprits, B. Ni (2011a), Long-term radiation belt simulation with the VERB 3-D code: Comparison with CRRES observations, J. Geophys. Res., 116, A12210, doi:10.1029/2011JA017019. Subbotin, D. A., Y. Y. Shprits, M. Gkioulidou, L. R. Lyons, B. Ni, V. G. Merkin, F. R. Toffoletto, R. M. Thorne, R.B. Horne and M. K. Hudson (2011b), Simulation of the acceleration of relativistic electrons in the inner magnetosphere using RCM-VERB coupled codes, J. Geophys. Res., 116, A08211, doi:10.1029/2010JA016350.