The SW pressure dependency was added to each erosion mechanism:
First some explanation of the variables used in the calculations:
- α: Particle, in the subindex is the variable evaluated for that particle.
- ref: As subindex, reference values
- refE: As subindex reference to Earth values
- rexo: Distance to the exobase
- Texo: Temperature exobase
- nexo: particle density for exobase
- mα: particle mass
- Mplanet: planet mass
- ρSW: Solar wind number density
- vSW: Solar wind velocity
- hα: Density scale factor. It is calculated as a function of the thermal distribution of the particles.
- rMP: Distance to magnetopause or IMB.
- Ωpc: Solid angle polar cap
- rcs: Distance magnetospheric cross section
- PSW: Solar wind dynamic pressure
- F10.7: Solar proxy for EUV radiation
- Jeans Escape: This mechanism affects neutral particles that are in the upper tail of the thermal velocity distribution. They are able to reach a velocity higher than the escape velocity of the planet, and being locate higher than the exobase they will not collide returning its energy to the system. It is more significant for lighter atoms like Hydrogen. It depends on the planet mass, temperature of the exobase of the planet, distance of the exobase, particle density at the exobase and particle mass. The theoretical formula is used in the code and it is constant respect to magnetic moment and SW pressure.
- Ion pick-up: This mechanism affects neutral particles that are high enough to first get ionized by the solar wind via: photoionization (βphoto), electron impact (βelec ) and charge exchange (βce).Then, they are captured by SW magnetic field and escape from the planet. This phenomena slows down the solar wind close to the planets and it is more relevant in planets with an induced magnetosphere. This rate depends of the density above the magnetopause or induced magnetosphere boundary r(θ), which is a function of the distance to the IMB and the scale height; and the particle flux of the SW. In the code, this is implemented by scaling it to the exobase and for magnetized planets we use a density proportion considering the measures of an unmagnetized one.
-
- Dissociative Recombination Photochemical escape: It includes: photodissociation, photodissociative ionization, electron impact dissociative ionization, and dissociative recombination. In Mars the last mechanism dominates and electrons from the solar wind recombine with Oxygen ions from Mars giving them the extra energy to reach the escape velocity. In the code this is implemented by a constant value from measurements. It is not affected by planetary magnetic moment or SW pressure.
- Cross Field ion loss: Particles are carried away by the magnetic field lines towards the plasmasphere, and then they eventually escape by plasmaspheric wind, blob, plumes or directly by ionospheric outflows. This is a highly variable phenomena. In the code, we escalate the variability in terms of the size of the solid angle of the polar caps, assuming that the particles that fill this region come exclusively from the cap.
- Sputtering: Ionospheric ions are accelerated by the solar wind, making them to reimpact the ionosphere, by the magnetic field of the planet and colliding with particles. The later receives enough energy to reach the escape velocity by the impact. Accordingly the rate is proportional to to the quantity of neutrals in the region of impact, and the amount pf ions picked up. The only ions affected are Oxygen ions, due to their larger gyroradius and their efficiency rate reimpacting their own neutrals.
- Cusp Escape: The cusp is the region in the cap that has open magnetic lines. This leads the SW plasma to enter to the cusp giving its kinetic energy to the neighbor particles. It has a clear limitation of the supply of neighbor particles that can be energized. In the code, the rate depends on the cross section, until it reaches the maximum rate of availability of ions. It will vary with the energy flux of the SW.
-
- Cap Escape: The plasma escapes in the polar cap, by the polar wind. The flux is small and steady compared to the cusps. The rate therefore escalates with the dimension of the cap.

The code is separated in several different files to organise constants and test the code easily. The main files are:
- variable_settings: Variables of the program in one unique place, so any change in this document will affect the entire program. Ex: Boltzmann constant, SW velocity, Hydrogen mass, etc.
- planetary_settings: Different parameters for each planet. Ex: escape rates, planet radius, planet mass, exobase density, exobase temperature, etc.
- escape_processes: Functions of the erosion mechanisms explained above.
- magnetic_model: All the calculations regarding to the magnetic model, e.g.: magnetic field dipole, magnetic field tilted dipole, tracing magnetic lines, cross section calculations, polar cap.
- Gunell18: This file uses previous functions and combines all the processes producing the desired plots, reproducing Gunell et al 2018.
- Gunnell_corrected: Same as previous file but with the correction of changing the SW density according to the planet and the formular of the sputtering.
- magnetopause_shape: Model of the magnetopause, according to Shue et al. 1998. Used for tilted magnetic field only.
- GeometricalFactors_dynPressure: Modifying geometrical factors with SW dynamic pressure.
- erosion_M1M2_dynpres_ascii: Model based on corrected Gunell that considers SW pressure variation, only velocity or only density. It generates ascii files with all the erosion rates.
- plot_erosion: it reads the generated files by erosion_M1M2_dynpres_ascii and creates the plots.
- erosion_dynpressFIX_ascii: Model based on corrected Gunell that considers SW pressure variation acconding to values given by Carolan et al 2019.
- plot_fixpres: ploting tool for the previous program.
Other files are used to test or to explore some constraints, but are not significant for the main code.




