PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

compiler error: count

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
elephant



Joined: 24 Feb 2011
Posts: 22

PostPosted: Thu Aug 18, 2011 6:52 am    Post subject: compiler error: count Reply with quote

Hi

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

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!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Thu Aug 18, 2011 8:51 am    Post subject: Reply with quote

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:
Code:

...
! 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
Back to top
View user's profile
elephant



Joined: 24 Feb 2011
Posts: 22

PostPosted: Thu Aug 18, 2011 9:12 am    Post subject: Reply with quote

Perfect! It worked!
Thnak you
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group