io: expose dMOC density-coordinate axis to XIOS, skip wet-mask on density-class 3D fields#896
Merged
Merged
Conversation
…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.
patrickscholz
approved these changes
Apr 28, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
io_xios: register thestd_densaxis (sigma_2 density classes) at context init viaxios_set_axis_attr, alongside the existingnz/nz1. Pullsstd_dens_Nandstd_densfrom thediagnosticsmodule so XIOS knows the axis length and bin values without the model having to issue them at runtime.io_meandata.write_mean: whennze == std_dens_N, skip theio_xios_apply_wet_3d_*calls. Density-class fields (std_dens_DIV/std_dens_H/std_dens_Zproduced by dMOC) are not on the geometric vertical grid; the wet-cell mask keyed offulevels_nod/nlevels_nodwould otherwise fill valid density bins withNC_FILL.local_values_*_copy(:, 1:myDim_nod2D)assignments as explicit do-loops on the owned-node range. Needed because the outer allocate ismyDim_nod2Dwhile the source array's stride was implicit; the loop form is what lets theif (nze /= std_dens_N)branch sit cleanly next to the wet-mask call without changing the per-cell semantics for non-density fields.