Skip to content

Commit

Permalink
And one more small fix in the logic to find 'singleCompCaseFlag' -
Browse files Browse the repository at this point in the history
considering that Fortran indexing starts at 1 when doing mod!
  • Loading branch information
theurich committed Sep 27, 2024
1 parent 84d4462 commit ffc6881
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,12 @@ subroutine ESMF_StateReconcile_driver (state, vm, attreconflag, rc)
if (singleCompCaseFlag) then
! singleCompIndex could be 1 or 2, however, cannot simply look this up
! in vmintids_send(1), because on PETs that do not have objects it only
! stores vmintids_send(1), which holds the index into vmIdMap of the
! stores vmintids_send(0), which holds the index into vmIdMap of the
! executing VM. Since there are only two possible values, the correct
! singleCompIndex must be "the other one". Therefore, look at
! vmintids_send(0), which is valid on all PETs, add 1 mod 2.
singleCompIndex = mod(vmintids_send(0)+1,2)
! vmintids_send(0), which is valid on all PETs, add 1 mod 2. But since
! indexing into vmIdMap starts at 1 the add 1 happens _after_ the mod 2.
singleCompIndex = mod(vmintids_send(0),2)+1
vmIdSingleComp => vmIdMap(singleCompIndex)
endif
endif
Expand Down

0 comments on commit ffc6881

Please sign in to comment.