Closed brey closed 1 year ago
a "naive" way to do this is to use something like this:
d = xr.open_dataset('./sflux/sflux_air_1.0001.nc')
d1 = d.isel(ny_grid=slice(2560,5120))
d2 = d.isel(ny_grid=slice(0, 2560))
d1['lon'] = d1.lon - 360.
new = xr.concat([d1, d2], dim="ny_grid")
new.to_netcdf('./sflux/sflux_air_1.0001.nc')
The downside of this approach is that it doubles the RAM requirements. I.e. if sflux_air_1.0001.nc
is 26GB then we need 52GB of RAM in order to fix the longitude.
I haven't tried it but, but I assume that the conversion would be more efficient if the fix was applied directly on the input meteo file (e.g. 20220713.00.tropical_cyclone.grib
).
Based on private communication with Joseph starting from v5.9 the mesh needs to be consistent with the meteo.
That is, if the mesh is [-180,180]/[0,360] so must be the meteo forcing.
Include a check and shift if needed.