Silverfrost Forums

Welcome to our forums

Intrinsic RR

7 Apr 2015 2:30 #16155

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

      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

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

Any advice is appreciated. Many thanks in advance.

KL

7 Apr 2015 3:03 #16156

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.

8 Apr 2015 8:38 #16166

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

8 Apr 2015 11:54 #16167

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.

8 Apr 2015 2:32 #16169

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

8 Apr 2015 2:44 #16170

Quoted from KL

... 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.

Please login to reply.