Skip to content

Commit a9e8403

Browse files
committed
More places for the LLVM workaround when dealing with Fortran pointers
inside Fortran derived types that are handed through the C/C++ layer.
1 parent 33464e4 commit a9e8403

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/addon/ESMX/Comps/ESMX_Data/ESMX_Data.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ subroutine ModelFinalize(xdata, rc)
720720
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
721721
line=__LINE__, file=__FILE__)) return
722722

723-
deallocate(is%ptr, stat=stat)
723+
deallocate(xstate, stat=stat)
724724
if (ESMF_LogFoundDeallocError(statusToCheck=stat, &
725725
msg='XDATA: Memory deallocation failed.', &
726726
line=__LINE__, &

src/addon/NUOPC/src/NUOPC_FieldDictionaryDef.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ subroutine NUOPC_FieldDictionaryDestroyI(fieldDictionary, rc)
144144
integer :: localrc
145145
integer :: garbageCount, item
146146
type(NUOPC_FieldDictionaryEntry) :: fdEntry
147+
type(NUOPC_FieldDictionaryEntryS), pointer :: wrap
147148

148149
if (present(rc)) rc = ESMF_SUCCESS
149150

@@ -173,7 +174,8 @@ subroutine NUOPC_FieldDictionaryDestroyI(fieldDictionary, rc)
173174
file=FILENAME, &
174175
rcToReturn=rc)) &
175176
return ! bail out
176-
deallocate(fdEntry % wrap, stat=localrc)
177+
wrap => fdEntry%wrap ! LLVM workaround for deallocate() runtime error!
178+
deallocate(wrap, stat=localrc)
177179
if (ESMF_LogFoundDeallocError(statusToCheck=localrc, &
178180
msg=ESMF_LOGERR_PASSTHRU, &
179181
line=__LINE__, &

0 commit comments

Comments
 (0)