I am having a problem compiling with pgi fortran compiler. The code compiles with gfortran. I’m not sure why pgi compiler doesn’t resolve the generic, the argument types look like they match. Any ideas?
I pasted the compile error and the code below.
ftn -O3 -c StringModule.f90 -o StringModule.o
/opt/cray/xt-asyncpe/3.6/bin/ftn: INFO: linux target is being used
PGF90-S-0155-Could not resolve generic procedure convert (StringModule.f90: 495)
PGF90-S-0146-Expression must be character type (StringModule.f90: 495)
PGF90-S-0155-Could not resolve generic procedure convert (StringModule.f90: 497)
PGF90-S-0146-Expression must be character type (StringModule.f90: 497)
0 inform, 0 warnings, 4 severes, 0 fatal for stringnamevaluebool
module StringModule
!----------------------------------------------------------------------------
interface Convert
procedure ConvertBool
end interface
!----------------------------------------------------------------------------
interface StringNameValue
procedure StringNameValueBool
end interface
contains
!----------------------------------------------------------------------------
function ConvertBool(value,convFmtSpec) result(charValue)
implicit none
logical value
character(len=*),optional :: convFmtSpec
character(len=32) iConvFmtSpec
character(len=64) charValue
iConvFmtSpec="(L17)"
if (present(convFmtSpec)) then
iConvFmtSpec="("//trim(convFmtSpec)//")"
end if
write(charValue,fmt=iConvFmtSpec),value
end function
!----------------------------------------------------------------------------
function StringNameValueBool(name,value,convFmtSpec,outFmtSpec) result(buffer)
implicit none
character(len=*) name
logical value
character(len=*),optional :: convFmtSpec
character(len=*),optional :: outFmtSpec
character(len=512) buffer
character(len=64) charValue
if (present(convFmtSpec)) then
charValue=Convert(value,convFmtSpec) ! LINE 495
else
charValue=Convert(value) ! LINE 497
end if
if (present(outFmtSpec)) then
buffer=StringNameValueChar(name,charValue,outFmtSpec)
else
buffer=StringNameValueChar(name,charValue)
end if
end function
end module