The Leeds Africa Climate Hackathon – experiences of running a hackathon and highlights of results

Crook, Julia, M a r s h a m, John H., Fi tzp a t rick, Ro ry, Arye e, Jeffr ey N. A., Baid u, Mich a el, Bak er, Jessic a C. A., Blan d, S a m, Ch a p m a n, S a r a h , De n by, Leif, H a r tl ey, Andr ew, Kovacs, Esz t er, La m, Timot hy, Mor ris, F r a n , M w a n t hi, Antho ny, Ow e n, La u r a , Pea t m a n, Simon, Picke rin g, Ben, S a bii ti, Geoffr ey, Wainw rig h t , Ca roline ORCID: h t t p s://o rcid.o rg/00 0 0-0 0 0 2-7 3 1 1-7 8 4 6, Webb, Tom, Yamb a, E d m u n d I., Ba ni, E ric Koka, Amoako, Kingsley Kwako a n d Ochie n g, Willis 2 0 2 3. The Lee ds Africa Clim a t e H a ck a t ho n – exp e rie nc e s of r u n ning a h ack a t ho n a n d hig hligh t s of r e s ul t s . Weat h e r 7 8 (2) , p p. 3 6-4 2. 1 0.1 0 0 2/w e a.42 4 6 file


Introduction
In November 2021, the 26th UN Climate Change Conference of the Parties (COP26) meeting was held in Glasgow, UK. This was a critical meeting regarding countries sticking to the Paris Agreement and, with much in the media throughout the year about the climate and ecological emergencies, the UK Met Office and several UK Universities within the Met Office Academic Partnership (MOAP) ran 'hackathons' to produce novel user-relevant climate change information, showcased at COP26 (Met Office, 2021a). 'Hackathons' are where people from different backgrounds come together for a relatively short time to creatively solve problems, traditionally with a focus on hand-on coding ('hacking'), but increasingly sometimes focused instead on wider problem solving and/or brainstorming.
In late May 2021, the University of Leeds held the Leeds Africa Climate Hackathon aiming to generate user-relevant narratives of possible future climate in East and West Africa, presented in a compelling way by relating possible future weather events to past events. This hackathon is the subject of this paper. Due to the COVID-19 situation, the hackathon was held as an online virtual event using Microsoft Teams, Zoom and other online platforms.
Future climate change information is often presented as future minus current climate, typically in terms of mean temperature and rainfall, or average impacts on different sectors, and often averaged over large regions. Yet it is the actual weather with day-to-day variability that is experienced locally that creates impacts. People tend to better understand and engage with future weather/impacts when expressed in terms of past weather/impacts they have experienced (e.g. for African climate, Fitzpatrick et al., 2020;for UK climate, Met Office, 2021b). Estimates of future precipitation change at the regional and local level are deeply uncertain for many parts of the world, especially for much of sub-Saharan Africa, and although climate models that demonstrate unrealistic mechanisms of change can sometimes be eliminated from studies (e.g. Rowell, 2019), it is not possible to give useful probabilistic projections of precipitation change and the uncertainty in projections can cause confusion for users of climate change information. Climate narratives (Dessai et al., 2018;Jack et al., 2020) are qualitative physical descriptions of plausible future evolutions of regional climate aimed at decision makers. They focus on the impacts of climate change, are often co-produced with climate scientists and decision makers, and are more accessible to non-climate specialists than probabilistic projections. Importantly, each narrative is written in terms of certainty, whereas the differences between different narratives expresses (if not completely represents) the envelope of uncertainty. Examples of the production of climate narratives for East Africa can be found in Burgin et al. (2019a,b), which have been used in processes to inform decision making (Evans et al., 2020).

Overview
The Leeds Africa Climate Hackathon focused on presenting how future weather would affect agriculture in Ghana or energy production from hydroelectric power in Kenya in terms of extremes experienced in recent history. The use of narratives was encouraged to address uncertainty via presenting several possible futures, without assigning probabilities to any possible future. The challenge was set as 'to bring together sources of information to present narratives of possible future climate in as compelling a way as possible by putting possible future weather events and variability into context by using past weather. To create well-communicated user-relevant narratives of possible futures and/or the underpinning information for these' . Teams were encouraged to use the mid-century future rather than end of century as it is more immediately relevant and engaging for decision makers. The event was held over nine days and provided the opportunity for early career researchers to experience working with different scientists and build strong relationships with their peers from other institutions. The purpose of the event was explained in an opening meeting along with presentations from invited African individuals from the two user-groups in Ghana and Kenya, and UK scientists experienced in the use of climate narratives. At this meeting, breakout groups allowed participants to discuss how they might progress and what data usergroups might provide. A mid-event meeting allowed teams to present their work so far and see what other teams were doing. Each team presented their results at a final meeting at which Mariane Diope-Kane (WMO) gave her external view of the event and results. Unlike at some other hackathons, to foster collaboration across teams, the event was not competitive between teams.

The participants and teams
The Leeds Africa Climate Hackathon had two focus groups, energy production in East Africa and agriculture in West Africa, and representatives from the Kenya Electricity Generating Company (KenGen), the Ministry of Food and Agriculture, Republic of Ghana, and the Ghana Cocoa Board were invited to take part to provide a user-perspective. This gave a mix of agricultural and non-agricultural uses in Ghana and Kenya, countries where existing links with Kwame Nkrumah University of Science and Technology (KNUST) and IGAD Climate Prediction and Applications Centre, Nairobi, Kenya (ICPAC) facilitated their participation. At short notice the participants from KenGen and Ghana Cocoa had to do fieldwork on the day of the opening event, but this challenge was addressed by each providing input either in writing or via a recorded talk. The event was open to any enthusiastic researchers with experience of analysing meteorological, or other large environmental datasets, and advertised at MOAP universities, KNUST and ICPAC. Expertise on climate change or African climate was not required, although for those who wanted to be involved in data analysis, we expected some experience of handling climate model data using Python. Apart from the African individuals from the two user-groups, there were 17 participants of whom three were from Africa, with the rest from the UK. Ideally, we would have liked to have more African participants. Unfortunately, well after dates were determined, the dates of the Pre-Climate Outlook Forum capacity building workshop and Greater Horn of Africa Climate Outlook Forums (GHACOF) event were announced, limiting input from ICPAC participants who were taking part in these events. Just before the start of the event, the participants were assigned to one of three teams, Ghana Cocoa, Ghana Ministry or KenGen. However, due to late dropouts, the Ghana Cocoa team lost its African repre-sentative and a UK Post-Doctoral Research Associate, so was very unbalanced, and we ended up with the two Ghana teams merging into one larger-than-ideal team (GhanaAg team).

The technology
We used Microsoft Teams and Zoom to hold plenary meetings at the start, middle and end of the hackathon. Although this worked well for most participants, some participants in Ghana and Kenya had some internet connection issues. Each team decided how many team meetings they would hold and what platform to use; Microsoft Teams and GatherTown were used for this purpose. We set up a Slack channel for each team so that members could communicate with each other easily throughout the event. This worked well and they shared plots using Google shared documents. Like several of the other MOAP hackathons (Thomas et al., 2022) we utilised JASMIN, the UK's analysis facility for environmental science that also hosts the Centre for Environmental Data Analysis (CEDA) archive of climate model data (Lawrence et al., 2013). JASMIN also provides web access to Jupyter Notebooks for visualising data using the Python programming language. Participants also had access to a 1TB group workspace on JASMIN in which to store processed data and observational datasets not accessible in the CEDA archive. We setup a GitHub repository with an example Notebook reading Climate Model Intercomparison Project Phase 6 (CMIP6) (Eyring et al., 2016;Gidden et al., 2019) data and Future Climate For Africa Improving Model Processes for African Climate (IMPALA) CP4 Africa (Kendon et al., 2019) data. We also provided code for calculating dry spells, heatwaves, and monsoon onsets, and some example code to calculate percentiles of maximum daily temperatures and where the 50th percentile of future daily maximum temperature fits within the current daily maximum temperatures. Given that we did not want to prescribe what climate variables, time periods, scenarios, regions or models they should use, we did not do any up-front pre-processing on CMIP6 data. We asked participants to save their own code in the GitHub repository so that the code could be shared between participants and so it could potentially be re-used in future and plots re-generated. Mostly they did not use GitHub to share code during the event but did push their code to the repository at the end of the event. The participants used JASMIN Notebooks to write and run code, although code that needed to write files to the group workspace had to be run from an SSH login as the Notebook service had no write access to the group workspace. Many of the participants already had access to JASMIN but for those that did not, training accounts were made available for the duration of the event. This worked well and is especially useful for participants outside the UK who normally have difficulty getting their own access to the JASMIN platform, which can be problematic even if they have an account if they do not have a stable IP address. By monitoring the Slack channel discussions during the event, it was possible to spot when both teams needed to do the same kind of thing and could potentially share code/ideas.

Data used and team working
The teams chose to use as many of the CMIP6 models as they could in the time available 1 , that had data for both the historic period and a middle/end of the century period for the variables they were interested in (temperature and precipitation were relevant for both dam levels and agriculture) or based on participants' previous experience of using CMIP6. CMIP6 provides nine different plausible future scenarios that combine socioeconomic and technological development, named the Shared Socioeconomic Pathways (SSPs) and result in different radiative forcing and therefore warming (Gidden et al., 2019). The teams looked at more than one of these scenarios (SSP1-1.9, equivalent to 1.5 degC warming, and up to SSP5-8.5) to get an idea of the range of possibilities as a function of mitigation actions. They did not look at the IMPALA CP4 data due to lack of time. Some of the participants obtained satellite or reanalysis data. The work was split largely by interests and experience and sub teams looked at different aspects.

Experience of participating
Through a post-event survey, the participants have expressed their enjoyment in taking part, particularly in working in new areas and simply sharing ideas and code and seeing how others approach problems. The thought processes that are gone through in a project are rarely documented in published papers. Learning new tools, gaining new contacts, and feeling that the work was of direct relevance to decisions makers were also highlighted.

Impacts of future weather on hydroelectric power in East Africa (prepared by the KenGen team)
Hydroelectric power constitutes a large component (30%) of Kenyan electricity 1 https://wcrp-cmip.github.io/CMIP6_CVs/docs/ CMIP6_source_id.html for a complete list of models used in CMIP6 generation. The Masinga dam, situated north of Nairobi is part of the 7-forks cascade of dams, that are part of the larger Tana River catchment (Bunyasi et al., 2013). Mount Kenya and Aberdare National Parks are in the north and western parts of the catchment. Other small-scale hydroelectric projects also exist.
Generally, Kenya experiences two seasonal rain periods, the 'Long rains' in March to May and the 'Short rains' in late October to December (Dunning et al., 2016), although there are strong local variations to this. KenGen highlighted two main risks: during droughts, when the reservoir level falls below a minimum threshold, electricity production stops; during wet periods, when the reservoir level reaches a maximum threshold, water needs to be let out of the reservoir, potentially flooding downstream areas. Key dry events were identified by KenGen as occurring in 2000, 2009 and 2017. KenGen provided data on the Masinga dam for the period June 1981 to February 2015 including reservoir levels at end of month, and mean flow per month. The Masinga dam reservoir has a peak capacity level of 1056.0m and a shutdown level of 1035.5m. The team aimed to predict shutdown frequency, shutdown duration, overflow frequency and overflow volume using precipitation and evaporation averaged over the catchment area for current and future periods. Evapotranspiration for models was estimated using the equation proposed by Thornthwaite (1948).
Comparison of observed (CHIRPS2, Funk et al., 2015) rainfall and Masinga dam reservoir levels 1996-2015 suggested a 3-year accumulated precipitation anomaly (data averaged over the Masinga Dam catchment area) under −400mm risks the dam being shut down as happened in 2000 and 2009. Using ERA5 reanalysis data (Hersbach et al., 2020), variability in evaporation was found to have a minimal effect by comparison to precipitation, which has more variance. Rainfall accumulations in the historical period differed dramatically between models resulting in different historical shutdown frequencies. Therefore, modelled mean 3-year accumulated rainfall changes over Kenya (2090-2099 mean compared to 2015-2024 mean) were obtained and the percentage change applied to observed (CHIRPS2) mean 3-year accumulated rainfall (1996)(1997)(1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015) to give a simple analysis of how the probability density function (PDF) might shift in future (Figure 1 for SSP2-4.5 and Figure 2 for SSP5-8.5). For 11 of the 17 of the models, rainfall accumulations increase in both scenarios. For eight of those models the change is greater in SSP5-8.5 than in SSP2-4.5 and in one model the change is greater in SSP2-4.5 than SSP5-8.5. For 2 of the 17 of the models, rainfall accumulations increase under SSP2-4.5 but decrease under SSP5-8.5. For 4 of the 17 models, rainfall accumulations decrease under SSP2-4.5 but increase under SSP5-8.5. Although more models have increasing rainfall accumulations suggesting shutdowns would be less frequent and overflow events more frequent over the long-term, the team found considerable variability in changes by mid-century. Note that climate change may change the shape of the PDF but analysis of this was not possible in the time of the hackathon. Figure 2 shows that for the most extreme modelled change the mode of the future distribution becomes comparable with the current wettest extremes, but most models show more moderate changes. With more time it would be useful to determine where in the dry future models PDF the recent current droughts such as seen in 2000, 2009 and 2017 are located. Although evaporation was found to have minimal effect in the historical period analysed, future impacts  could be important, and the analysis should be repeated using P-E.
The team also built a simple model using the inputs of precipitation and evaporation to predict the water level of the reservoir and predict shutdown frequency, shutdown duration, overflow frequency and overflow volume. The dam model was parametrized using observed weather (daily precipitation from CHIRPS2 and daily evaporation from ERA5) and dam responses (reservoir levels provided by KenGen) over the 1996-2015 period. It was mostly able to predict the time-series of reservoir levels, although overestimated the level at times of lowest levels, and is therefore likely to under-predict the frequency of shutdowns without further refinement. It also does not consider the extraction of water from the reservoir for other uses such as irrigation. The model was then run with CMIP6 daily outputs of precipitation and evaporation from the two scenarios. Although the results showed no clear patterns in shutdown frequencies some models showed increases in overflow events later in the century due to higher rainfall. Future rainfall is likely to be more intense over shorter periods (e.g. Finney et al., 2020). The team hypothesised that the dam would not be able to retain these higher intensity rains and would have to release them downstream, which in turn could increase periods when dam levels were low even if decadal rainfall were similar to today. This may also create increases in problems due to soil erosion and silting up of reservoirs (Chapman et al., 2021). Creating a sophisticated dam model takes far longer than the time of a hackathon, but this work shows there is potential to do this given more time. In fact, dam models are being used to aid water management (Oludhe et al., 2013) and such models could potentially be used to provide shutdown and overflow frequency changes under climate change.
The team summarised their results in three possible narratives shown in Box 1.

Impacts of future weather on agriculture in Ghana (prepared by the GhanaAg team)
Agriculture in Ghana is affected by monsoon onset dates, dry spells and extreme rainfall. For example, Ghana experienced its worst drought in modern history from 1981 to 1983. The drought peaked in 1983 and food production dropped dramatically resulting in food shortages (Tan and Rockmore, 2018). Although there has been some recovery of rainfall since the extreme dry episode of the 1970s and 1980s, characteristics of rainfall have changed (less spatial coherence and less temporal persistence) and the peak month appears to have shifted from August to July (Nicholson, 2013). Analysis of CMIP5 models suggests West Africa will see shorter wet seasons, increasing rainfall intensity, and decreasing rainfall frequency under climate change (Dunning et al., 2018). Therefore, it is important to look at high frequency rain rates and not just monthly means when assessing future rainfall impacts. The agriculture hackathon team looked at how daily extreme rainfall would change under future climate change using a range of CMIP6 models from SSP1-1.9, SSP2-4.5 and SSP5-8.5 scenarios and estimated the occurrence of droughts such as that in 1983.
In order to assess the credibility of future projections over Ghana, precipitation from CMIP6 models was first compared against observations. A historical CMIP6 climatology  was used as comparison with future scenarios and observed rainfall. In comparison to CHIRPS2 rainfall, the CMIP6 historical models tend to overestimate wet season (May-September) mean rainfall in Ghana (particularly South Ghana). The model mean overestimates moderate extremes (99th percentile of all days) rain over most of Ghana, but such extremes are underestimated over the south coast. In North Ghana, many models overestimate variance in daily rainfall. The CMIP6 historical models overestimate JJA surface temperature compared to ERA5.
There was disagreement between models regarding changes in future (2040-2070) wet season daily moderate extreme (99th percentile of all days) rainfall (Figure 3), with an increase or a decrease possible at all locations, and with one model having much larger decreases than any other model. The multi-model mean suggests that precipitation will get more extreme over North Ghana and less extreme over South Ghana. The Intergovernmental Panel on Climate Change 6th Assessment Report suggests more extreme extremes (daily maximum, 10-and 50-year events) increase with climate change everywhere in Ghana more robustly across models (Seneviratne et al., 2021). Again, in the multi-model mean, compared to the past, South Ghana will see an increase in dry spells lasting ~8 days and North Ghana will see more dry days overall, but their distribution will stay similar, but we emphasise that the multi-model mean is not a 'most likely' scenario and planning must account for different possible futures.
The Standardized Precipitation Evaporation Index 2 is a measure of drought that also includes the impact of temperature on water demand and has been used in many climate change studies. Mean drought intensity and 2 https://climatedataguide.ucar.edu/climate-data/ standardized-precipitation-evapotranspirationindex-spei Box 1. Future narratives for Kenya hydro power (prepared by the KenGen team) • Longer shutdown events.
• More extreme rainfall on short timescales (particularly during the short rains) leads to more frequent short-duration flood events.

Future 2: Wetter future
• More extreme rainfall events on daily timescales leads to high inflow on short timescales. • Generally, more rainfall during the long and short rains leads to more inflow. More extreme seasons similar to 2019 short rains. • Higher probability of more flood events.
• Overflow discharge will increase.

Future 3: Greater seasonal and year to year variability
• Some seasons with higher temperatures and lower rainfall leads to a seasonal deficit and lower reservoir levels. • Some seasons with higher rainfall (including extreme wet days) leads to more inflow and seasonal flood events. • Greater seasonal variability requires careful management of water levels and energy provision duration using the SPEI index were found to change very little from historical  up to mid-century (2010-2050) in the SSP1-1.9 scenario but increased in the SSP5-8.5 scenario (Figures 4a,b). No literature was available on the duration or severity of the 1983 drought. Therefore, SPEI was calculated for 1980-1985 (representative of the 1983 drought) using observational data (CHIRPS2 precipitation and CRU temperature) and the most severe SPEI and longest duration drought was picked out. The most severe SPEI during this time was −3. The percentage of months with this extreme drought index and the mean of the maximum drought duration increased in the SSP1-1.9 scenario but increased by substantially more in the SSP5-8.5 scenario using the mean of all mod-els (Figures 4c,d). This indicates that under a scenario with very high greenhouse gas emissions (SSP5-8.5), extreme droughts that currently occur very rarely will become much more common by the middle of the century, with the largest changes over South Ghana. The team summarised their results in the narrative shown in Box 2.

Lessons learned
From results of a post-event survey, to which 12 of the participants responded, we ascertained how the participants felt about the event.
The clarity of topic and information provided was about right according to 75% of respondents. The teams felt they had a good mix of people and members' time was largely well utilised although assessment of the use of their own time was more varied.
Normally, hackathons are events lasting a couple of days but due to the need to work online we decided to extend the time to 9 days with participants expected to work part time (typically a few hours each day). This was also suggested by the Open Data Institute, Leeds. This was because online working has been shown to be more tiring, the event was free from the logistical constraints of an in-person event, and as this gives the opportunity for codes to run, and for sequential work between participants. In practice 45% of our respondents said they would have preferred to have less elapsed time and gave reasons such as difficulty of scheduling the time out from their own projects over that time rather than blocking out a couple of full days. Some said it was not clear how much time they should spend each day on the hackathon. The teams had short meetings each day to exchange ideas and the rest of the time worked on their own so in fact were not online for much of the day. This flexibility allowed them to fit the work around their own schedules. However, specifying a time when they could work together using virtual co-working tools such as GatherTown may have helped define the time to spend on the hackathon.
Participants felt the technology worked well. Many participants were not very familiar with GitHub or Notebooks. Notebooks were easy to pick up, but the more experienced member of the team was left to work with GitHub. This is not a big problem, but code sharing may have been easier if GitHub had been used more. The GhanaAg team sometimes used GatherTown as a virtual coworking space. They expressed that it helped build a sense of community and allowed team members to easily go and talk to other people in the team as needed. The KenGen team were happy to use Slack as a communication channel, but they may have found using virtual co-working tools helpful if they had been more familiar with such tools.
Some participants found getting sectorspecific data more challenging than others, for example, the KenGen team was slower to start because KenGen was unreachable during the first week (due to the unexpected fieldwork). We provided IMPALA CP4 Africa data but neither team used it. This was largely due to time, as CMIP6 datasets are large, and the use of CMIP6 is important for accounting for uncertainty from global change and emissions scenarios, before considering uncertainties arising from the low resolution and parameterisation of convection in CMIP6 models. The use of JASMIN was ideal in providing access to large amounts of climate data and the ability to analyse that data.   CMIP6 model historical (1980-2010) versus SSP2-4.5 (2040-2070 (a) mean change in 99th percentile daily rain (mm), (b) largest negative difference for each grid point from all models and (c) largest positive difference for each grid point from all models.
Participants were able to come up with narratives although 83% felt output was incomplete (not surprising given the time), while 17% felt they had a finished product. It is possible that some of the participants could take this work further in the future and we emphasise that results presented in this paper are outputs from the hackathon. More analysis should be considered before any application to real-world decisions.
The virtual nature of the event, enforced by the COVID-19 pandemic, enabled an event with input from the African user groups and participants that was much easier than if travelling had been required. However, we wished there would have been more input from the user groups. Several participants said they wished they could have had more time with the user group individuals, more informal chats and more stakeholder data provided. However, it was understandably difficult for the user groups, limited by their busy schedules, to dedicate much time to the process without funding for their time, and with useable outputs far from guaranteed. A future planned workshop involving KenGen, funded by Adaption Research Alliance, is perhaps the kind of engagement required to better establish user needs and facilitate their input. There were fewer African participants than the organisers had hoped. GHACOF commitments partly explain this, but also it is simply challenging for individuals to spend time on unfunded projects (even if they are useful) in institutions where funding is limited, especially where a complete output is not guaranteed.
When running a hackathon, one needs to find a balance between defining a sufficiently narrow task that allows for relatively quick progress but leaves room for being creative. One participant suggested more organised leadership of the teams so that participants knew better what they should be doing (i.e. a request for team leaders up front). However, this conflicts slightly with the aim of bottomup leadership to foster creativity. One option to address this could be to have leaders rotate each day. Leaders of the hackathon did try to steer teams, but equally did not wish to stop teams pursuing what they had decided was most relevant. Overall, both teams pursued far more detailed scientific analysis and impacts modelling than had been anticipated and spent less time on the communication aspects of 'putting possible future weather events and variability into context by using past weather' . This may result in the background of the participants as physical scientists, whereas more mixed teams would perhaps have taken a more holistic approach. There were no social scientists on the teams; social scientists may be more familiar with communicating climate information as narratives. Although in our opening meeting, a scientist with an excellent background in science communication and the use of narratives presented his work as an example, a hands-on workshop session led by him held at the beginning of the hackathon or even before the event could have been beneficial.
Having a pre-hackathon scoping event may have been useful to get some ideas of what was needed up front and then some pre-processing of data could have occurred before the main event.
At the level of detail being addressed in a short event like this, different sectors often needed quite similar information. It is best to have one geographical area per team to avoid too much similarity in topics. Table 1 summarises what worked well and what needed further thought.
Overall, the participants enjoyed taking part, gaining experience of working with others and learning some new tools. Here are some of the responses when asked what the best thing about the event was: 'Investigating research I had not done before and working with a really nice group of people and sharing ideas and code' . 'Gaining new contacts and learning to use notebooks and github' .
'I really liked looking at the different ways others have made diagnostics to generate climate indices. You often don't get to see other people's work unless it is finely polished in a paper. But I am interested in their thought process to generate the ideas in the first place -which is not captured at all by academic publications' . • Lack of African time: how to get them more involved. Some funding for user-group individuals' time could address this. • Having a pre-event scoping meeting with the user-group individuals may help. • Be clear about how much time you expect participants to spend on the hackathon when it is spread over so many days and encourage teams to define the time they should spend working together using virtual co-working tools such as GatherTown. • Getting more social scientists as participants.
• Having a pre-event or early in the event workshop about best practice in science communication.