Do we have a function as DMAX1?

Do we have a function as DMAX1?

In my code, I have following line:


I am familiar with MAX command which finds the maximum of set of variables. D is for making the function Double precision (DMAX). But what is the 1 at the end?

Is there any place to get the directory of FORTRAN commands and functions?

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Our documentation lists all intrinsic procedures. In Visual Studio you can select Help > Intel Visual Fortran. DMAX1 is a standard Fortran intrinsic - the 1 at the end is an old Fortran convention distinguishing non-generic intrinsics that take real arguments from those that take integer arguments (names end in 0.) For example, there is an AMAX0 that takes default integer arguments and returns a default real result. AMAX1 takes default real arguments. While there is a DMAX1 there is no DMAX0.

Use of these specific procedure names should be avoided in new code - use the generic names (MAX in this case) instead.

Retired 12/31/2016

It is better (now) to use the generic names (MAX, MIN) and the compiler figures out the types of variables in the arguments.

DMAX1 probably thinks that the arguments should be double precision. Whereas using MAX will sort out amongst the arguments.

Did you use and search in the help?

I'm guessing the gremlins of 2013 are working on me!
i suggested you simply use the elemental function MAX
see attached which is in the Fortran Reference manual->A to Z Reference
somehow it double posted and when i went to correct...voila! all vanished...
gremlins of 2013!


Downloadimage/jpeg max.jpg252.66 KB

dmax1 is an f66 intrinsic, obsoleted by the f77 generic intrinsics. I haven't used an f66 compiler since 1985. Some compilers had an extension where mixed data type arguments could be promoted automatically to match a standard intrinsic. Such extensions were often dropped from f90 compilers, with the advent of the requirement for a diagnostic to complain about them.

DMAX1 is still defined in Fortran 2008, but I agree that the generic function names should be used instead. Still, if it is in existing code it will work.

Retired 12/31/2016


Steve Lionel (Intel) wrote:

Still, if it is in existing code it will work.

Dear All
Thanks for all replies. I understand what is DMAX1
Steve as you replied above, if I leave it as it is, it will work. Correct?
Then I will leave it.
The original program was written in 1972 and later amended several times during last 40 years.
Now I am adding few other things and I don't want to alter it. So it is better to leave it as it is.

The image of help was useful, thanks

Yes, it will work. I agree that you should not change code if it works correctly.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today