Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/reconcile-noop' into testing…
Browse files Browse the repository at this point in the history
…/nrl
  • Loading branch information
theurich committed Dec 14, 2024
2 parents 36025dd + 6a781b2 commit 9186abe
Showing 1 changed file with 1 addition and 60 deletions.
61 changes: 1 addition & 60 deletions src/Superstructure/StateReconcile/src/ESMF_StateReconcile.F90
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,8 @@ recursive subroutine StateReconcileIsNoopLoc(stateR, isNoopLoc, rc)
type(ESMF_StateItem_Flag), allocatable :: itemTypeList(:)
type(ESMF_State) :: nestedState
type(ESMF_Field) :: field
type(ESMF_Field), allocatable :: fieldList(:)
type(ESMF_FieldBundle) :: fieldbundle
type(ESMF_Array) :: array
type(ESMF_Array), allocatable :: arrayList(:)
type(ESMF_ArrayBundle) :: arraybundle
type(ESMF_RouteHandle) :: routehandle
type(ESMF_VM) :: vmItem
Expand Down Expand Up @@ -558,11 +556,6 @@ recursive subroutine StateReconcileIsNoopLoc(stateR, isNoopLoc, rc)
call ESMF_StateGet(nestedState, vm=vmItem, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
! recursion into nested state
call StateReconcileIsNoopLoc(stateR=nestedState, &
isNoopLoc=isNoopLoc, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
else if (itemtypeList(item) == ESMF_STATEITEM_FIELD) then
call ESMF_StateGet(stateR, itemName=itemNameList(item), &
field=field, rc=localrc)
Expand All @@ -576,34 +569,6 @@ recursive subroutine StateReconcileIsNoopLoc(stateR, isNoopLoc, rc)
fieldbundle=fieldbundle, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
call ESMF_FieldBundleGet(fieldbundle, fieldCount=fieldCount, &
isPacked=isFlag, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
if (.not.isFlag) then
! not a packed fieldbundle -> check each field item
allocate(fieldList(fieldCount))
call ESMF_FieldBundleGet(fieldbundle, fieldList=fieldList, &
rc=localrc)
if (ESMF_LogFoundError(localrc, &
ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
do i=1, fieldCount
call ESMF_FieldGet(fieldList(i), vm=vmItem, rc=localrc)
if (ESMF_LogFoundError(localrc, &
ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call ESMF_VMGetVMId(vmItem, vmId=vmIdItem, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
isNoopLoc = ESMF_VMIdCompare(vmIdItem, vmId, keyOnly=.true., &
rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
if (.not.isNoopLoc) exit ! exit for .false.
enddo
deallocate(fieldList)
endif
call ESMF_FieldBundleGet(fieldbundle, vm=vmItem, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
Expand All @@ -620,30 +585,6 @@ recursive subroutine StateReconcileIsNoopLoc(stateR, isNoopLoc, rc)
arraybundle=arraybundle, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
call ESMF_ArrayBundleGet(arraybundle, arrayCount=arrayCount, &
rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
allocate(arrayList(arrayCount))
call ESMF_ArrayBundleGet(arraybundle, arrayList=arrayList, &
rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
do i=1, arrayCount
call ESMF_ArrayGet(arrayList(i), vm=vmItem, rc=localrc)
if (ESMF_LogFoundError(localrc, &
ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
call ESMF_VMGetVMId(vmItem, vmId=vmIdItem, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
isNoopLoc = ESMF_VMIdCompare(vmIdItem, vmId, keyOnly=.true., &
rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
if (.not.isNoopLoc) exit ! exit for .false.
enddo
deallocate(arrayList)
call ESMF_ArrayBundleGet(arraybundle, vm=vmItem, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, &
rcToReturn=rc)) return
Expand All @@ -667,7 +608,7 @@ recursive subroutine StateReconcileIsNoopLoc(stateR, isNoopLoc, rc)

if (thisItem == ESMF_NULL_POINTER) isNoopLoc = .false. ! found proxy

! exit for .false. already from proxy, recursive state, or bundles
! exit for .false. already from proxy
if (.not.isNoopLoc) exit

call ESMF_VMGetVMId(vmItem, vmId=vmIdItem, rc=localrc)
Expand Down

0 comments on commit 9186abe

Please sign in to comment.