hvs_asciiSpatial_open Subroutine

public subroutine hvs_asciiSpatial_open(asciiSpatial, outProc, time, varSys, varPos, nDofs)

Open the output file for AsciiSpatial format.

Each time this routine is called, a new file is written Filename: {tracking_folder}{tracking_label}spatial_{timestamp}.res e.g.: tracking/lineProbe_spatial_00001_01_01378.1.res Each process open its own files

Arguments

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

asciiSpatial file output

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

Parallel environment to use for the output.

type(tem_time_type), intent(in) :: time

current global time

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

solver-provided variable systems

integer, intent(in) :: varPos(:)

Position of variables to dump in varSys

integer, intent(in) :: nDofs

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


Calls

proc~~hvs_asciispatial_open~~CallsGraph proc~hvs_asciispatial_open hvs_asciiSpatial_open proc~getheader getHeader proc~hvs_asciispatial_open->proc~getheader proc~tem_open tem_open proc~hvs_asciispatial_open->proc~tem_open proc~tem_time_sim_stamp tem_time_sim_stamp proc~hvs_asciispatial_open->proc~tem_time_sim_stamp proc~tem_abort tem_abort proc~getheader->proc~tem_abort proc~newunit newunit proc~tem_open->proc~newunit proc~tem_open->proc~tem_abort proc~upper_to_lower upper_to_lower proc~tem_open->proc~upper_to_lower mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~hvs_asciispatial_open~~CalledByGraph proc~hvs_asciispatial_open hvs_asciiSpatial_open proc~hvs_output_open hvs_output_open proc~hvs_output_open->proc~hvs_asciispatial_open proc~tem_tracker tem_tracker proc~tem_tracker->proc~hvs_output_open

Source Code

  subroutine hvs_asciiSpatial_open( asciiSpatial, outProc, time, varSys,      &
    &                               varPos, nDofs )
    ! ---------------------------------------------------------------------------
    !> asciiSpatial file output
    type(hvs_asciiSpatial_type ), intent(inout) :: asciiSpatial
    !> Parallel environment to use for  the output.
    type(tem_comm_env_type ), intent(in) :: outProc
    !> current global time
    type(tem_time_type ), intent(in) :: time
    !> solver-provided variable systems
    type(tem_varSys_type), intent(in) :: varSys
    !> Position of variables to dump in varSys
    integer, intent(in) :: varPos(:)
    !> The number of dofs for each scalar variable of the equation system
    integer, intent(in) :: nDofs
    ! ---------------------------------------------------------------------------
    integer :: nScalars
    character(len=pathLen)  :: filename  ! ascii file name
    character(len=1024)  :: buffer
    ! ---------------------------------------------------------------------------
    nScalars = sum(varSys%method%val(varPos(:))%nComponents)

    ! Write the rank into the string buffer
    write(buffer,'(i5.5)') outProc%rank

    asciiSpatial%timestamp = tem_time_sim_stamp( time )

    ! Generate ascii file name
    write(filename,'(a)') trim(asciiSpatial%basename)//'_p'//trim(buffer)      &
      &                //'_t'//trim(asciiSpatial%timestamp)//'.res'

    call tem_open( newunit = asciiSpatial%outunit, &
      &            file    = trim(filename),       &
      &            recl    = 1024,                 &
      &            status  = 'replace'             )

    write ( asciiSpatial%outUnit , '(a,i7)' ) '# Rank of the process: ',       &
        &                                     outProc%rank
    write ( buffer, '(a1, 3(1x,a24))' ) '#', 'coordX', 'coordY', 'coordZ'
    buffer = trim(buffer)                                    &
      &    //trim(getHeader( varSys, varPos, nDofs, .false. ))
    ! ... and write the header row to the file
    write ( asciiSpatial%outunit , '(a)' ) trim(buffer)

  end subroutine hvs_asciiSpatial_open