tem_connect_toNull Subroutine

public subroutine tem_connect_toNull(null_unit)

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: null_unit

Calls

proc~~tem_connect_tonull~~CallsGraph proc~tem_connect_tonull tem_connect_toNull proc~newunit newunit proc~tem_connect_tonull->proc~newunit

Called by

proc~~tem_connect_tonull~~CalledByGraph proc~tem_connect_tonull tem_connect_toNull proc~tem_logging_init_logger tem_logging_init_logger proc~tem_logging_init_logger->proc~tem_connect_tonull interface~tem_logging_init tem_logging_init interface~tem_logging_init->proc~tem_logging_init_logger proc~tem_logging_init_primary tem_logging_init_primary interface~tem_logging_init->proc~tem_logging_init_primary proc~tem_logging_init_primary->proc~tem_logging_init_logger proc~tem_logging_load tem_logging_load proc~tem_logging_load->proc~tem_logging_init_logger proc~tem_logging_load->proc~tem_logging_init_primary proc~tem_load_debug tem_load_debug proc~tem_load_debug->interface~tem_logging_init proc~tem_load_debug->proc~tem_logging_load proc~tem_logging_load_primary tem_logging_load_primary proc~tem_logging_load_primary->proc~tem_logging_init_primary proc~tem_logging_load_primary->proc~tem_logging_load proc~tem_debug_load_main tem_debug_load_main proc~tem_debug_load_main->proc~tem_load_debug

Source Code

  subroutine tem_connect_toNull(null_unit)
    integer, intent(out) :: null_unit

    logical :: null_connected

    inquire(file=trim(null_device), opened=null_connected)
    if (null_connected) then
      inquire(file=trim(null_device), number=null_unit)
      ! Some MPI implementations might connect stdin to the null device.
      ! Need to check if this is the case and attempt to open it again
      ! with a different unit to make it writable.
      if (null_unit == input_unit) then
        null_unit = newUnit()
        open(file=trim(null_device), unit=null_unit)
      end if
    else
      null_unit = newUnit()
      open(file=trim(null_device), unit=null_unit)
    end if

  end subroutine tem_connect_toNull