Conversation
In get_obs_pert(), the grid cell of each obs was found w.r.t. pert_grid_lH, whose ll_lon/ll_lat are computed from the local obs extent and are subject to roundoff. An obs close to a pert grid cell edge could therefore be mapped to different cells (and receive different perturbations) on different processors, making results depend on the EnKF analysis layout (e.g., the number of processors or the AnaLoadBal partition) and giving the same obs different perturbations for tiles analyzed on different processors. Find the cell w.r.t. pert_grid_f (identical on all processors) and convert to the pert_grid_lH index with the same integer offsets that are used to extract the local perturbation window in propagate_pert(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amfox37
force-pushed
the
bugfix/amfox/obs-pert-layout-independent
branch
from
September 24, 2026 16:00
de67df7 to
a04a9b5
Compare
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
In
get_obs_pert(), each obs was mapped to a perturbation grid cell withget_ij_ind_from_latlon(pert_grid_lH, ...). The local gridpert_grid_lHis built per processor from the local obs extent, and itsll_lon/ll_latare computed in single precision (e.g.ll_lat = pert_grid_f%ll_lat + real(ind_min-1)*dlat) and are subject to roundoff. An obs lying very close to a pert grid cell edge could therefore be mapped to different cells, and so receive different perturbations, depending on which processor handles it. As a result, the analysis depended on the EnKF layout (number of processors andAnaLoadBalpartition). Within a single run, the same obs could also get different perturbations for tiles analyzed on different processors.This PR finds the cell on the global
pert_grid_f, which is identical on all processors, and converts it to thepert_grid_lHindex with the same integer offsets (i_offg/j_offg) thatpropagate_pert()uses to extract the local perturbation window. The perturbation fields themselves were already layout independent; only the lookup was affected.Evidence
CF0360, 24 members, H SAF ASCAT, 240 ranks, comparing the default count-based
AnaLoadBalpartition against an experimental cost-weighted partition, with the same executable otherwise:ll_latrounded differently, so it got different perturbations.Impact