Fortran API compilation error with ifort (version 2021.7.1)
When compiling the Fortran API (gmsh.f90) with ifort, I am seeing the following compilation errors:
/usr/local/include/gmsh.f90(950): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is \
an element of an array that is not assumed shape, pointer, or polymorphic. [FILENAME]\
call C_API(fileName=istring_(fileName), &\
---------^
To me, It seems that the issue here is caused by passing istring_(fileName)
to C_API. Creating a new variable and assigning the result of the function to the variable, then passing the new variable into C_API does not yield any errors. For example, the following code works with ifort:
character(GMSH_API_MAX_STR_LEN, kind=c_char) :: fileNameC
fileNameC = istring_(fileName)
call C_API(fileName=trim(fileNameC), &
ierr_=ierr)
There might be other better fixes to this problem but the above fix is at least something clearly working.