- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm trying to use QDAGI http://www.roguewave.com/Portals/0/products/imsl-numerical-libraries/fortran-library/docs/6.0/math/default.htm?turl=qdagi.htm
I'm following the example in the webpage but I want to do it in a module.
When I try to compile it I get this error:
[bash]
$ make clean && make
rm -f modulo.X modulo1.o programa.o *.mod
ifort -openmp -I/common/vni/imsl/fnl700/rdhin111x64/include -c modulo1.f90
modulo1.f90(22): error #6632: Keyword arguments are invalid without an explicit interface. [ERRABS]
CALL QDAGI (F, BOUND, INTERV, RESULT, ERRABS=ERRABS, &
--------------------------------------------^
modulo1.f90(23): error #6632: Keyword arguments are invalid without an explicit interface. [ERREST]
ERREST=ERREST)
-----------------^
compilation aborted for modulo1.f90 (code 1)
make: *** [modulo1.o] Error 1
[/bash]
This is the module I wrote:
[fortran]
module modulo1
USE UMACH_INT
USE CONST_INT
IMPLICIT NONE
CONTAINS
SUBROUTINE INTEGRATE (VALUE, LOWER_BOUND)
INTEGER :: INTERV, NOUT
DOUBLE PRECISION :: VALUE, LOWER_BOUND
DOUBLE PRECISION :: ABS, DLOG, BOUND, ERRABS, ERREST, &
ERROR, ERRREL, EXACT, F, PI, RESULT
INTRINSIC :: ABS, DLOG
EXTERNAL :: F
! Get output unit number
CALL UMACH (2, NOUT)
! Set limits of integration
BOUND = 0.0
INTERV = 1
! Set error tolerances
ERRABS = 0.0
CALL QDAGI (F, BOUND, INTERV, RESULT, ERRABS=ERRABS, &
ERREST=ERREST)
! Print results
PI = CONST('PI')
EXACT = -PI*ALOG(10.)/20.
ERROR = ABS(RESULT-EXACT)
VALUE = RESULT
WRITE (NOUT,99999) RESULT, EXACT, ERREST, ERROR
99999 FORMAT (' Computed =', F8.3, 13X, ' Exact =', F8.3//' Error ', &
'estimate =', 1PE10.3, 6X, 'Error =', 1PE10.3)
END SUBROUTINE INTEGRATE
FUNCTION F (X)
DOUBLE PRECISION :: X
DOUBLE PRECISION :: F
DOUBLE PRECISION DLOG
INTRINSIC DLOG
F = DLOG(X)/(1.+(10.*X)**2)
END FUNCTION F
end module modulo1
[/fortran]
Any idea of what I'm doing wrong?
Thanks for the help!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The attached compressed archive contains two source files that show how to call the IMSL quadrature routine with the integrand function defined in a module, as you required.
The program gives the output [bash] Computed =-0.36169 Exact =-0.36169 Error 3.253E-14 -0.361689220620806 [/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page