! err71_save_rigid.jnl
! Ticket 2513: SAVE/RIGID with irregular axis wrote a bad file.

! Define a variable on an irregular axis.

let var = {123, 234, 345, 456, 567, 678, 789}
define axis/t/t0=1-jan-2015/units=day tax = \
{ 312.1, 312.7, 313.4, 314.2, 314.7, 315.4, 316.1}

let vart = reshape(var, t[gt=tax])

! Save with /RIGID. Previously this wrote a file with
! both bounds and edges attributes on the time axis. 
! It wrote the edges variable, not the bounds.

! Starting with this version, write bounds if needed when
! writing with /RIGID. Only write edges if they said /EDGES.

save/clobber/rigid/file=a.nc vart
sp ncdump a.nc

cancel var/all

! The grid was messed up - this gave an error
use a
show grid vart

