initialize Function

private function initialize(self, filename, scratch_units_number) result(error)

Arguments

TypeIntentOptionalAttributesName
class(vtm_file), intent(inout) :: self
character, intent(in) :: filename
integer(kind=I4P), intent(in), optional :: scratch_units_number

Return Value integer(kind=I4P)


Calls

proc~~initialize~6~~CallsGraph proc~initialize~6 initialize proc~penf_init penf_init proc~initialize~6->proc~penf_init proc~b64_init b64_init proc~initialize~6->proc~b64_init proc~check_endian check_endian proc~penf_init->proc~check_endian proc~b64_init->proc~penf_init

Contents

Source Code


Source Code

  function initialize(self, filename, scratch_units_number) result(error)
  !< Initialize file (writer).
  class(vtm_file), intent(inout)        :: self                  !< VTM file.
  character(*),    intent(in)           :: filename              !< File name of output VTM file.
  integer(I4P),    intent(in), optional :: scratch_units_number  !< Number of scratch units for very large list of named blocks.
  integer(I4P)                          :: scratch_units_number_ !< Number of scratch units for very large list of named blocks.
  integer(I4P)                          :: error                 !< Error status.

  if (.not.is_initialized) call penf_init
  if (.not.is_b64_initialized) call b64_init
  scratch_units_number_ = 0_I4P ; if (present(scratch_units_number)) scratch_units_number_ = scratch_units_number
  error = self%finalize()
  if (allocated(self%xml_writer)) deallocate(self%xml_writer)
  allocate(xml_writer_ascii_local :: self%xml_writer)
  error = self%xml_writer%initialize(format='ascii', filename=filename, mesh_topology='vtkMultiBlockDataSet')
  if (scratch_units_number_>0_I4P) allocate(self%scratch_unit(scratch_units_number_))
  endfunction initialize