! err751_show_grid_expr.jnl
! Issue 1961: show grid should say **full** not **compressed** for x,y axes.
! 12/4/2019

use coads_climatology
let var =  sst - sst[x=@ave,y=@ave]
! previously this said compressed for the X and Y axes.
show grid var

! The axes are not compressed...
say `var,return=shape`
list/x=180/y=0 var

! More examples extending the tests in bn_show_uvar_grid

use coads_climatology
let test = sst[x=240:320,y=0,t=@ave] + 6
show grid test

! Modulo axes ask for superset
let var = sst[x=0:540,L=1:15] - sst[x=0:540,y=@ave,L=1:15]
show grid var

let var = sst - sst[x=240,y=@iin,t=@ave] 
show grid var

! Result grid is full grid
let var = sst[L=@ave] - sst[x=@max] - sst[y=0]
show grid var

! transform on single-point range is equiv. to single-point subset

cancel mode interpolate  ! otherwise single-pt range fails
let var = sst - sst[X=30@max]
show grid var

set mode/last interpolate
let var = sst - sst[X=30:30.1@max]
show grid var

! dynamic grid
let var = sst[y=-10:10:.1,l=1,x=160e] - sst[y=-10,l=@ave,x=160e]
show grid var

! striding
let var = sst[i=1:180:3,j=1:90:2] - sst[x=@ave,y=@ave]
show grid var

! regridding

use coads_vwnd
define axis/t=1-jan-1980:31-dec-1982:1/units=days dax
let vwnd_days = vwnd[gt=dax,t=1-jun-1982:15-jul-1982] - vwnd[gt=dax,t=1-jun-1982:15-jul-1982,x=@ave,y=@ave]
sh grid vwnd_days


let vwnd_clim = vwnd[gt=month_irreg@mod] - vwnd[gt=month_irreg@mod,x=@ave,y=@ave]
sh grid vwnd_clim[L=4:9]

can dat/all
use coads_climatology

! non-compressing transforms

let var = sst[y=@iin] - sst[x=@ave,y=@ave]
show grid var

let var = sst[y=-30:30@iin] - sst[x=@ave,y=@ave]
show grid var

use levitus_3d_subset
let var = temp[z=@weq:20] - temp[x=@ave,y=@ave]
show grid var

let var = temp[z=1:120@weq:20] - temp[x=@ave,y=@ave]
show grid var


