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

Linking IMSL routines any ideas gratefully received

pkmilsom
Beginner
991 Views
I have used IMSL routines successfully in the past after including the commands

USE numerical_libraries
USE imslf90

at the top of my Fortan programmes. Now I want to use the IMSL routine CSIEZ to carry out interpolation

Working from the IMSL example I need to include the lines

USE CSIEZ_INT
USE UMACH_INT
then I get the following error messages

Error: Error in opening the Library module file. [CSIEZ_INT]
USE CSIEZ_INT
------------^
C: est.f90(2) : Error: Error in opening the Library module file. [UMACH_INT]
USE UMACH_INT
--------^
Error executing df.exe.

when I change the USE statements to

USE numerical_libraries
USE imslf90

I get different error messages

C: est.f90(21) : Error: The type of the actual argument differs from the type of the dummy argument. [XDATA]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
--------------------^
C: est.f90(21) : Error: The type of the actual argument differs from the type of the dummy argument. [VALUE]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
----------------------------------------^
C: est.f90(21) : Error: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [XVEC]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
-------------^
C: est.f90(21) : Error: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [VALUE]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
-------------^
C: est.f90(21) : Error: The shape matching rules of actual arguments and dummy arguments have been violated. [XDATA]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
--------------------^
C: est.f90(21) : Error: The shape matching rules of actual arguments and dummy arguments have been violated. [VALUE]
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
----------------------------------------^
Error executing df.exe.

easy LIVE boundary.exe - 6 error(s), 0 warning(s)

The code is below

USE numerical_libraries
USE imslf90
INTEGER NDATA
PARAMETER (NDATA=11)
!
INTEGER I, NOUT
REAL F, FDATA(NDATA), FLOAT, SIN, VALUE(2*NDATA-1), X,&
XDATA(NDATA), XVEC(2*NDATA-1)
INTRINSIC FLOAT, SIN
! Define function
F(X) = SIN(15.0*X)
! Set up a grid
DO 10 I=1, NDATA
XDATA(I) = FLOAT(I-1)/FLOAT(NDATA-1)
FDATA(I) = F(XDATA(I))
10 CONTINUE
DO 20 I=1, 2*NDATA - 1
XVEC(I) = FLOAT(I-1)/FLOAT(2*NDATA-2)
20 CONTINUE
! Compute cubic spline interpolant
CALL CSIEZ (XDATA, FDATA, XVEC, VALUE)
! Get output unit number


CALL UMACH (2, NOUT)
! Write heading
! Print the interpolant and the error
! on a finer grid
DO 30 I=1, 2*NDATA - 1
WRITE (6,*) XVEC(I), VALUE(I), F(XVEC(I)) - VALUE(I)
30 CONTINUE
END

I am grateful for any help
0 Kudos
2 Replies
durisinm
Novice
991 Views
You aren't calling CSIEZ with the right number of parameters. The IMSL documentation lists these as:
NDATA Number of data points. (Input)
NDATA must be at least 2.
XDATA Array of length NDATA containing the data point abscissas. (Input)
The data point abscissas must be distinct.
FDATA Array of length NDATA containing the data point ordinates. (Input)
N Length of vector XVEC. (Input)
XVEC Array of length N containing the points at which the spline is to be evaluated. (Input)
VALUE Array of length N containing the values of the spline at the points in XVEC. (Output)
Note that calling CSIEZ requires six parameters, and you're using only four. You need the NDATA and Nparameters.
Mike D.

Message Edited by durisinm on 06-08-2005 08:17 AM

0 Kudos
Steven_L_Intel1
Employee
991 Views
You are also trying to use IMSL 5.0 modules (the _INT modules) with IMSL 4.0, as provided by CVF, which is why the modules can't be found. These are supported by Intel Visual Fortran Pro.
0 Kudos
Reply