! bn_4d_gather_4d_din.jnl
! 2/2017

! force a split/gather operation due on multi-axis @din

set mode diag

define axis/x=1:200:1 xax
define axis/y=1:200:1 yax
define axis/z=1:200:1 zax
define axis/T=1:200:1 tax
let xyz = 0*X[gx=xax] + 0*Y[gy=yax] + Z[gz=zax]

* note: SUM of Z is N*(N+1)/2 = 20100
* area integral in XY is 200*200=40,000
* total integral is 804,000,000 (8.04*E8)

* 3D XYZ test
* 2d slice size = 200*200 = 40,000
* 3d full size is 8,000,000  - so 10,000,000 is bigger
set mode desp: 10000000    ! big: no need to split/gather
stat xyz[x=@din,y=@din,z=@din]

! again -- this time force split/gather because 
cancel memory/all
set mode desp: 2000000  ! 2,000,000 small -- requires split/gather

! will split into 4 pieces (1/4 of 8,000,000 fits into 2,000,000)
! so z=1:50; then =51:100, Z=101:150, Z=151:200
stat xyz[x=@din,y=@din,z=@din]


