Nvfortran (21.5-0) spurious error for procedure pointer actual argument

nvfortran 21.5-0 LLVM 64-bit target on x86-64 Linux -tp nehalem
NVIDIA Compilers and Tools
Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.

Linux compiler nvfortran (21-5-0) rejects conforming source with a procedure pointer actual argument when dummy is EXTERNAL.

NVFORTRAN-S-0188-Argument number 1 to doit: type mismatch (/tmp/a.f90: 11)
0 inform, 0 warnings, 1 severes, 0 fatal for test

Program test
  Implicit None
  Interface
    Subroutine model(x)
      Real :: x
    End Subroutine
  End Interface
  Procedure (model), Pointer :: pptr

  pptr => monit
  Call doit(mon=pptr)
Contains
  Subroutine monit(x)
    Real :: x

    Print *, x
  End Subroutine
  Subroutine doit(mon)
    External :: mon
    Call mon(2.0)
  End Subroutine
End Program

Thanks Themos. I’ve reproduced the issue here and filed a problem report, TPR #30324. We’ll have our engineers take look here soon.

As a workaround, you can replace “External” with the following:

% cat test.f90
Program test
  Implicit None
  Interface
    Subroutine model(x)
      Real :: x
    End Subroutine
  End Interface
  Procedure (model), Pointer :: pptr

  pptr => monit
  Call doit(mon=pptr)
Contains
  Subroutine monit(x)
    Real :: x

    Print *, x
  End Subroutine
  Subroutine doit(mon)
!    External :: mon
    procedure(model)::mon
    Call mon(2.0)
  End Subroutine
End Program
% nvfortran test.f90; a.out
    2.000000

-Mat

Hi Thomas,

FYI, TPR #30324 was fixed in the 21.11 release.

-Mat

Thank you for letting me know.