You don't show us the full code, but the error message is clear. You are mixing a rank 3 matrix (z_r) with a rank 5 matrix (t). If you look at how things are done in ROMS, it is largely within do loops specifying the exact range over which to perform some computation - each statement is operating on one element of a matrix at a time. You are using matrix notation without specifying the right subset of the t matrix - the 5 indices are for i,j,k,timelevel,tracer. Your passive tracer is going to be just part of t if you have the usual temperature and salt as well. Look at some examples like:

**Code:**

! Linear background

DO k=1,N(ng)

DO j=JstrR,JendR

DO i=IstrR,IendR

t(i,j,k,1,itemp)=20.+ 0.02*z_r(i,j,k)

t(i,j,k,1,isalt)=0.2*j

END DO

END DO

END DO