MetOffice / MetOffice/lfric_apps

XIOS aborts during context initialisation due to undefined field - `lfric_atm`

Open Beginner friendly
#773 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Fortran
Stars
31
Forks
118
Avg merge
2d 4h
Merged PRs (30d)
8

Description

### Version

main

### Are there any linked Issues or Pull Requests?

_No response_

### What happened?

During some experiments into XIOS XML settings, I turned on `par_access="independent"`. This caused an error when running `lfric_atm` with `oper_diags_hres` optional configuration.

XIOS aborts during context initialisation with the following error:

```
In file "field.cpp", function "void xios::CField::solveGridReference()", line 1605
-> A grid must be defined for field '__field_undef_id_19' .
```

This presented in `file_def_diags_ver.xml` which references `cloud__cloud_base_altitude` (not defined in the current METADATA field definitions). Since this is a dangling `field_ref`, nothing is inherited, so XIOS cannot solve the grid reference.

I think commenting out the two references (`lfric_ver_tp0` and `lfric_ver` field groups) rather than deleting them (so they can be restored if the diagnostic is added to METADATA) is probably the best way forward.

I also audited the remaining `field_ref` ids used by enabled files and this is the only missing one.

The same reference also exists in file_def_diags_ral.xml, file_def_diags_idealised.xml and file_def_diags_ls_and_jedi.xml. Those are not included by the affected iodef and are left unchanged, but will hit the same error if run against the lfric_atm metadata.

### Relevant log output

```shell
In file "field.cpp", function "void xios::CField::solveGridReference()", line 1605 -> A grid must be defined for field '__field_undef_id_19' .
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with file_def_diags_ver.xml and inspect the lfric_ver_tp0 and lfric_ver field groups that reference cloud__cloud_base_altitude. Run lfric_atm with the oper_diags_hres optional configuration and par_access="independent" to reproduce the XIOS initialisation error. Done means the dangling references are commented out and the configuration no longer aborts; review the matching references in file_def_diags_ral.xml, file_def_diags_idealised.xml and file_def_diags_ls_and_jedi.xml.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.