From 1710e47316283741fc3cea5080d6b76d254cf939 Mon Sep 17 00:00:00 2001 From: Marc DeGraef Date: Thu, 12 Dec 2024 10:45:20 -0500 Subject: [PATCH] fixes a termination problem in the HDF%popall() routine --- Source/EMsoftOOLib/mod_HDFsupport.f90 | 3 +++ Source/EMsoftOOLib/program_mods/mod_DIfiles.f90 | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/EMsoftOOLib/mod_HDFsupport.f90 b/Source/EMsoftOOLib/mod_HDFsupport.f90 index 5d74b1a..9dac8d9 100644 --- a/Source/EMsoftOOLib/mod_HDFsupport.f90 +++ b/Source/EMsoftOOLib/mod_HDFsupport.f90 @@ -642,6 +642,9 @@ recursive subroutine popall_(self, origin) call error_check_(self, trim(origin)//'pop_:unable to close requested level for object type '//self%head%next%objectType, & error,.TRUE.) +! if we just closed the file then we are done. + if (self%head%next%objectType.eq.'f') EXIT + ! and re-point the stack head tmp => self%head%next self%head%next => self%head%next%next diff --git a/Source/EMsoftOOLib/program_mods/mod_DIfiles.f90 b/Source/EMsoftOOLib/program_mods/mod_DIfiles.f90 index 90c766e..8355333 100644 --- a/Source/EMsoftOOLib/program_mods/mod_DIfiles.f90 +++ b/Source/EMsoftOOLib/program_mods/mod_DIfiles.f90 @@ -1242,6 +1242,7 @@ recursive subroutine readDotProductFile_(self, EMsoft, HDF, HDFnames, dpfile, hd call Message%printError('readDotProductFile','This is not a proper HDF5 file') end if + ! open the dot product file readonly = .TRUE. hdferr = HDF%openFile(dpfile, readonly) @@ -1674,7 +1675,7 @@ recursive subroutine readDotProductFile_(self, EMsoft, HDF, HDFnames, dpfile, hd end if ! and close the HDF5 dot product file -!call HDF%popall() +call HDF%popall() end associate