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

Error in IMSL routine QD2VL

Intel_C_Intel
Employee
395 Views

Hello,

I've tried to run the IMSL routine QD2VL sample problem which appears on page 698 of the MathV1.pdf file (using IVF Pro for Windows version 9.1.032). The build had no errors, but running it yielded the following output. Source is included too.

I'd appreciate your help in resolving this issue.

Yair

================= output========================

D:Fortran Projects rial1 rial1Debug>trial1

X Y F(X,Y) QD2VL DIF

*** TERMINAL ERROR 1 from QD2VL. The number of data points in the X

*** direction must be at least 3 while NXDATA = 0 is given.

*** TERMINAL ERROR 2 from QD2VL. The number of data points in the Y

*** direction must be at least 3 while NYDATA = 0 is given.

D:Fortran Projects rial1 rial1Debug>

================ source ========================

include 'link_f90_static.h'

INTEGER LDF, NXDATA, NYDATA

PARAMETER (NXDATA=21, NYDATA=42, LDF=NXDATA)

!

INTEGER I, J, NOUT

REAL F, FDATA(LDF,NYDATA), FLOAT, PI, Q, &

SIN, X, XDATA(NXDATA), Y, YDATA(NYDATA)

INTRINSIC FLOAT, SIN

! Define function

F(X,Y) = SIN(X+Y)

! Set up X-grid

DO 10 I=1, NXDATA

XDATA(I) = FLOAT(I-1)/FLOAT(NXDATA-1)

10 CONTINUE

! Set up Y-grid

DO 20 I=1, NYDATA

YDATA(I) = FLOAT(I-1)/FLOAT(NYDATA-1)

20 CONTINUE

! Evaluate function on grid

DO 30 I=1, NXDATA

DO 30 J=1, NYDATA

FDATA(I,J) = F(XDATA(I),YDATA(J))

30 CONTINUE

! Get output unit number

CALL UMACH (2, NOUT)

! Write heading

WRITE (NOUT,99999)

! Get value for PI and set X and Y

PI = CONST('PI')

X = PI/4.0

Y = PI/4.0

! Evaluate quadratic at (X,Y)

Q = QD2VL(X,Y, XDATA, YDATA,FDATA)

! Print results

WRITE (NOUT,'(5F12.4)') X, Y, F(X,Y), Q, (Q-F(X,Y))

99999 FORMAT (10X, 'X', 11X, 'Y', 7X, 'F(X,Y)', 7X, 'QD2VL', 9X,&

'DIF')

END

0 Kudos
2 Replies
Steven_L_Intel1
Employee
395 Views

You did not faithfully copy the source in the manual. In particular, you omitted the crucial first line:

USE IMSL_LIBRARIES

The INCLUDE is not a substitute for that. If you add the USE line (after the INCLUDE is fine), then it works as described.

All of the documented examples use the "Fortran 90" style calls to the IMSL routines which require that you have the appropriate USE line(s) as listed.

0 Kudos
Intel_C_Intel
Employee
395 Views

You're right of course, my bad.

Thanks a lot!

0 Kudos
Reply