Fix qv index lookup for lbc_scalars - #1507
Open
jihyeonjang wants to merge 1 commit into
Open
Conversation
The init_atm_case_lbc subroutine retrieves the lbc_scalars array from the lbc_state pool, but obtains the qv constituent index from the state pool using index_qv. The scalars and lbc_scalars arrays are separate variable arrays, and their constituent indices are generated independently. Therefore, the index_lbc_qv should be retrieved from lbc_state and used when indexing lbc_scalars. Since index_qv and index_lbc_qv are expected to always be the same (both equal to 1), this change would not affect the results, which are the lateral boundary conditions generated for regional MPAS simulations. However, care is needed when adding new variables to scalars and lbc_scalars. For example, I added a passive tracer as the last variable in both scalars and lbc_scalars arrays in Registry.xml. During init_atm_case_lbc, using an index from scalars accessed the wrong constituent in lbc_scalars, because currently tke is included in scalars but not in lbc_scalars.
jihyeonjang
force-pushed
the
fix_lbc_qv_index
branch
from
September 4, 2026 03:42
7311258 to
76c73ed
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.
This PR fixes the qv constituent index lookup in the
init_atm_case_lbcsubroutine.The
init_atm_case_lbcsubroutine retrieves thelbc_scalarsarray from thelbc_statepool, but obtains theqvconstituent index from thestatepool usingindex_qv. Thescalarsandlbc_scalarsarrays are separate variable arrays, and their constituent indices are generated independently. Therefore, theindex_lbc_qvshould be retrieved fromlbc_stateand used when indexinglbc_scalars.Since
index_qvandindex_lbc_qvare expected to always be the same (both equal to 1), this change would not affect the lateral boundary conditions generated for regional MPAS simulations.