Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Sun Dec 09, 2018 9:46 pm




Post new topic Reply to topic  [ 8 posts ] 

All times are UTC

Author Message
 Post subject: Grid cell volume
PostPosted: Mon Jun 04, 2007 8:39 pm 
Offline

Joined: Mon Jun 23, 2003 9:35 pm
Posts: 2
Location: University of Washington
Is there an easy way to find the grid cell volumes of an entire grid? I'm looking to find the volume of a water mass and this would make things very simple.

I'm not sure I completely understand the geometry involved, so I'm having a hard time figuring out how to calculate it. Surely the code has to do this somewhere...

Thanks,
Rebecca


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 04, 2007 9:33 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3516
Location: IMS/UAF, USA
The volume of a grid cell is (h+zeta)/(pm*pn). Look at how the diagnostic my_volume is computed for the entire domain in diag.F. In 3-D, the vertical sum of Hz should be equal to (h+zeta), as should z_w(N)-z_w(0).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 04, 2007 10:00 pm 
Offline

Joined: Mon Jun 23, 2003 9:35 pm
Posts: 2
Location: University of Washington
It seems to me that this computes the volume for the entire water column. How, then, does this get split between the different vertical levels?

In other words, if I want the volume at i=1, j=1 and N=12 (of 20), how do I find this?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 05, 2007 7:00 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3516
Location: IMS/UAF, USA
The vertical delta z is Hz(i,j,k).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 05, 2007 7:36 pm 
Offline

Joined: Tue Mar 13, 2007 6:38 pm
Posts: 39
Location: Independent researcher
Hi!
I still use version 2.2, and don't know if anything has changed in the new version.

In mod_grid.F there are some variables defined, three of them are:

Hz: Thickness of vertical rho-Points
Huon: Total u-Momentum Flux term: interpolated(Hz)*u*dy (dy is the same as 1/pn, at least for a rectilinear grid, I don't know anything about curvilinear setups)
Hvom: interpolated(Hz)*v*dx

The 'allocate' functions in that file allocate N vertical levels for each i,j for each one of those variables.

Roms uses a staggered grid (see http://marine.rutgers.edu/po/documentat ... =technique ).
Hz is, as documented in mod_grid, the thickness at rho points (thickness means cell hight). But due to the staggered grid, there is a different thickness at the neighbouring u and v points.
For example, take the Finite-Volume formulation for a tracer. Tracers are defined on rho-points, so the cell must be constructed in a way that it's center is a rho-point. Now the in- and outflow of the cell has to be calculated, to update the tracer. The in- and outflow has to be calculated on the cell boundaries, and in the case of a staggered grid, that's where the u- and v- points are located. To calculate the inflow per second, one has to multiply area*velocitynormal*tracer. Area is dx*Height or dy*Height, but one needs the hight at VELOCITY-points, not at rho points, so one has to linearly interpolate Hz between neighbouring rho-point-Heights (e.g, in set_massflux).

One problem in the above explanation is that cell heights are changing during a 3d-timestep, and if I understood correctly, the massflux for calculating tracer-flux is averaged in fast barotropic time to the middle of the flux-period. That means, in the equation for tracer-update you will find the following cell-heights:
one in the middle of the cell at time n to calculate the old volume of the grid cell.
one in the middle of the cell at time n+1, to calculate new volume.
one at each boundary at time n+1/2, for the inflow-area.

The second of the above is also calculated with the barotropic time steps, but with different weights as the third.

See the Shchepetkin-McWilliams 2005 paper for more info.

For the momentum equations, things are similar, I think, exept that now the cell boundaries coincide with rho points, so no need to interpolate the cellheights.

The above is all simplified, but what I want to say is that one has to take care at what time and at what location to define the height.

I hope I could help you, I spent some weeks to find out what I just wrote (and even now i don't know if it's right or not... :wink: )
--Stefan


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 05, 2007 8:26 pm 
Offline

Joined: Tue Mar 13, 2007 6:38 pm
Posts: 39
Location: Independent researcher
I think that what I wrote above only makes sense for 2nd order centered advection, both for velocity and tracers.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grid cell volume
PostPosted: Wed Jul 01, 2015 7:41 am 
Offline

Joined: Fri May 24, 2013 3:05 am
Posts: 23
Location: UWA
Can Hz be saved in the history files?
Or is set_depth function the only way to obtain it for postprocessing?

Many thanks.
Alexis


Top
 Profile  
Reply with quote  
 Post subject: Re: Grid cell volume
PostPosted: Wed Jul 01, 2015 4:40 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3516
Location: IMS/UAF, USA
One could add the writing of Hz to def_his.F and wrt_his.F. You'd also have to invent an id tag for it, put it in varinfo.dat and read it where they get read. Also check the Hout(idHz) in read_phypar.F. You can grep for one like idDano to see how it's done. Note that Hernan believes the id tags should all be six characters long, so perhaps idHzee or idHzed? :roll:

Most of us have postprocessing tools that know how to compute Hz, be it Matlab or whatever. Or one colleague asks me to write a static file of the z_rho, z_w appropriate for zeta=0 which I do with a Python script.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group