      PROGRAM test_prod3
      PARAMETER (n = 16)
      REAL a (n)
      REAL b (n, n)
      INTEGER ia (n), itemp1 (n)
      INTEGER ib (n, n), itemp2 (n, n)
      DOUBLE PRECISION da (n)
      DOUBLE PRECISION db (n, n)
      COMPLEX ca (n)
      COMPLEX cb (n, n)
      INTEGER i, j, iprod
      REAL rprod
      DOUBLE PRECISION dprod
      COMPLEX cprod
      INTEGER Ti1, Ti2
      INTEGER Tllb1
      INTEGER Tlub1
      INTEGER minLoc1, maxLoc1, minLoc2, maxLoc2, coord(3)
      COMMON /g_to_l/minLoc1, maxLoc1, minLoc2, maxLoc2, coord
      INTEGER TTT14temp_info (8,7), TTT0temp_info (8,7), Tia_info (8,7),
     & Tib_info (8,7), TTT18temp_info (8,7), TTT4temp_info (8,7), TTT23t
     &emp_info (8,7), TTT8temp_info (8,7), Tca_info (8,7), Tcb_info (8,7
     &), TTT13temp_info (8,7), TTT17temp_info (8,7), TTT3temp_info (8,7)
     &, TTT22temp_info (8,7), TTT7temp_info (8,7), TTT12temp_info (8,7),
     & Tda_info (8,7), Tdb_info (8,7), TTT16temp_info (8,7), TTT2temp_in
     &fo (8,7), TTT21temp_info (8,7), Ta_info (8,7), TTT6temp_info (8,7)
     &, Tb_info (8,7), TTT11temp_info (8,7), TTT15temp_info (8,7), TTT1t
     &emp_info (8,7), TTT20temp_info (8,7), TTT19temp_info (8,7), TTT5te
     &mp_info (8,7), TTT10temp_info (8,7), TTT9temp_info (8,7)
      INTEGER proclist(8)
      LOGICAL TT0temp (n)
      LOGICAL TT1temp (n)
      LOGICAL TT2temp (n)
      LOGICAL TT3temp (n)
      LOGICAL TT4temp (n, n)
      LOGICAL TT5temp (n, n)
      LOGICAL TT6temp (n, n)
      LOGICAL TT7temp (n, n)
      LOGICAL TT8temp (n, n)
      REAL TT9temp (n)
      LOGICAL TT10temp (n, n)
      REAL TT11temp (n)
      LOGICAL TT12temp (n, n)
      INTEGER TT13temp (n)
      LOGICAL TT14temp (n, n)
      INTEGER TT15temp (n)
      LOGICAL TT16temp (n, n)
      DOUBLE PRECISION TT17temp (n)
      LOGICAL TT18temp (n, n)
      DOUBLE PRECISION TT19temp (n)
      LOGICAL TT20temp (n, n)
      COMPLEX TT21temp (n)
      LOGICAL TT22temp (n, n)
      COMPLEX TT23temp (n)
      INTEGER TT24temp
      REAL product_1_R_M
      INTEGER product_1_I_M
      DOUBLE PRECISION product_1_D_M
      COMPLEX product_1_X_M
      REAL product_2_R_M
      INTEGER product_2_I_M
      DOUBLE PRECISION product_2_D_M
      COMPLEX product_2_X_M
      CALL parameter_for_intrinsic (TTT14temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT14temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT0temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tia_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tib_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tib_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT18temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT18temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT4temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT4temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT23temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT8temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT8temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tca_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tcb_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tcb_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT13temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT17temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT3temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT22temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT22temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT7temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT7temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT12temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT12temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tda_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tdb_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tdb_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT16temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT16temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT2temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT21temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Ta_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT6temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT6temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tb_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (Tb_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT11temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT15temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT1temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT20temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT20temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT19temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT5temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT5temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT10temp_info, 1, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT10temp_info, 2, 1, n, n, 0, 0)
      CALL parameter_for_intrinsic (TTT9temp_info, 1, 1, n, n, 0, 0)
      proclist(1)=-1
      TT24temp = 1
      DO Ti1 = 1, n
      a (Ti1) = 2.0
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      ia (Ti1) = 2
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      da (Ti1) = 2.0d0
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      ca (Ti1) = (2.0, 2.0)
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      b (Ti1, Ti2) = 1.1
      END DO
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      ib (Ti1, Ti2) = 1
      END DO
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      db (Ti1, Ti2) = 1.1d0
      END DO
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      cb (Ti1, Ti2) = (0.0, 1.0)
      END DO
      END DO
      TT24temp = 1
      DO i = 1, n
      itemp1 (i) = i
      END DO
      TT24temp = 1
      DO j = 1, n
      DO i = 1, n
      itemp2 (i, j) = i + j
      END DO
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      TT0temp (Ti1) = itemp1 (Ti1) .LE. 10
      END DO
      rprod = product_1_R_M (a, Ta_info (1, 1), Ta_info (2, 1), Ta_info,
     & TT0temp, TTT0temp_info (1, 1), TTT0temp_info (2, 1), TTT0temp_inf
     &o, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      TT1temp (Ti1) = itemp1 (Ti1) .LE. 10
      END DO
      iprod = product_1_I_M (ia, Tia_info (1, 1), Tia_info (2, 1), Tia_i
     &nfo, TT1temp, TTT1temp_info (1, 1), TTT1temp_info (2, 1), TTT1temp
     &_info, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      TT2temp (Ti1) = itemp1 (Ti1) .LE. 10
      END DO
      dprod = product_1_D_M (da, Tda_info (1, 1), Tda_info (2, 1), Tda_i
     &nfo, TT2temp, TTT2temp_info (1, 1), TTT2temp_info (2, 1), TTT2temp
     &_info, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      TT3temp (Ti1) = itemp1 (Ti1) .LE. 10
      END DO
      cprod = product_1_X_M (ca, Tca_info (1, 1), Tca_info (2, 1), Tca_i
     &nfo, TT3temp, TTT3temp_info (1, 1), TTT3temp_info (2, 1), TTT3temp
     &_info, proclist)
      WRITE (6, *) 'real-integer-dp-comlex 1d prod ='
      WRITE (6, *) rprod, iprod, dprod, cprod
      WRITE (6, *) '---------------------------------------------'
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT4temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      rprod = product_2_R_M (b, Tb_info (1, 1), Tb_info (2, 1), Tb_info 
     &(1, 2), Tb_info (2, 2), Tb_info, TT4temp, TTT4temp_info (1, 1), TT
     &T4temp_info (2, 1), TTT4temp_info (1, 2), TTT4temp_info (2, 2), TT
     &T4temp_info, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT5temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      iprod = product_2_I_M (ib, Tib_info (1, 1), Tib_info (2, 1), Tib_i
     &nfo (1, 2), Tib_info (2, 2), Tib_info, TT5temp, TTT5temp_info (1, 
     &1), TTT5temp_info (2, 1), TTT5temp_info (1, 2), TTT5temp_info (2, 
     &2), TTT5temp_info, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT6temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      dprod = product_2_D_M (db, Tdb_info (1, 1), Tdb_info (2, 1), Tdb_i
     &nfo (1, 2), Tdb_info (2, 2), Tdb_info, TT6temp, TTT6temp_info (1, 
     &1), TTT6temp_info (2, 1), TTT6temp_info (1, 2), TTT6temp_info (2, 
     &2), TTT6temp_info, proclist)
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT7temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      cprod = product_2_X_M (cb, Tcb_info (1, 1), Tcb_info (2, 1), Tcb_i
     &nfo (1, 2), Tcb_info (2, 2), Tcb_info, TT7temp, TTT7temp_info (1, 
     &1), TTT7temp_info (2, 1), TTT7temp_info (1, 2), TTT7temp_info (2, 
     &2), TTT7temp_info, proclist)
      WRITE (6, *) 'real-integer-dp-comlex 2d prod ='
      WRITE (6, *) rprod, iprod, dprod, cprod
      WRITE (6, *) '---------------------------------------------'
      TT24temp = 1
      DO Ti1 = 1, n
      a (Ti1) = 0
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      ia (Ti1) = 0
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      da (Ti1) = 0d0
      END DO
      TT24temp = 1
      DO Ti1 = 1, n
      ca (Ti1) = (0, 0)
      END DO
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT8temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_R_v_M (b, Tb_info (1, 1), Tb_info (2, 1), Tb_info (
     &1, 2), Tb_info (2, 2), Tb_info, 1, TT8temp, TTT8temp_info (1, 1), 
     &TTT8temp_info (2, 1), TTT8temp_info (1, 2), TTT8temp_info (2, 2), 
     &TTT8temp_info, TT9temp, TTT9temp_info (1, 1), TTT9temp_info (2, 1)
     &, TTT9temp_info, proclist)
      DO Ti1 = 1, n
      a (Ti1) = TT9temp (Ti1)
      END DO
      WRITE (6, *) 'real prod along dim 1, elements 1,2,n-1, and n'
      WRITE (6, *) a (1), a (2), a (n - 1), a (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT10temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_R_v_M (b, Tb_info (1, 1), Tb_info (2, 1), Tb_info (
     &1, 2), Tb_info (2, 2), Tb_info, 2, TT10temp, TTT10temp_info (1, 1)
     &, TTT10temp_info (2, 1), TTT10temp_info (1, 2), TTT10temp_info (2,
     & 2), TTT10temp_info, TT11temp, TTT11temp_info (1, 1), TTT11temp_in
     &fo (2, 1), TTT11temp_info, proclist)
      DO Ti1 = 1, n
      a (Ti1) = TT11temp (Ti1)
      END DO
      WRITE (6, *) 'real prod along dim 2, elements 1,2,n-1, and n'
      WRITE (6, *) a (1), a (2), a (n - 1), a (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT12temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_I_v_M (ib, Tib_info (1, 1), Tib_info (2, 1), Tib_in
     &fo (1, 2), Tib_info (2, 2), Tib_info, 1, TT12temp, TTT12temp_info 
     &(1, 1), TTT12temp_info (2, 1), TTT12temp_info (1, 2), TTT12temp_in
     &fo (2, 2), TTT12temp_info, TT13temp, TTT13temp_info (1, 1), TTT13t
     &emp_info (2, 1), TTT13temp_info, proclist)
      DO Ti1 = 1, n
      ia (Ti1) = TT13temp (Ti1)
      END DO
      WRITE (6, *) 'integer prod along dim 1, elements 1,2,n-1, and n'
      WRITE (6, *) ia (1), ia (2), ia (n - 1), ia (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT14temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_I_v_M (ib, Tib_info (1, 1), Tib_info (2, 1), Tib_in
     &fo (1, 2), Tib_info (2, 2), Tib_info, 2, TT14temp, TTT14temp_info 
     &(1, 1), TTT14temp_info (2, 1), TTT14temp_info (1, 2), TTT14temp_in
     &fo (2, 2), TTT14temp_info, TT15temp, TTT15temp_info (1, 1), TTT15t
     &emp_info (2, 1), TTT15temp_info, proclist)
      DO Ti1 = 1, n
      ia (Ti1) = TT15temp (Ti1)
      END DO
      WRITE (6, *) 'integer prod along dim 2, elements 1,2,n-1, and n'
      WRITE (6, *) ia (1), ia (2), ia (n - 1), ia (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT16temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_D_v_M (db, Tdb_info (1, 1), Tdb_info (2, 1), Tdb_in
     &fo (1, 2), Tdb_info (2, 2), Tdb_info, 1, TT16temp, TTT16temp_info 
     &(1, 1), TTT16temp_info (2, 1), TTT16temp_info (1, 2), TTT16temp_in
     &fo (2, 2), TTT16temp_info, TT17temp, TTT17temp_info (1, 1), TTT17t
     &emp_info (2, 1), TTT17temp_info, proclist)
      DO Ti1 = 1, n
      da (Ti1) = TT17temp (Ti1)
      END DO
      WRITE (6, *) 'd.p. prod along dim 1, elements 1,2,n-1, and n'
      WRITE (6, *) da (1), da (2), da (n - 1), da (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT18temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_D_v_M (db, Tdb_info (1, 1), Tdb_info (2, 1), Tdb_in
     &fo (1, 2), Tdb_info (2, 2), Tdb_info, 2, TT18temp, TTT18temp_info 
     &(1, 1), TTT18temp_info (2, 1), TTT18temp_info (1, 2), TTT18temp_in
     &fo (2, 2), TTT18temp_info, TT19temp, TTT19temp_info (1, 1), TTT19t
     &emp_info (2, 1), TTT19temp_info, proclist)
      DO Ti1 = 1, n
      da (Ti1) = TT19temp (Ti1)
      END DO
      WRITE (6, *) 'd.p. prod along dim 2, elements 1,2,n-1, and n'
      WRITE (6, *) da (1), da (2), da (n - 1), da (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT20temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_X_v_M (cb, Tcb_info (1, 1), Tcb_info (2, 1), Tcb_in
     &fo (1, 2), Tcb_info (2, 2), Tcb_info, 1, TT20temp, TTT20temp_info 
     &(1, 1), TTT20temp_info (2, 1), TTT20temp_info (1, 2), TTT20temp_in
     &fo (2, 2), TTT20temp_info, TT21temp, TTT21temp_info (1, 1), TTT21t
     &emp_info (2, 1), TTT21temp_info, proclist)
      DO Ti1 = 1, n
      ca (Ti1) = TT21temp (Ti1)
      END DO
      WRITE (6, *) 'complex prod along dim 1, elements 1,2,n-1, and n'
      WRITE (6, *) ca (1), ca (2), ca (n - 1), ca (n)
      TT24temp = 1
      TT24temp = 1
      DO Ti1 = 1, n
      DO Ti2 = 1, n
      TT22temp (Ti1, Ti2) = itemp2 (Ti2, Ti2) .GE. 10
      END DO
      END DO
      CALL product_2_X_v_M (cb, Tcb_info (1, 1), Tcb_info (2, 1), Tcb_in
     &fo (1, 2), Tcb_info (2, 2), Tcb_info, 2, TT22temp, TTT22temp_info 
     &(1, 1), TTT22temp_info (2, 1), TTT22temp_info (1, 2), TTT22temp_in
     &fo (2, 2), TTT22temp_info, TT23temp, TTT23temp_info (1, 1), TTT23t
     &emp_info (2, 1), TTT23temp_info, proclist)
      DO Ti1 = 1, n
      ca (Ti1) = TT23temp (Ti1)
      END DO
      WRITE (6, *) 'complex prod along dim 2, elements 1,2,n-1, and n'
      WRITE (6, *) ca (1), ca (2), ca (n - 1), ca (n)
      STOP
      END
