darothen / xbpch

xarray interface for bpch files
MIT License
17 stars 5 forks source link

conflicting sizes for dimension in reading bpch #22

Open Rainbow1994 opened 4 years ago

Rainbow1994 commented 4 years ago

Hi there, when i used open_bpchdataset module to open the ND51 output files of GEOS-Chem (V12.5.0), it turns out there is error about dimension dismatch. image The spatial resolution of my similation is 2x2.5. Is there anything wrong with my tracerinfo.dat? image

Thanks in advance!

Best, rainbow

FeiYao-Edinburgh commented 9 months ago

While it's been some time since @Rainbow1994 first posted the question, I believe it's still worthwhile to share my solution here for future reference. The error prompt indicates a dimension mismatch between the data and the coordinates. Specifically, you're running a 2x2.5 global simulation, which gives you a longitude coordinate of length 144. However, your ND51 diagnostics are reduced to a size of 72 likely because you've used the default setting of 08: IMIN, IMAX of region : 1 72 in the ND51 MENU? Therefore, it's not surprising that the xbpch package would flag a dimension mismatch. Other packages like PseudoNetCDF would do the same. However, with PseudoNetCDF, you can access the underlying data, dims, coords, etc., which allows you to correct the coords and construct the data yourself using the xarray.DataArray. There should be no issues with your tracerinfo.dat and diaginfo.dat files.

All the best, Fei