codee-com/open-catalog

[Fortran] NAG compiler requires to define variable before its usage

Open

#92 aperta il 1 lug 2025

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Fortran (12 fork)auto 404
Fortrangood first issuenew check

Metriche repository

Star
 (105 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

NAG compiler requires to define variable before its usage in type declaration section. For example, the following code is not correct:

subroutine test(a, n)
  implicit none
  real(8) :: a(n)
  integer :: n
end subroutine test

since usage of n happens before actual type definition.

The proper code is:

subroutine test(a, n)
  implicit none
  integer :: n
  real(8) :: a(n)
end subroutine test

Guida contributor