pyschism icon indicating copy to clipboard operation
pyschism copied to clipboard

Computing nodal correction - possible bug ?

Open simonweppe opened this issue 11 months ago • 0 comments

Hi team,

Just came across a potential bug when trying to compute nodal correction.

In tides.py there are some MAJOR and MINOR cons declared at the beginning and combined into ALL_CONSTITUENTS

This is later checked in get_nodal_correction (https://github.com/schism-dev/pyschism/blob/main/pyschism/forcing/bctides/tides.py#L275). If a cons is not in ALL_CONSTITUENTS (e.g. "L2"), this returns self._nodal_factors[constituent], which seems is not initialized. So it fails, although the correction information is indeed available further below https://github.com/schism-dev/pyschism/blob/main/pyschism/forcing/bctides/tides.py#L351

The function 'add_constituents' that should initialize self._nodal_factors is never called it seems.

Keen to hear your thoughts. Best Simon

simonweppe avatar Dec 03 '24 10:12 simonweppe