xoceanmodel / xroms

Work with ROMS ocean model output with xarray
https://xroms.readthedocs.io/
MIT License
62 stars 39 forks source link

Bug in derived.py for uv_geostrophic function of XROMS #63

Closed ak11283 closed 9 months ago

ak11283 commented 9 months ago

Dear All,

I started to analyze my CROCO output by using XROMS. Really I loved it, it is amazing for calculation of several physical variables in a very efficient and smart way specially for curvilinear grid system.

Recently, I tried to calculate the geostrophic current and I found that in the derived.py the surface zonal geostrophic current are calculated as ug = (-g * dzetadxi / to_u(f, xgrid, hboundary=hboundary, hfill_value=hfill_value).

However in ROMS the xi represent the X direction and eta represent the Y direction so basically the derivative of zeta with respect to xi shall represent vg instead of ug.

It is my understanding, if some thing I am missing please correct me.

Thank you.

Anurag

kthyng commented 9 months ago

@hetland Can you take a look at this?

hetland commented 9 months ago

Yup, these are indeed backwards. We put that in since we figured it would be useful, but we never used it for our work.

@ak11283 Do you want to fix it and send in a pull request?

ak11283 commented 9 months ago

Hi Rob and Kristen,

Thanks for your reply. Yes, shall fix it as soon as possible and shall send in a pull request.

kthyng commented 9 months ago

Hi @ak11283, there is now a new release of xroms on pypi (v0.6.0) that has this change. Please check it out! It will soon be available on conda-forge, too.