begin data gag_scratch:add.map
  symb &1 "'&1' &2"
end data gag_scratch:add.map
!
if (.not.exist(myflux%)) then
  clean\read uv &1
  clean\read model &2
  defin integer DIM[5]
  sic\compute dim dimof UV
  clean\flux_scale FIND 2
!!  FLUX APPLscale myvar
  define structure myflux% /global
  define double myflux%uv /like UV /Global
  define real myflux%weight /like UV /Global
  define integer myflux%n /global
  myflux%uv = uv
  for j 1 to dim[2]
    let myflux%weight[j] myflux%uv[10,j]
  next
  !
  sic\compute dim dimof flux
  symb var flux[1]
  symb step d_flux[1]
  for i 2 to dim[1]
    @ gag_scratch:add.map var flux['i']
    @ gag_scratch:add.map step d_flux['i']
  next
  let myflux%n dim[1]
endif
!
begin procedure my_proc
   clean\flux_scale APPLY MyVar
   let adj%res Myflux%UV-MyVar
end procedure my_proc
!
adjust\adjust myflux%UV "@ my_proc" /start /par 'var' /root adj /step 'step' /meth slatec /weight myflux%weight
!
let flux adj%par
let d_flux adj%errors
for i 1 to myflux%n
  say "Scale" i  flux[i] " +/-" d_flux[i] /format A I2 F10.3 A F6.3
next
!
