Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpxo compatibility in different grid longitude formats #112

Open
BahramKhazaei-NOAA opened this issue Dec 14, 2023 · 4 comments
Open

tpxo compatibility in different grid longitude formats #112

BahramKhazaei-NOAA opened this issue Dec 14, 2023 · 4 comments

Comments

@BahramKhazaei-NOAA
Copy link

BahramKhazaei-NOAA commented Dec 14, 2023

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.

@cuill
Copy link
Member

cuill commented Dec 14, 2023

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

@BahramKhazaei-NOAA
Copy link
Author

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
Copy link
Author

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

@cuill
Copy link
Member

cuill commented Dec 15, 2023

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

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

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

No branches or pull requests

2 participants