Rate This Document
Findability
Accuracy
Completeness
Readability

-std=legacy Syntax Standard

Symptom

The following error is reported during compilation:

Error: Actual argument contains too few elements for dummy argument 'wgrd' (1/4) at (1)
/home/wubingcheng/wrf/comGSIv3.7_EnKFv1.3/src/setuplight.f90:822:47:
 
  822 |         call get_ij(mm1,dlat-one,dlon,light_ij,my_head%wij(1))
 
subroutine get_ij(mm1,obs_lat,obs_lon,jgrd,wgrd,jjlat,jjlon)  // Definition of this interface.
 

Cause

GFortran supports the following standards: F95, F2003, F2008, F2018, GNU, and Legacy. By default, the -std option is set to the latest GNU standard, which has strict requirements on Fortran layout. Inconsistency between the number of passed arguments and the number of arguments in the interface definition will result in compilation errors under the latest standard.

Procedure

You can supplement and align arguments. Alternatively, if the modification workload is heavy, try the -std=legacy compilation option to switch to the F77 syntax standard to avoid this error.