init_error_unit Subroutine

public subroutine init_error_unit(open_it)

Uses

Open error file and record associated lun/unit

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: open_it

If true, open the file, otherwise do nothing


Contents

Source Code


Source Code

  subroutine init_error_unit (open_it)
    use mp, only : set_default_error_file_unit
    implicit none
    !> If true, open the file, otherwise do nothing
    logical, intent (in) :: open_it
    error_unit_no = 0
    if (run_name /= "unknown" .and. open_it) then
       call open_output_file (error_unit_no, ".error")
       ! TT: error_unit_no is overwritten for .error file
    end if
    ! Set mp's error file so that we don't have to set it in every
    ! call to mp_abort
    call set_default_error_file_unit(error_unit_no)
  end subroutine init_error_unit