Do we have a function as DMAX1?

Do we have a function as DMAX1?

Ritratto di Rasoul K.

In my code, I have following line:

PSMAX= DMAX1(PSXL,PSXL,PSYL,PSXU,PSYU)

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 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Steve Lionel (Intel)

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.

Steve
Ritratto di lklawrie

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?

Linda
Ritratto di bmchenry

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!

Allegati: 

AllegatoDimensione
Scarica max.jpg252.66 KB
Ritratto di Tim Prince

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.

Ritratto di Steve Lionel (Intel)

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.

Steve
Ritratto di Raasoul K.

Quote:

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

The image of help was useful, thanks

Ritratto di Steve Lionel (Intel)

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

Steve

Accedere per lasciare un commento.