diff --git a/Source/EMsoftOOLib/mod_povray.f90 b/Source/EMsoftOOLib/mod_povray.f90 index 6d77c17..f9695cc 100644 --- a/Source/EMsoftOOLib/mod_povray.f90 +++ b/Source/EMsoftOOLib/mod_povray.f90 @@ -211,15 +211,19 @@ subroutine PoVRay_destructor(self) call reportDestructor('PoVRay_T') -! if the file unit is still open, close it here -if (self%dunit.ne.0) then - inquire(unit=self%dunit, opened=itsopen) +! the following lines were commented out because the destructor routine +! gets called, for some reason, before the complete file has been written +! so the file is closed too early... - if (itsopen.eqv..TRUE.) then - close(unit=self%dunit, status='keep') - call Message%printMessage(' Closed PoVray file '//trim(self%filename)) - end if -end if +! if the file unit is still open, close it here +! if (self%dunit.ne.0) then +! inquire(unit=self%dunit, opened=itsopen) + +! if (itsopen.eqv..TRUE.) then +! close(unit=self%dunit, status='keep') +! call Message%printMessage(' Closed PoVray file '//trim(self%filename)) +! end if +! end if end subroutine PoVRay_destructor