Rate This Document
Findability
Accuracy
Completeness
Readability

Incorrect Variable Initialization Sequence

Symptom

The following error is reported during compilation:

pw3sr.f:37.35:
 
        REAL         :: Q(NX+2-MOD(NX,2),NY,NZ)
                                   1
Error: Symbol 'nx' is used before it is typed at (1)

Cause

The REAL variable Q depends on INTEGER variables NX, NY, and NZ. The dependent variables are defined after the Q variable. As a result, the compiler does not find the variable and a definition missing error occurs.

Procedure

Adjust the variable definition sequence.

  • Before:
    REAL         :: Q(NX+2-MOD(NX,2),NY,NZ)
    INTEGER      :: NX,NY,NZ
  • After:
    INTEGER      :: NX,NY,NZ
    REAL         :: Q(NX+2-MOD(NX,2),NY,NZ)