!   shogap.mac
!   Plots line graphs of field items in the air
!   based on the evaluation of torque by _torqcir.mac
!
!
!    arg1 = 1, plot Br
!         = 2, plot torque integran
!         = 3, plot torque integral
!    arg2 = starting angle for the B-radial plot (defaults to 0)
!    arg3 = ending angle for the B-radial plot (defaults to 360)          
*if,_tr_cal,ne,1,then
/out
  *msg,error
  The TORQUE calculation must FIRST be performed using the toolbar

*else

 *if,arg1,eq,0,then
   arg1=1
 *endif
/grid,1
/gthk,curve,2
/num,-1
/axlab,x,Angle (D) (from -X,CCW)
*vscfun,_las_ang,max,t_path(1,3)
*if,_las_ang,le,180,then
/axlab,x,Angle (D) (CCW) from Model Edge
*endif
*if,arg3,ne,0,then
  *if,arg3,gt,_las_ang,then
   arg3=_las_ang
  *endif
  _las_ang=arg3
*endif
*if,arg2,ne,0,then
   _str_ang=arg2
*endif
/xran,_str_ang,_las_ang
*if,arg1,eq,1,then
 /axlab,y,B_radial (T)
 *vplot,t_path(1,3),t_path(1,4)
 /nopr
 /out,bradial,sum
 *vwrite,t_path(1,3),t_path(1,4)
 (2f15.6)
 /out
 /out,shogap,sum
 *msg,info,_i_s
 Number of Br data points written to file BRADIAL.SUM: %i
 /out
 *uili,shogap,sum
 /gopr
*elseif,arg1,eq,2,then
 /axlab,y,R   Br   Bt  (torque/circum.)
 *vplot,t_path(1,3),t_path(1,5)
*elseif,arg1,eq,3,then
 /axlab,y,Torque Integral  (N-m)
 *vplot,t_path(1,3),t_path(1,6)
*endif
/xran
/grid
/gthk,curve,1
/num,1

*endif
  _str_ang=  $ _las_ang=