Skip to content

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

Variables

NameTypeAttributesDescription
maxleninteger(kind=I4P)parameterMax number of characters of static string.
end_reccharacter(len=1)parameterEnd-character for binary-record finalize.
asciiinteger(kind=I4P)parameterAscii-output-format parameter identifier.
binaryinteger(kind=I4P)parameterBase64-output-format parameter identifier.
rawinteger(kind=I4P)parameterRaw-appended-binary-output-format parameter identifier.
bin_appinteger(kind=I4P)parameterBase64-appended-output-format parameter identifier.
vtktype(Type_VTK_File)allocatableGlobal data of VTK files [1:Nvtk].
Nvtkinteger(kind=I4P)Number of (concurrent) VTK files.
finteger(kind=I4P)Current VTK file index.
vtmtype(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

NameTypeAttributesDescription
finteger(kind=I4P)Current output-format (initialized to ascii format).
topologycharacter(len=maxlen)Mesh topology.
uinteger(kind=I4P)Logical unit.
uainteger(kind=I4P)Logical unit for raw binary XML append file.
N_Byteinteger(kind=I8P)Number of byte to be written/read.
N_Byteinteger(kind=I4P)Number of byte to be written/read.
ioffsetinteger(kind=I8P)Offset pointer.
indentinteger(kind=I4P)Indent pointer.

Type-Bound Procedures

NameAttributesDescription
byte_updateProcedure for updating N_Byte and ioffset pointer.

Type_VTM_File

Derived type for handling VTM files.

Components

NameTypeAttributesDescription
uinteger(kind=I4P)Logical unit.
blkinteger(kind=I4P)Block indexes.
indentinteger(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

NameTypeIntentAttributesDescription
vtkclass(Type_VTK_File)inoutGlobal data of VTK file.
N_Byteinteger(kind=I8P)inNumber 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

NameTypeIntentAttributesDescription
actcharacter(len=*)inAction: 'ADD' one more element, 'REMOVE' current element file.
cfinteger(kind=I4P)inoutCurrent file index (for concurrent files IO).
Nvtkinteger(kind=I4P)inoutNumber of (concurrent) VTK files.
vtktype(Type_VTK_File)inoutallocatableVTK 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

NameTypeIntentAttributesDescription
casecharacter(len=*)inoptionalAttribute string case.
E_IOinteger(kind=I4P)outoptionalError trapping flag.
buffercharacter(len=*)inString where to search the attrib.
attribcharacter(len=*)inXML attribute id.
valinteger(kind=I4P)outReturned 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

NameTypeIntentAttributesDescription
casecharacter(len=*)inoptionalAttribute string case.
E_IOinteger(kind=I4P)outoptionalError trapping flag.
buffercharacter(len=*)inString where to search the attrib
attribcharacter(len=*)inXML attribute id
valcharacter(len=:)outallocatableReturned 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

NameTypeIntentAttributesDescription
Free_UnitintegeroutoptionalFree 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

NameTypeIntentAttributesDescription
stringcharacter(len=*)inString 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

NameTypeIntentAttributesDescription
stringcharacter(len=*)inInput 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

NameTypeIntentAttributesDescription
frominteger(kind=I4P)inoptionalOffset.
cfinteger(kind=I4P)inoptionalCurrent file index (for concurrent files IO).
buffercharacter(len=:)outallocatableString 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

NameTypeIntentAttributesDescription
to_findcharacter(len=*)inoptionalSearched XML element.
repeatintegerinoptionalNumber of repetitions.
cfinteger(kind=I4P)inoptionalCurrent file index (for concurrent files IO).
upperlogicalinoptionalTrue if return buffer in upper case.
insidecharacter(len=*)inXML element where to search 'to_find'.
buffercharacter(len=:)outallocatableString.

Call graph

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

NameTypeIntentAttributesDescription
cfinteger(kind=I4P)inoptionalCurrent file index (for concurrent files IO).
frominteger(kind=I4P)inoptionalOffset. Start point.
contentcharacter(len=:)outallocatable, optionalString with the content inside 'to_find' element.
insidecharacter(len=*)inXML element where to search 'to_find'.
to_findcharacter(len=*)inSearched XML element.
with_attributecharacter(len=*)inXML attribute id.
of_valuecharacter(len=*)inAttribute value.
buffercharacter(len=:)inoutallocatableString.

Call graph