Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

Error : The CALL statement is invoking a function subprogram as a subroutine.

$
0
0

I am trying to learn to use MKL routines. I have written a simple code for calculating the jacobian matrix. However, it ends up with the below error:

The CALL statement is invoking a function subprogram as a subroutine. [DJACOBI]

 

Here is my code and I am compiling it with: ifort -mkl newton2.f90 

INCLUDE '/home/vahid/intel/composer_xe_2015.3.187/mkl/include/mkl_rci.f90'

program newton2
    implicit none
    real*8, dimension(3) :: x
    real*8, dimension(3,3) :: fjac
    real*8 :: phi1,phi2,phi3
    integer :: i,m,n
    integer, parameter :: maxit=100
    real*8, parameter :: eps=0.0001

    INCLUDE '/home/vahid/intel/composer_xe_2015.3.187/mkl/include/mkl_rci.fi'

    external fcn

    x(1)=0
    x(2)=0
    x(3)=0
    n=3;m=3

    !Call fcn (m, n, x, f)

    call djacobi(fcn , n, m, fjac, x, eps)

    write(*,*) fjac

end program newton2

subroutine fcn (m, n, x, f)
    real*8, dimension(3) :: x,f
    real*8 :: phi1,phi2,phi3

    phi1=0 ; phi2 = 0.1; phi3= 0.9;
    f(1) = 2*(800) *(x(1)-0.7)  - 2*(12000)*(x(2)-0.45);
    f(2) = 2*(12000)*(x(2)-0.45)- 2*(1200)*(x(3)-0.9)  ;
    f(3) = x(1)*phi1 + x(2)*phi2 + x(3)*phi3 - 0.42  ;

end subroutine fcn

 


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>