OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
245 stars 120 forks source link

About reading xarray.dateset into model #1081

Closed QidiMa closed 1 year ago

QidiMa commented 1 year ago

Hi all,

It should be quite obvious but I'm a beginner with OpenDrift, apologies! I want to read directly xarray.dataset and let it into model .What should I do.

Thanks a lot! Best regards,

knutfrode commented 1 year ago

Hi, This is presently not possible, but a functionality we should soon add. A temporary workaround would be to write your dataset to a file, and then open this with reader_netCDF_CF_generic.

Another workaround would be to use reader_constant_2d.py: https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/reader_constant_2d.py

QidiMa commented 1 year ago

Thank you very much!