!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! @ c-old-slice
!
! &1: gtvl directory name for more complex plots
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
begin data gag_scratch:p-old-slice.init
  ! Parameter file for SLICE task
  task\file "Input file name" INPUT_MAP$   'name'"."'type'
  task\file "Output file name" OUTPUT_MAP$ 'name'".pv"
  task\character "Starting point" START$ 'true%slice%u[1,1]'" "'true%slice%u[2,1]'
  task\character "Ending point"   END$   'true%slice%u[1,2]'" "'true%slice%u[2,2]'
  task\go
end data gag_scratch:p-old-slice.init
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Define recovery behavior
on error return base
!
define character action*5
let action "&1"
!
! Pre-processing
if (action.ne."inter") then
   go\oldload 'name' /syntax hgdf /in aaa1
endif
!
@ l-old-position.cube aaa1 do%slice true%slice 2d
if ((true%slice%p[1,1].eq.true%slice%p[1,2]).and.(true%slice%p[2,1].eq.true%slice%p[2,2])) then
   message e slice "Begin and end points must differ"
   return
endif
! Some boundary checks needed here...
!
!
let true%slice%u[1,]  12*(aaa1%a0+true%slice%r[1,]/cos(aaa1%d0))/pi
let true%slice%u[2,] 180*(aaa1%d0+true%slice%r[2,])/pi
!
vector\run slice gag_scratch:p-old-slice.init /nowindow
sic rename 'name'".pv" 'cube%dir%tmp'"/"'name'".pv"
vector\header 'cube%dir%tmp'"/"'name'".pv" /extrema
!
! Post-processing
if (action.ne."inter") then
   set\panel /default
endif
!
! if exist(bbb1) then
!    delete /var bbb1
! endif
! define image bbb1 'cube%dir%tmp'"/"'name'".pv" read /global
go\oldload 'name'".pv" /syntax hgdf /in bbb1
greg1\limits /rgdata bbb1
greg1\set box square
greg2\plot bbb1 /scal lin true%scale[1] true%scale[2]
@ l-old-box-setup.cube bbb1 image
@ l-old-box.cube label bbb1
greg2\wedge right
!
! Go to root directory
if (action.ne."inter") then
   gtvl\change directory <greg
endif
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
