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

Calling IMSL routine inside a Subroutine in Intel Fortran !!!

rampy
Beginner
423 Views
I have been trying to call GAMMA function in IMSL from inside a subroutine.
It works when it is there in the main program , but when I call use it
inside a subroutine , it says GAMMA is not declared..!!

This is how my program looks like

INCLUDE 'link_f90_dll.h'
USE GAMMA_INT
USE UMACH_INT
USE linear_operators

IMPLICIT NONE
INTEGER Nmax
PARAMETER (Nmax=401)
REAL G(Nmax),F
F=1.5
CALL GAM(Nmax,G,F)
END


SUBROUTINE GAM(Nmax,G,F)

IMPLICIT NONE
INTEGER Nmax, I
REAL *8 G(Nmax)
REAL *8 F, V1, V2, V3

DO I=1,Nmax

V1= GAMMA(I-F)
V2= GAMMA(-F)
V3= GAMMA(I+1)
G(I)=V1/(V2*V3)

END DO

RETURN
END



0 Kudos
1 Reply
TimP
Honored Contributor III
423 Views

You would require a copy of the necessary USE statements in the subroutine where the function call occcurs. USE scope does not extend beyond an END.

0 Kudos
Reply