@Arjen this is a common gotcha in Fortran, see When is "n" in explicit-shape array A(n) implicitly typed, which discusses this at length with examples what is and what is not allowed and how exactly it works.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Why do we need TYPEOF? | 72 | 1374 | April 3, 2025 | |
|
Using module variables as dimensions in function arguments
|
24 | 1344 | March 26, 2024 | |
| Gfortran ignores error in dummy array specification | 5 | 215 | February 10, 2025 | |
| Intel Fortran doesn't enforce argument kind conformance? | 25 | 966 | October 27, 2024 | |
| Why I can access private module variable in this program? | 44 | 1986 | February 2, 2023 |