Rate This Document
Findability
Accuracy
Completeness
Readability

Rank Mismatch Error During Compilation with GFortran

Symptom

A rank mismatch error occurs. See Figure 1.

Figure 1 Rank mismatch

Possible Causes

The function where the compilation error is reported needs to transfer array parameters. However, the compiler of a later version does not allow transferring scalar parameters. Therefore, a compilation error message is displayed in the file.

Troubleshooting Procedure

Add the -fallow-argument-mismatch or -Wno-argument-mismatch compilation option that matches the compiler version.

  • The compilation option for GFortran 10.3.1 is -fallow-argument-mismatch.
  • The compilation option for GFortran 9.3.0 is -Wno-argument-mismatch.