Error: This USE statement is not positioned correctly within the scoping unit.
I keep getting this error, and I have no idea why. The program is in a very standard structure:
I did check help / man page of IFORT but no luck..
This thread at intel.com also discuss about the same problem.
the answer at this thread is
“USE YourModule” must preceed local variable declarations. Your include file (at least one of your include files) is declaring at least one variable.
Place your USE to preceed the include statements.
But that did not work completely,
and other half part of answer is
Add an only clause to select only the GETENV routine:
use IFPORT, only: GETENV
This will hide any other names in IFPORT;
This post will talk about why added USE IFPORT
This worked fine..
share your experience as well..
USE also must precede any IMPLICIT statements. Best is to have them come directly after the SUBROUTINE or FUNCTION statement.
you can have USE and IMPORT statements in the same interface body, but the forbidden ‘mixing’ I was referring to was that of placing any IMPORT statement before any USE statement .. source
Number of View :306
Recent Comments