Add new diagnostics
If you want to add a NEMO diagnostic to the NEMO code you will need to do the following:
Add any necessary code to calculate you new diagnostic in NEMO
Send the field to XIOS using
CALL iom_put( 'field_id', variable )
wherefield_id
is a unique id for your new diagnostics and variable is the fortran variable containing the data. This should be called at every model timestep regardless of how often you want to output the field. No time averaging should be done in the model code.If it is computationally expensive to calculate your new diagnostic you should also use “iom_use” to determine if it is requested in the current model run. For example,
IF iom_use('field_id') THEN !Some expensive computation !... !... iom_put('field_id', variable) ENDIF
Add a variable definition to the
field_def_nemo-???.xml
file.Add the variable to the
iodef.xml
orfile_definition.xml
file.