# Ocean Modeling Discussion

ROMS/TOMS

Search for:
 It is currently Sun Aug 25, 2019 6:53 pm

 Page 1 of 1 [ 1 post ]
 All times are UTC
Author Message
 Posted: Wed Apr 22, 2015 9:41 pm

Joined: Thu Dec 07, 2006 3:14 pm
Posts: 80
Location: USGS
I have been thinking about posting on this topic for a while. ROMS horizontal discretization is very well defined in Numerical Solution Technique and placement of rivers in Description of River Input. However, I don't think the notation in MATLAB has been documented. I think this had also been a part of the confusion in defining rivers / point sources locations in the past. I hope this helps prevent some confusion in the future.
Zafer

With (i, j) notation:
Indexing in ROMS (if working on ROMS code or defining inputs in analytical modules or NetCDF files):
Code:
--------v(i,j+1,k)---------
|                         |
u(i,j,k)    r(i,j,k)     u(i+1,j,k)
|                         |
---------v(i,j,k)----------

Indexing in MATLAB (for post processing, analsis and plotting purposes):
Code:
--------v(j+1,i+1,k)---------
|                           |
u(j+1,i,k)  r(j+1,i+1,k)     u(j+1,i+1,k)
|                           |
---------v(j,i+1,k)----------

Example with (xi, eta) notation:
in ROMS:
Code:
......................v(80,55)...............
u(80,54).....rho(xi= 80,eta= 54).....u(81,54)
......................v(80,54)...............

in MATLAB:
Code:
...................v(55,81)..................
u(55,80).....rho(eta= 55,xi= 81).....u(55,81)
...................v(54,81)..................

Explanation:
1. Array indices start from 1 in MATLAB.
2. Array indices start from 0 in Fortran (ROMS).
3. Array dimensions are flipped between MATLAB (eta, xi) and ROMS (xi, eta) notations.
4. rho point indices in MATLAB are one more of what they are in ROMS. i.e. [code]ROMS(xi, eta) -> MATLAB(eta+1, xi+1)
5. For u and v points this is slightly difference since these arrays have one member short in one of their dimensions. ROMS solves hydrodynamic equations over the interior points (i=1:Lm and j=1:Nm) for a full grid size of (i=0:L, j=0:M). i.e. Lm=L-1, Mm=M-1 and full range rho(0:L, 0:M), whereas, u(1:Lm, 0:M), v(0:L,1:M). See here for more details.
e.g.
Lm=158 means 1:158 interior points in ROMS which corresponds to 0:159 full range points in ROMS and 1:160 full range points in MATLAB.

1. Assume that the cell with rho(xi= 80,eta= 54) in the above example is a wet cell neighboring a land masked cell with rho(xi= 79,eta= 54) on the east of it. If defining a river / point source coming in from the east the location will be as river_Xposition=80, river_Eposition=54 in ROMS river input file.
2. You can test your river / point source indices by running map_rivers.m code, which can be found on this post.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ News, Events & Job Opportunities    Meetings/Workshops    Job Opportunities    Ocean News ROMS/TOMS    ROMS Adjoint    ROMS Benchmarks    ROMS Bugs    ROMS Discussion    ROMS Documentation    ROMS Ecosystem    ROMS FAQ    ROMS Ice    ROMS Information    ROMS Installation    ROMS Known Problems    ROMS Messages    ROMS Problems    ROMS Releases    ROMS Results    ROMS Sediment    ROMS Source    ROMS Tips    ROMS Tools and Techniques    ROMS Trivia    ROMS Usage    ROMS Webinar    ROMS Wish List ROMS/TOMS Applications    User Applications    Adriatic Sea Ocean Modeling    Ocean Modeling FAQ