function maxwind(args)
  'reinit'
  nc_file = subwrd(args,1)
  wind = subwrd(args,2)
  say nc_file
  say wind
  'sdfopen 'nc_file
  'q file'
  say result
  rec5 = sublin(result,5)
  nx = subwrd(rec5,3) ; ny = subwrd(rec5,6) ; nz = subwrd(rec5,9) ; nt = subwrd(rec5,12)
  say '(nx,ny,nz,nt) = ('nx','ny','nz','nt')'
  nxp = nx
  nyp = ny
  nzp = nz
  'set gxout print'
  tt = 1
  while ( tt <= nt )
    'set x 1'
    'set y 1'
    'set z 1'
    'set t 'tt
    say 'tt = 'tt
    'd max(max(max('wind',x=1,x='nx'),y=1,y='ny'),z=1,z='nz')'
      rec = sublin(result,(nyp+1)*nzp+3)
      max_wind = subwrd(rec,1)
      say ' max 'wind' = 'max_wind
    'd maxloc(max(max('wind',y=1,y='ny'),z=1,z='nz'),x=1,x='nx')'
      rec = sublin(result,(nzp+1)*nxp+3)
      xc = subwrd(rec,1)
      say ' xc = 'xc
    'd maxloc(max(max('wind',x=1,x='nx'),z=1,z='nz'),y=1,y='ny')'
      rec = sublin(result,(nzp+1)*nyp+3)
      yc = subwrd(rec,1)
      say ' yc = 'yc
    'd maxloc(max(max('wind',x=1,x='nx'),y=1,y='ny'),z=1,z='nz')'
      rec = sublin(result,(nyp+1)*nzp+3)
      zc = subwrd(rec,1)
      say ' zc = 'zc
    'd 'wind'(x='xc',y='yc',z='zc')'
      rec = sublin(result,2)
      wind_xc_yc_zc = subwrd(rec,1)
      say ' 'wind'(x='xc',y='yc',z='zc') = 'wind_xc_yc_zc
    tt=tt+1
  endwhile
  say '...finished.'
return
