View previous topic :: View next topic |
Author |
Message |
KL
Joined: 16 Nov 2009 Posts: 144
|
Posted: Tue Apr 07, 2015 3:30 pm Post subject: Intrinsic RR |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Tue Apr 07, 2015 4:03 pm Post subject: |
|
|
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 |
|
|
KL
Joined: 16 Nov 2009 Posts: 144
|
Posted: Wed Apr 08, 2015 9:38 am Post subject: |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1885
|
Posted: Wed Apr 08, 2015 12:54 pm Post subject: |
|
|
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 |
|
|
KL
Joined: 16 Nov 2009 Posts: 144
|
Posted: Wed Apr 08, 2015 3:32 pm Post subject: |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1885
|
Posted: Wed Apr 08, 2015 3:44 pm Post subject: Re: |
|
|
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 |
|
|
|