forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Intrinsic RR

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KL



Joined: 16 Nov 2009
Posts: 144

PostPosted: Tue Apr 07, 2015 3:30 pm    Post subject: Intrinsic RR Reply with quote

The declaration

Double Precision :: RR

leads to the following warning:

COMMENT - This declaration of RR has caused the intrinsic of the same name to be inaccessible

Should I simply not use RR or should I ignore the warning? Unfortunately, I did not find specific information regarding the intrinsic function RR. I had always thought that there are no reserved words for names in Fortran. The code is
Code:


      Double Precision Function RoCool11 ( TK )
!     ++++++++++++++++++++++++++++++++++

      Implicit None

      Double Precision , Intent (in) :: TK
      Double Precision               :: RR

      RR = 1.d+00
      RoCool11 = RR*TK

      RETURN
      END


It was compiled by
Code:

ftn95  RoCool11.f95  /dump /checkmate /List >> comp.lis


Any advice is appreciated. Many thanks in advance.

KL
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Apr 07, 2015 4:03 pm    Post subject: Reply with quote

You can ignore the comment but to avoid seeing it you can change from RR to something else.

RR is an FTN77 intrinsic available in FTN95 for portability. It is no longer documented except for a brief mention in the help file.
Back to top
View user's profile Send private message AIM Address
KL



Joined: 16 Nov 2009
Posts: 144

PostPosted: Wed Apr 08, 2015 9:38 am    Post subject: Reply with quote

Thank you very much for the quick answer Paul.

I have checked other intrinsics like LS, RS etc. and I got the same results. Obviously, there are restrictions on the name, but of course I can life with them. Normally one would anyhow avoid variable names which are names of intrinsics. However, it gets difficult, if the intrinsics are non-standard intrinsics, which are difficult to find and which are mentioned, but not documented.

Many thanks again,

Klaus
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Wed Apr 08, 2015 12:54 pm    Post subject: Reply with quote

The FTN77 non-standard intrinsics such as LS, RS, etc. are documented in the FTN77 User Guide, which is in the FTN77 directory/Doc/UserGuide.pdf. In the version that I have, the descriptions of LS, RS are on pages 147 and 148.
Back to top
View user's profile Send private message
KL



Joined: 16 Nov 2009
Posts: 144

PostPosted: Wed Apr 08, 2015 3:32 pm    Post subject: Reply with quote

Thank you very much for your help, mecej4.

However, I am not interested in the non-standard intrinsics as such. I just wonder why the names of most of the standard-intrinsics can be used as variable names (for instance sum, following the rule that there are no reserved words in Fortran 90), whereas some names cannot be used (for instance maxloc). It seems that none of the non-standard intrinsics names can be used as variable names.

Now, since I am aware of this, there is no problem at all and we can close this thread.

Klaus
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Wed Apr 08, 2015 3:44 pm    Post subject: Re: Reply with quote

KL wrote:

... whereas some names cannot be used (for instance maxloc). It seems that none of the non-standard intrinsics names can be used as variable names.
Klaus

Not quite true. In your code, you can replace all instances of RR by MAXLOC, and when you compile it after changing the warning messages will be similar.

Furthermore, the messages are only warnings, which can be turned off using suitable compiler options, and do not affect the success of the compilation.

I think that these warnings are quite useful, because there is a lot of Fortran 77 (and earlier) code that contains variable names such as SUM, EXIT, CYCLE, etc., which in Fortran 90 and later are newly introduced keywords, and Fortran maintains a tradition of maximum backward compatibility.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
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 © 2001, 2005 phpBB Group