Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

what's wrong with this IF statement

Brian_Murphy
New Contributor II
2,612 Views

Is there a problem with the following syntax?  Even though IOUT is .false. and IHEAD=1 and ITAIL=400, the code still runs the statement inside the IF.  I can even select the entire expression inside the IF (   )  and the debugger says it evaluates to FALSE.  What the heck is going on?

        IF (IOUT .OR. IHEAD .GT. ITAIL) THEN 
           CALL UMD2ER (1, ICNTL, INFO, -3, INFO (19))
        ENDIF 

 

0 Kudos
23 Replies
IanH
Honored Contributor III
351 Views

Brian Murphy wrote:

/warn:interface causes several dozen errors #8284 when compiling UMFPACK.LIB  That's why it was turned off.

Error    6     error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   [MP]    C:\Users\Brian\Documents\Visual Studio 2010\Projects\Xlrotor\Umfpack\umd2f0.f    604    

In the above error message, what does [MP] mean?  If this is the offending variable, I cannot find a variable by that name.

I would expect MP to be the name of a dummy argument in the called procedure.  The thing associated with that dummy argument is violating that language rule.

While violations of that specific language rule may not be problematic today, other /warn:interfaces identified issues certainly could.  I strongly recommend fixing things so that you get a clean /warn:interfaces build.

0 Kudos
Brian_Murphy
New Contributor II
351 Views

I'm going batty.  I was looking in the wrong place.  It turns out MP is indeed a dummy variable in the routine being called.  For this particular error, a 0 in the CALL statement is being passed into MP which is an integer array.

The version of UMFPACK I am using is from 1997 and it is 100% fortran.  Nowadays it is all in C with a fortran wrapper.  I have been wanting to stick with the all fortran version because it was working great in CVF, but maybe I should take another look at switching.

 

0 Kudos
Brian_Murphy
New Contributor II
351 Views

That was a great tip to look in the index of the Intel Help documentation.  I easily found /stand, and now I can anything else, too.

Elsewhere, I tried a data breakpoint using LOC(IOUT), and execution kept breaking without seeming to run at all.  I must have been doing something wrong.

After a little more sleuthing, IOUT, which is a local variable, appears to be getting used in an IF statement without having been set to a value.  So I put in a statement to initialize IOUT to .false. right after it's declared, and the problem I was having has gone away.

0 Kudos
Reply