Using module variables as dimensions in function arguments

  • variables appearing in the specification expression of an explicit shape array can be dummy argument variables, module variables, or local variables of parent scope (by host association), but can not be a local variable of the current procedure (because a local variable is not initialized at the specification point. Gfortran give compiling errors when you do this).

  • If a dummy array is declared as an explicit shape array, rank mismatch between actual array and dummy array is allowed. You get no warning even if turns on all compile warnings and have an explicit interface for the procedure. Because this is a feature of explicit shape arrays, not a weakness. If you want to avoid this kind of mismatch, use assumed-shape array instead.