From 6a03f349070f931460828fd10018bca1182f0d50 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Mon, 30 Dec 2024 17:19:17 +0100 Subject: [PATCH] Fix comment in file module (#1597) --- src/dftbp/common/file.F90 | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/dftbp/common/file.F90 b/src/dftbp/common/file.F90 index 912034d06a..3fed5ed2c3 100644 --- a/src/dftbp/common/file.F90 +++ b/src/dftbp/common/file.F90 @@ -99,10 +99,10 @@ module dftbp_common_file contains - !> Sets the file opening options according to a C-style mode string + !> Sets the file opening options according to a C-style mode string. subroutine TOpenOptions_setMode(this, mode, ioStat, ioMsg) - !> Instance. + !> Instance class(TOpenOptions), intent(inout) :: this !> C-like mode string ("r", "r+", "w", "w+", "a", "a+" followed by optional "t" or "b") @@ -331,7 +331,7 @@ subroutine TFileDescr_connectToFile(this, file, options, mode, ioStat, ioMsg) end subroutine TFileDescr_connectToFile - !> Connects the descriptor to an existing file unit + !> Connects the descriptor to an existing file unit. subroutine TFileDescr_connectToUnit(this, unit) !> File descriptor on exit @@ -346,7 +346,7 @@ subroutine TFileDescr_connectToUnit(this, unit) end subroutine TFileDescr_connectToUnit - !> Finalizes (closes) a file + !> Finalizes (closes) a file. elemental impure subroutine TFileDescr_disconnect(this) !> Instance @@ -382,7 +382,7 @@ elemental function TFileDescr_isConnected(this) result(connected) end function TFileDescr_isConnected - !> Assignment (should never be called as it stops the code) + !> Assignment (should never be called as it stops the code). elemental impure subroutine TFileDescr_assign(lhs, rhs) !> Right hand side of the assignment @@ -396,8 +396,9 @@ elemental impure subroutine TFileDescr_assign(lhs, rhs) end subroutine TFileDescr_assign - ! Finalizes the instance + ! Finalizes the instance. elemental impure subroutine TFileDescr_final_(this) + type(TFileDescr), intent(inout) :: this call this%disconnect() @@ -405,7 +406,7 @@ elemental impure subroutine TFileDescr_final_(this) end subroutine TFileDescr_final_ - !> Convenience wrapper connecting a file descriptor to a file + !> Convenience wrapper connecting a file descriptor to a file. subroutine openFile(fileDescr, file, options, mode, ioStat, ioMsg) !> File descriptor connected to the open file @@ -424,7 +425,7 @@ subroutine openFile(fileDescr, file, options, mode, ioStat, ioMsg) !! * "w+": readwrite (file created or truncated if it already exists) !! * "a": append-write (file opened if exists, otherwise created, positioned at the end) !! * "a+": append-read/write (file opened if exists, otherwise created, positioned at the end) - !! The values above can be followed by "t" for text/unformatted mode (default) or "b" for + !! The values above can be followed by "t" for text/formatted mode (default) or "b" for !! binary/unformatted mode. !! !! When arguments options and mode are both specified, the resulting options are determined by @@ -442,7 +443,7 @@ subroutine openFile(fileDescr, file, options, mode, ioStat, ioMsg) end subroutine openFile - !> Convenience wrapper for disconnecting a file descriptor (which closes the file) + !> Convenience wrapper for disconnecting a file descriptor (which closes the file). elemental impure subroutine closeFile(fileDescr) !> File descriptor, will be unconnected on exit @@ -453,7 +454,7 @@ elemental impure subroutine closeFile(fileDescr) end subroutine closeFile - !> Sets the default access type for file opening operations + !> Sets the default access type for file opening operations. !! !! Note: this routine is not thread of multi-instance-safe! subroutine setDefaultBinaryAccess(readAccess, writeAccess, readwriteAccess) @@ -482,7 +483,7 @@ function fileExists(file) result(exists) !> File to check for existence character(*), intent(in) :: file - !> True, if the file exists. + !> True, if the file exists logical :: exists inquire(file=file, exist=exists) @@ -490,16 +491,16 @@ function fileExists(file) result(exists) end function fileExists - !> Creates empty file without content or truncates files to zero content if it already exists + !> Creates empty file without content or truncates files to zero content if it already exists. subroutine clearFile(file, ioStat, ioMsg) !> Name of the file to create character(*), intent(in) :: file - !> I/O stat error generated during open, zero on exit, if no error occured. + !> I/O stat error generated during open, zero on exit, if no error occured integer, optional, intent(out) :: ioStat - !> I/O stat message generated during open, unallocated on exit, if no error occured. + !> I/O stat message generated during open, unallocated on exit, if no error occured character(:), allocatable, optional, intent(out) :: ioMsg type(TFileDescr) :: fd