Skip to content

Commit

Permalink
PISM.testing.create_scalar_forcing(): don't overwrite the output file
Browse files Browse the repository at this point in the history
This way we can store more than one time-series on the same file.
  • Loading branch information
ckhroulev committed Sep 9, 2020
1 parent cefa76c commit 61bf047
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site-packages/PISM/testing.py
Expand Up @@ -47,7 +47,10 @@ def create_scalar_forcing(file_name, variable_name, units, values, times, time_b
for k in range(len(values)):
times.append(time_bounds[2 * k + 1])

output = PISM.File(ctx.com, file_name, PISM.PISM_NETCDF3, PISM.PISM_READWRITE_CLOBBER)
try:
output = PISM.File(ctx.com, file_name, PISM.PISM_NETCDF3, PISM.PISM_READWRITE)
except:
output = PISM.File(ctx.com, file_name, PISM.PISM_NETCDF3, PISM.PISM_READWRITE_CLOBBER)

output.define_dimension(time_name, len(times))

Expand Down

0 comments on commit 61bf047

Please sign in to comment.