delete_file Subroutine

public subroutine delete_file(name)

Delete a file if it exists

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Called by

proc~~delete_file~~CalledByGraph proc~delete_file delete_file proc~halo_solver_main halo_solver_main proc~halo_solver_main->proc~delete_file

Source Code

    subroutine delete_file(name)

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

    integer :: istat, iunit

    open(file=name,newunit=iunit,status='OLD',iostat=istat)
    if (istat==0) then
        write(*,'(A)') ' * Deleting existing file: '//trim(name)
        close(iunit,status='DELETE',iostat=istat)
    end if

    end subroutine delete_file