NCL Home> Application examples> Special plots || Data files for some examples

Example pages containing: tidbits | resources | functions/procedures

Skew-T

The NCL script "skewt_func.ncl" is included with the NCL distribution.
It is designed to reproduce the "USAF Skew-t, log p diagram (form dod-wpc 9-16-1).
It may be loaded via:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
All wind directions/speeds or u-v components are assumed to reflect conventional meteorological conventions. Missing values, indicated by the _FillValue attribute, are allowed for any variable.
The user may alter the default behavior of the "skewT_BackGround" and "skewT_PlotData" functions.

[1] function skewT_BackGround (wks:graphic, Opts:logical)

Setting the "Opts" argument to a variable set to True (eg: opt=True) allows the user to alter the 'look' of the skewT background. This is demonstrated in Example 1. The following attributes may be changed from the default values:
                               
    Attribute          Default                                             
    --------------      ----                                                
    DrawIsotherm      = True                                                
    DrawIsobar        = True                                                
    DrawMixRatio      = True                                                
    DrawDryAdiabat    = True                                                 
    DrawMoistAdiabat  = True  ; aka: saturation or pseudo adibat            
    DrawWind          = True                                                
    DrawStandardAtm   = True                                                
    DrawColLine       = True                                                
    DrawColAreaFill   = False                                               
    DrawFahrenheit    = True  ; Fahrenheit "x" axis                         
    DrawHeightScale   = False                                               
    DrawHeightScaleFt = True  ;default is feet [otherwise km]              


[2] function skewT_PlotData (wks:graphic ,skewt_bkgd:graphic \ ,P[*]:numeric ,TC[*]:numeric \ ,TDC[*]:numeric ,Z[*]:numeric \ ,WSPD[*]:numeric,WDIR[*]:numeric \ ,dataOpts:logical )
Setting
    dataOpts = True 
allows various other options. For example:
                                        ; sounding colors
    dataOpts@colTemperature = "black"   ; default -> "Foreground"
    dataOpts@colDewPt       = "green"   ; default -> "RoyalBlue"
    dataOpts@colCape        = "orange"  ; default -> "Red"
                                        ; Winds at Pressure levels
    dataOpts@colWindP       = "black"   ; default -> "Foreground"
                                        ; Winds at geopotential [Z] levels
    dataOpts@colWindZ       = "black"   ; default -> "Foreground"
                                        ; Winds at pibal Height levels
    dataOpts@colWindH       = "black"   ; default -> "Foreground"
                                        
                                        ; sounding line patterns
    dataOpts@linePatternTemperature = 2 ; default=1 [solid]
    dataOpts@linePatternDewPt       = 3 ; default=1 [solid]
    dataOpts@linePatternCape        = 8 ; default=1 [solid]
                                        
                                        ; "x" location for windbarbs
    dataOpts@xpWind                 =42 ; default=45

                                        ; By default, skewT_PlotData expects
                                        ; wind speed (WSPD) and direction (WDIR).
    dataOpts@WspdWdir      = False      ; Set to False, if u and v are input.
PIBAL reports generally consist of winds at height above the surface. Below let hght,hspd and hdir represent Pibal wind reports:
    hght = (/1000.,3000.,7000.,25000. /)/3.208  ; hgt (M) 
    hspd = (/  50.,  27., 123.,   13. /)        ; speed at each height   
    hdir = (/  95., 185., 275.,  355. /)        ; direction              
                 
    dataOpts@PlotWindH      = True      ; if available, plot winds at height lvls 
    dataOpts@HspdHdir       = True      ; wind speed and dir [else: u,v]         
    dataOpts@Height         = hght      ; assign height of wind reports          
    dataOpts@Hspd           = hspd      ; speed [or u component]          
    dataOpts@Hdir           = hdir      ; dir   [or v component]          
Version 5.1.0: The information printed at the top of the skewT plot:
   Cape  -  Convective Available Potential Energy [J]
   Pwat  -  Precipitable Water [cm]
   Shox  -  Showalter Index (stability)
   Plcl  -  Pressure of the lifting condensation level [hPa]
   Tlcl  -  Temperature at the lifting condensation level [C]
is returned as attributes of the returned graphic object.

Example: Let skewT be the returned object. The data mat be retrieved via:

   cape = skewT@Cape
   pwat = skewT@Pwat
   shox = skewT@Shox
   plcl = skewT@Plcl
   tlcl = skewT@Tlcl
skewt_1.ncl: demonstrates the construction of three skew-T plot backgrounds. The left plot is the default. The center plot was created by setting the two attributes DrawColAreaFill and DrawHeightScale to "True". The third plot uses a centigrade scale [DrawFahrenheit = False] and the heights are indicated in meters [DrawHeightScale=True and DrawHeightScaleFt=False ].
skewt_2.ncl: Plots real data on the skew-T plots. Check out those wind barbs! The winds from a (bogus) pibal are indicated via a different color. Printed under the [optional] figure title, are several reference quantities:
    Plcl: Lifting Condensation Level [mb,  hPa]
    Tlcl: Temperature at the LCL
    Shox: Showalter Index
    Pwat: Total Precipitable Water [cm]
    Cape: Convective Available Potential Energy [Joules]
    
skewt_3.ncl:Plots real data. The left figure shows the full radiosonde while the right plot "thins" the number of wind barbs plotted and uses a Centigrade scale. Setting the Wthin attribute to 3 means plot every third wind barb.

The variables plotted are: T [C], TD [C, dew point temperature], Z [m], WSPD and WDIR [knots or m/s; wind speed and direction]. The only required variable is P [mb; Pressure]. The required order is surface [ie, ground] to top.
skewt_4.ncl: This shows how to plot two raobs on the same plot. Basically, (a) draw the background; (b) draw each sounding upon the background; (c) advance the frame after all soundings have been plotted. Options are used to change colors, line patterns, location of wind barbs [xpWind] and to thin the number of wind barbs [Wthin].