Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
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.

Trouble about Array Viewer!

bluehawkflyzhou
Principiante
973 Visualizações
0 Kudos
7 Respostas
Intel_C_Intel
Funcionário
973 Visualizações
Hello Wen,

I don't think:

testA(x)=dsqrt(x)

is what you want. The index for testA should be an integer between 0 and 2000. Instead:

testA(i)=dsqrt(x)

looks to be what you trying to do, i.e. initializing testA to contain the sqrts of values between 0.0 and 0.1. But as you noted, when you display the array in the Array Viewer you see an xrange of 0 to 2000. That's because the default behaviour is to display the array indices along the x-axis. To display different x-axis labels you need to create an additional array containing the x values and then call favSetDimScale.

The code would look like this:

Subroutine viewary( )
use AVDef
use AVViewer
use DFLib

real(8), allocatable :: testA(:)
real(8), allocatable :: xscale(:)
!DEC$ATTRIBUTES array_visualizer :: testA
real(8) xmax, x

integer istatus, ihv
allocate (testA(0:2000))
allocate (xscale(0:2000))

xmax=0.1
DO i=0, 2000
x=xmax*i/2000.0
100 testA(i)=dsqrt(x)
xscale(i) = x

END DO

call faglStartWatch(testA, istatus)
call faglStartWatch(xscale, istatus)
call FavStartViewer(ihv, istatus)
call favSetArray(ihv, testA, istatus)
call favSetDimScale(ihv, 1, xscale, istatus)
call favShowWindow(ihv, AV_TRUE, istatus)
call faglSaveAsFile(testA, "testA.agl", istatus)
call favEndViewer(ihv, istatus)
call faglEndWatch(testA, istatus)

deallocate(testA)
deallocate(xscale)
END Subroutine viewary

John

bluehawkflyzhou
Principiante
973 Visualizações
Johnreadey,

Thank you for your consideration.

I have tried it again as what you suggested but there was still no change. It seems a big trouble.

Can you give me some resource about CVF?

Wen
Intel_C_Intel
Funcionário
973 Visualizações
I'm not sure what the problem could be. I'll attach the source for the program I ran and a screen shot. Is this not what you are looking for?

John

bluehawkflyzhou
Principiante
973 Visualizações
Johnreadey,
Yes, I have done as what you suggested under Win32 API enviroment. I used a dialog to replace the keyboard response in your program. I also found that if I only utilized the line: call fagSaveasFile(...), what I had saved in the file was not what I needed X_scale_modified figure but the original form. So, I saved the figure directly in the array viewer as another file then everything was OK.

But another problem is coming: how can I realize the logarithm scale(uneven intervals) on X axis?

Thank you!
wen
Intel_C_Intel
Funcionário
973 Visualizações
Yes, that looks like a bug. At least saving from the Array Viewer works ok.

Logarithmic scales aren't supported in the Compaq Array Visualizer, but they are in the new Intel Array Visualizer that ships with Intel Fortran v7.0. There's a free trial download if you want to try it out.

John
bluehawkflyzhou
Principiante
973 Visualizações
Can you tell me the website?
Steven_L_Intel1
Funcionário
973 Visualizações
30-Day Trial of Intel Fortran for Windows (includes Array Visualizer). Be aware that it looks quite different from the one in CVF.

Steve
Responder