What is STASH?
STASH is the Unified Model's storage handling and diagnostic system. It is designed to cope with the many different configurations that the UM can be used in, but still provide output in a consistent and standard way.
Prognostic and Diagnostic Fields
The UM considers variables (or fields) to be of two different types, prognostic or diagnostic. Prognostic fields are ones which the model must have values for, prior to each timestep, as the equations of motion the model solves require these fields (these are fields such as specific humidity or potential temperature) so they must exist in the model start dump. Diagnostic fields are all other fields that are derrived from prognostic ones, and as such the model does not need to have prior values for these. Ancillary files (such as emissions, SSTs etc) contain prognostic fields.
From a user's perspective, STASH is used to output fields during the run, and from this point of view it does not matter if these are prognostic or diagnostic fields. However, you will need to consider these differences when you add new chemical tracers.
STASH Sections and Items
Each field that is considered by STASH has a unique address which is given by a section and an item number. Prognostic fields are mostly held in section 0 (with the exception of tracers) and diagnostics are organised by areas of the code, e.g. short-wave radiation diagnostics are held in section 1, long-wave radiation diagnostics are held in section 2 etc. Some sections will always be on, and some sections will only be on if a certain process is selected, e.g. the interactive land-surface scheme. Each section can hold up to 512 items, where each item is a separate prognostic or diagnostic field, and can be either 2D or 3D.
Each field has its own entry in a STASHmaster file. There is a master list of fields which is held in the STASHmaster_A file, which is located at
/projects/um1/vn8.2/ctldata/STASHmaster/STASHmaster_A
on MONSooN, and at
/work/n02/n02/hum/vn8.2/ctldata/STASHmaster/STASHmaster_A
on HECToR. This is also a handy list of all the fields that can be outputted from the model, which is easier to search than by going through the UMUI panels. UKCA uses section 34 for chemical tracers and chemical diagnostics, and section 38 for aerosol diagnostics.
Output Files
Before we cover outputting diagnostics from the UMUI STASH panel, we will first cover the different output fields files that are produced by the UM. Output from STASH is sent to different output streams, and there are two types of files used by these streams: standard PP files and climate mean files.
Standard PP files
In your UMUI job, go to Model Selection → Post Processing → Initialization and processing of mean and standard PP files. As well as choosing the packing profile (see the Help button for more information) this panel also describes how these different files are treated. As can be seen in Figure 1, there are 11 PP files defined, PP0 to PP10, which correspond to designators pa to pk (with units 60-69, and 151 - these unit numbers may be important in warning and error messages).
The table in this panel can be used to set various properties of these files, such as the time period the file covers, and whether or not the file is archived (i.e. either to the archive/ sub-directory or RDF facility on HECToR, or two the /nerc disk or MOOSE on MONSooN). Being able to change the time period is very useful - while for many simulations monthly mean files are preferred (see the discussion about climate meaning below), often you may wish to output higher frequency data, e.g. 6-hourly. These PP files are limited to a finite size and so outputting a month of 6-hourly data may cause the model to crash at run-time. The solution to this is to change how frequently the files are generated, e.g. you could output daily files instead of monthly ones.
Climate Mean files
Climate meaning is controlled in the same panel where the restart dump frequency is set: Model Selection → Atmosphere → Control → Post processing, Dumping & Meaning. The main panel is shown in Figure 2. In this example, as is standard for all climate jobs, restart dumps are created every 10 days, and this example as these dumps archived every 9 files, starting with the 9th file after the job is started, i.e. every 3 months (to save space you may choose to change this to 1 year or every 36 files). All other dumps are deleted after they are no longer needed. This means that if the model crashes and needs to be restarted, you will at most have lost 10 days of run. Note: while the model will bit compare on restarting from an old dump, this will not be the case if the dump frequency is changed.
This panel has selected regular frequency dumps with possible meaning sequence so climate meaning is possible. To do this, you must specify a date for the meaning sequence. Note: you should be careful about this choice of date, especially if you are changing the start-date of the run. It is advised that this meaning squence date is set to be on or before your start date. If it is not you will not generate some of the climate mean files.
The follow-on window from this panel (shown in Figure 3) gives more details about how climate meaning works. These files work on multiples of the dump period, so the first climate mean file created will be a multiple of 3 dump periods (i.e. 3x10 days, or 30 days. Since we are running a 360-day calendar, this is 1 model month) which is the pm monthly-mean file, which we considered when running existing UKCA Job. The second climate-mean file is a multiple of 3 of the monthly-mean files (i.e. 3x30 days, or 90 days, which is a season), the ps seasonal-mean file (the meaning date is important here to get the correct 3 months for each season). The third climate-mean file is a multiple of 4 of the seasonal-mean files (i.e. 3x90 days, or 360 days, a year), the pa annual-mean file. The final file created is a multiple of 10 of the annual-mean files - a decadal-mean px file.
The fields outputted to each of these pm, ps, pa, or px file is the same, and in the same order. All that is different is the meaning done to each field. Note: if you change the dump frequency you will change the frequency of creation of these climate-mean files. In this instance you would need to change the multiple for the first file to get a monthly-mean file correctly.
The UMUI STASH Panel
This panel can be found at Model Selection → Atmosphere → STASH → STASH. Specification of Diagnostic requirements and is shown in Figure 4. When you first open this panel you may get a window telling you that system diagnostics have been over-written by user diagnostics - just click continue here. We will cover user diagnostics in the adding new UKCA diagnostics tutorial.
This panel is organised as a table, listing the diagnostics that have been selected (currently - more can be added) and what the time, domain, and usage profile for each diagnostic is. In the table as well as giving the name of each diagnostic, the STASH section and item number is also given, with the table sorted by section, item.
Time Profiles
There is a rather extensive list of time profiles already existing in this job, and it is possible to add more by making a new one in a blank slot. These time profiles define how the data is time-processed prior to being output. Some profiles, such as T6H have no meaning, and just output the field as it is every 6 hours, other profiles, such as TDAYM will result in a daily mean of a field. You can view how these profiles are defined by selecting a profile (it will highlight yellow) and going to Profiles → Edit Profile → Edit time in the STASH panel menu. An example of the TDMPMN time profile is shown in figure 5. This is the climate-meaning time profile, and samples fields every dump period.
Domain Profiles
These profiles cover the horizontal and vertical domain covered by fields as they are output. Depending on the diagnostic which is outputted, some of these are on pressure levels, model theta levels, model rho levels, or on a single (e.g. a suface of top of the atmosphere) level etc.. The DALLTH outputs variables on all model theta levels, and it is this domain which UKCA fields (except for surface fields) are usually outputted on. If you edit this profile you can also see that it is possible to output zonal means of fields, or to limit the output to a particular area. This last option can be especially useful if a large amount (e.g. hourly) data is required, but only for a specific part of the world, over the length of a long run.
Usage Profiles
These profiles determine which output stream to use. The UPMEAN profile will send data to the climate-meaning stream discussed above, whereas the UPA profile will send data to the pa file etc.
Note: If you are sending data to the climate-meaning stream UPMEAN you must use the TDMPMN time profile (or a variation thereof), otherwise this output will become corrupted or incorrectly meaned.
The Menu Bar
The STASH panel is unusual for the UMUI in that it has a separate menu bar, rather than using a row of buttons along the bottom of the panel.
STASH
This menu contains the usual Close (i.e. save and close panel) and Abandon (i.e. close without saving) options.
Profiles
As discussed above, you can use the Edit Profile options to view (and change) new or existing profiles. You can also Copy or Delete profiles from this menu.
Diagnostics
This menu contains the items that you will probably use the most. It is here that you can add new diagnostics and change the order of the diagnostics in the table.
Help
The Help menu has a more detailed discription of the features and options in the STASH panel.
Written by Luke Abraham 2013