GD
Geodynamics
Diogo Lourenço

Guest

Diogo is a postdoctoral researcher at the Department of Earth and Planetary Sciences at the University of California Davis, USA. He uses numerical modeling to investigate the dynamics and evolution of the Earth and other rocky planets, in particular their mantles' structure and surface tectonic regimes. Diogo is part of the GD blog team as an Editor. You can reach him via e-mail .

Thoughts on geological modelling: an analogue perspective

Thoughts on geological modelling: an analogue perspective

In geodynamics we study the dynamics of the Earth (and other planets). We ground our studies in as much data as possible, however we are constrained by the fact that pretty much all direct information we can collect from the interior of the Earth only shows its present-day state. The surface rock record gives us a glimpse into the past dynamics and evolution of our planet, but this record gets sparser as we go back in time. This is why it is common to use modelling in geodynamics to fill this gap of knowledge. There are different types of modelling, and this week João Duarte writes about the importance of analogue modelling. 

João Duarte. Researcher at Instituto Dom Luiz and Invited Professor at the Geology Department, Faculty of Sciences of the University of Lisbon. Adjunct Researcher at Monash University.

The first time I went to EGU, in 2004, I presented a poster with some new marine geology data and a few sets of analogue models. I was doing accretionary wedges in sandboxes. At the time, I was in the third year of my bachelor’s degree and I was completely overwhelmed by the magnitude of the conference. It was incredible to see the faces of all those scientists that I used to read articles from. But one thing impressed me the most. Earth Sciences were consolidating as a modern, theoretical based science. The efforts in trying to develop an integrated dynamic theory of plate tectonics as part of mantle convection were obvious. The new emergent numerical models looked incredible, with all those colours, complex rheologies and stunning visualization that allowed us to “see” stresses, temperature gradients and non-linear viscosities. I was amazed.

Analogue modelling was at a relative peak in 2004, however it was also anticipated by some that it would quickly disappear (and indeed several analogue labs have closed since). It was with this mindset, that I later did the experiments for my PhD, which I finished in 2012 (Duarte et al., 2011). But I was fortunate. My supervisors, Filipe Rosas and Pedro Terrinha, took me to state-of-art labs, namely Toronto and Montpellier (lead at the time by Sandy Cruden and Jacques Malavieille, respectively), and I started to develop a passion for this kind of models. When I moved to Monash for a post-doc position, in 2011, this turned out to be a great advantage. There, modelers such as Wouter Schellart, Louis Moresi, Fabio Capitanio, David Boutelier and Sandy Cruden (yes, I met Sandy again at Monash) were using analogue models to benchmark numerical models. Why? Because many times, even though numerical models produce spectacular results, they might not be physically consistent. And there is only one way to get rid of this, which is to make sure that whatever numerical code we are using can reproduce simple experiments that we can run in a lab. The classical example is the sinking of a negatively buoyant sphere in a viscous medium.

Sandbox analogue model of an accretionary wedge. Part of the same experiment as shown in the header figure. Here, a sliced section cut after wetting, is shown. University of Lisbon, 2009. Experiments published in Duarte et al. (2011).

That was what we were doing at Monash. I worked with Wouter Schellart in the development of subduction experiments with an overriding plate, which were advancing step by step in both analogue and numerical schemes (see e.g., Duarte et al., 2013 and Chen et al., 2015, 2016 for the analogue models, and Schellart and Moresi, 2013 for numerical equivalents). The tricky bit was, we wanted to have self-consistent dynamic experiments in which we were ascribing the forces (negative buoyancy of the slab, the viscosity of the upper mantle, etc) and let the kinematics (i.e. the velocities) to be an emergent phenomenon. So, no lateral push or active kinematic boundaries were applied to the plates. This is because we now recognize that in general, it is the slab pull at subduction zones that majorly drives the plates and not the other way around. Therefore, if we want to investigate the fundamental physics and dynamics of subduction zones we need to use self-consistent models (both analogue and numerical). In order to carry out these models, we had to develop a new rheology for the subduction interface, which is a complex problem, both in the analogue and the numerical approaches (Duarte et al. 2013, 2014, 2015). But this is another very long story that would lead to a publication by itself.

Analogue models of subduction with an overriding plate and an interplate rheology. Monash University, 2012. Adapted from Duarte et al. (2013)

But what is analogue modelling all about? Basically, analogue models are scaled models that we can develop in the laboratory using analogue materials (such as sand), and that at the scale that we are doing our models have similar physical properties to those of natural materials (such as brittle rocks). But, as it is widely known, under certain circumstances (at large time and space scales), rocks behave like fluids, and for that we use analogue fluids, such as silicone putties, glucose and honey. We can also use fluids to simulate the interaction between subduction zones and mantle plumes in a fluid reservoir (see below figures and links to videos of scaled experiments using three different fluids to study slab-plume interaction; Meriaux et al., 2015a, 2015b, 2016). These are generally called geodynamic analogue models.

End of a slab-plume experiment in the upper mantle (see below). The tank is partially filled with glucose. The slab (laying at the analogue 660 discontinuity) is made of silicone mixed with iron powder. The plume is made of a water solution of glucose dyed with a red colorant. And that’s me on the left. Monash University, 2014.

I usually consider two main branches of analogue models. The first, which is the one mostly used by geologists, was started by Sir James Hall (1761 – 1832), that squeezed layers of clay to reproduce the patterns of folded rocks that he had observed in nature. This method was later improved by King Hubbert (1937), who laid the ground for the development of the field by developing a theory of scaling of analogue models applied to geological processes.

The other branch is probably as old as humans. It began when we started to manipulate objects and using them to understand basic empirical laws, such as the one that objects always fall. When Galileo was using small spheres in inclined surfaces to extract the physical laws that describe the movement of bodies, from rocks to planets, he was in a certain way using analogue models. He understood that many laws are scale invariant. Still today, these techniques are widely used by physicist and engineers when understanding for example the aerodynamics of airplanes, the stability of bridges, the dynamics of rivers or the resistance of dams. They use scaled models that reproduce at suitable laboratory scales the objects and processes that they are investigating.

What we did at Monash, was a mixture of both approaches. Though, we were less interested in exactly reproducing nature from a purely geometric and kinematic point of view, but we were more interested in understanding the physics of the object we were investigating: subduction zones. Therefore, we had to guarantee that we were using the correct dynamical approach in order to be able to extract generic physical empirical laws, hoping that these laws would provide us some insight on the dynamics of natural subduction zones. These empirical laws could readily be incorporated in numerical models, which would then help exploring more efficiently the space of the controlling parameters in the system.

Slab-Plume interaction in the upper mantle. Experiments published in Meriaux et al. (2015a, 2015b).

I want to finish with a question that I believe concerns all of us: are there still advantages in using analogue models? Yes, I believe so! One of the most important advantages is that analogue models are always three-dimensional and high-resolution. Furthermore, they allow a good tracking of the strain and to understand how it occurs in discontinuous mediums, for example when investigating the localization of deformation or the propagation of cracks. Numerical schemes still struggle with these problems. It is very difficult to have an efficient code that can deal simultaneously with very high resolution and large-scale three-dimensional problems, as it is required to investigate the process of subduction. Nevertheless, numerical models are of great help when it comes to track stresses, and model complex rheologies and temperature gradients. To sum up: nowadays, we recognize that certain problems can only be tackled using self-consistent dynamic models that model the whole system in three-dimensions, capturing different scales. For this, the combination of analogue and numerical models is still one of the most powerful tools we have. An interesting example of a field in which a combined approach is being used is the fascinating investigations on the seismic cycle (for example, see here).

Links to videos:

VIDEO 1: https://www.youtube.com/watch?v=U1TXC2XPbFA&feature=youtu.be
(Subduction with an overriding plate and an interplate rheology. Duarte et al., 2013)

VIDEO 2: https://www.youtube.com/watch?v=n5P2TzS6h_0&feature=youtu.be
(Slab-plume interaction at mantle scale. Side-view of the experiment on the top, and top-view of the experiment on the bottom. Meriaux et al., 2016)
References:

Chen, Z., Schellart, W.P., Strak, V., Duarte, J.C., 2016. Does subduction-induced mantle flow drive backarc extension? Earth and Planetary Science Letters 441, 200-210. https://doi.org/10.1016/j.epsl.2016.02.027

Chen, Z., Schellart, W.P., Duarte, J.C., 2015. Overriding plate deformation and variability of forearc deformation during subduction: Insight from geodynamic models and application to the Calabria subduction zone. Geochemistry, Geophysics, Geosystems 16, 3697–3715. DOI: 10.1002/2015GC005958

Duarte, J.C., Schellart, W.P., Cruden, A.R., 2015. How weak is the subduction zone interface? Geophysical Research Letters 41, 1-10. DOI: 10.1002/2014GL062876

Duarte, J.C., Schellart, W.P., Cruden, A.R., 2014. Rheology of petrolatum – paraffin oil mixtures: applications to analogue modelling of geological processes. Journal of Structural Geology 63, 1-11. https://doi.org/10.1016/j.jsg.2014.02.004

Duarte, J.C., Schellart, W.P., Cruden, A.R., 2013. Three-dimensional dynamic laboratory models of subduction with an overriding plate and variable interplate rheology. Geophysical Journal International 195, 47-66. https://doi.org/10.1093/gji/ggt257

Duarte, J.C., F.M. Rosas P., Terrinha, M-A Gutscher, J. Malavieille, Sónia Silva, L. Matias, 2011. Thrust–wrench interference tectonics in the Gulf of Cadiz (Africa–Iberia plate boundary in the North-East Atlantic): Insights from analog models. Marine Geology 289, 135–149. https://doi.org/10.1016/j.margeo.2011.09.014

Hubbert, M.K., 1937. Theory of scale models as applied to the study of geologic structures. GSA Bulletin 48, 1459-1520. https://doi.org/10.1130/GSAB-48-1459

Meriaux, C., Meriaux, A-S., Schellart, W.P., Duarte, J.C., Duarte, S.S., Chen, Z., 2016. Mantle plumes in the vicinity of subduction zones. Earth and Planetary Science Letters 454, 166-177. https://doi.org/10.1016/j.epsl.2016.09.001

Mériaux, C.A., Duarte, J.C., Schellart, W.P., Mériaux, A-S., 2015. A two-way interaction between the Hainan plume and the Manila subduction zone. Geophysical Research Letters 42, 5796–5802. DOI: 10.1002/2015GL064313

Meriaux, C.A., Duarte, J.C., Duarte, S., Chen, Z., Rosas, F.M., Mata, J., Schellart, W.P., and Terrinha, P. 2015. Capture of the Canary mantle plume material by the Gibraltar arc mantle wedge during slab rollback. Geophysical Journal International 201, 1717-1721. https://doi.org/10.1093/gji/ggv120

Schellart, W.P., Moresi, L., 2013. A new driving mechanism for backarc extension and backarc shortening through slab sinking induced toroidal and poloidal mantle flow: Results from dynamic subduction models with an overriding plate. Journal of Geophysical Research: Solid Earth 118, 3221-3248. https://doi.org/10.1002/jgrb.50173

Oceans on Mars: the geodynamic record

Oceans on Mars: the geodynamic record

Apart from our own planet Earth, there are a lot of Peculiar Planets out there! In this series we take a look at a planetary body or system worthy of our geodynamic attention, and this week we are back to our own solar system, more precisely to our neighbour Mars. In this post, Robert Citron, PhD student at the University of California, Berkeley, writes about the links between oceans, shorelines, and volcanism on Mars. A David Bowie approved blog post!

Robert Citron

Whether Mars was warm enough in its early history to support large oceans remains controversial. Although today Mars is extremely cold and dry, several lines of geological evidence suggest early Mars was periodically warm and wet. Evidence for ancient liquid water includes river channels, deltas and alluvial fans, lakes, and even shorelines of an extensive ocean.

Such features are carved into Mars’ ancient crust, which contains a remarkable geologic record spanning from over 4 billion years ago to present. How and where fluvial erosion takes place is highly dependent on topography. However, Mars is a dynamic planet and the topography observed today does not necessarily represent the planetary surface billions of years ago. Geological markers that seem misaligned today, such as river flow directions and sea levels, may be more consistent with ancient topography. Geodynamic models of how the planet has changed shape over time can therefore be used to test and constrain evidence of water on early Mars.

Shorelines are one example where geodynamic models have helped interpret the geological record. Perhaps the most compelling evidence for ancient Martian oceans are the hypothetical palaeo-shorelines that border Mars’ northern lowland basin. However, the shorelines fail to follow an equipotential surface, or contours of constant elevation, which would be expected if they formed via a standing body of liquid water. One explanation is that the shorelines used to follow an equipotential surface, but subsequent changes to the planet’s shape warped them to their present-day elevations, which vary by up to several kilometers.

Two geodynamic processes that likely changed the global shape of Mars are surface loading and true polar wander. True polar wander occurs when a planet reorients relative to its spin axis, which reshapes the planet because it changes the location of the equatorial bulge produced by the planet’s rotation. Large scale true polar wander on Mars was examined by Perron et al. (2007), which found that it could have warped past shoreline profiles to their present-day topographic profiles.

Another possibility is that Martian shoreline markers were deflected by flexure associated with surface loads. The emplacement or removal of material on a planet’s surface can cause flexure and displacement of nearby crust. This is observed on Earth, where melting of glaciers has unburdened underlying crust, allowing for rebound and displacement of past shoreline markers. Similar processes could be at work on Mars, but on a global scale.

Mars topography: The massive Tharsis volcanic province (red) is situated on the boundary between the southern highlands (orange) and northern lowlands (blue). The lowlands may have been covered by one or more ancient oceans, and are bordered by palaeo-shorelines. Two of the most prominent shorelines are the older Arabia shoreline (dashed line) and younger Deuteronilus shoreline (solid line). Image constructed by R. Citron using MOLA data. Shoreline data from Ivanov et al. (2017) and Perron et al. (2007).

The largest load on Mars is the Tharsis rise, a volcanic province that dominates the topography and gravity of the planet. Tharsis was built by volcanic activity over hundreds of millions to billions of years. Its emplacement changed Mars’ shape on a global scale; in addition to the Tharsis rise, there is a circum-Tharsis depression and an antipodal bulge.

In recent work (Citron et al. 2018), we found that the present-day variations in shoreline elevations can be explained by flexure from Tharsis and its associated loading. Of the two most prominent Mars shorelines, the older (~ 4 billion years old) Arabia shoreline corresponds to pre-Tharsis topography, deformed by almost all of the flexure associated with Tharsis. The younger (~ 3.6 billion years old) Deuteronilus shoreline corresponds to late-Tharsis topography, requiring only ~17% of Tharsis loading to explain its variations in elevation. This suggests that the Arabia shoreline formed before or during the early stages of Tharsis, and the Deuteronilus shoreline formed during the late stages of Tharsis growth. The match between the present-day shoreline markers and ancient equipotential surfaces supports the hypothesis that the markers do indicate shorelines formed by an ancient ocean.

The timing of ancient Martian oceans is consistent with recent work by Bouley et al. (2016), which found that the Mars valley networks (ancient river channels) also better fit Mars’ pre-Tharsis topography. In the topography of Mars prior to Tharsis, the flow direction of the channels are more consistent with the topographic gradient, and the channels occur at latitudes and elevations where climate models predict water ice (resulting in ice melt) to form.

The timing of the shorelines and valley networks relative to Tharsis volcanism suggests a close link between the stability of water on Mars and volcanic activity. Atmospheric models predict a cold and icy early Mars, however it is possible that oceans may be more sustainable during periods of heightened volcanism. Tharsis activity has also been associated with outflow channels indicative of catastrophic flooding that may have inundated the northern plains with water. Further examination of the link between Tharsis volcanism and oceans could increase our understanding of early Mars habitability.

Further reading:

Bouley, S., Baratoux, D., Matsuyama, I., Forget, F., Séjourné, A., Turbet, M., & Costard, F. (2016). Late Tharsis formation and implications for early Mars. Nature531(7594), 344.

Citron, R. I., Manga, M., & Hemingway, D. J. (2018). Timing of oceans on Mars from shoreline deformation. Nature555(7698), 643.

Ivanov, M. A., Erkeling, G., Hiesinger, H., Bernhardt, H., & Reiss, D. (2017). Topography of the Deuteronilus contact on Mars: Evidence for an ancient water/mud ocean and long-wavelength topographic readjustments. Planetary and Space Science144, 49-70.

Matsuyama, I., & Manga, M. (2010). Mars without the equilibrium rotational figure, Tharsis, and the remnant rotational figure. Journal of Geophysical Research: Planets115(E12).

Perron, J. T., Mitrovica, J. X., Manga, M., Matsuyama, I., & Richards, M. A. (2007). Evidence for an ancient martian ocean in the topography of deformed shorelines. Nature447(7146), 840.

Ramirez, R. M., & Craddock, R. A. (2018). The geological and climatological case for a warmer and wetter early Mars. Nature Geoscience11(4), 230.

It’s just coding … – Scientific software development in geodynamics

The Spaghetti code challenge. Source: Wikimedia Commons, Plamen petkov 92, CC-BY-SA 4.0

As big software packages become a commonplace in geodynamics, which skills should a geodynamicist aim at having in software development? Which techniques should be considered a minimum standard for our software? This week Rene Gassmöller, project scientist at UC Davis, Computational Infrastructure for Geodynamics, shares his insights on the best practices to make scientific software better, and how we can work to translate these into our field. Enjoy the read!

Rene  Gassmöller

Nowadays we often equate geodynamics with computational geodynamics. While there are still interesting analytical studies to be made, and important data to be gathered, it is increasingly common that PhD students in geodynamics are expected to work exclusively on data interpretation, computational models, and in particular the accompanying development of geodynamic software packages. But as it turns out, letting an unprepared PhD student (or unprepared postdoc or faculty member for that matter) work on a big software package is a near guarantee for the project to develop into a sizeable bowl of spaghetti code (see figure above for a representative illustration).

Note, that I intentionally write about ‘software packages’ instead of ‘code’, as many of these packages — think of Gplates (Müller et al, 2018), ObsPy (Krischer et al, 2015), FeniCS (Alneas et al, 2015) , or the project I am working on, ASPECT (Heister et al, 2017) — have necessarily left the stage of a quickly written ‘code’ for a single purpose, and developed into multi-purpose tools with a complex internal structure. With this growing complexity, the activity of scientific ‘coding’ evolved into ‘developing software’. However, when students enter the field of geophysics, they are rarely prepared for this challenge. Hannay et al. (2009) report that while researchers typically spend 30% or more of their time developing software, 90% of them are primarily self-taught, and only few of them received formal training for writing software, including tests and documentation. Nobody told them: Programming and engineering software are two very different things. Many undergraduate and graduate geoscience curricula today include classes about the basics of programming (e.g. in Python, R, or Matlab), and also discuss numerical and computational methods. While these concepts are crucial for solving scientific problems, they are not sufficient for managing the complexity of growing scientific software. Writing a 50-line script is a very different task from contributing to an inherited and poorly documented PhD project of 1,000 lines, which again is very different from managing a multi-developer project of 100,000 lines of source code. A recurring theme is that these differences are only discovered when damage has already been done. Hannay et al. (2009) note:

Codes often start out small and only grow large with time as the software proves its usefulness in scientific investigations. The demand for proper software engineering is therefore seldom visible until it is “too late”.

But what are these ‘proper software engineering techniques’?

Best practices vs. Best techniques in practice

In a previous blog post, Krister Karlsen already discussed the value of version control systems for reproducibility of computational research. It is needless to say that these systems (originally also termed source code control systems, e.g. Rochkind, 1975) are just as valuable for scientific software development as they are for reproducibility of results. However, they are not sufficient for developing reliable scientific software. Wilson et al. (2014) summarize a list of 8 best practices that make scientific software better:

  1. Write programs for people, not computers.
    • A program should not require its readers to hold more than a handful of facts in memory at once.
    • Make names consistent, distinctive, and meaningful.
    • Make code style and formatting consistent.
  2. Let the computer do the work.
    • Make the computer repeat tasks.
    • Save recent commands in a file for re-use.
    • Use a build tool to automate workflows.
  3. Make incremental changes.
    • Work in small steps with frequent feedback and course correction.
    • Use a version control system.
    • Put everything that has been created manually in version control.
  4. Don’t repeat yourself (or others).
    • Every piece of data must have a single authoritative representation in the system.
    • Modularize code rather than copying and pasting.
    • Re-use code instead of rewriting it.
  5. Plan for mistakes.
    • Add assertions to programs to check their operation.
    • Use an off-the-shelf unit testing library.
    • Turn bugs into test cases.
    • Use a symbolic debugger.
  6. Optimize software only after it works correctly.
    • Use a profiler to identify bottlenecks.
    • Write code in the highest-level language possible.
  7. Document design and purpose, not mechanics.
    • Document interfaces and reasons, not implementations.
    • Refactor code in preference to explaining how it works.
    • Embed the documentation for a piece of software in that software.
  8. Collaborate.
    • Use pre-merge code reviews.
    • Use pair programming when bringing someone new up to speed and when tackling particularly tricky problems.
    • Use an issue tracking tool.

There is a lot to be said about each of these techniques, but that would be beyond the scope of this blog post (please see Wilson et al.’s excellent and concise paper if you are interested). What I would like to emphasize here is that these techniques are often requested, but rarely taught. What are peer code reviews? How do I gradually introduce tests and refactor a legacy code? Who knows if it is better to use unit testing, integration testing, regression testing, or benchmarking for a given change of the code? And do I really need to know the difference? After all, a common argument against using software development techniques in applied computational science disciplines boils down to:

  • We can not expect these software development techniques from geodynamicists.
  • We should not employ the same best practices as Google, Amazon, Apple, because they do not apply to us.
  • There is no time to learn/apply these techniques, because we have to conduct our research, write our publications, secure our funding.

While from a philosophical standpoint it is easy to dismiss these statements as not adhering to best practices, and possibly impacting the reliability of the created software, it is harder to tackle them from a practical perspective. Of course it is true that implementing a sophisticated testing infrastructure for a one-line shell command is neither useful nor necessary. Maybe the same is true for a 20 line script that is written to specifically convert one dataset into another, but in this case putting it under version control would already be useful in order to record your process and apply it to other datasets. And from my own experience it is extraordinarily easy to miss the threshold at 40-100 lines at which writing documentation and implementing first testing procedures become crucial to avoid cursing yourself in the future for not explaining what you did and why you did it. So why are there detailed instructions for lab notes and experimental procedures, but not for geodynamic software design and reliability of scientific software? Geoscience, chemistry, and physics have established multi-semester lab and field exercises, to drill students towards careful scientific analysis. Should we develop comparable exercises for scientific software development (beyond numerical methods and basic programming)? How would an equivalent of these classes look like for computational methods? And is there a point where the skills of software development and geodynamics research grow so far apart we have to consider them separately and establish a unique career track, such as the Research Software Engineer that is becoming more popular in the UK?

In my personal opinion we have made great progress over the last years in defining best practices for scientific software (see e.g. https://software.ac.uk/resources/online-sustainability-evaluation, or https://geodynamics.org/cig/dev/best-practices/). However, it is still considered a personal task to acquire the necessary skills and to find the correct balance between careful engineering and overdesigning software. Establishing courses and resources that discuss these questions could greatly benefit our community, and allow for a more reliable scientific progress in geodynamics.

Collaborative software development – The overlooked social challenge

The contributor funnel. The atmosphere and usability of a project influence how many users will join a project, how long they stick around, and if they will take responsibility for the project by contributing to it or eventually become maintainers. Credit: https://opensource.guide/

Now that we covered every topic a scientist can learn about scientific software development in a single blog post, what can go wrong when you put several of them together to work on a software package? Needless to say, a lot. No matter if your software project is a closed-source, intra-workgroup project, or an open-source project with users and developers spread over different continents, things are going to get exponentially more complicated the more people work on your software. Not only does discussion and interaction take more time, there will also be conflicting ideas about computational methods, software design, or implementation. Using state-of-the-art tools like collaborative development platforms (Github, Gitlab, Bitbucket, pick your favourite) and modern discussion channels like chats (Slack, Gitter), forums (Discourse), or video conferences (Skype, Hangouts, Zoom) can alleviate a part of the communication barriers. But ultimately, the social challenges remain. How does a project decide between competing goals of flexibility and performance? Who is going to enforce a code of conduct in a project to keep the development environment open and friendly? Does a project create a welcoming atmosphere that invites new contributions, or does it repel newcomers by unrealistic standards and inappropriate behavior? How should maintainers of scientific software deal with unrealistic feature requests by users? How to encourage new users to become contributors and take responsibility for the software they benefit from? How to compromise or combine providing improvements to the upstream project versus publishing them as scientific papers? How to provide credit to contributors?

In my opinion it is unfortunate that these questions about scientific software projects are even less discussed than the (now increasing) awareness of reproducibility. On the bright side, there is already a trove of experiences in the open-source community. The same questions about attribution and credit, collaboration and community-management, and correctness and security have been discussed over the past decades in open-source projects all over the world, and nowadays a good number of resources provide guidance, such as https://opensource.guide/, or the excellent book  ‘How to Run a Successful Free Software Project’ (Fogel, 2017). Not all of it can be transferred to science, but we would waste time and energy to dismiss these experiences and instead repeat their mistakes.

Let us talk about engineering scientific software

I realize that in this blog post I opened more questions than I answered. Maybe that is because I am not aware of the answers that are already out there. But maybe it is also caused by a lack of attention that these questions receive. I feel that there are no established guidelines for which software development skills a geodynamicist should have, and what techniques should be considered a minimum standard for our software. If that is the case, I would invite you to have a discussion about it. Maybe we can agree on a set of guidelines and improve the state of software in geodynamics. But at the very least I hope I inspired some thought about the topic, and provided some resources to learn more about a discussion that will likely grow more important over the coming years.

References:

M. S. Alnaes, J. Blechta, J. Hake, A. Johansson, B. Kehlet, A. Logg, C. Richardson, J. Ring, M. E. Rognes and G. N. Wells. The FEniCS Project Version 1.5. Archive of Numerical Software, vol. 3, 2015, http://dx.doi.org/10.11588/ans.2015.100.20553.

Fogel, K. (2017). Producing Open Source Software: How to Run a Successful Free Software Project. O'Reilly Media, 2nd edition.

Hannay, J. E., MacLeod, C., Singer, J., Langtangen, H. P., Pfahl, D., & Wilson, G. (2009). How do scientists develop and use scientific software?. In Proceedings of the 2009 ICSE workshop on Software Engineering for Computational Science and Engineering (pp. 1-8). IEEE Computer Society.

Heister, T., Dannberg, J., Gassmöller, R., & Bangerth, W. (2017). High accuracy mantle convection simulation through modern numerical methods–II: realistic models and problems. Geophysical Journal International, 210(2), 833-851.

Krischer, L., Megies, T., Barsch, R., Beyreuther, M., Lecocq, T., Caudron, C., & Wassermann, J. (2015). ObsPy: A bridge for seismology into the scientific Python ecosystem. Computational Science & Discovery, 8(1), 014003.

Müller, R.D., Cannon, J., Qin, X., Watson, R.J., Gurnis, M., Williams, S., Pfaffelmoser, T., Seton, M., Russell, S.H. & Zahirovic, S. (2018). GPlates–Building a Virtual Earth Through Deep Time. Geochemistry, Geophysics, Geosystems.

Open Source Guides. https://opensource.guide/. Oct, 2018.

Rochkind, M. J. (1975). The source code control system. IEEE transactions on Software Engineering, (4), 364-370.

Wilson, G., Aruliah, D.A., Brown, C.T., Hong, N.P.C., Davis, M., Guy, R.T., Haddock, S.H., Huff, K.D., Mitchell, I.M., Plumbley, M.D. and Waugh, B. (2014). Best practices for scientific computing. PLoS biology, 12(1), e1001745.

Magma oceans

Magma oceans

The Geodynamics 101 series serves to showcase the diversity of research topics and methods in the geodynamics community in an understandable manner. We welcome all researchers – PhD students to professors – to introduce their area of expertise in a lighthearted, entertaining manner and touch upon some of the outstanding questions and problems related to their fields. For our latest ‘Geodynamics 101’ post we will talk about magma oceans!

When you think about the Earth a long, long time ago, in its late stages of formation, which picture comes to your mind? A lot of volcanoes erupting? Lava running from cracks in rocks? Meteorites falling? Maybe dinosaurs roaming the land? Well, first of all, there was certainly no life, and the dinosaurs only showed up somewhat recently in the history of the Earth (~240 million years ago, while the Earth is ~4500 million years old). In fact, our planet was a much more extreme environment that one might think… Even if frequent, meteorites would only arrive every few thousands of years. Temperatures at the surface were extremely high, as high as 2000 K (1727 °C). Yeah, forget it, too hot even to go to the beach. That, and… there was no land, because a big part of the rocks that form the Earth were molten and our planet was covered in a deep magma ocean. An ocean you definitely don’t want to go in for a swim.

Weather prediction for the Earth, 4.5 billion years ago: really hot, the sort of hot that doesn’t allow you to work on your tan because… well, everything was molten. This photo was in fact taken in the Hawaii Volcanoes National Park, in May 1954 during the eruption of the Kilauea Volcano. Credit: photo by J. P. Eaton, May 31, 1954

What?! A magma ocean?

That’s right, a magma ocean. Think of it as a body of magma, consisting of a mixture of molten or partially-molten rock, volatiles (dissolved gas and gas bubbles) and solids (suspended crystals). The magma behaves as a liquid, which means that the quantity of solids floating in the system is not enough for the solid particles to connect with each other. When that happens, we are left with a crystal mush, where the magma flows inside a porous rock, instead of having solid particles floating in the liquid, as happens in a magma ocean.

A magma ocean is an extreme environment that is vigorously convecting. Several laboratory experiments suggest that the consistency of such systems is something like honey, with uncertainties depending on several factors such as pressure, temperature, the amount of water and the presence of crystals. Yeah, extremely hot molten rocks flowing like honey covering all the surface of the Earth and extending to thousands of kilometres depth. Very, very different from today’s Earth, hum? By definition a magma ocean needs to encompass a substantial fraction of the planet (something like more than 10%), otherwise we can call it a magma pond or a magma lake. No swimming in these as well. Also, no ducks there.

Sounds a bit like science fiction, right?

Yeah… However, the idea has been around for some centuries. In the late XVII century, Gottfried Wilhelm Leibniz proposed that Earth began as a uniform liquid, and differentiated compositionally as it cooled. Others, such as Comte de Buffon, or Lord Kelvin tried to calculate the age of Earth based on the assumption that the Earth was once completely molten and cooled to present-day (and is still cooling).

Ironically, humankind had to go to the Moon in order for the magma ocean hypothesis to evolve to its modern form. Samples returned from the Apollo missions showed that the whiter part of the crust you can see when you look up to the Moon is composed of rocks called anorthosites. In short, and without going into detail, the only mechanism for the formation of these rocks that has attained general acceptance is if they formed through flotation of crystals to the top of a magma ocean on the early Moon. Other rocks recovered from the Moon are also consistent with a fractional solidification of a magma ocean.

If the Moon went through a magma ocean stage it is likely that the Earth underwent it too. Just as the other rocky planets in the inner Solar System: Mercury, Venus and Mars. In fact, various observations point to the occurrence of magma oceans in the early evolution of rocky planets. We know this through the observation of, for example, iron meteorites, or on Earth because we know that a large iron core exists. A magma ocean facilitates the formation of the core early in the history of the planets. Iron is a heavy metal that is thought to have arrived on the early Earth mixed with silicon and silicates. A very hot magma ocean would have melted the rocks and metals and allowed the heavier liquid iron to sink down to the centre of the Earth to form the core.

Thus, it is widely accepted that magma oceans are significant events in the earliest stages of planetary evolution and set the initial conditions for their future evolution. Meaning that understanding how a magma ocean evolved on Earth is key to understand why life exists on our planet.

How did magma oceans form?

The late stage of formation of the Earth and other rocky planets was an energetic process, where violent impacts between protoplanets happened. The energy provided by impacts was the largest energy source to heat and melt the Earth. There were however other sources of heat I should mention such as the conversion of gravitational energy of formation into heat, heat losses from the core at the core-mantle boundary, radioactive decay (mainly short-lived isotopes such as 26Al and 60Fe, which are important in the early stages of planetary formation), electromagnetic induction heating and tidal heating (caused by the proximity to another large object). Basically, a large amount of energy was being provided to the juvenile rocky planets. Thus, again, it is very likely they underwent one or multiple large-scale melting events.

It is probable that in the last giant impact to hit the Earth, the impactor was the size of Mars. Such a big impact had enough energy to melt at least a substantial part of the mantle. Oh, and this impact is also believed to have formed the Moon. Pretty cool, right? The Moon-forming impact was most likely in the origin of the last major, deep and global magma ocean on Earth. But how did the magma ocean evolve in such a way that set up the initial conditions for the evolution of a tectonically active planet, able to sustain water at the surface, an atmosphere, and life?

BOOOMMM! And the Earth was molten! And the Moon was formed! Artist’s depiction of a collision between two planetary bodies. Such an impact between Earth and a Mars-sized object likely formed the Moon. Credit: NASA/JPL-Caltech

How did the magma ocean evolve on Earth?  

Fortunately for us, the magma ocean solidified, and Earth’s conditions are very different from back then. According to the conventional view, as a magma ocean loses heat from the surface, its temperature drops, and it starts crystalizing from the bottom-up. When there are enough crystals present, a solid matrix is formed, and because overall this structure flows slower, the heat loss is also much slower, and thus crystallization is prolonged. Estimates for the transition from a liquid- to a solid-dominated regime range from thousands of years to several hundred million years. However, fully crystallizing the mantle takes billions of years. It might sound a bit strange that the uncertainty in the lifetime of a magma ocean exhibits such large differences. This is due to the fact that we don’t know much about such a system (we never observed one…), and the data available is rare and hard to interpret. These are the sort of uncertainties that we have to deal with when studying the evolution of a magma ocean on Earth:

  • Was an atmosphere present? After the Moon-forming impact the surface temperatures were very high (~2000 K), so the heat transfer from the interior to the surface of the magma ocean is expected to be very rapid. But, these values can be buffered, and timescales of crystallization extended if an atmosphere is present. In the beginning an atmosphere composed of vaporized silicates (literally vaporized rock!) covered the Earth. Afterwards, as the magma ocean cools down, it degasses through bubbles that rise up and burst at the surface to form a thick and insulating steam-dominated atmosphere. Such atmosphere can substantially extend the cooling time by millions of years. As we will see next, this has important implications in the mode of crystallization of a magma ocean. Finally, once sufficient cooling is attained, the atmosphere collapses into a water ocean, and our planet starts to look more like the “Blue Planet” we recognize today.

How does the magma ocean crystallize? In the classic view, shown here, it crystallizes from the bottom-up. Credit: Diogo Lourenço

  • Could the surface be solid? The existence of a solid lid at the surface would slow down the cooling of a magma ocean, and therefore increase its solidification time. However, it is unlikely that such a lid developed in bigger planets because of: (1) the possible existence of an insulating atmosphere that keeps the temperature at the surface high, (2) the major possibility of any solidified material to sink, and (3) any small impactor during the cooling of the magma ocean would disrupt the formed lid. The only likely way to form a relatively complete conductive lid on a planetary-scale magma ocean is by flotation of buoyant minerals to the surface. Like in the Moon, remember? However, this mechanism is likely to occur only on small planets.
  • How do crystals in a magma ocean behave? One of the most important and complex questions regarding the crystallisation of a magma ocean is whether the crystals continue to be suspended in the liquid, or whether they settle, being removed from the liquid magma ocean. This is a challenging problem to address due to the lack of information about the conditions in a magma ocean, and the complexity of the physics of settling versus entrainment in a vigorous fluid flow. In general, longer timescales of magma ocean freezing imply relatively slow convection within the magma ocean and may allow for crystal settling. On the other hand, short timescales imply fast turbulent convection, and hence no crystal settling. On Earth, with all the uncertainties, both styles are acceptable to have operated, but most likely a combination of the two types of solidification existed in a magma ocean, where at first crystals remained entrained, and as the magma ocean cools down crystals started to settle.
  • Full-mantle overturns? Another complexity in the evolution of a magma ocean is that full-mantle overturns are predicted. Two types have been proposed: (1) Thermal overturns, where the (partially-molten) mantle resulting from the solidification of a magma ocean is gravitationally unstable. These instabilities can grow to a solid-state overturning of the cumulate mantle. (2) “Compositional” overturns. As the magma ocean crystallizes, a progressive enrichment of iron and incompatible elements in the magma is expected, and ultimately, this leads to an unstable compositional density stratification because magma ocean cumulates will be denser as the crystallisation front proceeds. A single overturn and a pronounced stratification of the compositionally stratified cumulate layers are expected, which could delay mantle solid convection for billions of years. However, it might be the case that stratification is (partially) erased through progressive mixing due to multiple incremental cumulate overturns, instead of a single one.

How does the magma ocean crystallize? In a more more recent view, shown here, it crystallizes from the middle-out. Iron (Fe) tends to concentrate in the magma. Eventually, when the BMO is almost solid, the last-forming solids are highly iron-enriched, and probably dense enough to become stable against entrainment in the solid mantle. Credit: Diogo Lourenço based on Labrosse et al. (2007)

  • Did the magma ocean really crystallize from the bottom to the top? Alright, here we go for another strange bit. The conventional view presented above is that the magma ocean crystallised from the bottom-up. Makes sense, yes? However, evolution from a completely molten state resulting from the Moon-forming impact might have been different from the conventional view. Recent measurements suggest that it is possible that liquids are denser than solids at lowermost mantle depths, opening the possibility for alternative scenarios of crystallisation of a magma ocean from mid-mantle depths. This would imply that as the magma ocean crystallizes, a shallow and a basal magma ocean (BMO) are formed. The solid layer grows upward and downward, however it grows faster towards the surface because of rapid heat loss to the atmosphere. The BMO’s heat loss is buffered by the mantle, so it crystallizes much slower. Moreover, the basal melt layer is also cooling slower because iron and incompatible trace elements (such as heat-producing elements) would tend to be concentrated in the magma. Eventually, the BMO would almost completely solidify, with the last-forming solids being highly iron-enriched, and probably dense enough to become stable against complete entrainment in the solid mantle. These dense and solid piles could account for some of the observed large-scale features with reduced seismic velocities around the core-mantle boundary we observe today. Understanding whether the Earth had a BMO, and if so, its evolution, is a first-order question that has important implications for planetary thermochemical evolution, for example some reservoirs isolated from the rest of the mantle can be the result from the crystallisation of a BMO. Also, it would have affected the thermal history of the Earth and affected the history of the geodynamo in our planet.

Answering these questions, which are all connected to the chemical and dynamical evolution of a magma ocean, is very important in order to understand the initial conditions for solid-state mantle convection, which on Earth led to plate tectonics and life (but did not in other terrestrial planets). We should keep in mind that magma oceans are common and are still being formed in other galaxies, so maybe planets with magma oceans will one day become targets for direct imaging. Who knows?

I will leave you with some links and further reading below if you really got excited with this text! If you really really got motivated then you can also read my PhD thesis, I’m still recovering from that time, so it will make me happy to know it taught something to other people.

Alright, enough! Hope you enjoyed the read and remember to not swim in magma oceans (you might get arrested)! Bye-bye!

References and further reading:

Abe, Y. (1997). Thermal and chemical evolution of the terrestrial magma ocean. Physics of the Earth and Planetary Interiors, 100:27-39.

Ballmer, M. D., Lourenço, D. L., Hirose, K., Caracas, R., and Nomura, R. (2017). Reconciling magma-ocean crystallization models with the present-day structure of the earth’s mantle. Geochemistry, Geophysics, Geosystems, 18(7):2785–2806.

Elkins-Tanton, L. T. (2012). Magma Oceans in the Inner Solar System. Annual Review of Earth and Planetary Sciences, 40(1):113–139.

Labrosse, S., Hernlund, J. W., and Coltice, N. (2007). A crystallizing dense magma ocean at the base of the Earth’s mantle. Nature, 450(7171):866–869. 

Labrosse, S., Hernlund, J. W., and Hirose, K. (2015). Fractional Melting and Freezing in the Deep Mantle and Implications for the Formation of a Basal Magma Ocean. In The Early Earth Accretion and Differentiation, edited by Badro, J. and Walter, M., Hoboken, NJ. 

Lourenço, D. L. (2017). The influence of melting on the thermo-chemical evolution of rocky planets’ interiors. PhD thesis, ETH Zurich. [link]

Rubie, D. C., Nimmo, F., and Melosh, H. J. (2007). Formation of Earth’s Core, In Treatise on Geophysics, edited by Gerald Schubert, Elsevier, Amsterdam, pages 51-90.

Solomatov, V. S. (2007). Magma Oceans and Primordial Mantle Differentiation, In Treatise on Geophysics, edited by Gerald Schubert, Elsevier, Amsterdam, pages 91-119.

[Read More]