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
Message
Author
antoinemarie

passive tracer as a function of depth?

#1 Unread post by antoinemarie »

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:

analytical.f90:709.29:

& GRID(ng) % z_r, &
1
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,

Antoine

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: passive tracer as a function of depth?

#2 Unread post by kate »

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)
            t(i,j,k,1,isalt)=0.2*j
          END DO
        END DO
      END DO

Post Reply