Second surprise (at least with my version of ifx/ifort )was that I was going to say a nice feature of the Intel compilers is that you have a lot of control over what happens for each diagnostic id. So you can do this
ifort -diag-disable=10448 -diag-error=6075 main.f90
and you quit getting reminded ifort is obsolete, and message 6075 is now an error. You can even set up a system-wide default or a user-level default and change that. The surprise was when I used ifx I did not see an error indicating ifx did not support that, but it is still a warning.
ifx -diag-error=6075 main.f90
So I have had a customization file with changes to include my own libraries in the default load, to default to a static load, and so on for so long that I did not notice it was not working with ifx.
That really is a crazy default for procedures in modules and contained procedures but there is a lot of legacy code around that expects to be able to use an array as any type of working storage, and to allow equivalencing of different types and scalar values passed as one-element arrays and vice-versa that it is probably the default because there does not seem to be any control of whether 6075 applies to things only without explicit interfaces or to everything.
Almost every compiler allowed that with no warning so commonly it became a de-facto feature of Fortran, although the first time it is mentioned in the standard it says the arguments have to match to be standard conforming. That is the most vexing issue over and over again when I have ported older applications to standard-conforming coding, as that is not always trivial to resolve. (sometimes you just pass A as [A] if the procedure does not change it, or A(n) as A(n:n) and maybe make two working arrays, one integer and one real, ⌠so sometimes it is easy). So this Intel âfeatureâ lets you put function statements that broke the rules in a contained procedure, and regular procedures into a module more easily because of this behavior, but then the code does not work with a lot of other compilers.
I was going to suggest fpm should probably add some -diag-IDs to -diag-error but if ifx ignores this that is not too helpful. If anyone has the latest ifx can they confirm it does not change from a warning to an error on the latest-and-greatest?
PS: The first machine I used that did a nice job with diagnostic codes that I remember was a Cray. You could turn the messages on and off by number, and a program called âexplainâ told you what to do about the message in greater detail if it was not obvious. Nothing else I was using allowed as much control for a long time, and I always missed the feature when not available. Later g95 and Intel compilers allowed some control, and the -diag-* option on ifort is quite a powerful customization option. I hope all the up and coming compilers allow that. I do not currently have access to a Cray, but the explain command was multi-lingual and you could create your own message catalog for use with the command. Very nice. It had/has an API too so you could use that with your own codes as well. We still follow that model with production codes; just the act of writing the documentation for something like âexplainâ can make you realize the code needs changed â generally if it is really hard to explain what the message means you should think about whether the code should be doing something else!