https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103707

            Bug ID: 103707
           Summary: Stray "Array operands are incommensurate"
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

Just stumbled across this...

module prec
  implicit none
  private
  public :: wp
  integer, parameter :: dp = selected_real_kind(15)
  integer, parameter :: sp = selected_real_kind(6)
  integer, parameter :: wp = dp
  real (kind=wp), parameter :: one = 1._wp

end module prec

program main
  use prec
  implicit none
  integer, parameter :: ndim = 6
  real(kind=wp), dimension(ndim), parameter :: &
       fmin = [  0.74_wp, 0.004_wp, 0.002_wp, 0.8_wp,  0._wp,  0.8_wp], &
       fmax = [  1.93_wp, 0.26_wp,  0.127_wp, 4.0_wp,  1.2_wp, 1.0_wp]

contains
  function fld2phys (trial) result (xpt)
    real(kind=wp), dimension(ndim), intent(in) :: trial
    real(kind=wp), dimension(ndim) :: xpt
       xpt = fmin * (fmax/fmin)**trial
  end function fld2phys

end program main
[zfkts@loginb001 ~]$ gfortran tst.f90
tst.f90:24:25:

   24 |        xpt = fmin * (fmax/fmin)**trial
      |                         1
Error: Array operands are incommensurate at (1)

Reply via email to