Skip to content

Read axis values demonstration - #60

Open
Nathan Mannall (NMannall) wants to merge 3 commits into
MetOffice:mainfrom
NMannall:read_axis_values
Open

Read axis values demonstration#60
Nathan Mannall (NMannall) wants to merge 3 commits into
MetOffice:mainfrom
NMannall:read_axis_values

Conversation

@NMannall

Copy link
Copy Markdown
Collaborator

This PR adds a new XIOS example to demonstrate a bug caused by axis values being overwritten with uninitialised data when reading a file using independent reads.

The demonstration currently fails when running in the CI.

@NMannall

Copy link
Copy Markdown
Collaborator Author

This bug is caused by axis values being overwritten with uninitialised data by XIOS when reading a file using independent reads.

The problem function is CNc4DataInput::readFieldVariableValue in file nc4_data_input.hpp: https://forge.ipsl.fr/ioserver/browser/XIOS2/trunk/src/io/nc4_data_input.hpp?rev=2866#L79. Line 84 in that file means that when using independent reads, the function returns and the data in var is never changed (i.e. by reading it from the input file on line 96).

This causes a problem in the function CNc4DataInput::readAxisAttributeValueFromFile in file nc4_data_input.cpp: https://forge.ipsl.fr/ioserver/browser/XIOS2/trunk/src/io/nc4_data_input.cpp?rev=2866#L589

On line 610, the readFieldVariableValue function is called, passing in the uninitialised array readAxisValue. On line 617, this is then used to update axis->value - setting it to uninitialised data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant