;************************************************** ; skewt_3.ncl ; ; Concepts illustrated: ; - Drawing Skew-T plots ; - Thinning the wind barbs in a Skew-T plot ; - Customizing the background of a Skew-T plot ;************************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.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" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" ;************************************************** begin ; --- Read Data ----------------------------------------; ; diri="../../" ; filctl3km = systemfunc("ls /vol-th/home/typhoon550/typhoon/zuoq/install/WRFV3/run01/wrfout_d03_2013-01-2*");ctrl run 3.3km ; filctl1km = systemfunc("ls /vol-th/home/typhoon550/typhoon/zuoq/install_test/WRFV3/run_ctrl_4d_1km_40/wrfout_d04_2013-01-2*");cr 1.1 ; filles1km = systemfunc("ls /vol-th/home/typhoon550/typhoon/zuoq/install_test/WRFV3/run_les_4d_1km_40/wrfout_d04_2013-01-2*");le 1.1 ; filles222 = systemfunc("ls /vol-th/home/typhoon550/typhoon/zuoq/install_test/WRFV3/run_les_5d_200_40/wrfout_d05_2013-01-2*");LE 222m ; order: Surface is 'bottom' eg: 1000,950,935,897,... do fnum = 12,12,1; dimsizes(fils)-1,1;0,23,1 ; a = addfile(filctl3km(fnum)+".nc","r") ; b = addfile(filctl1km(fnum)+".nc","r") ; c = addfile(filles1km(fnum)+".nc","r") ; d = addfile(filles222(fnum)+".nc","r") ; filstime = wrf_user_list_times(a) ; print("filstime"+filstime) f = addfile("data_T_W"+fnum+".nc","r") print("working on "+fnum) tdata = f->tdata tddata = f->tddata pdata = f->pdata zdata = f->zdata udata = f->udata vdata = f->vdata ;************************* ; create plot ;************************* ; type = "png" ; CHANGE HERE type = "pdf" ; type@wkPaperWidthF = 8.0 ; type@wkPaperHeightF = 8.0 ; wks = gsn_open_wks ("pdf", "T_W_SKEW_all_38.2248_"+filstime) ; wks = gsn_open_wks(type,"RH_run01_d05_help_"+str_sub_str(filstime,":","_")) wks = gsn_open_wks(type,"help.T_W_SKEW_all_"+fnum) ; --- Create background skew-T and plot sounding---------------- ; left variable resB = True resB@gsnDraw =False resB@gsnFrame=False resB@xyLineColors = (/"black","red","blue","green"/) resB@xyDashPatterns = (/0,0,0,0/) ; (/0,1,2,3/) ; dashed line for 2nd resB@vpWidthF = 0.6 resB@vpHeightF = 0.8 resB@gsnMaximize = True resB@xyLineThicknesses = (/1,1,1,1/) ; thicker line resB@tiXAxisString = " " ; axis string resB@trXMinF = -35 resB@trXMaxF = 8 resB@trYReverse = True resB@trYMaxF = max(pdata(:,0:7)) resB@trYMinF = min(pdata(:,0:7)) ; resB@trYMaxF = 1030 ; resB@trYMinF = 900 ; right variable resT = True resT@gsnDraw =False resT@gsnFrame=False resT@xyLineColors = (/"black","red","blue","green"/) resT@xyDashPatterns = (/1,1,1,1/); (/0,1,2,3/) ; dashed line for 2nd resT@xyLineThicknesses = (/1,1,1,1/) ; thicker line resT@tiXAxisString = " " ; axis string resT@trXMinF = -35 resT@trXMaxF = 8 resT@trYReverse = False resT@trYMaxF = max(zdata(:,0:7)) resT@trYMinF = min(zdata(:,0:7)) plot = gsn_csm_x2y2(wks,tdata(:,0:7),tddata(:,0:7),pdata(:,0:7),zdata(:,0:7),resB,resT) xnum = new((/4,8/),"float") xnum(0,:)=0 xnum(1,:)=2 xnum(2,:)=4 xnum(3,:)=6 wmbarb(wks,xnum,zdata(:,0:7),-udata(:,0:7),-vdata(:,0:7)) draw(plot) frame(wks) end do end