title: Which is the right structure for loaded module and interface in F90?
body: <p>The following Fortran lines</p>
  <pre><code>SUBROUTINE AFprep (ida, idb, jda, jdb, kda, kdb )
    IMPLICIT NONE
    include 'mpif.h'
    USE some_module
  
      interface
        SUBROUTINE nothing (azf, ata)
          REAL,          INTENT(IN)    :: azf         ( : , : , : )
          REAL,          INTENT(IN)    :: ata         ( : , : , : )
        END SUBROUTINE nothing
      end interface
  
    REAL,      PARAMETER :: PI = 3.14159265
    REAL( 8 ), PARAMETER :: DPI = 3.14159265358979324D0
    REAL, PARAMETER :: PI180  = PI / 180.0
    REAL, PARAMETER :: GRAV = 9.80622
  
    INTEGER, INTENT(IN)           :: ida, idb, jda, jdb, kda, kdb
    REAL                          :: aensf
  
    REAL, ALLOCATABLE, SAVE :: densq   ( : , : , : )
  
    integer :: i, j, status(MPI_STATUS_SIZE)
    character (len = 50) :: myfmt
  
  END SUBROUTINE AFprep
  </code></pre>
  <p>are producing the error</p>
  <pre><code>Error: USE statement at (1) cannot follow INTERFACE statement at (2)
  </code></pre>
  <p>This is bit odd because <code>USE</code> is before <code>interface</code> (unless the compiler moves it around for some reason that I don't see). <code>some_module</code> is a very large module built earlier and the compiler is GCC-11. I'm not really sure what to do because the compilation goes through if <code>USE some_module</code> is commented out (moving <code>USE</code> after <code>interface</code> results in the same error as expected).</p>