Compilation error with mpifort gcc

Dear all,

When compiling with the version v5.4 we found syntax errors in the code.

Compiler version
$ mpifort --version
GNU Fortran (Debian 10.2.1-6) 10.2.1 20210110

These are Fortran-language errors, that require recoding.
(…)
mpifort -c -ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32 -O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -ftree-vectorize -ftree-loop-if-convert -finline-limit=512 -I $CMAQ-master/lib/x86_64/gcc/ioapi/lib -I $CMAQ-master/lib/x86_64/gcc/ioapi/include_files -I $CMAQ-master/lib/x86_64/gcc/mpi -I. -Dparallel -Dm3dry_opt -DSUBST_BARRIER=SE_BARRIER -DSUBST_GLOBAL_MAX=SE_GLOBAL_MAX -DSUBST_GLOBAL_MIN=SE_GLOBAL_MIN -DSUBST_GLOBAL_MIN_DATA=SE_GLOBAL_MIN_DATA -DSUBST_GLOBAL_TO_LOCAL_COORD=SE_GLOBAL_TO_LOCAL_COORD -DSUBST_GLOBAL_SUM=SE_GLOBAL_SUM -DSUBST_GLOBAL_LOGICAL=SE_GLOBAL_LOGICAL -DSUBST_GLOBAL_GATHER=SE_GLOBAL_GATHER -DSUBST_GLOBAL_BCAST=SE_GLOBAL_BCAST -DSUBST_LOOP_INDEX=SE_LOOP_INDEX -DSUBST_SUBGRID_INDEX=SE_SUBGRID_INDEX -DSUBST_HI_LO_BND_PE=SE_HI_LO_BND_PE -DSUBST_SUM_CHK=SE_SUM_CHK -DSUBST_SE_INIT=SE_INIT -DSUBST_INIT_ARRAY=SE_INIT_ARRAY -DSUBST_COMM=SE_COMM -DSUBST_MY_REGION=SE_MY_REGION -DSUBST_SLICE=SE_SLICE -DSUBST_GATHER=SE_GATHER -DSUBST_DATA_COPY=SE_DATA_COPY -DSUBST_IN_SYN=SE_IN_SYN -DSUBST_PE_COMM="./PE_COMM.EXT" -DSUBST_CONST="./CONST.EXT" -DSUBST_FILES_ID="./FILES_CTM.EXT" -DSUBST_EMISPRM="./EMISPRM.EXT" -DSUBST_MPI="$CMAQ-master/lib/x86_64/gcc/mpi/include/mpif.h" subhdomain.F
pwrgrdd.f:256:27:

240 | CALL MPI_RECV( WHO, 1, MPI_INTEGER, MPI_ANY_SOURCE,
| 2

256 | CALL MPI_RECV( RECVBUF, MSGSIZE, MPI_REAL, WHO,
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4)).
pwrgrdd.f:306:24:
(…)
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(4)).
se_global_sum_module.f:108:25:

108 | call mpi_reduce (var, sum, 1, mpi_real, mpi_sum, 0,
| 1

167 | call mpi_reduce (var, sum, n, mpi_real, mpi_sum, 0,
| 2
(…)
Most of them seem related to MPI, are we missing any flag?

Thanks,

Solange

The above says that your mpifort is based on gfortran version 10.2.1

See the I/O API Makeinclude.Linux2_x86_64gfort10 – starting with version 10, gfortran has its own idiosyncratic interpretation of the Fortran Standard. You probably need to add the compile-flag

-fallow-argument-mismatch

to your CMAQ compile-flags, as the I/O API does for its gfortran-10 flags…

Don’t you just love the way some compiler-writers don’t preserve version-to-version compatibility??!

1 Like

Thank you so much for your quick answer!

That worked perfectly.