Skip to content

Commit

Permalink
fix issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Feb 9, 2019
1 parent 06eea72 commit fde355a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/NCDatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1406,12 +1406,17 @@ end

function ncgen(io::IO,fname; newfname = "filename.nc")
ds = Dataset(fname)
unlimited_dims = unlimited(ds.dim)

print(io,"ds = Dataset(\"$(escape(newfname))\",\"c\")\n")

print(io,"# Dimensions\n\n")
for (d,v) in ds.dim
print(io,"ds.dim[\"$d\"] = $v\n")
if d in unlimited_dims
print(io,"ds.dim[\"$d\"] = Inf # unlimited dimension\n")
else
print(io,"ds.dim[\"$d\"] = $v\n")
end
end

print(io,"\n# Declare variables\n\n")
Expand Down

0 comments on commit fde355a

Please sign in to comment.