pyschism icon indicating copy to clipboard operation
pyschism copied to clipboard

tpxo compatibility in different grid longitude formats

Open BahramKhazaei-NOAA opened this issue 1 year ago • 4 comments

I realized that when I use longitude values in range (-180,180) pyschism generates different bctides.in compared to a case that I use the same grid but with longitudes translated into range (0, 360). That also results in erroneous simulation results by the model (in a 2D tide-only case).

I'm using tpxo as source. My grid covers Alaska and overlaps with dateline.

Just a note that we had discussions about this before and my recollection is that pyschism internally makes the translation to avoid this, but opened this issue to figure out where this error comes from.

BahramKhazaei-NOAA avatar Dec 14 '23 14:12 BahramKhazaei-NOAA

@BahramKhazaei-NOAA I tested with Pacific hgrid. Both ranges generated the same bctides. Would you mind sharing your hgrid?

cuill avatar Dec 14 '23 15:12 cuill

I'm comparing these two:

(-180, 180) range --> Not working BS_mesh_v1.14_updatedBC.zip

(0, 360) range --> Working BS_mesh_v1.14_updatedBC_0_360.zip

Thank you for your help.

BahramKhazaei-NOAA avatar Dec 15 '23 02:12 BahramKhazaei-NOAA

And here are the bctides and their difference: bctides.zip

BahramKhazaei-NOAA avatar Dec 15 '23 02:12 BahramKhazaei-NOAA

@BahramKhazaei-NOAA It looks like the conversion from [0, 360) to [-180, 180) is wrong.

It should be: lon[lon>180] -= 360

cuill avatar Dec 15 '23 19:12 cuill