NVFORTRAN-S-0038-Symbol problem

Hi,

I got this error on the following minimal example below with nvfortran 22.5:

NVFORTRAN-S-0038-Symbol, compute, has not been explicitly declared (mod_b.F90: 47)
  0 inform,   0 warnings,   1 severes, 0 fatal for prc_c
nvfortran -g -c -traceback mod_a.F90
nvfortran -g -c -traceback mod_b.F90

mod_a.F90:

MODULE MOD_A

   IMPLICIT NONE


   TYPE :: TYP_A

    CONTAINS
    PROCEDURE :: compute => PRC_A

   END TYPE TYP_A

   

CONTAINS

PURE SUBROUTINE PRC_A(A)

      IMPLICIT NONE

      CLASS(TYP_A), INTENT(INOUT) :: A

   END SUBROUTINE PRC_A

   

END MODULE MOD_A

mod_b.F90:

MODULE MOD_B

   USE MOD_A

   IMPLICIT NONE


   TYPE TYP_B
   
      TYPE(TYP_A) :: A
   
      CONTAINS
      PROCEDURE :: PRC_B
   
   END TYPE TYP_B

   
CONTAINS

PURE SUBROUTINE PRC_B(B)

      IMPLICIT NONE

      CLASS(TYP_B), INTENT(INOUT) :: B

      CALL PRC_C(B)

   END SUBROUTINE PRC_B

   


   PURE SUBROUTINE PRC_C(B)

      USE MOD_A

      IMPLICIT NONE

      INTEGER(KIND=4) :: m

      CLASS(TYP_B), INTENT(INOUT) :: B

      ! DO m = 1, 10 ! OK
      DO CONCURRENT (m = 1: 10)
         CALL B%A%compute
         ! CALL PRC_A(B%A) ! OK
      END DO

   END SUBROUTINE PRC_C

   
END MODULE MOD_B

The error will not arise, if I use :

  • DO instead of DO CONCURRENT or
  • CALL PRC_A(B%A) instead of CALL B%A%compute

I look forward to a fix of this bug. Thank you very much!

Ali

Hi Ali,

I don’t think this one is a bug, but rather that we don’t support procedure pointers in device code as of yet. We’re working on C++ virtual functions and function pointers now which should be then carried over to Fortran. Though, I added an RFE (TPR #31903) to track you request and I can then notify you when this support has been added.

-Mat

1 Like

Thanks Mat!

Hi Ali,

FYI, TPR #31903 has been fixed in release 22.7.

I was incorrect in my original assessment in that this is type-bound procedure so should have work (i.e. it was a bug in the compiler). Engineering was able to resolve it and now the code will compile as expected.

-Mat

1 Like

Many thanks. It works well.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.