PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Relational expression mixes character with numeric data

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation
View previous topic :: View next topic  
Author Message
Sudeep Mohan



Joined: 16 Feb 2010
Posts: 7

PostPosted: Wed Aug 04, 2010 10:55 am    Post subject: Relational expression mixes character with numeric data Reply with quote

when I compile my program with pgf95 it gives error for this line:
IF(ANS.EQ.'Y')THEN

error is : Relational expression mixes character with numeric data

but pgf77 does not? why is that?

I have to declare character ANS*1 then pgf95 does not give error. Implicit none is defined in the main program.

but why is that pgf95 gives error whereas pgf77 compiles fine?
Back to top
View user's profile
N. Shamsundar



Joined: 20 Apr 2005
Posts: 23

PostPosted: Sun Aug 15, 2010 5:16 pm    Post subject: Scope of IMPLICIT NONE Reply with quote

There is insufficient information in your post to answer your questions, but one can make a guess:

An IMPLICIT NONE declaration applies only to the program unit (main program, subroutine or function) in which it is contained. It does not apply to any other program unit, even in the same source file.

Without IMPLICIT NONE, default variable typing makes ANS a real variable, and that explains the error message that you received.

The compiler option -Mdclchk may be used to locate implicitly typed variables.

The Fortran 77 and 9X standards do not allow comparing a character expression to a noncharacter expression. The PGI F77 compiler does not flag such a comparison unless the -Mstandard compiler option is used.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation 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