Using INTERFACE command--works in Lahey, not Portland

I’m not someone who has used this in a program, but inherited some code that has worked previously under the Lahey compiler. It has generic functions defined within a module using the INTERFACE command, and then splits them out to specific functions, depending on the number of arguments that are passed to the generic function. These specific functions are then defined at the end of the same source code file, but after the END MODULE command. Also, the specific functions each contain a USE GLERLUTIL command (GLERLUTIL being the name of the module that contains the generic function, as well as other functions that are called by the specific functions.

The compiler squawks about assigning values to variable names that correspond to the names of the specific functions, even though they are headed as “INTEGER FUNCTION”.

Things I’ve tried:
Comment out ‘USE GLERLUTIL’ in the specific functions.
Put the specific functions inside the module GLERLUTIL. This leads to the linker not recognizing the calls to these functions.
Move all of the specific functions to a separate source code file and module.

Any suggestions?

Hi Brent,

I don’t believe it’s legal to have the “USE GLERLUTIL” within the functions that are defined in the interface of the module due to use association conflicts. I wrote a small example and got similar error messages from Gfortran, Ifort, and Sun f90. I’m not sure why Lahey would allow it. Granted, I may not have correctly reproduced your error so please feel free to send an example to PGI Customer Service (trs@pgroup.com).

Commenting out ‘USE GLERLUTIL’ should have worked, unless the code fails for other reasons.

Hope this helps,
Mat