Skip to content

Mistake in computation horizontal divergence #14

@daanreijnders

Description

@daanreijnders

First of all, thanks for making these tutorials! They've really helped me master xgcm, which I use almost daily now.

I spotted a mistake in the MITgcm example. The computation of the divergence is incorrect. The right MITgcm discrete form is found here. The difference is that there should be no multiplication by ds.drF (which in the link you currently include is present to correctly represent the z-derivative of the vertical velocity in the continuity equation), and that there should be an additional division by ds.hFacC. This also means that you may want to rename u/v_transport, since you don't need the transport after all.

I figured it's easiest for me to open an issue over a PR, since I don't know your specific workflow/integration for getting these examples on the xgcm website.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions