! SCTCMD PROGRAM MAGNET CESR.CESR SBP 88.10.07 ! Sets any cesr chopper type magnet variables found to have command ! not equal to hardware scaler value, to the scaler value ! sctcmd n m => correct if diff gt n , tell if diff gt m program sctcmd use sim_utils implicit none integer:: dlim,dtell integer:: nt,be(10),en(10),typs(10),ints(10) real:: vals(10) character*200:: invoke logical:: err call cesr_getarg(0,invoke) !0 => whole line, get prog invocation call parseme(invoke,nt,be,en,typs,ints,vals,err) !breakdown string dlim=1 ; dtell=6 !correct if err>1 ; type if err>6 if (len_trim(invoke).gt.0) then !user args if((nt.gt.0).and.(typs(1).eq.2)) dlim=ints(1) if((nt.gt.1).and.(typs(2).eq.2)) dtell=ints(2) endif call mnet_connectf('MAGNET') !get in touch with hardware call prcnam('sctcmd') call more_sca_to_cmd(dlim,dtell) !correct if gt 1 err, type if gt 6 call mnet_disconnectf !so mpm_byebye omits traceback stop end program