LMDZ XIOS outputs
You can control many outputs using XIOS (see XIOS_output_controls for details).
Contents
Output files
The main output file, equivalent to diagfi.nc is Xhistins.nc. This file is controlled mainly by file_def_physics.xml (the name of the file can be changed too)
Parameter files
iodef.xml context_pcm_physics.xml field_def_physics.xml file_def_physics.xml
Here a XML example files for XIOS for the
XML example files are different for DYNAMICO. See Controling outputs in the dynamics with DYNAMICO.
You you will find XML examples here:
- deftank/dynamicofor Generic-DYNAMICO
- deftank/dynamicofor Pluto-DYNAMICO.
field_def_physics.xml
This file declares all variables available in the model. It should correspond to all variables written by write_output() (see Adding new variables in the physics (physiq_mod/physiq).
The code will abort if a variable is not defined here but is present in physiq_mod (it will give an error [ id = weirdvar, U = field ] object was not found.
such as given as example in The_XIOS_Library#field_definitions).
WARNING: It should NOT BE CONFUSED with file_def_physics.xml
Adding a variable in field_def_physics.xml is not sufficient to write it in the outputs, you should also select it in file_def_physics.xml.
file_def_physics.xml
This file (example here) lists the output files you want to write, and which variables to write in it.
WARNING: it should NOT BE CONFUSED with field_def_physics.xml
An example (available at the link above), with the name of the output file and here only one variable (temperature) would look like:
<file_definition>
<file id="histins"
name="Xhistins"
output_freq="40ts"
sync_freq="40ts"
type="one_file"
time_units="days"
enabled="true">
<!-- VARS 3D -->
<field_group operation="instant"
grid_ref="grid_3D_out"
freq_op="1ts">
<field field_ref="temperature" />
</field_group>
</file_definition>
Adding new variables in the physics (physiq_mod/physiq)
If you add fields using the write_output() routine (for example in physiq_mod), you will need to add a corresponding field in field_def_physics.xml. For example,
call write_output("temperature","temperature","K",zt)
corresponds to
<field id="temperature"
long_name="Atmospheric temperature"
unit="K" />
You can automatize the translation fortran->XML via the script UTIL/convert_diagfi_to_xml.py (by pasting the write_output() lines into the fortran_input file read by the script).
You will need to know if the variable is 1D,2D or 3D before putting it in the right section of the field_def_physics.xml file though. As a word of caution, the script parses the line using commas. Please don't use commas in the long names of variables!
Going further
Check out more details on the use of XIOS here: XIOS_output_controls