Kalashnikov
Joined: 25 May 2006 Posts: 7
|
Posted: Mon May 29, 2006 5:23 am Post subject: Problem calling a function |
|
|
I'm having difficulty calling the following function:
FUNCTION determinant(jac)RESULT(det)
IMPLICIT NONE
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp),INTENT(IN)::jac(:,
REAL(iwp)::det
INTEGER::it
it=UBOUND(jac,1)
SELECT CASE(it)
CASE(1)
det=1.0_iwp
CASE(2)
det=jac(1,1)*jac(2,2)-jac(1,2)*jac(2,1)
CASE(3)
det=jac(1,1)*(jac(2,2)*jac(3,3)-jac(3,2)*jac(2,3))
det=det-jac(1,2)*(jac(2,1)*jac(3,3)-jac(3,1)*jac(2,3))
det=det+jac(1,3)*(jac(2,1)*jac(3,2)-jac(3,1)*jac(2,2))
CASE DEFAULT
WRITE(*,*)' wrong dimension for Jacobian matrix'
END SELECT
RETURN
END FUNCTION determinant
I've provided the following interface:
interface EMELIANENKO
FUNCTION determinant(jac)RESULT(det)
REAL(iwp),INTENT(IN)::jac(:,
end FUNCTION
end interface
...also, I've made the following declarations which pertain to the DETERMINANT function:
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp) :: det,determinant
(Is it correct to declare the function DETERMINANT in this way?)
I'm getting the following error message:
"error 283 - DETERMINANT must appear in a type declaration because IMPLICIT NONE has been used"
Is there something wrong with the interface or the declarations of DET and DETERMINANT?
Thanks,
Mikhail Kalashnikov _________________ Mikhail Kalashnikov |
|