Skip to content

io: expose dMOC density-coordinate axis to XIOS, skip wet-mask on density-class 3D fields#896

Merged
JanStreffing merged 3 commits into
mainfrom
feat/fesom-xios-std-dens-axis
Apr 28, 2026
Merged

io: expose dMOC density-coordinate axis to XIOS, skip wet-mask on density-class 3D fields#896
JanStreffing merged 3 commits into
mainfrom
feat/fesom-xios-std-dens-axis

Conversation

@JanStreffing

@JanStreffing JanStreffing commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • io_xios: register the std_dens axis (sigma_2 density classes) at context init via xios_set_axis_attr, alongside the existing nz / nz1. Pulls std_dens_N and std_dens from the diagnostics module so XIOS knows the axis length and bin values without the model having to issue them at runtime.
  • io_meandata.write_mean: when nze == std_dens_N, skip the io_xios_apply_wet_3d_* calls. Density-class fields (std_dens_DIV / std_dens_H / std_dens_Z produced by dMOC) are not on the geometric vertical grid; the wet-cell mask keyed off ulevels_nod / nlevels_nod would otherwise fill valid density bins with NC_FILL.
  • Same hunks rewrite the surrounding whole-array local_values_*_copy(:, 1:myDim_nod2D) assignments as explicit do-loops on the owned-node range. Needed because the outer allocate is myDim_nod2D while the source array's stride was implicit; the loop form is what lets the if (nze /= std_dens_N) branch sit cleanly next to the wet-mask call without changing the per-cell semantics for non-density fields.

…density-class 3D fields

io_xios: register the std_dens axis (sigma_2 density classes) at context
init via xios_set_axis_attr, alongside existing nz / nz1. Pulls
std_dens_N and std_dens from the diagnostics module so XIOS knows the
length and values without the model having to issue them at runtime.

io_meandata: in write_mean, skip io_xios_apply_wet_3d* when the field
has nze == std_dens_N. Density-class fields (e.g. std_dens_DIV /
std_dens_H / std_dens_Z used by dMOC) are not on the geometric vertical
grid; the wet-cell mask keyed off ulevels_nod / nlevels_nod would fill
valid bins with NC_FILL.

Same hunks also replace whole-array assignments of local_values_*_copy
with explicit do-loops on the owned-node range — needed because the
allocate uses myDim_nod2D while the source array stride was implicit;
the loop form is what allows the std_dens_N branch to live cleanly next
to the wet-mask call.
@JanStreffing JanStreffing self-assigned this Apr 27, 2026
@JanStreffing JanStreffing added the enhancement New feature or request label Apr 27, 2026
@JanStreffing
JanStreffing merged commit cb674c6 into main Apr 28, 2026
19 checks passed
@JanStreffing
JanStreffing deleted the feat/fesom-xios-std-dens-axis branch May 4, 2026 09:33
patrickscholz pushed a commit that referenced this pull request Jun 19, 2026
io: expose dMOC density-coordinate axis to XIOS, skip wet-mask on density-class 3D fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants