Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Alexander-Barth/NCDatasets.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Feb 11, 2019
2 parents 16314e4 + fde355a commit 8bf55d3
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 8bf55d3

Please sign in to comment.