could not resolve generic procedure

Hi

I ve recently met a problem which read
PGF90-S-0155-Could not resolve generic procedure agrif_bc_variable (uv3dpremix_.f: 618)
PGF90-S-0155-Could not resolve generic procedure agrif_bc_variable (uv3dpremix_.f: 620)
0 inform, 0 warnings, 2 severes, 0 fatal for sub_loop_uv3dpremix_tile

I dunno how to figure out such issue. I d really appreciate it if someone can help me out !!

Below is the corresponding procedure, I only list the variable declaration

interface Agrif_Bc_variable
          module procedure Agrif_Bc_variable0d,
     &                     Agrif_Bc_variable1d,
     &                     Agrif_Bc_variable2d,
     &                     Agrif_Bc_variable3d,
     &                     Agrif_Bc_variable4d,
     &                     Agrif_Bc_variable5d


      Subroutine Agrif_Bc_variable0d(tabvarsindic0,tabvarsindic,
     &                               calledweight,procname)
      INTEGER*4 :: tabvarsindic0
      INTEGER*4 :: tabvarsindic
      External :: procname
      Optional ::  procname
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      INTEGER*4 :: dimensio
      ...
     Subroutine Agrif_Bc_variable1d(q,tabvarsindic,calledweight,
     &                               procname)
      REAL   , Dimension(:)          :: q
      External :: procname
      Optional ::  procname
      INTEGER*4 :: tabvarsindic, indic
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars
     ...
      Subroutine Agrif_Bc_variable2d(q,tabvarsindic,calledweight,
     &                               procname)
      REAL   , Dimension(:,:)          :: q
      External :: procname
      Optional ::  procname
      INTEGER*4 :: tabvarsindic, indic
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars
      ...
      Subroutine Agrif_Bc_variable3d(q,tabvarsindic,calledweight,
     &                               procname)
      REAL   , Dimension(:,:,:)          :: q
      External :: procname
      Optional ::  procname
      INTEGER*4 :: tabvarsindic, indic
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars
      ...
      Subroutine Agrif_Bc_variable4d(q,tabvarsindic,calledweight,
     &                               procname)
      REAL   , Dimension(:,:,:,:)          :: q
      External :: procname
      Optional ::  procname
      INTEGER*4 :: tabvarsindic, indic
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars
      ...
      Subroutine Agrif_Bc_variable5d(q,tabvarsindic,calledweight,
     &                               procname)
      REAL   , Dimension(:,:,:,:,:)          :: q
      External :: procname
      Optional ::  procname
      INTEGER*4 :: tabvarsindic, indic
      REAL, OPTIONAL :: calledweight
      REAL    :: weight
      LOGICAL :: pweight
      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars
      ...

The commands I used are
cpp -P -traditional -DLinux -I…
pgf90 -c -Bstatic_pgi -fastsse -Mipa=fast -i4 -r8 -I… -o…
Thanks again!!

Yisen

Are your subroutines’ interfaces also inside the interface block? It kind of looks like you’re using both generic and explicit interfaces, and I’m not sure that’s allowed. When you use MODULE PROCEDURE it’s usually like:

MODULE generic_sort

IMPLICIT NONE

INTERFACE sort
   MODULE PROCEDURE sort_real
   MODULE PROCEDURE sort_int
   MODULE PROCEDURE sort_cmplx
END INTERFACE

CONTAINS
   SUBROUTINE sort_real(array, vals)
     (code for this)
   END SUBROUTINE sort_real

   SUBROUTINE sort_int(array, vals)
     (code for this)
   END SUBROUTINE sort_int

   SUBROUTINE sort_cmplx(array, vals)
     (code for this)
   END SUBROUTINE sort_cmplx

END MODULE

. (I’m assuming this code is in a module, since you are using MODULE PROCEDURE.)

This way the explicit interfaces for the subroutines are generated since they are in a module, and then the generic interface block provides the generic interface.

Thanks very much for your reply. And yes I had the same structure as you wrote except I use the continuation symbol to declare them together.

Here is a full version of that file structure

      MODULE  Agrif_bcfunction
      USE Agrif_Boundary
      USE Agrif_Update
      USE Agrif_fluxmod
      USE Agrif_Save
C
      IMPLICIT NONE
C
      interface Agrif_Bc_variable
          module procedure Agrif_Bc_variable0d
          module procedure ...
          ...
      end interface

      interface Agrif_Set_Parent
          module procedure Agrif_Set_Parent_int,
     &                     Agrif_Set_Parent_real
      end interface

      interface Agrif_Interp_variable
          module procedure Agrif_Interp_var0d,
     &                     Agrif_Interp_var1d,
     &                     ...
      end interface

      interface Agrif_Init_variable
          module procedure Agrif_Init_variable0d,
     &                     Agrif_Init_variable1d,
     &                     ...
      end interface
C
      interface Agrif_update_variable
          module procedure Agrif_update_var0d,
     &                     Agrif_update_var1d,
     &                    ... 
      end interface

      interface Agrif_Save_Forrestore
         module procedure Agrif_Save_Forrestore0d,
     &                    Agrif_Save_Forrestore2d,
     &                    ...
      end interface
C
      Contains
      Subroutine .....
      End Subroutine ....
      Subroutine ...
      End Subroutine ...
      ...

      End Module

Then when compiling, use -I to indicate the .mod file dir, but the problem is still there

Yisen

Hi Yisen,

The next thing to check is if your actual arguments match one of the subroutines. How is agrif_bc_variable called at line 618 and 620 of uv3dpremix_.f and how are the arguments declared?

  • Mat

Hello Mat

The subroutine is called in uv3dpremix_.f

    Call Agrif_Bc_Variable(uext, 14,calledweight=tinterp,
     &                         procname=interpspongeu)
      Call Agrif_Bc_Variable(vext, 13,calledweight=tinterp,
     &                         procname=interpspongev)

In the same file the declaration is

external interpspongeu, interpspongev
REAL, ALLOCATABLE, Dimension(:,:,:) :: uext
REAL, ALLOCATABLE, Dimension(:,:,:) :: vext
REAL :: tinterp

Can you help look if there is a problem?
Thanks a lot

Yisen

I ve compiled this successfully using gfortran (also run well). So I guess it might be not program error. I really want to use pgi compiler. Is it possible that this is because of missing a certain flag?

Yisen

Hi Yisen,

I don’t see anything obvious and since works with Gfortran, it’s sounding more like a compiler issue. Can you please send a reproducing example to PGI Customer Service (trs@pgroup.com)?

Thanks,
Mat

Hi Mat

I like system. If version problem, is there a chance I can get it fixed by adding some patches you provide?

Thanks

Hello Mat

I ve emailed an example to the address you provided but they said they are so busy that can help only with the current compiler subscription. Do you have time to help me with this? I would really appreciate it.

Yisen

Hi Yisen,

If your code works with the most current compiler then yes it was most likely a compiler issue that has been fixed.

I do apologize PGI Customer Support was unable to help. They usually try but must prioritize based on customers with support subscriptions.

What do you need help with? I can try as well but am currently traveling in Europe. Is it something you can post the PGI UF?

  • Mat

Hi Mat

Thank you for your reply. I am think if there is a way to figure this issue out without updating (I am a student so I cannot decide that)
I feel the code basically follows the Fortran standard, and is not complicated.
Maybe, just maybe, there is possibility to circumvent this by adjusting something that you can help with.

[Actually, in this machine only PGI has the associated MPI and I need MPI anyway. I had a hard time in installing MPI with gfortran on the infiniband structure and failed to make it in the end.]

I am not sure if this will occupy much of your time. I realize this is kind of personal request. And I d really appreciate it if you could give me some direction (could be after you come back).

Have a great journey

Regards…Yisen

Hi Yisen,

I’m back in the office and was able to get your code from PGI Customer Service. I compiled your code with PGI 6.2-2, 6.2-3, 6.2-4, and 6.2-5 and all were able to successfully compile the code. Which version are you using? (pgf90 -V)

  • Mat

Morning Mat

I believe you have magic touch !
My version is
pgf90 6.2-3 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.

The OS is SUSE-10.0.
Is this problem becoming more difficult to resolve?

Thanks

Yisen