compiler error: count

Hi

When I want to compile a code using “pgf90” the compiler gives me the following error message.
Code looks like:

do i=1,2
   do j=1,10
      if (count(isnand(Array1(1:5,Array2(i,1,j)))).gt.0) then
         ...
      end if
   end do
end do

PGF90-S-0074-Illegal number or type of arguments to count - keyword argument mask 
PGF90-S-0038-Symbol, isnand, has not been explicitly declared

I read that I have to use “isnsnd” for double precision numbers. Correct?
What can I do?
Thank you!

Hi elephant,

You need to declare “isnand” since it’s an external function.

Though, I would suggest using the F2003 “ieee_is_nan” routine instead since it’s a standard Fortran elemental function rather then an extension or external routine. For example:

... 
! need to use the ieee_arithmetic module
use ieee_arithmetic
...
do i=1,2
   do j=1,10
      if (count(ieee_is_nan(Array1(1:5,Array2(i,1,j)))).gt.0) then
         ...
      end if
   end do
end do

Hope this helps,
Mat

Perfect! It worked!
Thnak you