Skip to content

Commit

Permalink
Delay null file handle closure until after post-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
godotalgorithm committed Nov 17, 2024
1 parent c92b082 commit cd9b9aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interface/mopac_api_finalize.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ module subroutine mopac_finalize(properties)
integer :: status, i, j, size
type(c_ptr), allocatable :: pptr(:)

! close dummy output file to free up /dev/null
close(iw)

! record properties
if (.not. moperr) call mopac_record(properties)

! close dummy output file to free up /dev/null
close(iw)

! collect error messages & assign NULL pointers for memory safety
if (moperr) then
properties%charge = c_null_ptr
Expand Down

0 comments on commit cd9b9aa

Please sign in to comment.