/out,b_mach3d,out
_err=0
*if,arg5,eq,1,then
*ask,desnam,Parameter file name,0
*get,_ty,parm,desnam,type
*if,_ty,ne,3,then
_err=1
/nerr
*msg,error
The file name must be Character data. If the name is entered&
directly, it must be enclosed in single quotes. A parameter&
which has character data can also be entered. No action
*endif
arg1=desnam
*endif
*if,_err,eq,1,:end
/nerr,0,1e5
fini
/cle,all
abbr,,mabbr3d,mac
_arg1=arg1
*get,_targ1,parm,_arg1,type
*if,_targ1,ne,3,then
arg1='mach3d'
*endif
*set,_cpu
*dim,_cpu,,7
/inp,%arg1%,des
*get,_cpu(1),active,,time,wall
use_53=0
*if,rotor_id,eq,'pmrotor',then
pm_rotor,rref,,nrpgen,,r_mesh
*else
/nerr
*msg,error
The rotor ID being specified is not available or is specified incorrectly
/out,b_mach3d,out,,append
/nerr,0,1e5
*endif
/out,b_mach3d,out,,append
*get,_cpu(2),active,,time,wall
*if,stat_id,eq,'slotsta',then
slotsta,0,stref,,nspgen,,,s_mesh
*elseif,stat_id,eq,'rslotsta',then
rslotsta,0,stref,,nspgen,,,s_mesh
*else
/nerr
*msg,error
The stator ID being specified is not available or is specified incorrectly
/out,b_mach3d,out,,append
/nerr,0,1e5
*endif
/out,b_mach3d,out,,append
*get,_cpu(3),active,,time,wall
save,m_2d,db
mach3d,r_stk,m_stk,s_stk,n_div3d,skew_ang
*get,_cpu(4),active,,time,wall
/out,b_mach3d,out,,append
*if,nrpgen,lt,nrp,then
_mg1=1
pmach3d,1
_mg1=0
*endif
/out,b_mach3d,out,,append
*get,_cpu(5),active,,time,wall
*get,_twfile,parm,w_file,type
*if,_twfile,ne,3,then
arg2=1
*else
_optwnd=0
*if,skew_ang,gt,0,then
*get,_tskew,parm,skew_stk,type
*if,_tskew,eq,3,then
*if,skew_stk,eq,'stator',then
_optwnd=1
*endif
*endif
*endif
*endif
*if,arg2,eq,0,then
/nerr,0,1e5
gen_arc=1
*set,_in_wnd
*dim,_in_wnd,,12
_in_wnd(1)=ax_clear,coil_w,coil_h,180/nsp,maxslotr,nsp
*set,_in_wndc
*dim,_in_wndc,char,2
_in_wndc(1)=w_file,'s_iron'
_n_prom=1
b_wndsc
_n_prom=0
*endif
/out,b_mach3d,out,,append
*get,_cpu(6),active,,time,wall
_mg1=1
fmagbc,'s_iron'
_mg1=
save,%arg1%,db
/out,b_mach3d,out,,append
*if,skew_ang,gt,0,then
skew,skew_ang,skew_stk
*endif
/out,b_mach3d,out,,append
*get,_cpu(7),active,,time,wall
fitplot
alls
/pnum,mat,1
/num,1
/view,1,1,1,1
/auto
eplo
save,%mname%,db
*if,arg3,gt,0,then
_mg1=1
mvrot3d,arg3,1
_mg1=
mvpsol
fini
/post1
tor_3d
*endif
*stat,_cpu
:end
/out