! bn_dp_readscale.jnl
! 9-Feb-2006 ACM

! When there is a double precision variable, 
! and when the user specifies an offset, read the
! variable in double precision, apply the offset and
! then convert to single precision.  When plotting
! the user specifies the offset to add back to the
! axis labels.

set list/prec=8

use adouble.nc

list xax
let xlon = 140

! Now read xax with an offset
set var/offset=`-1*xlon` xax
can mem

list xax

! define an axis from xax
define axis/x/units=lon xir = xax
let pvar = yvar[gx=xir@asn]

! Plot, adding back the offset on axis labels.
plot/set/color=red/line/sym=22 pvar
ppl xvaloff `xlon`
ppl plot

! Test a 2-D double precision variable
can data/all
use adouble_2D.nc
set var/offset=`-1*xlon` xax
list xax

cancel list/precision
