; Example script to produce plots for a WRF real-data run, ; with the ARW coordinate dynamics option. ; Create a single skewT plot load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" begin diri = "./" fili = "sounding_201603180600Z.txt" nlvl = 4482 ncol = 6 TestData = asciiread (diri+fili , (/nlvl,ncol/), "float") ; We generate plots, but what kind do we prefer? ; type = "x11" type = "pdf" ; type = "ps" ; type = "png" wks = gsn_open_wks(type,"./capricorn_201603180600Z") gsn_define_colormap(wks,"WhViBlGrYeOrReWh") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Second get the variables we will need at from obs p_obs = TestData (:,0) tc_obs = TestData (:,1) tdc_obs = TestData (:,2) z_obs = TestData (:,3) ;wspd = TestData (:,4) ;wdir = TestData (:,5) u_obs = TestData (:,4) v_obs = TestData (:,5) p_obs@_FillValue = -32768 tc_obs@_FillValue = -32768 tdc_obs@_FillValue = -32768 z_obs@_FillValue = -32768 ;wdir@_FillValue = -32768 ;wspd@_FillValue = -32768 u_obs@_FillValue = -32768 v_obs@_FillValue = -32768 ;u_obs = wspd*cos((-90-wdir)/360*6.28) ;v_obs = -wspd*sin((-90-wdir)/360*6.28) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Define a few skew-T plotting options skewtOpts = True skewtOpts@DrawHeightScale = True ; plot height scale on side skewtOpts@DrawHeightScaleFt = False ; plot height scale in km skewtOpts@DrawStandardAtm = True ; draw standard atm on plot skewtOpts@vpXF = 0.12 ; controls off-set from left skewtOpts@vpYF = 0.87 ; controls off-set from top skewtOpts@vpWidthF = 0.65 ; controls size of plot skewtOpts@vpHeightF = 0.65 ; controls size of plot skewtOpts@DrawFahrenheit = False ; use deg C scale skewtOpts@tiMainFontHeightF = 0.025 ; change height of main title ;skewtOpts@DrawColLine = True ; draw lines in black skewtOpts@DrawColAreaFill = True ; color on background plot skewtOpts@DrawColAreaColor = "White" ; final color may depend on the color table used skewtOpts@DrawColAreaColor = "White" ; Light Green for WhViBlGrYeOrReWh color table skewtOpts@PrintOpts = False ; do not print options out ; Get the skew-T background skewtOpts@tiMainString = "Sounding (201603180600Z)" skewt_bkgd = skewT_BackGround (wks, skewtOpts) draw (skewt_bkgd) ;***************************************************************** ; draw sounding ;***************************************************************** dataOpts = True dataOpts@PrintZ = False ; do not print Z dataOpts@ThermoInfo = False ; print thermodynamic info dataOpts@colTemperature = "black" dataOpts@colDewPt = "red" dataOpts@Parcel = 1 dataOpts@WspdWdir = False ; wind speed and dir [else: u,v] dataOpts@HspdHdir = True ; wind speed and dir [else: u,v] dataOpts@PlotWindH = False ; plot wind barbs at h lvls [pibal; special] dataOpts@linePatternDewPt = 0 ; default=1 [solid] dataOpts@linePatternCape = 8 ; default=1 [solid] dataOpts@colCape = "orange" ; default -> "Red" dataOpts@Wthin = 30 ; plot every n-th wind barb dataOpts@xpWind = 45. ; new location for winds [default 45] skewT_data = skewT_PlotData(wks, skewt_bkgd, p_obs, (tc_obs)-273.16, (tdc_obs)-273.16, z_obs/1000., u_obs, v_obs, dataOpts) draw (skewT_data) frame(wks) end