rcaneill / xnemogcm

Interface to open NEMO global circulation model output dataset with xarray and create a xgcm grid.
https://xnemogcm.readthedocs.io/
MIT License
21 stars 10 forks source link

why require xgcm? #2

Closed rabernat closed 4 years ago

rabernat commented 4 years ago

Hi @rcaneill! Thanks for providing this awesome package. (@roxyboy just showed it to me.)

I like the analogy of xmitgcm : MITgcm :: xnemogcm : nemo

However, I'm confused why you depend on xgcm? In contrast, xmitgcm doesn't require or depend on xgcm, although they are compatible.

rcaneill commented 4 years ago

Hi @rabernat, thanks for your enthusiasm!

When I was looking for a name for this tool, I just thought: "why searching a new name when I can just combine nemo and xmitgcm!".

However, I'm confused why you depend on xgcm? In contrast, xmitgcm doesn't require or depend on xgcm, although they are compatible.

This is an excellent question.
The first point is that at the very beginning I wrote the code for my own usage before thinking on how to share it, so some stuff are still very messy. I used to have a bigger library that was opening the NEMO datasets, creating the xgcm grid and performing analysis. I decided afterwards to split it into a package that opens the data (xnemogcm) and a package that will perform computation (xbasin package, that is empty for the moment).
The second point is that I work with terrain following coordinates that I need to interpolate to a constant grid, but NEMO does not output the depth of all the grid cells, only the scale factors. Thus the depth are computed from the scale factors in the open_domcfg function (this part works but is not very clean yet). I use xgcm in this computation.

Maybe I should set xgcm as an optional library, needed only if the user explicitly asks for this depths computation. I don't really know what would be the best option.

rcaneill commented 4 years ago

I close this issue as xnemogcm does not use xgcm anymore. No depth is computed from the scale factors: this is done in https://github.com/rcaneill/xbasin (work in progress).