(git:6a2e663)
cp_files Module Reference

Utility routines to open and close files. Tracking of preconnections. More...

Functions/Subroutines

subroutine, public close_file (unit_number, file_status, keep_preconnection)
 Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected. More...
 
integer function, public get_unit_number (file_name)
 Returns the first logical unit that is not preconnected. More...
 
subroutine, public init_preconnection_list ()
 Allocate and initialise the list of preconnected units. More...
 
subroutine, public open_file (file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
 Opens the requested file using a free unit number. More...
 
logical function, public file_exists (file_name)
 Checks if file exists, considering also the file discovery mechanism. More...
 
character(len=default_path_length) function, public discover_file (file_name)
 Checks various locations for a file name. More...
 
character(len=default_path_length) function, public get_data_dir ()
 Returns path of data directory if set, otherwise an empty string. More...
 

Detailed Description

Utility routines to open and close files. Tracking of preconnections.

History
  • Creation CP2K_WORKSHOP 1.0 TEAM
  • Revised (18.02.2011,MK)
  • Enhanced error checking (22.02.2011,MK)
Author
Matthias Krack (MK)

Function/Subroutine Documentation

◆ close_file()

subroutine, public cp_files::close_file ( integer, intent(in)  unit_number,
character(len=*), intent(in), optional  file_status,
logical, intent(in), optional  keep_preconnection 
)

Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.

Parameters
unit_number...
file_status...
keep_preconnection...
Author
Matthias Krack (MK)

Definition at line 118 of file cp_files.F.

◆ get_unit_number()

integer function, public cp_files::get_unit_number ( character(len=*), intent(in), optional  file_name)

Returns the first logical unit that is not preconnected.

Parameters
file_name...
Returns
...
Author
Matthias Krack (MK)
Note
-1 if no free unit exists

Definition at line 236 of file cp_files.F.

Here is the caller graph for this function:

◆ init_preconnection_list()

subroutine, public cp_files::init_preconnection_list

Allocate and initialise the list of preconnected units.

History
  • Creation (22.02.2011,MK)
Author
Matthias Krack (MK)

Definition at line 272 of file cp_files.F.

Here is the caller graph for this function:

◆ open_file()

subroutine, public cp_files::open_file ( character(len=*), intent(in)  file_name,
character(len=*), intent(in), optional  file_status,
character(len=*), intent(in), optional  file_form,
character(len=*), intent(in), optional  file_action,
character(len=*), intent(in), optional  file_position,
character(len=*), intent(in), optional  file_pad,
integer, intent(inout)  unit_number,
integer, intent(in), optional  debug,
logical, intent(in), optional  skip_get_unit_number,
character(len=*), intent(in), optional  file_access 
)

Opens the requested file using a free unit number.

Parameters
file_name...
file_status...
file_form...
file_action...
file_position...
file_pad...
unit_number...
debug...
skip_get_unit_number...
file_accessfile access mode
Author
Matthias Krack (MK)

Definition at line 305 of file cp_files.F.

Here is the call graph for this function:

◆ file_exists()

logical function, public cp_files::file_exists ( character(len=*), intent(in)  file_name)

Checks if file exists, considering also the file discovery mechanism.

Parameters
file_name...
Returns
...
Author
Ole Schuett

Definition at line 493 of file cp_files.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ discover_file()

character(len=default_path_length) function, public cp_files::discover_file ( character(len=*), intent(in)  file_name)

Checks various locations for a file name.

Parameters
file_name...
Returns
...
Author
Ole Schuett

Definition at line 509 of file cp_files.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_data_dir()

character(len=default_path_length) function, public cp_files::get_data_dir

Returns path of data directory if set, otherwise an empty string.

Returns
...
Author
Ole Schuett

Definition at line 541 of file cp_files.F.

Here is the caller graph for this function: