Skip to content

Define naming pattern for diagnostics #138

@tomchor

Description

@tomchor

At the moment the diagnostics don't follow a strict naming pattern. Taking the TKEBudgetTerms as an example:

#+++ TKEBudgetTerms exports
export TurbulentKineticEnergy, KineticEnergy
export KineticEnergyTendency, KineticEnergyDiffusiveTerm, KineticEnergyForcingTerm
export IsotropicKineticEnergyDissipationRate, KineticEnergyDissipationRate
export XPressureRedistribution, YPressureRedistribution, ZPressureRedistribution
export XShearProductionRate, YShearProductionRate, ZShearProductionRate

Some diagnostics have Term appended to their names (like KineticEnergyDiffusiveTerm), some don't (like KineticEnergyDissipationRate). Some start with KineticEnergy (like KineticEnergyDiffusiveTerm again) but some don't (like XShearProductionRate).

It would be nice to agree on a naming pattern to use from now on. I think it's more important to be clear than it is to be concise. For example, something like the snippet below (which is made up code just for example sake) isn't 100% clear

using Oceanostics
ε = DissipationRate

Which is why the currently implemented code has a more verbose name:

using Oceanostics
χ = TracerVarianceDissipationRate(model)
ε = KineticEnergyDissipationRate(model)

We could keep following this pattern and make things more verbose, following the pattern "budgeted quantity" + "term name", which would bring KineticEnergyDissipationRate, KineticEnergyPressureRedistribution, TracerVarianceForcing, etc.

Another option is to not export function/diagnostic names at the top/package level and name the modules according to the equations the diagnostic terms come from. That way the snippet above would become something like

using Oceanostics
χ = TracerVarianceEquation.DissipationRate(model)
ε = KineticEnergyEquation.DissipationRate(model)

which, I would argue, is pretty readable, and not too verbose.

cc @glwagner

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions