Clarification on Transforming `hadv` / `vadv` (and `hdiff` / `vdiff`) to Physical Cartesian Coordinates

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
hyc006
Posts: 43
Joined: Thu Nov 30, 2023 2:12 am
Location: UCSD

Clarification on Transforming `hadv` / `vadv` (and `hdiff` / `vdiff`) to Physical Cartesian Coordinates

#1 Unread post by hyc006 »

Hello,

I’ve been working on heat budget diagnostics in ROMS and ran into something I’m struggling to interpret. I’m comparing:

1. Volume integral of `hadv` from the ROMS diagnostic (`dia`) output,
2. Surface integral of the horizontal advective flux calculated directly from the `his` output using a fixed control volume in physical (x, y, z)-space.
Picture1.png
Here’s what I found:
* The diagnostic heat budget from the `dia` terms (i.e., hadv + vadv + hdiff + vdiff + sources) closes nicely, so the internal ROMS accounting is consistent.
* My surface integral method also flow the similar trend, so I don’t believe there is a numerical or math mistake in my flux calculations.
* However, the `hadv` term alone from `dia` does not match the horizontal advection calculated from the surface integral, even though I selected a control volume that spans the full depth and set surface heat fluxes to zero.
heat_budget_his_dia_ellipse_day5.png
From what I’ve read, I suspect this is because ROMS uses terrain-following s-coordinates, so `hadv` and `vadv` are not pure Cartesian x, y, z horizontal and vertical advection terms. Some of the physical horizontal flux associated with sloping sigma layers ends up in `vadv` instead of `hadv`.

I’m looking for resources or documentation to help me better understand:

1. How exactly `hadv` / `vadv` (and similarly `hdiff` / `vdiff`) are defined in ROMS,
2. How to transform these diagnostics into physical horizontal and vertical components in Cartesian coordinates, so I can interpret them more intuitively,
3. Whether there are example scripts or workflows others have used for this type of analysis.

Any explanations, references, or example code would be greatly appreciated. I’ve read through the WikiROMS pages on sigma coordinates, but I’m still unsure about how to formally make this transformation.

Thanks in advance for your help!

User avatar
wilkin
Posts: 941
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Clarification on Transforming `hadv` / `vadv` (and `hdiff` / `vdiff`) to Physical Cartesian Coordinates

#2 Unread post by wilkin »

I don't entirely follow what you are showing in those plots, and whether your apparent mismatch is a matter of a small residual, or a large offset. The y-axis scales are quite different.

If you have only a modest mismatch it may because the exact calculation in the diagnostics averages every timestep of ROMS, and uses the time-varying layer thickness (Hz) due to the moving s-coordinate, whereas in post-processing from history records you inevitably incur errors from working with occasional snapshots, and possibly you have not adjusted your delta-z for time in the vertical integrals.

We introduced the output average options ...

Code: Select all

Aout(iHUTav) == T T     ! Huon_temp, ...     tracer volume flux, <Huon*t>
Aout(iHVTav) == T T     ! Hvom_temp, ...     tracer volume flux, <Hvom*t>
... so that you can save the triple nonlinear product of layer thickness H times u times tracer to more accurately compute fluxes through horiztonal faces in budget calculations. You might do better to work with these. They include the layer thickness, so a vertical integral is just a vertical sum over k.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

hyc006
Posts: 43
Joined: Thu Nov 30, 2023 2:12 am
Location: UCSD

Re: Clarification on Transforming `hadv` / `vadv` (and `hdiff` / `vdiff`) to Physical Cartesian Coordinates

#3 Unread post by hyc006 »

Thank you so much for your reply and for pointing out the averaging options like Aout(iHUTav) and Aout(iHVTav) — this is very helpful, and I’ll definitely try saving these flux products in my next run to reduce errors from post-processing.
To clarify my question a bit more: the mismatch I’m seeing is actually large, not just a small residual. The fourth subplot in my figure highlights this clearly.
Picture2.png
Here’s what I find:
When I compute the surface integral of the horizontal flux directly from the history file output (orange line in the third subplot, using the last part of the flux form equation), it matches the volume-integral ∂T/∂t very well. This suggests that my direct calculation of the surface flux should be correct.
Picture3.png
However, when I calculate the volume integral of temp_hadv (middle part of the equation, from the dia file output), it does not match either the surface integral or ∂T/∂t. This is actually the big mismatch I’m seeing.
Picture1.png
Interestingly, when I integrate temp_hadv + temp_vadv, the match is much better, which suggests that the mismatch is specifically related to how ROMS defines temp_hadv versus temp_vadv.
I’m wondering that temp_hadv and temp_vadv are defined in ROMS’s sigma-coordinate space and don’t directly correspond to pure Cartesian x,y,z horizontal and vertical advection.
Could you confirm if this interpretation is correct? And are there any resources, papers, or documentation that explain how to transform hadv / vadv (and hdiff / vdiff) into physically meaningful horizontal and vertical advection and diffusion terms in Cartesian coordinates? I’d like to better understand the coordinate definitions so I can interpret the diagnostics more accurately.
Sorry again for not showing this clearly before, and thank you for your time and guidance!

Post Reply