Input Files - adeytown/um2netcdf GitHub Wiki

There are 3 types of input files used by UM2NetCDF

1. UM Input Files

These are the binary files that are parsed and processed by UM2NetCDF. Variables located within these files are collected and written in an output NetCDF file. Currently, UM2NetCDF can only use UM fields files or UM dump files as the UM input files. Also note that UM2NetCDF cannot parse WGDOS-packed fields.

2. Stash2cf Files

These are XML files that define various metadata characteristics for UM data fields. An example of a valid stash2cf file can be found in the run subdirectory. One must specify a stash2cf file in order to run UM2NetCDF.

A valid stash2cf file will follow the structure below:

<stash2cf>
<model model_id="0">
   <section section_id="0">
       <item>
           <stash_code>1</stash_code>
           <varname>sfc_air_press</varname>
           <longname>air pressure at model surface</longname>
           <standardname>air_pressure</standardname>
           <units>Pa</units>
           <validmax>110000.000000</validmax>
           <validmin>60000.000000</validmin>
           <umgrid>0</umgrid>
           <accum_field>0</accum_field>
           <level_type>1</level_type>
       </item>
   </section>
</model>
</stash2cf>

The model tag refers to the UM atmospheric model. UM2NetCDF has only been tested with 1 model tag being used. The STASH CODE of any particular UM variable will be equal to

1000*section_id + stash_code

Please note that the stash_code attribute listed in the stash2cf XML file is not equal to any valid UM STASH CODE. Apologies for any confusion that this will cause.

Every UM data field defined in the XML file will have its own tag section. This tag section will have 10 attributes. It is compulsory for all 10 attributes be defined for every UM data field defined in the stash2cf file. A description of each attribute now follows:

stash_code: equal to the UM ITEM CODE of the particular data field

varname: name that the variable will be called in the output NetCDF file

longname: CF-compliant descriptive name for the UM variable

standardname: CF-compliant standard name for the UM variable

units: CF-compliant units for the stored UM field

validmax: defines the maximum field value to be displayed (not stored) in the output NetCDF file

validmin: defines the minimum field value to be displayed (not stored) in the output NetCDF file

umgrid: flag variable used to denote which grid the data field is natively stored on. Valid values are 1, 2, 3, 11, 18, 19, 21, 22 and 23. Variables with an umgrid value of 11, 18 or 18 will be linearly interpolated onto the theta points of an Arakawa C grid (if the -i option is selected by the user).

accum_field: flag used to distinguish if an accumulation variable is created by performing a mean (accum_field=0) or a summation (accum_field=1) operation.

level_type: flag used to denote whether the data field values sit at theta (level_type=2) or rho (level_type=1) points in the vertical.

3. Run Configuration File

An user may specify a run configuration file using the -c flag with UM2NetCDF. This is a XML file that defines a number of run and/or site-specific characteristics. An example of a run configuration file can be found in the run subdirectory. The file follows the structure given below.

<run_config>
   <institution>Martian Weather Service</institution>
   <ps>666</ps>
   <niwa_eps>4</niwa_eps>
   <rose_id>unknown</rose_id>
   <model_name>mars01</model_name>
   <references>unknown</references>
   <comment>Runs of the invasion landing area</comment>
   <title>Martian Regional Model Output</title>
   <data_assimilation_method>none</data_assimilation_method>
</run_config>

If an user wishes to use/specify a run configuration file, then that XML file must define all 9 attributes shown above. The attributes are described below.

institution: name of the site at which the UM input file was generated

ps: version of the PS suite used in the run

niwa_eps:

rose_id: ID for the rose suite from which the UM fields or dump file was produced.

model_name: name of the forecast/simulation run

references: URL or journal citation describing the setup of the forecast run

comment: any additional information about the run

title: title of the output file

data_assimilation_method: self-explanatory

If no run configuration file is specified, then the following defaults will be used:

institution = ACME Corporation
ps = 0
niwa_eps = 0
rose_id = 0
model_name = my UM Model
references = no references listed
comment = no comment
title = Model Output
data_assimiliation_method = no data assimilation used
⚠️ **GitHub.com Fallback** ⚠️