Using STASH


STASH

STASH is the means that the UM uses to handle file IO & on-line processing of data. It works using a dictionary of fields the model can supply (the 'STASHmaster' file). You can use it to perform both spatial and temporal averaging of fields as the model runs, and then output the fields to files.

Suppose we want to get the surface temperature at every 3 hours of the model run. Firstly you would go to the stash panel in the UMUI - Atmosphere->STASH->STASH Specification. This gives you a table where you can edit which fields are output by STASH.

Stash main.png

On the top of the panel are 3 different lists of profiles, one each for time, domain and usage. Below the profiles are a list of diagnostics for the model to output.

Profiles define what processing is done on the field. The time and domain profiles define selection & averaging temporally and spatially, while the usage profile defines what file the output is sent to.

Time Profile

First let's look at the time profile. In this case we want the field to be measured every 3 hours, without any kind of averaging. To view profiles right click their names in the profile list and click edit.

Stash time.png

In the top half of this screen is a range of different options for time processing, such as averaging or min/max. In the bottom half are parameters such as the period to average over & how often to output the result.

Domain Profile

The domain profile specifies the spatial range of the output, both vertically and laterally. To switch between these use the *HORIZ* and *LEVS* buttons on the bottom of the window. You can output fields on pressure or height levels (amongst others), but in this case we're looking at surface temperature which will use the single level option.

Stash horiz.png

Horizontally you can look at the whole globe, just a hemisphere or a selected region. You might want to limit the domain if you're running a large simulation with only a specific area of interest to conserve output space - output the whole globe at low temporal resolution & the specific area at a higher resolution. You can also mask out the land or ocean, & perform spatial averaging if desired.

Usage Profile

Now that we've selected the spatial and temporal behaviour, the next thing to do is specify what to do with the actual output. Usually the output will be sent to a 'PP stream', which goes to a file with a .pa to .pk suffix. Clicking the FILES button at the bottom of the panel shows you the behaviour of the PP streams.

Stash usage.png

Stash pp.png

It is possible to re-initialise the PP stream periodically, rather than continuing to add output fields to the same file. Output will begin to be written to a new file, e.g. in this case the output PP0 is re-initialised every 30 days, so after 30 days have passed in the simulation the output will be written to uaidaa.pa002, then uaidaa.pa003 after 60 days & so on.

Diagnostics

Once all of the profiles have been set up you'll want to select a field to actually measure. To do this click the New... button on the side of the STASH window, which shows you the database of available fields. These are split up by sections, which you can select at the top of the panel. Double click a diagnostic to add it to the main STASH window.

Stash fields.png

You'll need to set the profiles of the field after you've added it, which you can do by selecting a profile in the STASH panel & then double clicking the field name in the Diagnostics Table.

Disabling output

To disable all STASH output select the Deactivate diagnostics checkbox on the STASH panel. You can also deactivate individual fields by double-clicking on the Include column of the diagnostics table for the relevant field.

Depending on the science section configuration of the model some STASH fields may not be available in a run, & so will not be output. If this is the case the available column in the STASH panel will show a 'N'.

The I+P+A column is a combination of the 'Include', 'Package' and 'Available' columns, to show if the field will actually be included in the output files.

* 'Include' is a yes/no switch for enabling a single diagnostic. This can be changed by double clicking on the 'Y' or 'N'.
* 'Package' allows different diagnostics to be grouped together to be enabled or disabled with a single switch. Packages can be enabled/disabled using the 'Package...' button in the top right of the STASH screen.
* 'Available' checks if the diagnostic will actually be calculated given the science sections you're using in a model. If this is 'N' you may need to check what science sections you're using.

If the I+P+A column shows an 'X' that means that at least one of these options has disabled output of the field.

Resources

| Controlling means calculations | STASH documentation | Output file formats