- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am tring to use the QDNG subroutine. I have Intel Visual Fortran
composer XE with IMSL library. I have added IMSL library to the library
and includ path (page 891). I got two erros even when I run the sample
code from the IMSL math mannual:
1. program exception - access violation
this error occus when calling QDNG subroutine
2. Keyword arguments are invalid without an explicit interface. [ERRABS]
Keyword arguments are invalid without an explicit interface. [ERREST]
this is an error for compiling the code when I include these optional arguments.
Please help me. Thank you very much !!!
The code is below:
PROGRAM Main
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
IMPLICIT NONE
INTEGER NOUT
REAL A, ABS, B, ERRABS, ERREST, ERROR, EXACT, EXP, F, RESULT
INTRINSIC ABS, EXP
EXTERNAL F
! Get output unit number
CALL UMACH (2, NOUT)
! Set limits of integration
A = 0.0
B = 2.0
! Set error tolerances
ERRABS = 0.0
!CALL QDNG (F, A, B, RESULT) !, ERRABS=ERRABS, ERREST=ERREST)
! Print results
EXACT = 1.0 + EXP(2.0)
ERROR = ABS(RESULT-EXACT)
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
!
REAL FUNCTION F (X)
REAL X
REAL EXP
INTRINSIC EXP
F = X*EXP(X)
RETURN
END
1. program exception - access violation
this error occus when calling QDNG subroutine
2. Keyword arguments are invalid without an explicit interface. [ERRABS]
Keyword arguments are invalid without an explicit interface. [ERREST]
this is an error for compiling the code when I include these optional arguments.
Please help me. Thank you very much !!!
The code is below:
PROGRAM Main
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
IMPLICIT NONE
INTEGER NOUT
REAL A, ABS, B, ERRABS, ERREST, ERROR, EXACT, EXP, F, RESULT
INTRINSIC ABS, EXP
EXTERNAL F
! Get output unit number
CALL UMACH (2, NOUT)
! Set limits of integration
A = 0.0
B = 2.0
! Set error tolerances
ERRABS = 0.0
!CALL QDNG (F, A, B, RESULT) !, ERRABS=ERRABS, ERREST=ERREST)
! Print results
EXACT = 1.0 + EXP(2.0)
ERROR = ABS(RESULT-EXACT)
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
!
REAL FUNCTION F (X)
REAL X
REAL EXP
INTRINSIC EXP
F = X*EXP(X)
RETURN
END
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are calling the "Fortran 90" interface and therefore must add:
USE QDNG_INT
after the PROGRAM statement. You probably missed this because in the manual, this line is shown on the previous page. The example also requires the line:
USE UMACH_INT
as shown there.
USE QDNG_INT
after the PROGRAM statement. You probably missed this because in the manual, this line is shown on the previous page. The example also requires the line:
USE UMACH_INT
as shown there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much. My code now works.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page