Skip to content

Commit

Permalink
fixup! Write output through a buffer to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj-A-Kowalski committed Jan 26, 2024
1 parent 1c0e025 commit c8ad8d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions UserInterface/fileOutput/outputFile_class.f90
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ end subroutine init
!! Upon the destruction of the object, write the output to file
!!
!! NOTE:
!! This subroutine WILL NOT be called if the `end program` statement is
!! reached! [Only `end subroutine`, `end block` etc.]. In that case
!! one needs to call `finalisation` manually
!! Being marked `final`(a deconstructor) this subroutine will be normally implicitly called by
!! by the compiler whenever a variable of `type(outputFile)` goes out of scope (e.g. when program
!! execution reaches `end subroutine`, `end function` or `end block` statement. However, the rule in
!! Fortran is that the decostructors are NOT called at the end of the program `end program`. In that case
!! if one uses the output file as a module variable or defines it inside the program block, the `finalisation`
!! must be called explicitly to ensure or data from the buffer is written to the disk
!!
!!
subroutine finalisation(self)
type(outputFile), intent(inout) :: self
Expand Down

0 comments on commit c8ad8d7

Please sign in to comment.