Documentation for module cp_files

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

source: cp_files.F
Loading...

public Subroutines/Functions:

Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
FUNCTION
LOGICAL
file_exists (file_name)
Checks if file exists, considering also the file discovery mechanism.
FUNCTION
get_data_dir
Returns path of data directory if set, otherwise an empty string
FUNCTION
INTEGER
get_unit_number (file_name)
Returns the first logical unit that is not preconnected
Allocate and initialise the list of preconnected units
Opens the requested file using a free unit number

SUBROUTINEclose_file(unit_number, file_status, keep_preconnection)

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

Arguments:
INTEGER,
INTENT(in)
:: unit_number ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_status ...
LOGICAL,
INTENT(in),
OPTIONAL
:: keep_preconnection ...

FUNCTIONfile_exists(file_name)

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

Return Value ::
LOGICAL
Arguments:
CHARACTER(*),
INTENT(in)
:: file_name ...

FUNCTIONget_data_dir()

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

Return Value ::

FUNCTIONget_unit_number(file_name)

Returns the first logical unit that is not preconnected

Return Value ::
INTEGER
Arguments:
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_name ...

SUBROUTINEinit_preconnection_list()

Allocate and initialise the list of preconnected units

SUBROUTINEopen_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

Arguments:
CHARACTER(*),
INTENT(in)
:: file_name ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_status ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_form ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_action ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_position ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_pad ...
INTEGER,
INTENT(inout)
:: unit_number ...
INTEGER,
INTENT(in),
OPTIONAL
:: debug ...
LOGICAL,
INTENT(in),
OPTIONAL
:: skip_get_unit_number ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_access file access mode