Skip to content

Commit

Permalink
Ensure the returned 'vm' object has init code set to indicate it is
Browse files Browse the repository at this point in the history
valid.
  • Loading branch information
theurich committed Sep 25, 2024
1 parent 3f94d1b commit e25151c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Infrastructure/Array/interface/ESMF_ArrayGet.cppF90
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
call c_ESMC_GetVM(array, vm, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! Set init code
call ESMF_VMSetInitCreated(vm, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
endif

! Obtain DistGrid information
Expand Down
4 changes: 4 additions & 0 deletions src/Infrastructure/ArrayBundle/interface/ESMF_ArrayBundle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,10 @@ subroutine ESMF_ArrayBundleGetListAll(arraybundle, keywordEnforcer, &
call c_ESMC_GetVM(arraybundle, vm, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! Set init code on the VM object before returning
call ESMF_VMSetInitCreated(vm, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
endif

! Return successfully
Expand Down
4 changes: 4 additions & 0 deletions src/Infrastructure/Route/interface/ESMF_RHandle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ subroutine ESMF_RouteHandleGetP(routehandle, keywordEnforcer, name, vm, rc)
call c_ESMC_GetVM(routehandle, vm, localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
! Set init code on the VM object before returning
call ESMF_VMSetInitCreated(vm, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
endif

! Return successfully
Expand Down

0 comments on commit e25151c

Please sign in to comment.