FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines | Variables
binarydbinterface Module Reference

Fortran interface for the C functions for doing binary IO. More...

Data Types

interface  readdoubledb
 Reads a double precision array from the specified binary file. More...
 
interface  writedoubledb
 Writes a double precision array to the specified binary file. More...
 
interface  closebinarydb
 Closes the specified binary file. More...
 
interface  openBinaryDB
 Opens a binary direct access file for read or write. More...
 
interface  closeBinary_DB
 Closes the specified binary file. More...
 
interface  deleteDB
 Deletes the named file. More...
 
interface  setBufDB
 Allocates an in-core buffer for the specified binary file. More...
 
interface  flushBinaryDB
 Flushes the in-core buffer of the specified binary file to disk. More...
 
interface  writeIntDB
 Writes an integer array to the specified binary file. More...
 
interface  writeFloatDB
 Writes a single precision array to the specified binary file. More...
 
interface  writeDoubleD4
 Writes a double precision array to the specified binary file. More...
 
interface  writeDoubleD8
 Writes a big double precision array to the specified binary file. More...
 
interface  writeCharDB
 Writes a character string to the specified binary file. More...
 
interface  writeTagDB
 Writes a file tag and checksum to the specified binary file. More...
 
interface  readIntDB
 Reads an integer array from a specified binary file. More...
 
interface  readFloatDB
 Reads a single precision array from a specified binary file. More...
 
interface  readDoubleD4
 Reads a double precision array from a specified binary file. More...
 
interface  readDoubleD8
 Reads a big double precision array from a specified binary file. More...
 
interface  readCharDB
 Reads a character string from a specified binary file. More...
 
interface  readTagDB
 Reads the file tag and checksum from a specified binary file. More...
 
interface  setPositionDB
 Sets the read position for a specified binary file. More...
 
interface  getPositionDB
 Gets the current position for a specified binary file. More...
 
interface  putCharDB
 Writes a character string at a specified file location. More...
 
interface  copyBinaryDB
 Copies data from one binary file to another. More...
 

Functions/Subroutines

subroutine, private readdoubledb4 (fileNum, data, nData, status)
 Reads a double precision array from a specified binary file. More...
 
subroutine, private readdoubledb8 (fileNum, data, nData, status)
 Reads a big double precision array from a specified binary file. More...
 
subroutine, private writedoubledb4 (fileNum, data, nData, status)
 Writes a double precision array to the specified binary file. More...
 
subroutine, private writedoubledb8 (fileNum, data, nData, status)
 Writes a big double precision array to the specified binary file. More...
 
subroutine, private closebinarydb1 (fileNum, status)
 Closes the specified binary file. More...
 
subroutine, private closebinarydb2 (fileNum, forceDelete, status)
 Closes the specified binary file. More...
 
subroutine, private readdoubledbfile (fileName, dtype, ndata, data, ierr, jerr)
 Reads a double precision matrix from a named binary file into core. More...
 
subroutine, private writedoubledbfile (fileName, dtype, chksum, data, ierr, sbuf)
 Writes a double precision matrix to a named binary file. More...
 

Variables

integer, parameter tmp_p = 0
 Opening mode for temporary files. More...
 
integer, parameter read_p = 1
 Read file opening mode. More...
 
integer, parameter write_p = 2
 Write file opening mode. More...
 
integer, parameter append_p = 3
 Append file opening mode. More...
 
integer, parameter update_p = 4
 Update file opening mode. More...
 
integer, parameter reawri_p = 5
 Read/write file opening mode. More...
 

Detailed Description

Fortran interface for the C functions for doing binary IO.

Function/Subroutine Documentation

◆ closebinarydb1()

subroutine, private binarydbinterface::closebinarydb1 ( integer, intent(in)  fileNum,
integer, intent(out)  status 
)
private

Closes the specified binary file.

Parameters
[in]fileNumFile handle for the file to close
[out]statusExit status (negative on error)

◆ closebinarydb2()

subroutine, private binarydbinterface::closebinarydb2 ( integer, intent(in)  fileNum,
logical, intent(in)  forceDelete,
integer, intent(out)  status 
)
private

Closes the specified binary file.

Parameters
[in]fileNumFile handle for the file to close
[in]forceDeleteIf .true., force deleting the file after close
[out]statusExit status (negative on error)

◆ readdoubledb4()

subroutine, private binarydbinterface::readdoubledb4 ( integer, intent(in)  fileNum,
real(dp), intent(out)  data,
integer, intent(in)  nData,
integer, intent(out)  status 
)
private

Reads a double precision array from a specified binary file.

Parameters
[in]fileNumFile handle for the file to read from
[in]dataThe real array to read into
[in]nDataNumber of words to read
[out]statusExit status

◆ readdoubledb8()

subroutine, private binarydbinterface::readdoubledb8 ( integer, intent(in)  fileNum,
real(dp), intent(out)  data,
integer(i8), intent(in)  nData,
integer, intent(out)  status 
)
private

Reads a big double precision array from a specified binary file.

Parameters
[in]fileNumFile handle for the file to read from
[in]dataThe real array to read into
[in]nDataNumber of words to read
[out]statusExit status

◆ readdoubledbfile()

subroutine, private binarydbinterface::readdoubledbfile ( character(len=*), intent(in)  fileName,
character(len=*), intent(in)  dtype,
integer, intent(in)  ndata,
real(dp), intent(out)  data,
integer, intent(inout)  ierr,
integer, intent(inout), optional  jerr 
)
private

Reads a double precision matrix from a named binary file into core.

Parameters
[in]fileNameName of the file to read
[in]dtypeFile tag identifying the correct data type
[in]ndataNumber of words to read
[in]dataThe real array to read into
ierrError flag
jerrOptional error flag for the read operation
Author
Knut Morten Okstad

date 21 Dec 2016

◆ writedoubledb4()

subroutine, private binarydbinterface::writedoubledb4 ( integer, intent(in)  fileNum,
real(dp), intent(in)  data,
integer, intent(in)  nData,
integer, intent(out)  status 
)
private

Writes a double precision array to the specified binary file.

Parameters
[in]fileNumFile handle for the file to write to
[in]dataThe real array to write
[in]nDataNumber of words to write
[out]statusExit status

◆ writedoubledb8()

subroutine, private binarydbinterface::writedoubledb8 ( integer, intent(in)  fileNum,
real(dp), intent(in)  data,
integer(i8), intent(in)  nData,
integer, intent(out)  status 
)
private

Writes a big double precision array to the specified binary file.

Parameters
[in]fileNumFile handle for the file to write to
[in]dataThe real array to write
[in]nDataNumber of words to write
[out]statusExit status

◆ writedoubledbfile()

subroutine, private binarydbinterface::writedoubledbfile ( character(len=*), intent(in)  fileName,
character(len=*), intent(in)  dtype,
integer, intent(in)  chksum,
real(dp), dimension(:,:), intent(in)  data,
integer, intent(out)  ierr,
real(sp), dimension(:), intent(out), optional  sbuf 
)
private

Writes a double precision matrix to a named binary file.

Parameters
[in]fileNameName of the file to write
[in]dtypeFile tag identifying the data type to write
[in]chksumFile checksum
[in]dataThe real array to write
ierrError flag
sbufSingle precision buffer used for type casting
Author
Knut Morten Okstad
Date
3 Jan 2005

Variable Documentation

◆ append_p

integer, parameter binarydbinterface::append_p = 3

Append file opening mode.

◆ read_p

integer, parameter binarydbinterface::read_p = 1

Read file opening mode.

◆ reawri_p

integer, parameter binarydbinterface::reawri_p = 5

Read/write file opening mode.

◆ tmp_p

integer, parameter binarydbinterface::tmp_p = 0

Opening mode for temporary files.

◆ update_p

integer, parameter binarydbinterface::update_p = 4

Update file opening mode.

◆ write_p

integer, parameter binarydbinterface::write_p = 2

Write file opening mode.