module mykinds
   implicit none
   integer, parameter :: ik1 = selected_int_kind(2)
   integer, parameter :: ik2 = selected_int_kind(4)
   integer, parameter :: ik4 = selected_int_kind(9)
   integer, parameter :: ik8 = selected_int_kind(18)
end module mykinds

module ops1
   use mykinds, only: wik => ik1
   implicit none
   private
include 'ifaces.i90'
   contains
include 'logical.i90'
end module ops1

module ops2
   use mykinds, only: wik => ik2
   implicit none
   private
include 'ifaces.i90'
   contains
include 'logical.i90'
end module ops2

module ops4
   use mykinds, only: wik => ik4
   implicit none
   private
include 'ifaces.i90'
   contains
include 'logical.i90'
end module ops4

module ops8
   use mykinds, only: wik => ik8
   implicit none
   private
include 'ifaces.i90'
   contains
include 'logical.i90'
end module ops8

module generic_recombination
   use ops1
   use ops2
   use ops4
   use ops8
   implicit none
end module generic_recombination

program logical_test
   use mykinds
   use generic_recombination
   implicit none
   integer(ik1) a, b
   integer(ik2) c, d
   integer(ik4) e, f
   integer(ik8) g, h

   a = 12
   b = 10
   write(*,'(b0.4)') ibits(a .CLR.  b,0,4)
   write(*,'(b0.4)') ibits(a .NOR.  b,0,4)
   write(*,'(b0.4)') ibits(a .BCR.  b,0,4)
   write(*,'(b0.4)') ibits(a .NOTA. b,0,4)
   write(*,'(b0.4)') ibits(a .BIC.  b,0,4)
   write(*,'(b0.4)') ibits(a .NOTB. b,0,4)
   write(*,'(b0.4)') ibits(a .XOR.  b,0,4)
   write(*,'(b0.4)') ibits(a .NAND. b,0,4)
   write(*,'(b0.4)') ibits(a .AND.  b,0,4)
   write(*,'(b0.4)') ibits(a .XNOR. b,0,4)
   write(*,'(b0.4)') ibits(a .SELB. b,0,4)
   write(*,'(b0.4)') ibits(a .BNSR. b,0,4)
   write(*,'(b0.4)') ibits(a .SELA. b,0,4)
   write(*,'(b0.4)') ibits(a .BNS.  b,0,4)
   write(*,'(b0.4)') ibits(a .OR.   b,0,4)
   write(*,'(b0.4)') ibits(a .SET.  b,0,4)
   c = 12
   d = 10
   write(*,'(b0.4)') ibits(c .CLR.  d,0,4)
   write(*,'(b0.4)') ibits(c .NOR.  d,0,4)
   write(*,'(b0.4)') ibits(c .BCR.  d,0,4)
   write(*,'(b0.4)') ibits(c .NOTA. d,0,4)
   write(*,'(b0.4)') ibits(c .BIC.  d,0,4)
   write(*,'(b0.4)') ibits(c .NOTB. d,0,4)
   write(*,'(b0.4)') ibits(c .XOR.  d,0,4)
   write(*,'(b0.4)') ibits(c .NAND. d,0,4)
   write(*,'(b0.4)') ibits(c .AND.  d,0,4)
   write(*,'(b0.4)') ibits(c .XNOR. d,0,4)
   write(*,'(b0.4)') ibits(c .SELB. d,0,4)
   write(*,'(b0.4)') ibits(c .BNSR. d,0,4)
   write(*,'(b0.4)') ibits(c .SELA. d,0,4)
   write(*,'(b0.4)') ibits(c .BNS.  d,0,4)
   write(*,'(b0.4)') ibits(c .OR.   d,0,4)
   write(*,'(b0.4)') ibits(c .SET.  d,0,4)
   e = 12
   f = 10
   write(*,'(b0.4)') ibits(e .CLR.  f,0,4)
   write(*,'(b0.4)') ibits(e .NOR.  f,0,4)
   write(*,'(b0.4)') ibits(e .BCR.  f,0,4)
   write(*,'(b0.4)') ibits(e .NOTA. f,0,4)
   write(*,'(b0.4)') ibits(e .BIC.  f,0,4)
   write(*,'(b0.4)') ibits(e .NOTB. f,0,4)
   write(*,'(b0.4)') ibits(e .XOR.  f,0,4)
   write(*,'(b0.4)') ibits(e .NAND. f,0,4)
   write(*,'(b0.4)') ibits(e .AND.  f,0,4)
   write(*,'(b0.4)') ibits(e .XNOR. f,0,4)
   write(*,'(b0.4)') ibits(e .SELB. f,0,4)
   write(*,'(b0.4)') ibits(e .BNSR. f,0,4)
   write(*,'(b0.4)') ibits(e .SELA. f,0,4)
   write(*,'(b0.4)') ibits(e .BNS.  f,0,4)
   write(*,'(b0.4)') ibits(e .OR.   f,0,4)
   write(*,'(b0.4)') ibits(e .SET.  f,0,4)
   g = 12
   h = 10
   write(*,'(b0.4)') ibits(g .CLR.  h,0,4)
   write(*,'(b0.4)') ibits(g .NOR.  h,0,4)
   write(*,'(b0.4)') ibits(g .BCR.  h,0,4)
   write(*,'(b0.4)') ibits(g .NOTA. h,0,4)
   write(*,'(b0.4)') ibits(g .BIC.  h,0,4)
   write(*,'(b0.4)') ibits(g .NOTB. h,0,4)
   write(*,'(b0.4)') ibits(g .XOR.  h,0,4)
   write(*,'(b0.4)') ibits(g .NAND. h,0,4)
   write(*,'(b0.4)') ibits(g .AND.  h,0,4)
   write(*,'(b0.4)') ibits(g .XNOR. h,0,4)
   write(*,'(b0.4)') ibits(g .SELB. h,0,4)
   write(*,'(b0.4)') ibits(g .BNSR. h,0,4)
   write(*,'(b0.4)') ibits(g .SELA. h,0,4)
   write(*,'(b0.4)') ibits(g .BNS.  h,0,4)
   write(*,'(b0.4)') ibits(g .OR.   h,0,4)
   write(*,'(b0.4)') ibits(g .SET.  h,0,4)
end program logical_test

