MITgcm / xmitgcm

Read MITgcm mds binary files into xarray
http://xmitgcm.readthedocs.io
MIT License
56 stars 65 forks source link

The binary files time cannot be read correctly due to int32 #334

Open mini-DONG opened 9 months ago

mini-DONG commented 9 months ago

Hi! xmitgcm can read MITgcm mds binary files fastly, and I use it a lot. But I meet a problem recently, I run the MITgcm model for 100 years. Then I used xmitgcm to read the model output like:

from xmitgcm import open_mdsdataset
ds = open_mdsdataset(
                     r'G:\exp\ctrl',
                     r'G:\exp',
                     iters=[8953200],
                     delta_t=240)

I find the time is negative: 1702626570349 There is no problem with the output before this moment. I noticed that the iter use the int32 which cover -2,147,483,647~2,147,483,647. But the 8953200*240=2148768000 which is greater than the maximun of int32 . So, may be we need the int64 to solve the problem. And what should I do to read the time correctly?