m_fileIO Module

module~~m_fileio~~UsesGraph module~m_fileio m_fileIO module~variablekind variableKind module~variablekind->module~m_fileio module~m_readline m_readline module~variablekind->module~m_readline module~m_strings m_strings module~variablekind->module~m_strings module~m_errors m_errors module~variablekind->module~m_errors module~m_writeline m_writeline module~variablekind->module~m_writeline module~m_unittester m_unitTester module~variablekind->module~m_unittester module~m_parameters m_parameters module~variablekind->module~m_parameters module~m_readline->module~m_fileio module~m_strings->module~m_fileio module~m_strings->module~m_readline module~m_strings->module~m_writeline module~m_errors->module~m_fileio module~m_errors->module~m_readline module~m_errors->module~m_strings module~m_errors->module~m_writeline module~m_errors->module~m_unittester module~m_writeline->module~m_fileio module~m_unittester->module~m_fileio iso_fortran_env iso_fortran_env iso_fortran_env->module~variablekind iso_fortran_env->module~m_strings iso_fortran_env->module~m_errors iso_fortran_env->module~m_writeline iso_fortran_env->module~m_unittester module~m_parameters->module~m_strings
Help

Contains functions and subroutines that inquire and operate on files including reading and writing multiple entries to a file

Used By

module~~m_fileio~~UsedByGraph module~m_fileio m_fileIO program~scaletest_coretran scaleTest_coretran module~m_fileio->program~scaletest_coretran module~m_tests m_tests module~m_fileio->module~m_tests program~test_coretran test_coretran module~m_tests->program~test_coretran
Help


Functions

public function fileExists(fName) result(yes)

Checks whether the file with name fName exists on disk

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name to check

Return Value logical

Exists?

public function hasExtension(fName, extension) result(yes)

Checks if a file 'fname' is of type 'extension'

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

character(len=3), intent(in) :: extension

Extension to find

Return Value logical

Has this extension?

public function isOpen(fname) result(yes)

Is the file open or not

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname

File name

Return Value logical

Is the file open?

public function getFileSize(fName) result(that)

Get the file size in Bytes

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

Return Value integer(kind=i32)

Size of the file

public function getNFileLines(fName, nHeader) result(N)

Counts the number of lines in a file after the number of specified header lines

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

integer(kind=i32), intent(in), optional :: nHeader

Skip this number of lines at the top of the file

Return Value integer(kind=i32)

Number of lines in the file

public function getExtension(fName) result(that)

Get the extension of a file

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

Return Value character(len=:), allocatable

File extension

public function trimExtension(fName) result(that)

Trims the extension of a filename

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

Return Value character(len=:), allocatable

File name without the extension


Subroutines

public subroutine checkIsOpen(fName)

Checks whether a file is open with an error message if not

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fName

File name

public subroutine openFile(fname, iunit, stat, istat)

Open a file and perform necessary checks for failure stat should be 'new','old','unknown','append'

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname

File name

integer(kind=i32), intent(out) :: iunit

Unit number returned

character(len=*), intent(in) :: stat

Status of the file you are opening

integer(kind=i32), intent(out) :: istat

Error flag

public subroutine openBinaryFile(fname, iunit, stat, istat)

Open an unformatted binary file stat should be 'new','old','unknown','append'

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname

File Name

integer(kind=i32), intent(out) :: iunit

Unit number returned

character(len=*), intent(in) :: stat

Status of the file you are opening

integer(kind=i32), intent(out) :: istat

Error Flag

public subroutine closeFile(fname, iunit, stat, istat)

Close a file and perform any necessary checks

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname

File name

integer(kind=i32), intent(in) :: iunit

Unit number returned

character(len=*), intent(in) :: stat

Status of the file you are closing

integer(kind=i32), intent(out) :: istat

Error Flag

public subroutine deleteFile(fname)

Deletes a file on disk

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fname

File name to delete

public subroutine skipFileLines(iunit, N)

Skip N lines in a file

Arguments

Type IntentOptional AttributesName
integer(kind=i32), intent(in) :: iunit

Unit number to skip

integer(kind=i32), intent(in) :: N

Number of lines to skip

public subroutine fileIO_test(test)

Arguments

Type IntentOptional AttributesName
class(tester) :: test