kipp_choose_device Subroutine

public subroutine kipp_choose_device()

Choose output device from environment.

/xw when $DISPLAY is set, else PNG named by st%prefix.

Arguments

None

Source Code

   subroutine kipp_choose_device()
      !! Choose output device from environment.
      !!
      !! /xw when `$DISPLAY` is set, else PNG named by `st%prefix`.
      character(len=256) :: disp
      integer :: ln, status
      call get_environment_variable('DISPLAY', disp, ln, status)
      if (status == 0 .and. ln > 0) then
         st%device = '/xw'
         st%interactive = .true.
         print '(a)', '[kipp] display detected -> interactive /xw window'
      else
         st%device = '/png'
         st%interactive = .false.
         print '(a)', '[kipp] no $DISPLAY -> PNG mode (writes '//trim(st%prefix)//'.png)'
      end if
   end subroutine kipp_choose_device