about no underscore in pgfortran

In order to better call C functions, it is recommended to add a “-fno-underscoring” parameter similar to gfortran.

I’d recommend you look into using the Fortran 2003 ISO_C_BINDING module which is the standardized method for C and Fortran interoperability.

https://gcc.gnu.org/onlinedocs/gfortran/Interoperable-Subroutines-and-Functions.html

-Mat