Skip to content

TPXO forcing changes - #473

Open
stephankramer wants to merge 3 commits into
releasefrom
skramer/tpxo-updates
Open

stephankramer wants to merge 3 commits into
releasefrom
skramer/tpxo-updates

Conversation

@stephankramer

Copy link
Copy Markdown
Contributor

This PR introduces a number of changes in TPXOTidalBoundaryForcing related to uptide recent improvements:

  • Thetis to use longitudes -180<=lon<180 when calling uptide, so that we can compute a lon.min() to lon.max() range for domains wrapping the zero meridian. Previously uptide required longitudes to be in the same range, .e.g. 0<lon<360, as was used in the netcdf file and it didn't interpolate correctly at the wrap around point, which effectively meant that using the global 1/6 degree TPXO solution it would not interpolate any point 0<lon<1/6, and Thetis would silently zero such boundary points (see next item)
  • Thetis to not silence uptide interpolation errors. Previously Thetis would simply zero these points, now we let uptides exception pass through so it can be dealt with by the user. If you want the previous behaviour use zero_missing_points=True
  • Uptide now also supports TPXO in the high-resolution atlas format in which the data files are separated per constituents. This can now also be used in TPXOTidalBoundaryForcing by specifying e.g. elev_file='h_{con}_tpxo10_atlas_30_v2.nc' where con will be substitude by the requested constituent names
  • Pending on Enable velocities from TPXO atlas and unit conversion stephankramer/uptide#19 you can now also specify uv_file='u_{con}_tpxo10_atlas_30_v2.nc' for velocities or transports. Uptide will be able to compute a velocity also if only transports are available by dividing transports by TPXO's own hu/hv depths. Therefore in Thetis TPXOTidalBoundaryForcing you now have to specify if you want transports instead of velocities, whereas previously what you got depended on TPXO version
  • Previously velocities or transports where returned by uptide in whatever units where used in the specific TPXO version, which varied a lot: m/s vs cm/s for velocities and m^2/s and cm^2/s for transports. Now uptide and thus TPXOTidalBoundaryForcing will always return m/s (velocity) or m^2/s (transport) and do a conversion if needed.

This is used in the high-resolution atlas version of TPXO. Also converts
"mm" such that elevations are always returned in meters.
BREAKING CHANGE: previously uptide's TPXOncTidalComponentInterpolator
returned velocities or transport in whatever units where used in TPXO -
e.g. in tpxo9 it uses cm/s for velocities but m^2/s for transports, but
TPXO10 atlas version it uses cm^2/s for tranports. With
stephankramer/uptide#19 uptide will always return
velocities in m/s and transports in m^2/s with conversion
if needed. That uptide PR also enables choosing between velocity 'u',
'v' or transport 'U', 'V', and if only transports are provided but
velocity is asked for it computes the velocity from the transport by
using TPXO's hu/hv depths. Thus in Thetis' TPXOTidalForcing you can now
specify whether you want to interpolate velocities into the uv_field or
transports - where in the latter case you can, yourself, divide by the higher
resolution bathymetry on the computational mesh instead of TPXO's.
@stephankramer

Copy link
Copy Markdown
Contributor Author

Currently sits on release for testing, but plan to merge into main

Since stephankramer/uptide@aff505d
uptide accepts longitude in arbitrary modulus range of 360, so we
no longer have to use positive longitudes but can use standard
-180<=lon<=180. This has the advantage that for models straddling the
0-meridian, the longitude range is correctly computed by simply taking
the min and max. This range is used by uptide to determine which part of
the global grid is read in and more importantly at every timestep it
computes the tide at all these grid points in the range. So previously
for a region with say -4<lon<6, we'd convert to positive longitude,
giving 0<lon<6 or 356<lon<360 - so the min, max range would come out as
0-360, i.e. uptide would compute the tide on all netcdf gridpoints over
the entire width og the global mesh (but within the latitude range).

That merge also fixes a bug in the wrapping around of the global grid:
the TPXO global grid ranges from 1/6<=lon<=360 (i.e. the lon=360 degree is not
repeated with a lon=0 column). Points that were in the 0<lon<1/6 range
would fail to interpolate. Uptide would raise an error, but Thetis (used
to) ignore it and set it to zero. The wrapping bug has been fixed in
uptide, so 0<lon<1/6 points are correctly interpolated. To avoid such
bugs being silenced, this commit changes Thetis to *not* silence these
interpolation exceptions. If you want the old behaviour (because say
your regional tidal grid doesn't entirely cover your model region and you
know you're fine with points outside being zeroed) use
zero_missing_points=True in the TidalBoundaryForcing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant