GBTOlib: library for evaluation of molecular integrals in mixed Gaussian / B-spline basis 111
Loading...
Searching...
No Matches
data_file_gbl::data_file_obj Module Reference

This object provides access to the data stored on the data file. The first record on the file is the identifier given by the constant data_file_obj_id. The next record is the number of data sets (headers) stored on the file. After that the header of the first (if any) data set follows. More...

Public Member Functions

procedure open (this, path)
 Opens the file for stream access given its path. If the file does not exist then a new one is created, otherwise the file is opened in the append mode and the existing headers for the data sets are read-in and printed out on screen.
procedure get_unit_no (this)
 Returns the unit number associated with the file.
procedure get_file_name (this)
 Returns the path associated with the file.
procedure start_record (this, header)
 Writes a new header on the file and returns the value first_record which belongs to the new header. This value can be used by other routines to write the actual data to the file starting on the position first_record. Each record must be terminated by a call to close_record with the values corresponding to the starting and final positions of the actual data record.
procedure close_record (this, header, first_record, last_record)
 Completes the given record given its header and the positions of the start and end of the data record.
procedure remove_last_record (this)
 Removes the last header from the file: this can be useful when working with files that contain a broken last record.
procedure print_headers (this)
 Prints on the screen the header data.
procedure find_header (this, header, first_record, last_record)
 Attempts to find the specified header and returns the positions of start and end of the corresponding data record.
procedure get_header_containing (this, data_header, str1, str2)
 Returns the header containing the specified strings. Returns 0 if a unique matching header has been found and returns a non-zero number (error number) if not.
procedure get_header (this, i, data_header)
 Returns the header with the given sequence number.
procedure get_no_headers (this)
 Returns the number of headers on the file.
procedure close (this)
 Closes the data file.

Public Attributes

character(len=line_len) identifier
 Data file version.

Detailed Description

This object provides access to the data stored on the data file. The first record on the file is the identifier given by the constant data_file_obj_id. The next record is the number of data sets (headers) stored on the file. After that the header of the first (if any) data set follows.

Warning
All read/write operations on the associated file are performed only by the master process. What the master has read-in is broadcast to the other processes. Any other routines added to this object in the future must work in the same way.

Member Function/Subroutine Documentation

◆ close()

procedure data_file_gbl::data_file_obj::close ( class(data_file_obj) this)

Closes the data file.

◆ close_record()

procedure data_file_gbl::data_file_obj::close_record ( class(data_file_obj) this,
character(len=*), intent(in) header,
integer, intent(in) first_record,
integer, intent(in) last_record )

Completes the given record given its header and the positions of the start and end of the data record.

◆ find_header()

procedure data_file_gbl::data_file_obj::find_header ( class(data_file_obj) this,
character(len=*), intent(in) header,
integer, intent(out) first_record,
integer, intent(out) last_record )

Attempts to find the specified header and returns the positions of start and end of the corresponding data record.

◆ get_file_name()

procedure data_file_gbl::data_file_obj::get_file_name ( class(data_file_obj) this)

Returns the path associated with the file.

◆ get_header()

procedure data_file_gbl::data_file_obj::get_header ( class(data_file_obj) this,
integer, intent(in) i,
type(data_header_obj), intent(out) data_header )

Returns the header with the given sequence number.

◆ get_header_containing()

procedure data_file_gbl::data_file_obj::get_header_containing ( class(data_file_obj) this,
type(data_header_obj), intent(out) data_header,
character(len=*), intent(in) str1,
character(len=*), intent(in), optional str2 )

Returns the header containing the specified strings. Returns 0 if a unique matching header has been found and returns a non-zero number (error number) if not.

◆ get_no_headers()

procedure data_file_gbl::data_file_obj::get_no_headers ( class(data_file_obj) this)

Returns the number of headers on the file.

◆ get_unit_no()

procedure data_file_gbl::data_file_obj::get_unit_no ( class(data_file_obj) this)

Returns the unit number associated with the file.

◆ open()

procedure data_file_gbl::data_file_obj::open ( class(data_file_obj) this,
character(len=*), intent(in) path )

Opens the file for stream access given its path. If the file does not exist then a new one is created, otherwise the file is opened in the append mode and the existing headers for the data sets are read-in and printed out on screen.

Todo
The unit number associated to the file should be returned by this function - this will allow me to get rid of get_unit_no below.

◆ print_headers()

procedure data_file_gbl::data_file_obj::print_headers ( class(data_file_obj) this)

Prints on the screen the header data.

◆ remove_last_record()

procedure data_file_gbl::data_file_obj::remove_last_record ( class(data_file_obj) this)

Removes the last header from the file: this can be useful when working with files that contain a broken last record.

◆ start_record()

procedure data_file_gbl::data_file_obj::start_record ( class(data_file_obj) this,
character(len=*), intent(in) header )

Writes a new header on the file and returns the value first_record which belongs to the new header. This value can be used by other routines to write the actual data to the file starting on the position first_record. Each record must be terminated by a call to close_record with the values corresponding to the starting and final positions of the actual data record.

Member Data Documentation

◆ identifier

character(len=line_len) data_file_gbl::data_file_obj::identifier

Data file version.


The documentation for this module was generated from the following file: