# correct way to calculate transport through a section in an ocean numerical model

Suppose that I want to calculate the transport across a certain transect (green line) from the outputs of an ocean numerical model. The model has the $u$ values at the center of the grids (crosses) and the $v$ values at the corners (circles), as it uses a C-grid.

Should I use the velocity values closest to the transect? Should I average the values at the corners? Interpolate?

Side question: does anyone know some Matlab toolbox to analyze numerical model outputs?

• How does this question relate to Earth Science? – Fred Jul 31 '17 at 2:48
• How does numerical modeling relate to Earth Science? – shamalaia Jul 31 '17 at 3:00
• This question is about modelling of ocean flow (as per the edit to the question) - it seems perfectly on-topic to me. Voting to leave open. – Semidiurnal Simon Jul 31 '17 at 14:35
• I do not think that it does boil down to mathematics. It depends on the specific problem. For some applications, it could be acceptable to interpolate, for others it couldn't. – shamalaia Aug 1 '17 at 0:35
• We tried to start an ocean and atmospheric modeling stackexchange, but it never got enough interest. Too bad. That is the reason we ended here and that is why I feel this kind of question must be on topic. Otherwise, the poor modelers (like me, sort of) would cry – arkaia Aug 1 '17 at 12:57

I have been using the routines in nctoolbox (also check here) that do all the slicing (vertical, horizontal, following a track). The repository is in GitHub.

The one you should looking at is vsliceg.m.

• from a quick look, it seems that the script interpolates the values between the grid points? Do you think that it is appropriate? I do not think that we can extract information below the resolution of the model. Otherwise, we would not need to increase the resolution in the first place. I'd prefer to just take the value at the grid point closest to the section. – shamalaia Aug 2 '17 at 0:12
• The issue is that a lot of model solutions use discretizations such as Arakawa-C (en.wikipedia.org/wiki/Arakawa_grids#Arakawa_C-grid) that calculate different fields at different locations and thus interpolation is necessary – arkaia Aug 2 '17 at 0:26

I would:

1. Compute (U,V) transport on the model's C grid. This is easy if the model returns a batotropic velocity.

2. Define a set of points S along the transect. The points should have spacing comparable to the model's horizontal resolution.

3. Interpolate (U,V) transport to S.

4. Find the component of (U,V) perpendicular to your transect.

5. Iterate over model outputs.

I can't say much about general numerical processing toolboxes. It looks like there are several for ROMS and MATLAB; google "ROMS toolbox arango" (it has been a long time since I used ROMS).