SE dycore diags: WV_PDC & other per-element dyn grid history fields only written one element per rank
- Dominant language
- No language data
- Stars
- 9
- Forks
- 22
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 4
Description
### What happened?
`WV_PDC` diagnostic from SE dycore on ne16pg3 with 192 ranks gives 1728 of 13824 fvm columns with data and the rest fillvalue (1e36); 1728 = 192 ranks x 9 columns, i.e. the first element's slot on every rank.
Lightly edited analysis from `claude-fable-5-1` below:
Cause: `prim_advance_mod.F90` util_function (L1749-1772) is called once per
element and does `call history_out_field(name_out, f_out)` (L1769) with the
element's nx*nx values.
CAM passes the element: `outfld(name_out, f_out, nx*nx, ie)`
(CAM prim_advance_mod.F90 L1727).
CAM-SIMA's history_out_field has no column-offset argument:
`history_out_field_1d/2d` call `hist_field_accumulate(field_info, field_values, 1, ...)` (cam_history.F90 L672, L723),
so every element accumulates into columns 1:nx*nx of the rank's
buffer and the other elements' slots are never written.
Same shape for every per-element dycore-grid write in stepon.F90 (the
*_gll fields, PS&IC/T&IC etc.); only WV_PDC verified from output.
### What are the steps to reproduce the bug?
See above
### What CAM-SIMA hash were you using?
458b5d53 (based off sima0_20_002)
### What machine were you running CAM-SIMA on?
CGD machine (e.g. izumi)
### What compiler were you using?
GNU
### Path to a case directory, if applicable
_No response_
### Will you be addressing this bug yourself?
Any Software Engineer can do this
### Extra info
Tagging @peverwhee @nusbaume !
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with util_function in prim_advance_mod.F90 at lines 1749-1772 and history_out_field_1d/2d in cam_history.F90 at lines 672 and 723, then compare the CAM call in prim_advance_mod.F90 with CAM-SIMA's accumulation interface. Review the per-element writes in stepon.F90, including *_gll and PS&IC/T&IC fields. Reproduce the WV_PDC case and verify every element's columns are populated rather than only the first nine per rank.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100