File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1313from parcels ._core .utils .time import is_compatible as datetime_is_compatible
1414from parcels ._typing import Mesh
1515from parcels .field import Field , VectorField
16+ from parcels .tools .converters import Geographic , GeographicPolar
1617from parcels .tools .loggers import logger
1718from parcels .xgrid import XGrid
1819
@@ -206,8 +207,15 @@ def from_copernicusmarine(ds: xr.Dataset):
206207 autoparse_metadata = False ,
207208 )
208209 )
209- fields = {}
210- for varname in ds .data_vars :
210+
211+ U = Field ("U" , ds ["U" ], grid )
212+ V = Field ("V" , ds ["V" ], grid )
213+
214+ U .units = GeographicPolar ()
215+ V .units = Geographic ()
216+
217+ fields = {"U" : U , "V" : V }
218+ for varname in set (ds .data_vars ) - set (fields .keys ()):
211219 fields [varname ] = Field (varname , ds [varname ], grid )
212220
213221 if "U" in fields and "V" in fields :
You can’t perform that action at this time.
0 commit comments