Appearance
Lib_VTK_IO_Back_End
Back-end module for Lib_VTK_IO.
Source: src/third_party/VTKFortran/references/legacy/Lib_VTK_IO_Back_End.f90
Dependencies
Contents
- Type_VTK_File
- Type_VTM_File
- byte_update
- vtk_update
- get_int
- get_char
- Get_Unit
- Upper_Case
- adjustlt
- read_record
- move
- search
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
maxlen | integer(kind=I4P) | parameter | Max number of characters of static string. |
end_rec | character(len=1) | parameter | End-character for binary-record finalize. |
ascii | integer(kind=I4P) | parameter | Ascii-output-format parameter identifier. |
binary | integer(kind=I4P) | parameter | Base64-output-format parameter identifier. |
raw | integer(kind=I4P) | parameter | Raw-appended-binary-output-format parameter identifier. |
bin_app | integer(kind=I4P) | parameter | Base64-appended-output-format parameter identifier. |
vtk | type(Type_VTK_File) | allocatable | Global data of VTK files [1:Nvtk]. |
Nvtk | integer(kind=I4P) | Number of (concurrent) VTK files. | |
f | integer(kind=I4P) | Current VTK file index. | |
vtm | type(Type_VTM_File) | Global data of VTM files. |
Derived Types
Type_VTK_File
Derived type for handling VTK files.
@note The OOP encapsulation allows safe use of parallel paradigms.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
f | integer(kind=I4P) | Current output-format (initialized to ascii format). | |
topology | character(len=maxlen) | Mesh topology. | |
u | integer(kind=I4P) | Logical unit. | |
ua | integer(kind=I4P) | Logical unit for raw binary XML append file. | |
N_Byte | integer(kind=I8P) | Number of byte to be written/read. | |
N_Byte | integer(kind=I4P) | Number of byte to be written/read. | |
ioffset | integer(kind=I8P) | Offset pointer. | |
indent | integer(kind=I4P) | Indent pointer. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
byte_update | Procedure for updating N_Byte and ioffset pointer. |
Type_VTM_File
Derived type for handling VTM files.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
u | integer(kind=I4P) | Logical unit. | |
blk | integer(kind=I4P) | Block indexes. | |
indent | integer(kind=I4P) | Indent pointer. |
Subroutines
byte_update
Subroutine for updating N_Byte and ioffset pointer.
Attributes: elemental
fortran
subroutine byte_update(vtk, N_Byte)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
vtk | class(Type_VTK_File) | inout | Global data of VTK file. | |
N_Byte | integer(kind=I8P) | in | Number of bytes saved. |
Call graph
vtk_update
Subroutine for updating (adding and removing elements into) vtk array.
Attributes: pure
fortran
subroutine vtk_update(act, cf, Nvtk, vtk)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
act | character(len=*) | in | Action: 'ADD' one more element, 'REMOVE' current element file. | |
cf | integer(kind=I4P) | inout | Current file index (for concurrent files IO). | |
Nvtk | integer(kind=I4P) | inout | Number of (concurrent) VTK files. | |
vtk | type(Type_VTK_File) | inout | allocatable | VTK files data. |
Call graph
get_int
Get integer value of attribute 'attrib' defined into buffer.
fortran
subroutine get_int(case, E_IO, buffer, attrib, val)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
case | character(len=*) | in | optional | Attribute string case. |
E_IO | integer(kind=I4P) | out | optional | Error trapping flag. |
buffer | character(len=*) | in | String where to search the attrib. | |
attrib | character(len=*) | in | XML attribute id. | |
val | integer(kind=I4P) | out | Returned integer value. |
Call graph
get_char
Get character value of attribute 'attrib' defined into buffer.
fortran
subroutine get_char(case, E_IO, buffer, attrib, val)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
case | character(len=*) | in | optional | Attribute string case. |
E_IO | integer(kind=I4P) | out | optional | Error trapping flag. |
buffer | character(len=*) | in | String where to search the attrib | |
attrib | character(len=*) | in | XML attribute id | |
val | character(len=:) | out | allocatable | Returned string value |
Call graph
Functions
Get_Unit
Procedure for obtaining a free logic unit for safely opening a file.
@note If no units are available, -1 is returned.
On-the-fly usage
The unit value is returned by the function and also by the optional argument Free_Unit. This allows the function to be used directly (on-the-fly) in an open statement like
fortran
open(unit=Get_Unit(myunit),...) ; read(myunit)...Returns: integer
fortran
function Get_Unit(Free_Unit) result(funit)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
Free_Unit | integer | out | optional | Free logic unit. |
Call graph
Upper_Case
Function for converting lower case characters of a string to upper case ones.
The library uses this function in order to achieve case-insensitivty: all character variables used within the libary functions are pre-processed by Uppper_Case function before these variables are used. So the users can call the library functions without pay attention of the case of the keywords passed to the functions: calling the function VTK_INI with the string E_IO = VTK_INI('Ascii',...) is equivalent to E_IO = VTK_INI('ASCII',...).
Attributes: elemental
Returns: character(len=len)
fortran
function Upper_Case(string)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | String to be converted. |
Call graph
adjustlt
Extend adjustl to remove tab characters (char(9)).
Attributes: elemental
Returns: character(len=len)
fortran
function adjustlt(string) result(res)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | Input string. |
Call graph
read_record
The read action stops when finding a EOR character (char(10))
Returns: integer(kind=i4P)
fortran
function read_record(from, cf, buffer) result(E_IO)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
from | integer(kind=I4P) | in | optional | Offset. |
cf | integer(kind=I4P) | in | optional | Current file index (for concurrent files IO). |
buffer | character(len=:) | out | allocatable | String containing the next record. |
Call graph
move
Advance in VTK file inside the mark 'inside', until find the mark 'to_find', 'repeat' times.
Returns: integer(kind=I4P)
fortran
function move(to_find, repeat, cf, upper, inside, buffer) result(E_IO)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
to_find | character(len=*) | in | optional | Searched XML element. |
repeat | integer | in | optional | Number of repetitions. |
cf | integer(kind=I4P) | in | optional | Current file index (for concurrent files IO). |
upper | logical | in | optional | True if return buffer in upper case. |
inside | character(len=*) | in | XML element where to search 'to_find'. | |
buffer | character(len=:) | out | allocatable | String. |
Call graph
search
Search in VTK file from position 'pos' inside the mark 'inside', until find the mark 'to_find', eventually, having attribute 'with_attribute' matching the value 'of_value'.
Returns: integer(kind=I4P)
fortran
function search(cf, from, content, inside, to_find, with_attribute, of_value, buffer) result(E_IO)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
cf | integer(kind=I4P) | in | optional | Current file index (for concurrent files IO). |
from | integer(kind=I4P) | in | optional | Offset. Start point. |
content | character(len=:) | out | allocatable, optional | String with the content inside 'to_find' element. |
inside | character(len=*) | in | XML element where to search 'to_find'. | |
to_find | character(len=*) | in | Searched XML element. | |
with_attribute | character(len=*) | in | XML attribute id. | |
of_value | character(len=*) | in | Attribute value. | |
buffer | character(len=:) | inout | allocatable | String. |
Call graph