Skip to main content

Posts

Showing posts from May, 2016

On the edge

One of the more difficult aspects of coding stencils or other neighbourhood-based operations is working out what should happen at the edge of the grid. Parallel array languages such as ZPL have expended significant effort to provide mechanism to make coding edge effects easier. PM handles edge effects by making use of optional data types - containers that can hold either a value ( e.g. : an integer) or null . Optional types have many uses, including the representation of unbounded data structures in a pointerless language. A number of operators are defined for optional types, most usefully |.  x|y returns the value contained in x if that value is not null . Otherwise y is returned.  Binary communicating operators (x@[ neighbourhood ] or x@{ neighbourhood }) always return optionally-typed values, with off-edge cells set to null . Combined with the | operator, this makes dealing with edge-effects straightforward. The following code fragment demonstrates how PM hand...

2016 Conference Presentation

Conference presentation on PM at European Geosciences Union General Assembly, Vienna, April 2016. Slides - PDF You may note some small changes in the language from previous posts - I will update on these in a new post soon.