*----------------------------------------------------------------------
*
*  Defines and plots (significant) winds...
*
*  To use: grads -l
*
*----------------------------------------------------------------------

'reinit'

************************************************************************
*  allow external GrADS functions
************************************************************************

rc = gsfallow("on")

************************************************************************
*  open GrADS ctl file containing winds...
************************************************************************

 model = 'isabel_ras'
'open windr-'model'.ctl'

************************************************************************
*  GrADS metafile output...
************************************************************************

'enable print sig_wind-'model'.gx'

*-----------------------------------------------------------------------
*  plot wind, magnitude of wind...
*-----------------------------------------------------------------------

'set gxout shaded'
'c'
'd uur'
'draw title \\\ "uur" (ms`a-1`n)'
'run cbar 0.7'
'print'
pause()
'c'
'd vvr'
'draw title \\\ "vvr" (ms`a-1`n)'
'run cbar 0.7'
'print'
pause()
'c'
'wind = mag(uur,vvr)'
'd wind'
'draw title \\\ "wind = mag(uur,vvr)" (ms`a-1`n)'
'run cbar 0.7'
'print'
pause()

*-----------------------------------------------------------------------
*  define and plot significant winds, vectors...
*-----------------------------------------------------------------------

wind_threshold = 15
'sigu = maskout(uur,wind-'wind_threshold')'
'sigv = maskout(vvr,wind-'wind_threshold')'
'sigwind = mag(sigu,sigv)'

'c'
*'set gxout grfill'
'set gxout shaded'
'd sigwind'
'draw title \\\ Wind Magnitude (wind_threshold = 'wind_threshold' ms`a-1`n)'
'run cbar 0.7'
'print'
pause()
'c'
'set gxout vector'
'd sigu;sigv'
'draw title \\\ Wind Vectors (wind_threshold = 'wind_threshold' ms`a-1`n)'
'print'
pause()
'c'
'set gxout vector'
'd skip(sigu,2,2);sigv'
'draw title \\\ Wind Vectors (wind_threshold = 'wind_threshold' ms`a-1`n)'
'print'
pause()
'c'
'set gxout barb'
'd skip(sigu,2,2);sigv'
'draw title \\\ Wind Barbs (wind_threshold = 'wind_threshold' ms`a-1`n)'
'print'
'disable print'
