Semantic Werks

Thoughts on people, machines and systems.

Posts Tagged ‘climate change

Open science and workflows

with 2 comments

I was talking to Jon Pipitone about scientific computing. For a long time this field was mired in the relatively obscure (yet vitally important) field of numerical analysis. Now,  however, with the relative interest generated by `ClimateGate’ and open-source software, interest in scientific computing — by which is typically meant computing for scientific disciplines, such as biology, chemistry, physics, and in particular, the software supporting that computing — has grown, particularly with respect to the repeatability of these experiments.  An excellent resource to read for an introduction is the Microsoft research report on “4th Paradigm science”.

Spurred on by a post by programmers who have converted relatively opaque C/Fortran code to Python, I wondered what other such projects might be around. The goal being to make the procedures followed more open and understandable by laypeople (as much as that might be possible — just because we know what rain is doesn’t mean we are all climatologists).

I asked him what might be worth trying to convert:

A … particularly nasty, but possible idea would be to convert a single fortran module from an existing climate model over into python, and then use some fancy python-fortran bridge to make they two talk to each other.  That way you could slowly convert a model over to python. You’d be forced into, at least partially, keeping the original model architecture.  That wouldn’t be ideal, but at least you’d know you were being true to the model (because you could compare output).

Sounds nasty to me.  If you were considering rewriting a chunk of a model, I’d suggest starting with NASA’s ModelE (or a newer version). It’s the simplest and littlest, big GCM I’ve seen.

But then I realized that moving code from C/Fortran to Python gains you a little bit of readability, a lot of maintainability, sacrifices speed, and leaves you, ultimately, back at the same point you started: computer code (procedural at that).

There’s a parallel to ‘literate programming‘. What we would really like to do is write these tools in a language that is platform independent and language independent.

Here’s how I see the transition:
Science workflow1.  Cognitive understanding —> 2. Language of science (mathematics, with bio/phys/chem extensions) —> 3. language of platform (R, mathematica, custom code) —> 4. bytecode ==> 5. computer processing –> 6. output representation

We would like to get rid of having to do the second translation, right? So that you can just write in the language of mathematics and have the output (prediction, in the form of graph, chart, numbers) be correct. So I guess there should be two sides to this workflow: one from the natural language to the bytecode, and the other from the bytecode back out to natural representation.

The assumption I’m making is that the further away from bytecode you get the more people have a chance of understanding your work.

Some of this discussion is (uncomfortably) similar to model-driven approaches, of course. The challenge there, for me, has always been that you cannot represent *all* the problem in the model – so you end up with a bunch of custom code anyway. Jon again:

Yup.  And the climate scientists will tell you that all the time.  There are all sorts of optimisations and workarounds that have to be specified in the code.  Not to mention the fact that the way you decide to discretize the mathematics in the papers and which algorithms you choose as implementations are also dependent on the rest of the model/compiler/platform, etc..  So it’s not that we’re trying to replace the second step, but just make it clear what’s happening along the way.

Written by Neil

2010 February 1 at 11:41

De-referencing climate claims

with 2 comments

Our group of software scientists, informaticians, and modeling experts at the University has been congregating weekly to discuss software science’s role in {ameliorating|understanding|preventing|debunking} climate change. Steve Easterbrook’s been the inspiration.

We have undertaken the challenge of modeling some of the claims and information used in climate change. We started out with wind renewables, specifically chaps 10/14/18/B in the Mackay book.

I found this figure interesting:

Predicted energy outputs, renewable energy sources

Predicted energy outputs, renewable energy sources

It’s from Mackay, page 107, and shows his estimates for renewable energy outputs, in kWh/day, in the first column, compared with four other sources. What I wanted to do was suss out the reasons for the discrepancies in the numbers. I’ve picked the offshore wind row, which he has as generating up to 48 kWh/d (32 deep, 16 shallow) vs 6.4, 4.6, and 21 kWh/d for other sources. That’s a difference of between 2x and 10x, depending on source and whether you include deep offshore (‘deep’ is water deeper than 25 metres, not including floating generators). Mackay’s numbers are derived from a series of Fermi calculations in his book.

CAT report

The biggest number is 21kWh/d, which was included in the Centre for Alternative
Technology’s (CAT) “Island Britain” plan  — Helweg-Larsen and Bull (2007). I found a copy of this online, and tried to figure out the genesis of this number.  The first sentence on page 85 gives 3,212 TWh/year as the potential amount of (offshore) wind energy, and estimates harnessing 14% of this by 2027. 14% of 3212 is 450, divided by 365 to give a daily figure, which is 1.23 TWh/day. MacKay gives his figures per person, so I used the population as of 2007, which is 61 million people, and divided by that, then multiplied by 106 (to change from Tera to kilo). Result is 20.16, which is close to the 21 kWh/day MacKay lists (probably due to rounding). Obviously the 2027 population of the UK will be much higher than 61 million, and I believe the figures used in the CAT report are only for Great Britain, which excludes a lot of offshore area around Ireland (and, I suppose, the Isle of Man, etc).

The key datum here is the 3,212 TWh/year estimate of potential wind energy offshore. That number comes from Department of Trade and Industry (Nov 2002) “Future Offshore: A strategic framework for the offshore wind industry“. In that report Table 2.2, page 26, summarizes the various wind energy potentials. This information is derived from a GIS that models water depth, wind speeds, etc. The report uses four strategic regions only, and omits water less than 5m deep, since there is likely to be greater conflicts closer to shore. However, the table calculates values for depths between 5 and 30 metres, and a second value for water between 30-50 m. The total energy production is then listed 3,213 TWh/year for all depths between 5-50m, within the four strategic regions. These regions are selected for location near the grid and also expanse of shallow water. They look comparatively small in size, so I suspect the totals are greatly underestimating the total potential (notwithstanding grid improvements to transfer the energy).

What is the cause of the difference between Mackay’s 48kWh/day and CAT’s 21kWh/day? One is due to this difference in the size of possible area. Mackay calculates the water depths, then arbitrarily takes 1/3 as usable (due to shipping etc).  Another is estimates of potential wind energy. He uses average power per square metre of 3 W/m2, while the CAT/DTI report presents no such estimate, but its calculations suggest they are using a factor of 12 W/m2. I cannot find their source for such a huge increase in the average power per unit area. Mackay, on page 60, lists the actual power for a running farm at 2.6 W/m2.

I think what the DTI/CAT report did was to place a ’3MW’ turbine every 500 metres, then multiply that density by the total area, to get total power capacity. I.e., for a one km2 unit, there would be nine turbines possible (using their 500m separation), for a power potential of 27W/m2. The DTI paper, on page 27, then assumes a 40% load factor (Mackay states industrial averages are nearer 30%). If we assume 10 turbines per km2 (not sure why 10 and not 9), we end up with the 12W/m2 figure they used. This is an unsafe assumption, however, as the real world data from Mackay seems to suggest. Certainly the factor of 4 improvement is highly suspect.

Conclusions

It seems clear that this little exercise has pointed out some very interesting inconsistencies. Obviously, calculations for potential energy sources in twenty years will always be subject to some uncertainty — who can say for sure what the possible results will be, or what ‘unknown unknowns’ will exist? Nonetheless, even for these simple analyses assumptions varied greatly — available area, feasible sea depth, load factors, unit power.

To me, it seems clear that more detailed planning than these rough estimates should be performed. The DTI report, for example, seems to be a major policy statement of the UK government! And it isn’t like the information is hard to gather, relative to other sciences. We could surely stick some anenometers out there to improve our knowledge of peak loads, evaluate current projects, perform some economic analysis like risk assessments, etc., in order to derive a more realistic, finer-grained model.

I would like to acknowledge Jon Udell, whose efforts in ‘citizen e-democracy’  have been at the forefront for a long period of time. See, for example, his work tracking down the sources for crime statistics in his hometown. Too often the tidy figure quoted in a published study is the product of sloppiness and lazy research. And all too rarely is this figure fact-checked. But that is a (relatively) painless thing to do in the age of the Internet, and I think it behooves us all as citizens to do so.

Written by Neil

2009 August 26 at 00:05

Follow

Get every new post delivered to your Inbox.

Join 198 other followers