tem_probing_delete Subroutine

public subroutine tem_probing_delete(filename)

Delete the file with the given name.

Use this in the beginning of the application, to clear old logs.

Arguments

Type IntentOptional AttributesName
character(len=*) :: filename

Name of the file to delete.


Calls

proc~~tem_probing_delete~~CallsGraph proc~tem_probing_delete tem_probing_delete proc~newunit newunit proc~tem_probing_delete->proc~newunit

Contents

Source Code


Source Code

  subroutine tem_probing_delete(filename)
    ! -------------------------------------------------------------------- !
    !> Name of the file to delete.
    character(len=*) :: filename
    ! -------------------------------------------------------------------- !
    logical :: is_oldfile
    integer :: probeunit
    ! -------------------------------------------------------------------- !

    inquire(file=trim(filename), exist = is_oldfile)
    probeunit = newunit()
    if (is_oldfile) then
      open( probeunit, file=filename, status='old', position='append', &
        &   action='write' )
    else
      open( probeunit, file=filename, status='new', action='write' )
    end if
    close(probeunit, status='delete')
  end subroutine tem_probing_delete