initialize Function

private function initialize(self, format, filename, mesh_topology, nx1, nx2, ny1, ny2, nz1, nz2, is_volatile, mesh_kind) result(error)

Arguments

TypeIntentOptionalAttributesName
class(xml_writer_appended), intent(inout) :: self
character, intent(in) :: format
character, intent(in) :: filename
character, intent(in) :: mesh_topology
integer(kind=I4P), intent(in), optional :: nx1
integer(kind=I4P), intent(in), optional :: nx2
integer(kind=I4P), intent(in), optional :: ny1
integer(kind=I4P), intent(in), optional :: ny2
integer(kind=I4P), intent(in), optional :: nz1
integer(kind=I4P), intent(in), optional :: nz2
logical, intent(in), optional :: is_volatile
character, intent(in), optional :: mesh_kind

Return Value integer(kind=I4P)


Contents

Source Code


Source Code

  function initialize(self, format, filename, mesh_topology, nx1, nx2, ny1, ny2, nz1, nz2, &
                      is_volatile, mesh_kind) result(error)
  !< Initialize writer.
  class(xml_writer_appended), intent(inout)        :: self          !< Writer.
  character(*),               intent(in)           :: format        !< File format: ASCII.
  character(*),               intent(in)           :: filename      !< File name.
  character(*),               intent(in)           :: mesh_topology !< Mesh topology.
  integer(I4P),               intent(in), optional :: nx1           !< Initial node of x axis.
  integer(I4P),               intent(in), optional :: nx2           !< Final node of x axis.
  integer(I4P),               intent(in), optional :: ny1           !< Initial node of y axis.
  integer(I4P),               intent(in), optional :: ny2           !< Final node of y axis.
  integer(I4P),               intent(in), optional :: nz1           !< Initial node of z axis.
  integer(I4P),               intent(in), optional :: nz2           !< Final node of z axis.
  character(*),               intent(in), optional :: mesh_kind     !< Kind of mesh data: Float64, Float32, ecc.
  logical,                    intent(in), optional :: is_volatile   !< Flag to check volatile writer.
  integer(I4P)                                     :: error         !< Error status.

  self%topology = trim(adjustl(mesh_topology))
  self%format_ch = 'appended'
  self%encoding = format
  self%encoding = self%encoding%upper()
  select case(self%encoding%chars())
  case('RAW')
    self%encoding = 'raw'
  case('BINARY-APPENDED')
    self%encoding = 'base64'
  endselect
  call self%open_xml_file(filename=filename)
  call self%write_header_tag
  call self%write_topology_tag(nx1=nx1, nx2=nx2, ny1=ny1, ny2=ny2, nz1=nz1, nz2=nz2, mesh_kind=mesh_kind)
  self%ioffset = 0
  call self%open_scratch_file
  error = self%error
  endfunction initialize