Reproducible simulations with Singularity

This article was originally posted on the author’s personal blog.

Reproducing the result of a scientific experiment is necessary to establish trust, and reproducibility has long been a key part of the scientific method. Traditionally, an experiment could be repeated by following the method documented by the original scientists: setting up apparatus, taking measurements, and so on. If the method was sufficiently well documented then it was, perhaps, likely that the original results could be reproduced. These ‘wet lab’ experiments continue today, but many experiments are now performed entirely on computers. Such computational experiments involve no physical apparatus, but merely the processing of input data files through some scientific software before writing more data files for later analysis and plotting.

Repeating computational experiments is particularly difficult because, before any results can be obtained, there are many pieces of software apparatus that must be assembled: we must install an operating system, choose the correct version of our programming language and all the necessary scientific libraries, and we must use input parameters that are identical to those used in the original experiment. Assembling any of these pieces incorrectly might lead to subtly incorrect results, obviously incorrect results, or a failure to obtain any results at all. All this places a burden on the original scientists to document every piece of software, its version number and input parameters, and places a burden on the scientist wishing to reproduce the results.

There are a variety of tools that help to relieve this burden by automating the process of conducting computational experiments. Singularity is one such tool, having been purpose-built for automating computational experiments. A scientist creates a single configuration file that provides all the information Singularity needs to assemble the pieces of software apparatus and perform the experiment. This way, instead of writing a ‘method’ section that is only human-readable, the scientist has written a configuration file that is both human-readable and machine-readable. Using this configuration, Singularity will create an image file with all the correct versions of scientific software pre-installed. The scientist can verify their work by reproducing their experiment themselves, and they can run the same experiment just by copying the image file between their personal laptop, office workstation, or their institution’s HPC cluster. And they can send their Singularity configuration file and image files to other scientists, or they can obtain a DOI by uploading the files to Zenodo, making their computational experiments citeable in the same way as their journal publications.

I’ve used Singularity to run my own atmospheric simulations using the OpenFOAM computational fluid dynamics software. While my results have yet to be reproduced by others, I regularly use Singularity to reproduce my own results on my laptop, university desktop and AWS cloud compute servers, giving me confidence that my software and my results are robust. Whenever I’ve been stuck, the friendly Singularity developers have been quick to help out on twitter. But overall, I’ve found Singularity to be easy to use, and anyone that is familiar with git commands should feel right at home using it. Give it a try!

VMSG and COMET 2018 (or a Tale of Two Conferences)

The Volcanic and Magmatic Studies Group (VMSG) held a conference from the 3-6th of January in Leeds. The Centre for Observation and Modelling of Earthquakes, Volcanoes and Tectonics (COMET) held a student conference from 8-9th January in Cambridge. It was a conference double-whammy about all things volcanic – heaven!

VMSG is a joint special interest group of the Mineralogical Society of Great Britain and Ireland and the Geological Society of London. The VMSG conference is a fairly small affair, with about 200 in attendance, and it brings together research in geochemistry, seismology, volcanology and related fields. Because of its size, it’s a nice informal space where there is a focus on students presenting their work to the VMSG community, but anyone is free to present their research.

Talks ranged from how tiny fossils, called diatoms, became trapped in a pyroclastic density current, to modelling of lava domes, to how local people interact with the volcano they live on at Masaya, to every aspect of volcanology you can think of. The final talk was definitely a highlight – with everyone in 3D glasses to look at volcanic plumes across Russia, it really brought the satellite images to life (and we got to keep the glasses).

90 posters on a variety of topics were presented, the majority of which were by students (I was one of them). There was of course an obligatory dinner and disco to round off the second day of talks, and a great chance to network with other people from VMSG.

For the best poster title of the conference, you need look no further than this gem.

The conference also provides workshops on different aspects of research, with sessions on writing papers, diffusion modelling and InSAR to name a few. These were hosted on the 6th at the University of Leeds Environment and Earth Sciences Department, and comprised a full day of talks and labs so you could get to grips with the techniques you were being shown. I attended the InSAR workshop, which gave a good introduction to the topic of comparing two satellite images and seeing where the ground had moved. There was also a session on deformation modelling in the afternoon and playing with bits of code.

26771981_1615887968434336_143604950_o
An afternoon of modelling InSAR deformations and code – hill-arity ensued.

Then it was onto the second leg of the conferences, which took the action to Cambridge, where students that are part of COMET met up to discuss work and attend talks from 8-9th January.

26732711_1615887681767698_951066323_o
Gneiss weather in Cambridge!

COMET is a National Environment Research Council Centre of Excellence, it comprises a group of researchers that uses remote and ground sensed data and models to study earthquakes and volcanoes. They also work with the British Geological Survey and the European Space Agency, and fund PhD projects in related fields.

The meet-up of students comprised two days of talks from students, with some keynote speakers who had been past members of COMET that had gone on to careers outside of academia. The talks from second and third years included: remote sensing and InSAR being used to examine tectonic strain in the East African Rift Valley and slip (movement) rates along faults in Tibet, modelling how gas bubbles in magma change the more crystals you add to the magma, and using cosmogenic isotopes to work out slip rates on a fault in Italy.

26695576_1615887065101093_724648553_o
The Department had cabinets and cabinets of samples that rocked.

First years are also given the chance to give a talk lasting 5 minutes, so I filled people in on what I’d been up to in the past four months – lots of data collection! My project will be using satellite data to look at the varied eruption behaviour of Bagana volcano in Papua New Guinea, with a view to modelling this behaviour to better understand what causes it. Bagana has a tendency to send out thick lava flows in long pulses and let out lots of gas, and occasionally then violently erupt and let out lots of ash and hot pyroclastic density currents. But it is very understudied, as it is so remote – so there’s lots still to be learnt about it!

26736005_1616717381684728_2011570642_o
Me with my poster (I’ve run out of geology puns).

The meet-up also included a fancy meal in Pembroke College’s Old Library, with candles and it felt a bit like being at Hogwarts! Then it was back to Reading, thoroughly worn out, but with lots of ideas and many useful contacts – VMSG2019 is in St. Andrews and I can’t wait.

Deficiencies in climate model simulations of the seasonal rains in Africa

Email: c.m.dunning@pgr.reading.ac.uk

‘When is the wet season in Britain?’ a new student from Botswana asked me once. ‘Errrr, January-December?’ I replied flippantly. But in Botswana, and across much of Africa they experience one or two well-defined wet seasons per year, when the majority of the annual rainfall occurs. The timing and length of this wet season(s) is of significant societal importance; it replenishes water supplies used for drinking and other domestic purposes, affects the agricultural growing seasons and impacts the lifecycle of a number of vectors associated with the transmission of diseases such as malaria and dengue fever. Delays in the onset, or even failure of the wet season, can lead to reduced yields and potential food insecurity.

Future changes in climate will not be felt solely through changes in mean climate; projected shifts in atmospheric circulation patterns will also alter seasonality. Africa is acutely vulnerable to the effects of climate change so understanding future changes in the seasonal cycle of African precipitation is of utmost importance in establishing appropriate adaptation strategies. In order to produce reliable projections of seasonality, we require models to contain an accurate representation of current seasonality.

In our recent study we use a novel method to diagnose progression of the rainy seasons across continental Africa and identify important deficiencies in the climate simulations (a previous blog post and paper describes this method).

Firstly, when we use the method of Dunning et al. (2016) to identify the wet seasons in satellite-based precipitation estimates, atmosphere-only and coupled climate model simulations we find that the rainy seasons are differentiated more clearly from the dry seasons (shown by larger differences in the average rainfall per rainy day; Figure 1) than when fixed meteorological seasons (OND, MAM etc) are used, as this method accounts for interannual variability in seasonal timing and model timing biases.

figure_1anew

Figure 1. Average rainfall rate (mm day−1) during the wet/dry seasons over the Horn of Africa (a) and the Sahel (b) when defined using meteorological seasons (dashed bars) and dynamically varying seasons (Dunning et al. 2016, solid). See Figure 2 for a map of the regions.

Overall, climate model simulations capture the gross seasonal cycle of African precipitation on a continental scale, and seasonal timing exhibits good agreement with observations, however deficiencies manifest over key regions (Figure 2). The Horn of Africa (Somalia, southern Ethiopia, Kenya) experiences two wet seasons per year; the ‘long rains’ during March-May and the ‘short rains’ during October-November.  Whilst the simulations capture two wet seasons per year, they exhibit significant timing biases, with the long rains around 3 weeks late and the short rains nearly 4 weeks too long on average (Figure 2). Accounting for these biases may be crucial in interpreting the contrasting trend of observed declining rainfall during the ‘long rains’ in recent years and model projections of increasing ‘long rains’ rainfall in the future.

figure_4_regions_withbars_newlegend

Figure 2: Multi-model mean onset (open circles) and cessation (filled squares) for observations, atmosphere-only (AMIP) and coupled (CMIP) over selected regions (b). Shaded bars indicate the period of the wet season. For SWAC the mean annual regime onset/cessation in coupled simulations is plotted, along with mean onset/cessation for MIROC4h and BCC-CSM1-1-M (coupled simulations).

The most notable bias affects the southern coastline of West Africa, a region of complex meteorology with growing population and declining air quality. This region experiences the first wet season from April-June and the second wet season from mid-September-October, separated by the ‘Little Dry Season’ (LDS) in July-August. The LDS can be useful for weeding and spraying crops with pesticides between the two wet seasons, but can adversely affect crop yields if it is too long or pronounced. We find that simulations produce an unrealistic single summer wet season, with no mid-summer break in the rains and this is linked with biases in ocean temperature patterns. Given that climate simulations cannot capture the current seasonality, future projections for this region should be treated with caution.

Tweet_Fig5

Figure 3: a) Location of the region that experiences the Little Dry Season (LDS; blue dots) and the SST region of interest (pink box). b) Mean annual cycle of rainfall in observations, atmosphere-only and coupled simulations over LDS region.

This work highlights important deficiencies in the representation of the seasonal cycle of rainfall by climate simulations with implications for the reliability of future climate projections and associated impact assessments, including water availability for hydropower generation, the length of the malaria transmission season and future crop yields.

The full paper can be found here:

Dunning, C.M., Allan, R.P. and Black, E. (2017) Identification of deficiencies in seasonal rainfall simulated by CMIP5 climate models, Environmental Research Letters, 12(11), 114001, doi:10.1088/1748-9326/aa869e

 

Clear-Air Turbulence and Climate Change

Europe_turbulence_blog
Figure 1: Percentage change of clear-air turbulence over Europe and the North Atlantic

Clear-Air Turbulence (CAT) is a major hazard to the aviation industry. If you have ever been on a plane you have probably heard the pilots warn that clear-air turbulence could occur at any time so always wear your seatbelt. Most people will have experienced it for themselves and wanted to grip their seat. However, severe turbulence capable of causing serious passenger injuries is rare. It is defined as the vertical motion of the aircraft being strong enough to force anyone not seat belted to leave the chair or floor if they are standing. In the United States alone, it costs over 200 million US dollars in compensation for injuries, with people being hospitalised with broken bones and head injuries. Besides passengers suffering serious injuries, the cabin crew are most vulnerable as they spend most of the time on their feet serving customers. This results in an additional cost if they are injured and unable to work.

Clear-air turbulence is defined as high altitude inflight bumpiness away from thunderstorm activity. It can appear out of nowhere at any time and is particularly dangerous because pilots can’t see or detect it using on-board instruments.  Usually the first time a pilot is aware of the turbulence is when they are already flying through it. Because it is a major hazard, we need to know how it might change in the future, so that the industry can prepare if necessary. This could be done by trying to improve forecasts so that pilots can avoid regions likely to contain severe turbulence or making sure the aircraft can withstand more frequent and severe turbulence.

Our new paper published in Geophysical Research Letters named ‘Global Response of Clear-Air Turbulence to Climate Change’ aims at understanding how clear-air turbulence will change in the future around the world and throughout the year. What our study found was that, the busiest flight routes around the world would see the largest increase in turbulence. For example, the North Atlantic, North America, North Pacific and Europe (see Figure 1) will see a significant increase in severe turbulence which could cause more problems in the future. These regions see the largest increase because of the Jet Stream. The Jet Stream is a fast flowing river of air that is found in the mid-latitudes. Clear-air turbulence is predominantly caused by the wind traveling at different speeds around the Jet Stream. Climate change is expected to increase the Jet Stream speed and therefore increase the vertical wind shear, causing more turbulence.

To put these findings in context, severe turbulence in the future will be as frequent as moderate turbulence historically. Anyone who is a frequent flyer will have likely experienced moderate turbulence at some point, but fewer people have experienced severe turbulence. Therefore, this study suggests this will change in the future with most frequent flyers experiencing severe turbulence on some flight routes as well as even more moderate turbulence. Our study also found moderate turbulence will become as frequent in the summer as it has done historically in winter. This is significant because although clear-air turbulence is more likely in winter, it will however now become much more of a year round phenomenon (see Figure 2).

Seasonal_turbulence_blog
Figure 2: Percentage change of clear-air turbulence around the world in all four seasons. No Stipling (stipling) indicates it is (is not) significant at the 90% confidence level.

This increase in clear-air turbulence highlights the importance for improving turbulence forecasting. Current research has shown that using ensemble forecasts (many forecasts of the same event) and also using more turbulence diagnostics than the one we used in this study can improve the forecast skill. By improving the forecasts, we could consistently avoid the areas of severe turbulence or make sure passengers and crew are seat-belted before the turbulence event occurs. Unfortunately, as these improvements are not yet fully operational, you can still reduce your own risk of injury by making sure you wear your seat belt as much as possible so that, if the aircraft does hit unexpected turbulence, you would avoid serious injuries.

Storer, L. N., Williams, P. D., & Joshi, M. M. (2017). Global response of clear-air turbulence to climate change. Geophysical Research Letters, 44, 99769984. https://doi.org/10.1002/2017GL074618

This blog was originaly writen for EGU Blogs

Adventures in Modelling – NCAS Climate Modelling Summer School

At the beginning of September 3 PhD students from Reading, including myself, went to Cambridge to attend the NCAS Climate Modelling Summer School. This is an annual event aimed at PhD students and early career scientists who want to develop their understanding of climate models, with topics covering parameterisations to supercomputers.

IMG_3847
Staff and students of the course pose outside the Chemistry department, which played host to morning lectures

The course ran over two weeks with lectures on the components of climate models in the morning, covering fundamental dynamics and thermodynamics, numerical methods and different parameterisations. This was followed by an afternoon of computer practicals and then more topical lectures in the evening, such as “User engagement in climate science” and “The Sun and Earth’s climate system”. The lectures were very fast paced but this was a great opportunity to cover so many topics in a short space of time and get a grounding in lots of different topics that I will definitely be looking over in future. A poster session on the second evening gave us the chance to learn about other people’s work and make connections with other people starting out their careers in climate science, including a few readers of the blog, that will hopefully last throughout our careers.

One of the highlights of the course was the chance to run some (rather interesting) experiments with an earth system model. This involved breaking into groups with each being given a different project. It was exciting to go  through the whole process of having an idea, developing a hypothesis, thinking of specific experiments to answer the hypothesis and then analysing the results in just a week – something that takes much longer when you’re doing a PhD! My group worked on the Flat Earth experiment, which looked at the effect of removing all of the earth’s orography not, to our dismay, turning the earth into a flat disk. I learned a lot about how to run models, something which I have never done even though I use the output. It also developed my understanding of different climate processes that I don’t work with such as the monsoons, and even dynamical vegetation.

monsoons
Flat earth experiment looking at the change in the monsoon winds

Throughout the course we stayed at St Catharine’s College. Right in the centre of Cambridge it quickly felt like a home from home, keeping us well fed to get through the intense science. Although the weekend was rainy, apparently breaking a run of excellent weather for the school, we still had plenty of time to explore beautiful Cambridge. A few people were even brave enough to go punting!

An interesting, hectic and inspiring two weeks later we may have been glad to head back to Reading for a good sleep but having thoroughly enjoyed the summer school.

Buildings2000-®TimRawle-resized-w680px
The beautiful St Catharine’s College, image from http://www.caths.cam.ac.uk/

 

1st Met Office Training and Research Summer School

Email: carlo.cafaro@pgr.reading.ac.uk

From the last week of June until the 1st September I took part in the Met Office Training and Research (MOTR), as part of the Mathematics of Planet Earth CDT.

Inspired by the highly popular and successful Geophysical Fluid Dynamics Summer School at the Woods Hole Oceanographic Insitution in the USA, it is a 10 week-programme, hosted by Met Office in Exeter. The PhD students have the opportunity to handle an applied research topic outside the area of their PhD, diversify their portfolio and experience the working and social life at the Met Office.

In the first two weeks we participated in a summer school. In particular in the first week there was a lecture course on ”Regional Climate Variability and Change”. In the morning the lectures were given by David Karoly from University of Melbourne on “patterns of climate change”, starting from the basic concepts of the climate systems and then expanding to the climate change attribution. In the afternoon we had specialist lectures by Met Office and University of Exeter scientists about El Nino, modelling paleoclimates and attribution of extreme weather events. 

IMG-20170630-WA0001
David Karoly giving one of his lecture on attribution of regional climate change patterns.

In addition, in the afternoon we had to do lab work working in pairs, using Climate Explorer, choosing a specific continent of the world and investigating past climate and future climate projections for that area. My colleague and I selected South America and we gave a presentation about that.

During the second week we participated in the workshop ”Future opportunities to inform UK regional projections”, with a lecture given by Ed Hawkins, amongst  others, talking about sources of uncertainty.

From the third week onward each student started a research project in different Met Office research groups. A different colleague and I worked within the Atmospheric Processes and Parametrization group (APP), supervised by Gabriel Rooney. My project was on numerical simulations and theoretical aspects of colliding density currents. Other colleagues were placed within the Climate Science, Dynamics groups and Informatics Lab, a partner of Met Office.

A typical day for us at Met Office started at 9am, meeting almost every day with Gabriel at 9.45 am, coffee break at 10.30 for half an hour or so (where I also met Annelize, previously in Reading), 1 hour lunch break and then “working” again until 5.30 pm or so.

WP_20170710_19_20_06_Pro
Not quite our typical day at Met Office (found on a desk at Met Office)

Also, once a week we had the meeting with the smaller convection group, where everyone was asked to give an update of their own work. We also attended journal club sessions on Fridays and a brainstorming meeting on 21st July. It was nice to take part in these events, even being only summer interns. During the project phase we had also weekly advanced seminars by Glenn Shutts and Mike Cullen, mainly about large-scale dynamics and hierarchies of operational models used in NWP.

WP_20170721_10_34_41_Pro
Glenn Shutts giving a lecture on Rossby waves breaking.

Personally, it was a wonderful experience for several reasons. The Met Office is a very pleasant place to work, with very friendly and flexible people. Since I think my project was quite academic I did not find many differences with working at university itself. Nevertheless, interacting with new people in a new environment has provided me with new inspirations and insights. I had the chance to talk with several scientists and also a chief Meteorologist, since I was curious about the activities carried out in the Operational room and how much communication there is with the research side. There were some social and sports events organised by MOSSA (Met Office Social and Sports Association) which I really enjoyed (picnic and sports day), getting the chance to meet and to talk with people of other research divisions.

Finally, to top it off, I visited Exeter a lot and the area around, mainly during the weekends and the 5 days of holidays agreed at the beginning, even going to Cornwall for 2 days. 

In the end I would like to thank all of the organisers, my supervisor and all the people I talked with for giving me and my colleagues this very valuable opportunity which I will keep always in mind for my future career.

Thunderstorms and showers: an insight into UK operational radar rainfall estimation.

If there’s one thing you can count on in Britain it’s that at any given time someone, somewhere, is talking about rain.  Either it’s raining, or we want it to rain, or it absolutely mustn’t be raining today.  It’s just one of those things we love to complain about – and we do!

My work isn’t in forecasting rain, but observing it. It’s a little known fact that the rainfall map you see on the front page of the Met Office website doesn’t just come straight out of one giant weather radar, neatly packaged.  There’s a lot of work that has to happen before we can turn the “reflectivities” from many different radar echoes into a sensible estimate of how heavily it’s raining on your street.

The Met Office owns and manages a network of 15 weather radars across the UK, and receives data from three more, in Ireland and the Channel Islands.  We’ve now almost completed a major upgrade of the network, replacing key components of the old radars – some of which had been running operationally for over 30 years! – with new technology.  The dual polarisation and Doppler information we obtain from the upgraded radars improves our ability to distinguish between “rain” and “non-rain” echoes, and to measure how fast the rain is moving, feeding improvements in short range “nowcasts” and flood forecasting models. It can also help us estimate the quantity of rainfall and other types of precipitation in real time.

For my PhD, I’m looking at how to improve Met Office estimates of surface rain rates from radar measurements at long range.  When a radar measures weather, it does so with a beam of energy that spreads out with distance.  20 km from the radar, the echo received represents a volume of space around 600 m by 400 m by 400 m.  At 50 km, the volume is 600 m by 1 km squared.  By 100 km, the beam has spread out to be 2 km wide.  This effect is called “beam broadening”, and limits the spatial detail with which we can measure rainfall.

The other effect of range is the increasing height of the radar beam above the ground.  This means the radar isn’t always measuring liquid rain drops, but may be measuring frozen ice crystals or snow, high up in colder parts of the atmosphere, which will melt before they reach the surface.  Snow, melting snow and rain all have different reflectivities, so we have to correct for this “vertical profile” to calculate how much rain is falling at ground level.

The Met Office corrects for the vertical reflectivity profile (VPR) using an iterative scheme (Kitchen et al. 1994, Kitchen 1997).  We know roughly the VPR shape, and the amount of beam broadening at a given range, so we can scale this shape to the actual radar reflectivity measurement.  This allows us to correct for the impacts of melting snow, which causes a huge enhancement of the radar measurement and would – if uncorrected – lead to extreme overestimates of rainfall.  In the early days of weather radar, this caused rings of very high rain rates to appear in the image: an effect called “bright banding”.  VPR correction also compensates for the underestimation of rain rates at very long distances from the radar.

201410131416_stratiform_rhi
Vertical slice “range height indicator” scan of rain from October 2014.  There is a “bright band” at 2 km height due to melting snowflakes in the reflectivity and linear depolarisation ratio (LDR).

In my work, I’m using measurements from the upgraded dual polarisation radar network to choose between different VPR shapes in making this correction.  Specifically, I’m investigating the depolarising properties of different melting drops, to identify the rare situations where we don’t need to correct for “bright banding”.  The linear depolarisation ratio (LDR), which I’m using to identify the large melting snowflakes that cause radar bright bands, has to be measured using different scans from the ones used to collect reflectivities for rainfall rates, and the Met Office is one of very few meteorological services capable of measuring LDR operationally.  Using LDR in this way can improve rainfall estimates significantly in cases where there is no bright band (Smyth and Illingworth, 1998; Sandford et al., in press).

201507032220_convective_rhi
Vertical slice “range height indicator” scan of a convective shower from July 2015.  There is no bright band in reflectivity, and very little melting layer enhancement in LDR.

As a logical extension to this work, I’m also looking into new VPR shapes for “non-bright band” rain, using vertical slice “range height indicator” scans from our research radar at Wardon Hill.  Correction for bright band is well established in the radar literature, as this is the most common type of rain at high latitudes (where the freezing level is low enough to affect radar measurements), but other types of VPR (e.g. Fabry and Zawadzki, 1995) are rarely discussed.  With the improvements in classification achieved by the new LDR algorithm, a suitable VPR shape is needed to correct for underestimation far from the radar in cases without bright band.  I’ve recently developed a test profile shape for non-bright band VPRs, and demonstrated improvements to rain rates in localised convective case studies. The method is currently being trialled for use in the Met Office’s operational radar processing software.

In the future it’s hoped that the work I’m doing will further improve the accuracy of Met Office rainfall estimates, particularly in thunderstorms and convective showers. And when the weather is doing things like this, that’s good to know!

References

Fabry, F. and I. Zawadzki, 1995: Long-term radar observations of the melting layer of precipitation and their interpretation. Journal of the Atmospheric Sciences, 52, 838-851.

Kitchen, M., 1997: Towards improved radar estimates of surface precipitation rate at long range. Quarterly Journal of the Royal Meteorological Society, 123, 145-163.

Kitchen, M., R. Brown. and A. Davies, 1994: Real-time correction of weather radar data for the effects of bright band, range and orographic growth in widespread precipitation. Quarterly Journal of the Royal Meteorological Society, 120, 1231-1254.

Sandford, C., A. Illingworth, and R. Thompson, in press: The potential use of the linear depolarisation ratio to distinguish between convective and stratiform rainfall to improve radar rain rate estimates. Journal of Applied Meteorology and Climatology.

Smyth, T. and A. Illingworth, 1998: Radar estimates of rainfall rates at the ground in bright band and non-bright band events. Quarterly Journal of the Royal Meteorological Society, 124, 2417-2434.