hvs_dump_debug_array Subroutine

public subroutine hvs_dump_debug_array(proc, tree, time, vrtx, debug_data)

Dumps the debug_data into a file.

This routine takes a one-dimensional array (one value per element, ordered liek the treeIDs) and stores it into a vtk file. The name of the vtk-file is debug_dump, the values are called debug_value.

The caller has to provide the vrtx, which can be created with the tem_calc_vrtx_coord-routine.

Arguments

Type IntentOptional Attributes Name
type(tem_comm_env_type), intent(in) :: proc
type(treelmesh_type), intent(in) :: tree
type(tem_time_type), intent(in) :: time
type(tem_vrtx_type) :: vrtx
real(kind=rk) :: debug_data(tree%nElems)

Calls

proc~~hvs_dump_debug_array~~CallsGraph proc~hvs_dump_debug_array hvs_dump_debug_array interface~convert_to_base64 convert_to_Base64 proc~hvs_dump_debug_array->interface~convert_to_base64 proc~hvs_vtk_close~2 hvs_vtk_close proc~hvs_dump_debug_array->proc~hvs_vtk_close~2 proc~hvs_vtk_init~2 hvs_vtk_init proc~hvs_dump_debug_array->proc~hvs_vtk_init~2 proc~hvs_vtk_open~2 hvs_vtk_open proc~hvs_dump_debug_array->proc~hvs_vtk_open~2 proc~hvs_vtk_write_meshdata~2 hvs_vtk_write_meshdata proc~hvs_dump_debug_array->proc~hvs_vtk_write_meshdata~2 proc~char_to_base64 char_to_base64 interface~convert_to_base64->proc~char_to_base64 proc~int32_to_base64 int32_to_base64 interface~convert_to_base64->proc~int32_to_base64 proc~int64_to_base64 int64_to_base64 interface~convert_to_base64->proc~int64_to_base64 proc~int8_to_base64 int8_to_base64 interface~convert_to_base64->proc~int8_to_base64 proc~real32_to_base64 real32_to_base64 interface~convert_to_base64->proc~real32_to_base64 proc~real64_to_base64 real64_to_base64 interface~convert_to_base64->proc~real64_to_base64 proc~tem_open tem_open proc~hvs_vtk_init~2->proc~tem_open proc~hvs_vtk_open~2->proc~tem_open proc~tem_time_iter_stamp tem_time_iter_stamp proc~hvs_vtk_open~2->proc~tem_time_iter_stamp proc~tem_time_sim_stamp tem_time_sim_stamp proc~hvs_vtk_open~2->proc~tem_time_sim_stamp proc~hvs_vtk_write_meshdata~2->interface~convert_to_base64 interface~convert_to_base64_single convert_to_Base64_single proc~char_to_base64->interface~convert_to_base64_single interface~encodeblock EncodeBlock proc~char_to_base64->interface~encodeblock interface~encodeindex EncodeIndex proc~char_to_base64->interface~encodeindex proc~int32_to_base64->interface~convert_to_base64_single proc~int32_to_base64->interface~encodeblock proc~int32_to_base64->interface~encodeindex proc~int64_to_base64->interface~convert_to_base64_single proc~int64_to_base64->interface~encodeblock proc~int64_to_base64->interface~encodeindex proc~int8_to_base64->interface~convert_to_base64_single proc~int8_to_base64->interface~encodeblock proc~int8_to_base64->interface~encodeindex proc~real32_to_base64->interface~convert_to_base64_single proc~real32_to_base64->interface~encodeblock proc~real32_to_base64->interface~encodeindex proc~real64_to_base64->interface~convert_to_base64_single proc~real64_to_base64->interface~encodeblock proc~real64_to_base64->interface~encodeindex proc~newunit newunit proc~tem_open->proc~newunit proc~tem_abort tem_abort proc~tem_open->proc~tem_abort proc~upper_to_lower upper_to_lower proc~tem_open->proc~upper_to_lower proc~char_to_base64_single char_to_base64_single interface~convert_to_base64_single->proc~char_to_base64_single proc~int32_to_base64_single int32_to_base64_single interface~convert_to_base64_single->proc~int32_to_base64_single proc~int64_to_base64_single int64_to_base64_single interface~convert_to_base64_single->proc~int64_to_base64_single proc~int8_to_base64_single int8_to_base64_single interface~convert_to_base64_single->proc~int8_to_base64_single proc~real32_to_base64_single real32_to_base64_single interface~convert_to_base64_single->proc~real32_to_base64_single proc~real64_to_base64_single real64_to_base64_single interface~convert_to_base64_single->proc~real64_to_base64_single mpi_abort mpi_abort proc~tem_abort->mpi_abort

Source Code

  subroutine hvs_dump_debug_array( proc, tree, time, vrtx, debug_data)
    !---------------------------------------------------------------------------
    type(tem_comm_env_type), intent(in) :: proc
    type(treelmesh_type), intent(in) :: tree
    type(tem_time_type), intent(in) :: time
    type(tem_vrtx_type) :: vrtx
    real(kind=rk) :: debug_data(tree%nElems)
    !---------------------------------------------------------------------------
    type(hvs_vtk_file_type) :: vtk_file
    type(hvs_vtk_config_type) :: vtk_config
    character :: linebreak
    character(len=PathLen) :: headerline
    !---------------------------------------------------------------------------

    vtk_config%dataform = 'binary'
    vtk_config%write_pvd = .false.

    call hvs_vtk_init( vtk_file   = vtk_file,     &
      &                vtk_config = vtk_config,   &
      &                basename   = 'debug_dump', &
      &                proc       = proc          )
    vtk_file%has_celldata = .true.


    call hvs_vtk_open( vtk_file = vtk_file,   &
      &                use_iter = .true.,     &
      &                proc     = proc,       &
      &                time     = time        )

    call hvs_vtk_write_meshdata( vtk_file = vtk_file,   &
      &                          vrtx     = vrtx,       &
      &                          nElems   = tree%nElems )


    linebreak = new_line('x')
    write(vtk_file%outunit) '<CellData Scalars="debug_value">'//linebreak

    write(headerline,'(a,i0,a)') '    <DataArray type="Float64" ' &
      & // ' Name="debug_value"'                                  &
      & // ' NumberOfComponents="', 1, '"'                        &
      & // ' format="' // trim(vtk_file%dataform) // '">'
    write(vtk_file%outunit) trim(headerline) // linebreak

    call convert_to_base64( debug_data, tree%nElems, vtk_file%outunit )
    write(vtk_file%outunit) linebreak

    ! Close the data array again.
    write(headerline,'(a)') '    </DataArray>'
    write(vtk_file%outunit) trim(headerline) // linebreak

    call hvs_vtk_close( vtk_file, proc)

  end subroutine hvs_dump_debug_array