module ooc_mesage_mod
  implicit none

  interface ooc_message
     module procedure print_integer
     module procedure print_real
     module procedure print_character
     module procedure print_logical
     module procedure print_info
  end interface

contains

! returns m so that nn/m=integer (m<=n)
! -------------------------------------
  integer function prime(nn, n) result(m)
    integer, intent(in) :: nn,n
    integer             ::  p,i
    p=nn/n
    do m=n,1,-1
       i=p
       do while(i*m<nn)
          i=i+1
       end do
       if (i*m .eq. nn) exit
    end do
  end function
! -----------------------------
  subroutine print_integer(n,v)
    character(len=*), intent(in) :: n
    integer,          intent(in) :: v
    call oocline()
    write (0,'(" OC ",a,"=",i8)') trim(n),v
    call oocline()
  end subroutine
  subroutine print_real(n,v)
    character(len=*), intent(in) :: n
    real,             intent(in) :: v
    call oocline()
    write (0,'(" OC ",a,"=",f15.6)') trim(n),v
    call oocline()
  end subroutine
  subroutine print_character(n,v)
    character(len=*), intent(in) :: n,v
    call oocline()
    write (0,'(" OC ",a,"=",a)') trim(n),trim(v)
    call oocline()
  end subroutine
  subroutine print_info(n)
    character(len=*), intent(in) :: n
    call oocline()
    write (0,'(" OC ",a)') trim(n)
    call oocline()
  end subroutine
  subroutine print_logical(n,v)
    character(len=*), intent(in) :: n
    logical,          intent(in) :: v
    call oocline()
    write (0,'(" OC ",a,"=",l2)') trim(n),v
    call oocline()
  end subroutine
! ----------------------------------------------------------------
  subroutine oocline()
    write (0,*) 'OC-------------------------------------------'
  end subroutine
! ----------------------------------------------------------------


end module
