|
|
If some output is missing for a specific analysis, it might be possible to find this output in the restart files. To open these restart files in a meaningful way, the patches within a multifile restart file need to be merged.
|
|
|
|
|
|
```python
|
|
|
import xarray as xr
|
|
|
|
|
|
def patch_reader(ds):
|
|
|
ds = ds.assign_coords({'ncells': ds['global_cell_indices'].squeeze(drop=True)})
|
|
|
ds = ds.drop(['global_vert_indices', 'global_edge_indices', 'global_cell_indices', 'vn.TL1', 'vt', 'grf_tend_vn', 'ddt_vn_phy' ,'vn.TL3', 'vn.TL4'])
|
|
|
return ds
|
|
|
|
|
|
ds=xr.open_mfdataset('patch1_*.nc', preprocess=patch_reader, concat_dim='ncells', combine='nested')
|
|
|
``` |