Skip to content

Commit

Permalink
corrects bug due to compression in obs file
Browse files Browse the repository at this point in the history
forgot to remove the compression for the observed flow file which raises a RuntimeError: NetCDF: Invalid argument in parallel computing
  • Loading branch information
ThibHlln committed Nov 12, 2018
1 parent 3239319 commit 601a29e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions smartpy/inout.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ def write_flow_netcdf_file_from_dict(timeframe, discharge, netcdf_file, report,
with Dataset(netcdf_file + '.nc', 'w', format='NETCDF4', parallel=parallel) as my_file:
my_file.description = "Discharge file generated with SMARTpy v{}.".format(__version__)
my_file.createDimension('DateTime', None)
t = my_file.createVariable("DateTime", np.float64, ('DateTime',), zlib=True)
t = my_file.createVariable("DateTime", np.float64, ('DateTime',))
t.units = 'seconds since 1970-01-01 00:00:00.0'
my_file.createVariable('flow', np.float64, ('DateTime',), zlib=True, complevel=5)
my_file.createVariable('flow', np.float64, ('DateTime',))

my_file.variables['DateTime'][0:len(my_list_datetime[1:])] = \
(np.asarray(my_list_datetime[1:], dtype='datetime64[us]') - np.datetime64('1970-01-01T00:00:00Z')) / \
Expand Down
2 changes: 1 addition & 1 deletion smartpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# along with SMARTpy. If not, see <http://www.gnu.org/licenses/>.


__version__ = '0.1.4'
__version__ = '0.1.4-1'

0 comments on commit 601a29e

Please sign in to comment.