-
Notifications
You must be signed in to change notification settings - Fork 1
Using XIOS
At runtime XIOS reads in the iodef.xml file, which takes the form:
<?xml version="1.0"?>
<simulation>
<context id="xios" >
Some XIOS parameters
</context>
<context id="nemo">
NEMO components
</context>
</simulation>
As you can see XIOS refers to the different sections as 'contexts'. Generally there are two in the iodef file, one for XIOS itself and one for NEMO. The XIOS context contains a few general variables that can ususally be left as default.
The NEMO context (or any other model) can be into 5 main components;
- axis -> Define 1D vertical axis
- domain -> Define 2D-domain
- grid -> Define multi-dimensional grid composed of axis and domains
- field -> Define fields from model
- file -> Define output file structure
Each component is defined inside the context as a definition, e.g. <axis_definition>
, which itself comprises of either simple elements (e.g. <axis ... />
) or a group element (e.g. <axis_group ... />
) comprising of multiple simple elements.
Whilst it is possible to include all these components directly in iodef.xml, for most projects this quickly becomes unwieldy. The recommended approach is for iodef to point to a 'header' file such as context_nemo.xml, which in turn points to separate file(s) for each component. This results in the following file hierarchy:
iodef.xml
| context_nemo.xml
| | axis_def_nemo.xml
| | domain_def_nemo.xml
| | grid_def_nemo.xml
| | field_def_nemo.xml
| | file_def_nemo.xml
To point to a file, an element has the option src. For example under the file structure above, iodef.xml would call the NEMO context header with
<context id="nemo" src="./context_nemo.xml"/>
Which in turn would contain the following to call all the components:
<context id="nemo">
<axis_definition src="./axis_def_nemo.xml>
<domain_definition src="./domain_def_nemo.xml"/>
<grid_definition src="./grid_def_nemo.xml"/>
<field_definition src="./field_def_nemo-oce.xml"/>
<field_definition src="./field_def_fabm.xml"/>
<file_definition src="./file_def_nemo.xml"/>
</context>
Axis definitions contain the 1D vertical axes information. These will most likely be the same for all NEMO runs and takes the form
<axis_definition>
<axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
...
<axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
</axis_definition>
Domain definitions contain the horizontal 2D domain information.
<domain_definition>
<domain id="grid_T" long_name="grid T"/>
...
<domain id="grid_W" long_name="grid W"/>
</domain_definition>
Some runs may wish to create subdomains to output data on a smaller grid or even a single point. Any subdomains are specified after the full domain with references to the full domain id, and contain a <zoom_domain>
element to declare the start indices and the number of points.
<domain_definition>
<domain_group id="grid_T">
<domain id="grid_T" long_name="grid T"/>
<domain id="subgridA_T" domain_ref="grid T">
<zoom_domain ibegin="334" jbegin="404" ni="81" nj="95" />
</domain>
</domain_group>
</domain_definition>
NOTE:- The main domain definition is the same between XIOS1 and XIOS2, but the subdomains are defined differently.
The grid definitions pull together the axis and domains to create the grids. 2D grids only need to specify the domain, whilst 3D need a domain and axis.
<grid_definition>
<grid id="grid_T_2D" >
<domain id="grid_T" />
</grid>
<grid id="grid_T_3D" >
<domain id="grid_T" />
<axis id="deptht" />
</grid>
<grid id="subgridAT_grid" >
<domain domain_ref="subgridA_T" />
<axis id="deptht" />
</grid>
</grid_definition>
NOTE:- This structure differs from XIOS1. Here the domain and axis are classed as elements of the grid, whereas previously XIOS1 only referenced them
The field definition elements reprepresent the variables in the model. Usually there is a separate field definitions file per module in NEMO, for example one for ocean physics (field_def_nemo-oce.xml) and one for biogeochemistry through FABM (field_def_nemo-fabm.xml). The field definitions have several options that can be set, such as the precision level and the time operation to apply.
<field_definition prec="4" operation="average" enabled=".TRUE." >
<field_group id="ptrc_T" grid_ref="grid_T_3D">
<field id="light_ADY" long_name="light gelbstoff absorption" unit="1/m" default_value="-.200E+21" />
...
<field id="G3_c" long_name="benthic dissolved inorganic carbon carbon" unit="mmol/m^2" default_value="-.200E+21" />
</field_group>
</field_definition>
Output files are defined through the file definition element. A file group shares options such as the output frequency, then under each file element is a set of fields to include in that file.
<file_definition >
<file_group id="1d" output_freq="1d" enabled=".TRUE." >
<file id="file61" name_suffix="_grid_U" description="tracer variables" sync_freq="1d">
<field field_ref="uoce" operation="average" long_name="sea_water_x_velocity" />
<field field_ref="utau" name="tauuo" long_name="surface_downward_x_stress" />
</file>
</file_group>
</file_definition>