wrf-model / WPS

The official repository for the WRF Preprocessing System (WPS)
201 stars 157 forks source link

Builds with GNU 11 compilers fail with argument type mismatch errors #180

Open mgduda opened 3 years ago

mgduda commented 3 years ago

When using the GNU 11 compilers, various errors in actual argument types prevent all three of the main WPS components (geogrid, ungrib, and metgrid) from compiling. For example:

gfortran  -ffree-form -O -fconvert=big-endian -frecord-marker=4 -c output_module.f90 -I/glade/scratch/duda/wrf_support/WPS/../WRF/external/io_netcdf -I/glade/scratch/duda/wrf_support/WPS/../WRF/external/io_grib_share -I/glade/scratch/duda/wrf_support/WPS/../WRF/external/io_grib1 -I/glade/scratch/duda/wrf_support/WPS/../WRF/external/io_int -I/glade/scratch/duda/wrf_support/WPS/../WRF/inc -I/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/11.1.0//include
output_module.f90:1735:41:

 1735 |                                          var_value, &
      |                                         1
......
 1763 |                                          var_value, &
      |                                         2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
output_module.f90:1680:41:

 1680 |                                          var_value, &
      |                                         1
......
 1708 |                                          var_value, &
      |                                         2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
mgduda commented 3 years ago

As a workaround, adding -fallow-argument-mismatch to the definition of FFLAGS and F77FLAGS allows the main WPS components to be compiled.