!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! @ p_corner.greg
! J.Pety 2004
!
! &1: aaa
! &2: center
! &3: size
!
! Hyp: cube is lmv-ordered.
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
for i 1 to 2
   !
   ! First find iblc and itrc
   !
   if (&3[i].eq.0) then
      let iblc[i] 1
      let itrc[i] &1%dim[i]
   else
      if (&1%convert[3,i].gt.0) then
         let sblc[i] '&2[i]-&3[i]/2'
         let strc[i] '&2[i]+&3[i]/2'
      else if (&1%convert[3,i].lt.0) then
         let sblc[i] '&2[i]+&3[i]/2'
         let strc[i] '&2[i]-&3[i]/2'
      else
         say " "
         message e corner "&1%convert[3,"'i'"] is zero valued"
         say " "
         return base
      endif
      let rblc[i] sblc[i]*sec
      let rtrc[i] strc[i]*sec
      let iblc[i] &1%convert[1,i]+(rblc[i]-&1%convert[2,i])/&1%convert[3,i]
      let itrc[i] &1%convert[1,i]+(rtrc[i]-&1%convert[2,i])/&1%convert[3,i]
      let iblc[i] max(iblc[i],1)
      let itrc[i] min(itrc[i],&1%dim[i])
   endif
   !
   ! Then define rblc, rtrc, sblc and strc accordingly to ensure concordance...
   !
   let rblc[i] &1%convert[2,i]+(iblc[i]-&1%convert[1,i])*&1%convert[3,i]
   let rtrc[i] &1%convert[2,i]+(itrc[i]-&1%convert[1,i])*&1%convert[3,i]
   let sblc[i] rblc[i]/sec
   let strc[i] rtrc[i]/sec
next
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
