river issue

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

river issue

#1 Unread post by seashellingolds »

Hello All

I just got an issue with my river setup. Please look at the grid below

... p-v-p-v-p-v-p-v-p-v-p ...
... u-r-u-r-u-r-u-r-u-r-u ...
... p-v-p-V-p-V-p-v-p-v-p ...
.... ------------u-r-u-r-u ...
.... ------------p-v-p-v-p ...

This is part of a grid. I just labeled the masked points with letters. If I set a southward river at the left big V point, it has no problem. But if right big V point, the result looks like no-river case.
I did some tests and finally concluded, in my grid, for all the southward river, if there is a wall just right on the east (on the west it is ok), the river doesnt work (not sure if I say it clearly enough...).

I didnt check rivers with other directions. I might do something stupid here or violate the rule how to set river
Please help indicate where I made mistake. Thanks a lot

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

Re: river issue

#2 Unread post by kate »

What would be more helpful to us would be if you could print out that V value from several places in the code to confirm that it's getting set back to zero - and pin down where that's happening. Or else watch in the debugger.

Are you sure you have the right i,j? Same as the rho point just above it?

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: river issue

#3 Unread post by seashellingolds »

kate wrote:What would be more helpful to us would be if you could print out that V value from several places in the code to confirm that it's getting set back to zero - and pin down where that's happening. Or else watch in the debugger.

Are you sure you have the right i,j? Same as the rho point just above it?
Thanks Kate. Definitely it is a good idea to print out V values at several places. I ll do that
As for the indices, since my left V gave me no problem, I guess the indices could be right
btw shouldnt the indices be the same as the rho point below it?

Thanks
Yisen

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

Re: river issue

#4 Unread post by kate »

seashellingolds wrote:As for the indices, since my left V gave me no problem, I guess the indices could be right
btw shouldnt the indices be the same as the rho point below it?
It depends. In the ROMS view, the v indices match the rho above. In the netcdf file view, the indices match the rho below. The grid indices were fixed before we starting using netcdf I/O and would perhaps be done differently if we were to start over.

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: river issue

#5 Unread post by seashellingolds »

kate wrote:
seashellingolds wrote:As for the indices, since my left V gave me no problem, I guess the indices could be right
btw shouldnt the indices be the same as the rho point below it?
It depends. In the ROMS view, the v indices match the rho above. In the netcdf file view, the indices match the rho below. The grid indices were fixed before we starting using netcdf I/O and would perhaps be done differently if we were to start over.
I see your point. The rho point index starts from 0 while v point starts from 1 in the code. I ll look into the indices too to make sure everything is all right.

Thank again!

User avatar
arango
Site Admin
Posts: 1361
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: river issue

#6 Unread post by arango »

Actually, our ROMS design is much better. This is going to be quite complicate in the near future with the nesting, since we are going to have negative indices. There are not alternatives!!! The problem is in NetCDF, which is not generic enough to allow 0 and negative indices. It seems that they wanted to avoid lower and upper bound dimensions when defining arrays in a NetCDF. I can see why this will get complicate very quickly. So we have to use array shift with lower index 1 in all NetCDF arrays.

Post Reply