Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

CONTAINS statement

gelarimer
Beginner
1,826 Views

I can locate a Break Point in an Internal Procedure but cannot get variable values either by running mouse cursor over variable or in Watch windows in Visual Studio. Internal Procedure appears to work, just can't debug normally. The Internal Procedure uses two global variables that are associated with a USE MODELGlobals in the host routine.Must be doing something wrong, but haven't been able to figure out what the problem is. Code follows, and any comments would be appreciated.

SUBROUTINE DIAminmax(Jmin, Jmax, Wake, iError)

! USE ifwin included in MODELGlobals
USE MODELGlobals

IMPLICIT NONE

INTEGER(4) iret
INTEGER(4) iErr, iError

REAL Dia_min, Dia_max
REAL Jmax, Jmin
REAL Wake ! Wake is not global
REAL Const
REAL N

CHARACTER(giCharLen) cDia

LOGICAL, SAVE :: bDiaChng = .FALSE.

! rangle of possible diameters
Dia_max = (MPH*Wake*1.46667*60.0*Gear_Ratio)/(Jmin*RPM)
Dia_min = Dia_max*(Jmin/Jmax)
....
.... ! calculate Dia_minDia_max here
....

if(Dia .LT. Dia_min) then

Dia = CEILING(Dia_min*100.0)/100.0

iError = Update() ! internal procedure

else if(Dia .GT. Dia_max) then

Dia = FLOOR(Dia_max*100.0)/100.0

iError = Update()

else if(bDiaChng) then

iError = Update()

end if

iError = 1
RETURN
&nb sp;

CONTAINS

INTEGER FUNCTION Update()

! * Dia and gszDia are Global Variables
! * see USE MODELGlobals above

write(cDia, '(F5.2)', IOSTAT=iErr) Dia

read(cDia, '(F5.2)', IOSTAT=iErr) Dia

cDia = ADJUSTL(cDia)

gszDia = cDia(1:5)//ACHAR(0)

iret = SetWindowText(ghDIA, gszDia)

Update = 1
RETURN

End FUNCTION Update

END

0 Kudos
12 Replies
Steven_L_Intel1
Employee
1,826 Views

No, you're not doing anything wrong. It's a known problem that host-associated variables are not viewable in the debugger. It is something we're working on. Sorry for the inconvenience.

You may be able to add a watch of modname::varname for the variables in the module.

0 Kudos
gelarimer
Beginner
1,826 Views
Thanks for the quick reply and info.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,826 Views

You can use the scope operator (::) as Steve suggests or if you do not like typing that in then simply declare and use a local pointer.

real, pointer :: pDia
...
pDia => Dia

You can make that work around code conditional compile. Pick an explanitory name such as DEBUG_REQUIRES_SCOPE_HACK. Define this in a general include file. Then when the compiler is fixed you can try the code out by not defining the symbol. Keep the code in for a few updates of the compiler just in case the fix is un-fixed (or if you port your code to a system that is running an older version of the compiler).

Jim Dempsey

0 Kudos
gelarimer
Beginner
1,826 Views
Thanks again Jim for the helpful information.
0 Kudos
wfrancis76
Beginner
1,826 Views
I am having this same problem using VS .NET 2005. I'm using the latest version of the Intel compiler. Has this problem not been fixed?
0 Kudos
Steven_L_Intel1
Employee
1,826 Views
It has not, but it is actively being investigated. It is not a simple problem to solve.

I urge anyone who has encountered this problem to report it to Intel Premier Support. It will help ensure that you obtain a fix as soon as it is available.
0 Kudos
Dave_A_1
Beginner
1,826 Views

Has this problem ever been solved?  I am using VS 2008 & Fortran Visual Composer XE 2013.

Thanks,

Dave

 

0 Kudos
abhimodak
New Contributor I
1,826 Views

Hi Dave

I believe it hasn't been since I still see it. One way to look at the variable values is to go to the calling routine through call-stack. This is, obviously, irritating to say the least but your don't need to declare local pointers and then delete them after debugging.

Abhi

0 Kudos
Dave_A_1
Beginner
1,826 Views

Hi Abhi,

Thank you for the response, but I am not sure what you are suggesting I do.  Suppose I am debugging a contains procedure and want to look at the value of a variable.  What exactly do I do?

Thanks,

Dave

 

0 Kudos
abhimodak
New Contributor I
1,826 Views

Hi Dave

In the debugging session, check your call-stack window. By clicking on the call from the parent procedure, you can go in that frame. The value of the variable will be available in the watch window and by hovering mouse over it. I have attached two snapshots and one screen-capture movie. I hope this is what you are looking for.

Abhi

0 Kudos
abhimodak
New Contributor I
1,826 Views

Hi Dave

Somehow the file upload did not go through the last time. Putting in the snapshots again.

Abhi

0 Kudos
Dave_A_1
Beginner
1,826 Views

Abhi,

Thank you; this is a HUGE help!

Dave

 

0 Kudos
Reply