Skip to content

Commit 35208be

Browse files
authored
Merge pull request #1758 from knutfrode/dev
Fixed bug regarding writing buffer with no time steps to disk
2 parents b739e9e + c657e43 commit 35208be

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

opendrift/export/io_netcdf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def write_buffer(self):
4747
self._netCDF_encoding = encoding
4848
return
4949

50+
if self.result.sizes['time'] == 0:
51+
logger.debug('No new time steps to write')
52+
return
53+
5054
self.outfile = Dataset(self.outfile_name, 'a') # Re-open file at each write
5155
numtimes = self.outfile['time'].shape[0]
5256

0 commit comments

Comments
 (0)