passive tracer as a function of depth?

Discussion of how to use ROMS on different regional and basin scale applications.

Moderators: arango, robertson

Post Reply
Posts: 52
Joined: Mon Mar 07, 2011 5:37 pm
Location: HYDRATEC

passive tracer as a function of depth?

#1 Post by antoinemarie » Mon Nov 07, 2011 9:55 am

Hi roms users!

I want to know if it is possible to define a passive tracer as a function of depth. I try to define z_r as in ana_initial, but I obtain the following error:


& GRID(ng) % z_r, &
Error: Rank mismatch in argument 't' at (1) (5 and 3)
make: *** [/home/AMarie/roms/Projects/richardmenil/Build/analytical.o] Error 1

Can someone help me please?

Thanks in advance,


User avatar
Posts: 3754
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: passive tracer as a function of depth?

#2 Post by kate » Mon Nov 07, 2011 5:58 pm

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: Select all

! 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)
          END DO
        END DO
      END DO

Post Reply