function maxwind(args)
  'reinit'
  nc_file = subwrd(args,1)
  wind = subwrd(args,2)
  wind_units = subwrd(args,3)
  say
  say nc_file
  say wind' ('wind_units')'
  say
  'sdfopen 'nc_file
  'q file'
  say result
  say
  rec5 = sublin(result,5)
  nx = subwrd(rec5,3) ; ny = subwrd(rec5,6) ; nz = subwrd(rec5,9) ; nt = subwrd(rec5,12)
  say
  say '(nx,ny,nz,nt) = ('nx','ny','nz','nt')'
  say
  nxp = nx
  nyp = ny
  nzp = nz
*
* get the x- and y-limits for virtual page
*
  'q gxinfo'
  rec3 = sublin(result,3) ; xpl = subwrd(rec3,4) ; xpu = subwrd(rec3,6)
  rec4 = sublin(result,4) ; ypl = subwrd(rec4,4) ; ypu = subwrd(rec4,6)
  tt = 1
  while ( tt <= nt )
    'set x 1'
    'set y 1'
    'set z 1'
    'set t 'tt
    say 'tt = 'tt
    'set gxout print'
    '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)
    '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)
    '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 ' (xc,yc,zc) = ('xc','yc','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
*
* find "world" coordinates of (xc,yc) and convert "world" coordinates
* to "xy" coordinates for plotting track of hurricane center...
*
      'set x 'xc
      lonc = subwrd(result,4)
      'set y 'yc
      latc = subwrd(result,4)
      say ' (lonc,latc,zc) = ('lonc','latc','zc')'
    'd 'wind'(lon='lonc',lat='latc',z='zc')'
      rec = sublin(result,2)
      wind_lnc_ltc_zc = subwrd(rec,1)
      say ' 'wind'(lon='lonc',lat='latc',z='zc') = 'wind_lnc_ltc_zc
*
* plot the wind and place a mark at the max
*
    'c'
    'set vpage 'xpl' 'xpu' 'ypl' 'ypu
    'set parea 'xpl+1' 'xpu-1' 'ypl+1' 'ypu-1
    'set x 1 'nx
    'set y 1 'ny
    'set z 'zc
    'set gxout shaded'
    'set grads off'
    'd 'wind
    'run cbar 0.7'
    'draw title \ Max 'wind' = 'wind_lnc_ltc_zc' ('wind_units')\at (lonc,latc,zc)=('lonc','latc','zc')'
    'q w2xy 'lonc' 'latc
      xpos = subwrd(result,3)
      ypos = subwrd(result,6)
      say ' (xpos,ypos) = ('xpos','ypos')'
    'set line 1 1 6'
    'draw mark 6 'xpos' 'ypos' 0.2'
    'c events'
    pause()
    tt=tt+1
  endwhile
  say '...finished.'
  'close 1'
return

function pause()
*
* Pauses till ENTER key is pressed 
*
 say
 say '*********************************'
 say 'Press "ENTER" key to continue...'
 say '*********************************'
 pull answer
*
return
