Error: Incompatible ranks 0 and 1 in assignment at (1)
<p>I'm working in a finite difference method on an irregular grid, this is the important part of the code:</p>

<pre><code> IMPLICIT DOUBLE PRECISION (A-Z)
      REAL*16 IPSI,ICORR,POT(20000),VA(20000),delta1(20000),
     $delta2(20000),R(20000),a,b,d
      COMPLEX Y(20000),TY2(50000),Z(20000),PSI0(20000),RES,DPSI,C,
     $CORR,OPK
 DO I=3,NR-1
    delta1=R(I)-R(I-1)
    delta2=R(I+1)-R(I)
    a=(2/(delta1*(delta1+delta2)))
    b=(-2/(delta1*delta2))
    d=(2/(delta2*(delta1+delta2)))
    TY2(I)=((d*Z(I+1))+(b*Z(I))+(a*Z(I-1)))
 ENDDO
</code></pre>

<p>When I try to compile I got Error: Incompatible ranks 0 and 1 in assignment at (1) for a,b,d and TY2. Any solution will be appreciated. Thanks!</p>