!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
begin data gag_scratch:uv-fit.init
  !
  task\character "UVtable name"   UVTABLE$ 'name'".uvt"
  task\integer   "Channels: first, last (0,0 for all)" CHANNEL$[2]  'first' 'last'
  task\real      "UV range (max, min) in meters"  UV_RANGE$[2] 'uvfit%range[1]' 'uvfit%range[2]'
  task\integer   "Number of functions" NF$ 'uvfit%nf'
  !
  task\character "Function #1"       FUNCT01$    'uvfit%funct01'
  task\real      "Parameters"        PARAM01$[7] 'uvfit%param01[1]' 'uvfit%param01[2]' 'uvfit%param01[3]' 'uvfit%param01[4]' 'uvfit%param01[5]' 'uvfit%param01[6]' 'uvfit%param01[7]'
  task\real      "Starting range"    RANGE01$[7] 'uvfit%range01[1]' 'uvfit%range01[2]' 'uvfit%range01[3]' 'uvfit%range01[4]' 'uvfit%range01[5]' 'uvfit%range01[6]' 'uvfit%range01[7]'
  task\integer   "numb. of starts"   START01$[7] 'uvfit%start01[1]' 'uvfit%start01[2]' 'uvfit%start01[3]' 'uvfit%start01[4]' 'uvfit%start01[5]' 'uvfit%start01[6]' 'uvfit%start01[7]'
  task\logical   "Subtract function" SUBSF01$    'uvfit%subsf01'
  !
  if (uvfit%nf.ge.2) then
     task\character "Function #2"       FUNCT02$    'uvfit%funct02'
     task\real      "Parameters"        PARAM02$[7] 'uvfit%param02[1]' 'uvfit%param02[2]' 'uvfit%param02[3]' 'uvfit%param02[4]' 'uvfit%param02[5]' 'uvfit%param02[6]' 'uvfit%param02[7]'
     task\real      "Starting range"    RANGE02$[7] 'uvfit%range02[1]' 'uvfit%range02[2]' 'uvfit%range02[3]' 'uvfit%range02[4]' 'uvfit%range02[5]' 'uvfit%range02[6]' 'uvfit%range02[7]'
     task\integer   "numb. of starts"   START02$[7] 'uvfit%start02[1]' 'uvfit%start02[2]' 'uvfit%start02[3]' 'uvfit%start02[4]' 'uvfit%start02[5]' 'uvfit%start02[6]' 'uvfit%start02[7]'
     task\logical   "Subtract function" SUBSF02$    'uvfit%subsf02'
  endif
  if (uvfit%nf.ge.3) then
     task\character "Function #3"       FUNCT03$    'uvfit%funct03'
     task\real      "Parameters"        PARAM03$[7] 'uvfit%param03[1]' 'uvfit%param03[2]' 'uvfit%param03[3]' 'uvfit%param03[4]' 'uvfit%param03[5]' 'uvfit%param03[6]' 'uvfit%param03[7]'
     task\real      "Starting range"    RANGE03$[7] 'uvfit%range03[1]' 'uvfit%range03[2]' 'uvfit%range03[3]' 'uvfit%range03[4]' 'uvfit%range03[5]' 'uvfit%range03[6]' 'uvfit%range03[7]'
     task\integer   "numb. of starts"   START03$[7] 'uvfit%start03[1]' 'uvfit%start03[2]' 'uvfit%start03[3]' 'uvfit%start03[4]' 'uvfit%start03[5]' 'uvfit%start03[6]' 'uvfit%start03[7]'
     task\logical   "Subtract function" SUBSF03$    'uvfit%subsf03'
  endif
  if (uvfit%nf.ge.4) then
     task\character "Function #4"       FUNCT04$    'uvfit%funct04'
     task\real      "Parameters"        PARAM04$[7] 'uvfit%param04[1]' 'uvfit%param04[2]' 'uvfit%param04[3]' 'uvfit%param04[4]' 'uvfit%param04[5]' 'uvfit%param04[6]' 'uvfit%param04[7]'
     task\real      "Starting range"    RANGE04$[7] 'uvfit%range04[1]' 'uvfit%range04[2]' 'uvfit%range04[3]' 'uvfit%range04[4]' 'uvfit%range04[5]' 'uvfit%range04[6]' 'uvfit%range04[7]'
     task\integer   "numb. of starts"   START04$[7] 'uvfit%start04[1]' 'uvfit%start04[2]' 'uvfit%start04[3]' 'uvfit%start04[4]' 'uvfit%start04[5]' 'uvfit%start04[6]' 'uvfit%start04[7]'
     task\logical   "Subtract function" SUBSF04$    'uvfit%subsf04'
  endif
  !
  task\character "fit table name"    RESULT$    'name'".uvfit"
  task\character "residuals UVtable" RESIDUALS$ 'name'"-res.uvt"
  task\go
  !
end data gag_scratch:uv-fit.init
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
if ("&1none".eq."none") then
   vector\run uv_fit gag_scratch:uv-fit.init /nowindow
else
   message e uvfit "Unknown mathematical fitting library: &1"
   return base
endif
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
