tem_restart_writeData Subroutine

public subroutine tem_restart_writeData(restart, chunk)

This subroutine dumps the given chunk to a given position in the restart file.

Arguments

Type IntentOptional Attributes Name
type(tem_restart_type), intent(inout) :: restart

The restart object describing how and what to output.

real(kind=rk), intent(in) :: chunk(:)

The data to output. It is organized as a serialized array of all scalar entries of all variable systems. Where first all the data for the nElems of the first variable system is provided. Within each variable system the data is organized elementwise.


Source Code

  subroutine tem_restart_writeData( restart, chunk )
    ! -------------------------------------------------------------------- !
    !> The restart object describing how and what to output.
    type(tem_restart_type), intent(inout) :: restart
    !> The data to output.
    !! It is organized as a serialized array of all scalar entries of all
    !! variable systems. Where first all the data for the nElems of the first
    !! variable system is provided. Within each variable system the data is
    !! organized elementwise.
    real(kind=rk), intent(in) :: chunk(:)
    ! -------------------------------------------------------------------- !
    integer :: ioStatus( mpi_status_size )
    integer :: iError
    ! -------------------------------------------------------------------- !
    ! Now write the collected data (from the state array and prob. derived
    ! quantities) into the file, using the view defined in
    ! [[tem_restart_openWrite]]
    ! arguments:
    ! file handle = binary unit opened in mpi_file_open
    ! initial address of buffer = first entry to dump within the chunk
    !                             this is ad
    call mpi_file_write_all( restart%binaryUnit, chunk,         &
      &                      restart%nChunkElems,               &
      &                      restart%write_file%vectype,        &
      &                      iostatus, iError                   )
    call check_mpi_error( iError,'File write all in tem_restart_writeData')

  end subroutine tem_restart_writeData