# Standard-conformant or compiler regression?

**URL:** <https://fortran-lang.discourse.group/t/standard-conformant-or-compiler-regression/7702>\
**Category:** Help\
**Created:** [March 26, 2024, 2:38pm UTC](https://fortran-lang.discourse.group/t/standard-conformant-or-compiler-regression/7702 "2024-03-26T14:38:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jr\_reuter](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jr_reuter/32/352_2.png) [@jr\_reuter](https://fortran-lang.discourse.group/u/jr_reuter)\
**Post date:** [March 26, 2024, 2:38pm UTC](https://fortran-lang.discourse.group/t/standard-conformant-or-compiler-regression/7702/1 "2024-03-26T14:38:47Z")

</div>

After an update commit on gfortran within the last week, the code below throws an error upon compilation, but it worked with earlier versions, with nagfor, intel, flang-new. Is it standard-conformant or a regression?  
t1.f90:28:13:  
28 | submodule (t1) t1\_s  
| 1  
Error: Variable ‘n\_external’ cannot appear in the expression at (1)

```auto
module t1
  use, intrinsic :: iso_c_binding !NODEP!
  implicit none
  private
  public :: t1_t
  integer :: N_EXTERNAL = 0

  type :: t1_t
  contains
    procedure :: set_n_external => t1_set_n_external
  end type t1_t

  abstract interface
     subroutine ol_eval (id, pp, emitter) bind(C)
       import
       real(kind = c_double), intent(in) :: pp(5 * N_EXTERNAL)
     end subroutine ol_eval
  end interface
  interface
    module subroutine t1_set_n_external (object, n)
      class(t1_t), intent(inout) :: object
      integer, intent(in) :: n
    end subroutine t1_set_n_external
  end interface

end module t1

submodule (t1) t1_s
  implicit none
contains
  module subroutine t1_set_n_external (object, n)
    class(t1_t), intent(inout) :: object
    integer, intent(in) :: n
    N_EXTERNAL = n
  end subroutine t1_set_n_external

end submodule t1_s

```

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [March 26, 2024, 5:28pm UTC](https://fortran-lang.discourse.group/t/standard-conformant-or-compiler-regression/7702/2 "2024-03-26T17:28:44Z")

</div>

I think this is related to [Using module variables as dimensions in function arguments](https://fortran-lang.discourse.group/t/using-module-variables-as-dimensions-in-function-arguments/5742). In your example you are using a module variable to define array size in an interface. It’s allowed for regular subroutines, so I am guessing it is allowed in an interface too.
