file_handling_class Module Reference

Provide some basic file-handling routines. More...

Functions/Subroutines

integer function, public get_next_io_unit ()
 Finds the next unused unit number. More...
 
integer function, public open_unformatted_outfile (file_name)
 Shorthand for opening a new unformatted file for writing (output file) More...
 
integer function open_unformatted_infile (file_name)
 Open an unformatted file for reading. More...
 
integer function, public open_outfile (file_name)
 Shorthand for opening a new file for writing (output file) More...
 
integer function, public open_infile (file_name)
 Same for reading (input file) More...
 
subroutine, public close_io_file (unit_no, file_name)
 Close an external file. More...
 
subroutine, public delete_io_file (file_name, raise_error)
 Delete a file. More...
 

Variables

integer, parameter, private min_unit =10
 Minimum unit number. More...
 
integer, parameter, private max_unit =9999
 Maximum unit id. More...
 

Detailed Description

Provide some basic file-handling routines.

Author
Darko Mocelj
Date
07.05.04

Edited:

  • 12.11.09: Christian Winteler
  • 11.01.14: Oleg Korobkin
  • 07.11.16: Oleg Korobkin
  • 22.01.21: Moritz Reichert

Function/Subroutine Documentation

◆ close_io_file()

subroutine, public file_handling_class::close_io_file ( integer, intent(in)  unit_no,
character(len=*), intent(in), optional  file_name 
)

Close an external file.

This function is used to close a file and complain if it does not work.

Parameters
[in]unit_nounit number
[in]file_namefor reporting

Definition at line 143 of file file_handling_class.f90.

Here is the call graph for this function:

◆ delete_io_file()

subroutine, public file_handling_class::delete_io_file ( character(len=*), intent(in), optional  file_name,
logical, optional  raise_error 
)

Delete a file.

This function is used to delete a file. If the file does not exist and raise_error is present, an error is raised.

Author
M. Reichert
Parameters
[in]file_namefor reporting
raise_errorRaise error in case of failure

Definition at line 191 of file file_handling_class.f90.

Here is the call graph for this function:

◆ get_next_io_unit()

integer function, public file_handling_class::get_next_io_unit

Finds the next unused unit number.

In case there is no open slot for a new file this subroutine will call an error. For example if there are more files open than max_unit, this error will get called.

Returns
the next available unit number

Definition at line 39 of file file_handling_class.f90.

Here is the call graph for this function:

◆ open_infile()

integer function, public file_handling_class::open_infile ( character(len=*), intent(in)  file_name)

Same for reading (input file)

This function is used for read input files and complain if it does not work.

Parameters
[in]file_namepath to open
Returns
unit number

Definition at line 125 of file file_handling_class.f90.

Here is the call graph for this function:

◆ open_outfile()

integer function, public file_handling_class::open_outfile ( character(len=*), intent(in)  file_name)

Shorthand for opening a new file for writing (output file)

This function is used to open a file in order to write into it. It will also complain if it is not possible.

Parameters
[in]file_namepath to open
Returns
unit number

Definition at line 107 of file file_handling_class.f90.

Here is the call graph for this function:

◆ open_unformatted_infile()

integer function file_handling_class::open_unformatted_infile ( character(len=*), intent(in)  file_name)

Open an unformatted file for reading.

Parameters
[in]file_namepath to open
Returns
unit number

Definition at line 88 of file file_handling_class.f90.

Here is the call graph for this function:

◆ open_unformatted_outfile()

integer function, public file_handling_class::open_unformatted_outfile ( character(len=*), intent(in)  file_name)

Shorthand for opening a new unformatted file for writing (output file)

Parameters
[in]file_namepath to open
Returns
unit number

Definition at line 73 of file file_handling_class.f90.

Here is the call graph for this function:

Variable Documentation

◆ max_unit

integer, parameter, private file_handling_class::max_unit =9999
private

Maximum unit id.

Definition at line 22 of file file_handling_class.f90.

◆ min_unit

integer, parameter, private file_handling_class::min_unit =10
private

Minimum unit number.

Definition at line 21 of file file_handling_class.f90.