hvs_asciiSpatial_init Subroutine

public subroutine hvs_asciiSpatial_init(asciiSpatial, varsys, varpos, basename, globProc, outProc, solver, geometry, nDofs, nElems, glob_nElems, useGetPoint, nPoints, glob_nPoints, timeControl)

Initialize asciiSpatial output format. initialize reduction if reduction is active

Arguments

Type IntentOptional Attributes Name
type(hvs_asciiSpatial_type), intent(inout) :: asciiSpatial

AsciiSpatial output file settings

type(tem_varSys_type), intent(in) :: varsys

Description of the available variable system to get the given varnames from.

integer, intent(in) :: varpos(:)

List of variable positions that should be written in the output.

character(len=*), intent(in) :: basename

An extension to the output basename.

type(tem_comm_env_type), intent(in) :: globProc

Global communicator type for global rank information

type(tem_comm_env_type), intent(in) :: outProc

Process description to use.

type(tem_solveHead_type), intent(in) :: solver

Global solver information

type(tem_shape_type), intent(in), optional :: geometry(:)

shape defined for this ascii output

integer, intent(in) :: nDofs

The number of dofs for each scalar variable of the equation system

integer, intent(in) :: nElems

Number of elements to output by local process

integer(kind=long_k), intent(in) :: glob_nElems

Total number of elements across process on this output

logical, intent(in) :: useGetPoint

if get_point is to be used to track the point

integer, intent(in) :: nPoints

Number of points to output by local process

integer(kind=long_k), intent(in) :: glob_nPoints

Total number of points across process on this output

type(tem_timeControl_type), intent(in), optional :: timeControl

output timeControl


Calls

proc~~hvs_asciispatial_init~~CallsGraph proc~hvs_asciispatial_init hvs_asciiSpatial_init proc~tem_abort tem_abort proc~hvs_asciispatial_init->proc~tem_abort proc~hvs_ascii_write_header hvs_ascii_write_header proc~hvs_asciispatial_init->proc~hvs_ascii_write_header mpi_abort mpi_abort proc~tem_abort->mpi_abort interface~tem_shape_out tem_shape_out proc~hvs_ascii_write_header->interface~tem_shape_out proc~aot_out_close aot_out_close proc~hvs_ascii_write_header->proc~aot_out_close proc~tem_timecontrol_out tem_timeControl_out proc~hvs_ascii_write_header->proc~tem_timecontrol_out proc~tem_solvertag tem_solverTag proc~hvs_ascii_write_header->proc~tem_solvertag proc~aot_out_val aot_out_val proc~hvs_ascii_write_header->proc~aot_out_val proc~aot_out_open aot_out_open proc~hvs_ascii_write_header->proc~aot_out_open interface~tem_varsys_out tem_varSys_out proc~hvs_ascii_write_header->interface~tem_varsys_out proc~tem_shape_out_vec tem_shape_out_vec interface~tem_shape_out->proc~tem_shape_out_vec proc~tem_shape_out_scal tem_shape_out_scal interface~tem_shape_out->proc~tem_shape_out_scal proc~tem_timecontrol_out->proc~aot_out_val proc~aot_out_open_table aot_out_open_table proc~tem_timecontrol_out->proc~aot_out_open_table proc~aot_out_close_table aot_out_close_table proc~tem_timecontrol_out->proc~aot_out_close_table proc~tem_time_out tem_time_out proc~tem_timecontrol_out->proc~tem_time_out proc~tem_varsys_out_vector tem_varSys_out_vector interface~tem_varsys_out->proc~tem_varsys_out_vector proc~tem_varsys_out_single tem_varSys_out_single interface~tem_varsys_out->proc~tem_varsys_out_single proc~tem_shape_out_vec->proc~aot_out_open_table proc~tem_shape_out_vec->proc~aot_out_close_table proc~tem_shape_out_vec->proc~tem_shape_out_scal proc~tem_varsys_out_vector->proc~aot_out_open_table proc~tem_varsys_out_vector->proc~aot_out_close_table proc~tem_varsys_out_vector->proc~tem_varsys_out_single proc~tem_shape_out_scal->proc~aot_out_val proc~tem_shape_out_scal->proc~aot_out_open_table proc~tem_shape_out_scal->proc~aot_out_close_table interface~tem_canonicalnd_out tem_canonicalND_out proc~tem_shape_out_scal->interface~tem_canonicalnd_out interface~tem_cylinder_out tem_cylinder_out proc~tem_shape_out_scal->interface~tem_cylinder_out proc~tem_shape_bclabel_out tem_shape_bcLabel_out proc~tem_shape_out_scal->proc~tem_shape_bclabel_out interface~tem_ellipsoid_out tem_ellipsoid_out proc~tem_shape_out_scal->interface~tem_ellipsoid_out proc~tem_shape_proplabel_out tem_shape_propLabel_out proc~tem_shape_out_scal->proc~tem_shape_proplabel_out interface~tem_triangle_out tem_triangle_out proc~tem_shape_out_scal->interface~tem_triangle_out interface~tem_stlhead_out tem_stlHead_out proc~tem_shape_out_scal->interface~tem_stlhead_out interface~tem_sphere_out tem_sphere_out proc~tem_shape_out_scal->interface~tem_sphere_out proc~tem_shape_level_out tem_shape_level_out proc~tem_shape_out_scal->proc~tem_shape_level_out proc~tem_time_out->proc~aot_out_val proc~tem_time_out->proc~aot_out_open_table proc~tem_time_out->proc~aot_out_close_table proc~tem_varsys_out_single->proc~aot_out_val proc~tem_varsys_out_single->proc~aot_out_open_table proc~tem_varsys_out_single->proc~aot_out_close_table

Called by

proc~~hvs_asciispatial_init~~CalledByGraph proc~hvs_asciispatial_init hvs_asciiSpatial_init proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~hvs_asciispatial_init proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~hvs_output_init

Contents

Source Code


Source Code

  subroutine hvs_asciiSpatial_init(asciiSpatial, varSys, varPos, basename,     &
    &                              globProc, outProc, solver, geometry, nDofs, &
    &                              nElems, glob_nElems, useGetPoint, nPoints,  &
    &                              glob_nPoints, timeControl                   )
    ! --------------------------------------------------------------------------!
    !> AsciiSpatial output file settings
    type(hvs_asciiSpatial_type), intent(inout) :: asciiSpatial

    !> Description of the available variable system to get the given varnames
    !! from.
    type(tem_varSys_type), intent(in) :: varsys

    !> List of variable positions that should be written in the output.
    integer, intent(in) :: varpos(:)

    !> An extension to the output basename.
    character(len=*), intent(in) :: basename

    !> Global communicator type for global rank information
    type(tem_comm_env_type ), intent(in) :: globProc

    !> Process description to use.
    type(tem_comm_env_type), intent(in) :: outProc

    !> The number of dofs for each scalar variable of the equation system
    integer, intent(in) :: nDofs

    !> Number of elements to output by local process
    integer, intent(in) :: nElems

    !> Total number of elements across process on this output
    integer(kind=long_k), intent(in) :: glob_nElems

    !> Global solver information
    type(tem_solveHead_type ),intent(in) :: solver

    !> shape defined for this ascii output
    type(tem_shape_type), optional, intent(in) :: geometry(:)

    !> output timeControl
    type(tem_timeControl_type), optional, intent(in) :: timeControl

    !> if get_point is to be used to track the point
    logical, intent(in) :: useGetPoint

    !> Number of points to output by local process
    integer, intent(in) :: nPoints

    !> Total number of points across process on this output
    integer(kind=long_k), intent(in) :: glob_nPoints
    ! ----------------------------------------------------------------------!
    integer :: nScalars, chunkSize, nChunks
    ! ----------------------------------------------------------------------!

    ! Compute nChunks, Abort if nChunks>1 asciiSpatial format
    ! and for ascii format abort if nChunk>1 and no reduction defined
    nScalars = sum(varSys%method%val(varPos(:))%nComponents)

    if (useGetPoint) then
      chunkSize = min(io_buffer_size/nScalars, nPoints)
    else
      chunkSize = min(io_buffer_size/(nScalars*nDofs), nElems)
    end if
    if ( (nElems > 0) .and. (chunkSize == 0) ) then
      write(logUnit(0),*)'Error in asciiSpatial output: '//trim(basename)
      write(logUnit(0),*) 'The chosen io_buffer_size of ', io_buffer_size
      write(logUnit(0),*) 'is too small for outputting ', nScalars
      write(logUnit(0),*) 'scalar values'
      write(logUnit(0),*) 'Please increase the io_buffer_size to at &
        & least ', real(nScalars*nDofs) / real(131072), ' MB!'
      call tem_abort()
    end if

    if (chunkSize>0) then
      if (useGetPoint) then
        nChunks = ceiling(real(nPoints, kind=rk)/real(chunkSize, kind=rk))
      else
        nChunks = ceiling(real(nElems, kind=rk)/real(chunkSize, kind=rk))
      end if
    else
      nChunks = 0
    end if

    asciiSpatial%chunkSize = chunkSize
    asciiSpatial%nChunks = nChunks

    asciiSpatial%basename = trim(basename)
    ! write ascii header lua
    call hvs_ascii_write_header(out_format   = 'asciispatial', &
      &                         basename     = trim(basename), &
      &                         varSys       = varSys,         &
      &                         varPos       = varPos,         &
      &                         globProc     = globProc,       &
      &                         outProc      = outProc,        &
      &                         nDofs        = nDofs,          &
      &                         solver       = solver,         &
      &                         geometry     = geometry,       &
      &                         timeControl  = timeControl,    &
      &                         glob_nElems  = glob_nElems,    &
      &                         useGetPoint  = useGetPoint,    &
      &                         glob_nPoints = glob_nPoints    )

  end subroutine hvs_asciiSpatial_init