- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have check the help for dsqrt(). it's nearly same with sqrt() and
the complier is OK with sqrt().
Would anyone can explain for me ?
Error: This name does not have a type, and must have an explicit type. [DSQRT] r1=dsqrt(r2)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While you would expect a legacy Fortran compile to perform automatic typing of functions such as DSQRT(), the compiler has not done so. As you figured out, the normal way for the last 25 years has been to use the generic sqrt() (except for the case where you pass a function name in a function call). So, there would not be any normal usage where you would not be required to declare the non-generic function, either by interface block or by DOUBLE PRECISION DSQRT. If you choose to use DSQRT, the compiler might not be able to check your argument number and type, unless you provide an interface block.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did not show all the messages. I am certain that you also saw something like this:
Warning: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [DSQRT]
(Unless you suppressed warnings.)
You had IMPLICIT NONE and gave to DSQRT an argument that was not DOUBLE PRECISION. The latter caused the warning, since DSQRT is not generic, and then the compiler complained that you did not declare DSQRT since it was no longer an intrinsic.
If you had called DSQRT with a proper double argument, the compiler would have been happy.
Warning: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [DSQRT]
(Unless you suppressed warnings.)
You had IMPLICIT NONE and gave to DSQRT an argument that was not DOUBLE PRECISION. The latter caused the warning, since DSQRT is not generic, and then the compiler complained that you did not declare DSQRT since it was no longer an intrinsic.
If you had called DSQRT with a proper double argument, the compiler would have been happy.
Message Edited by sblionel on 10-11-2005 09:09 AM

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page