;title: webplot_heatrate.pro ;purpose: To plot heating rates operationally for the web. ; ;author: Matthew Shupe ;date; 2/14/02 ;modified: 2/14/02 ;----------------------------------------------- ;pro webplot_heatrate,inarg inarg='19980602' site='shb' sitename='SHEBA' ;Get a list of files for the argument cd,'/data1/sheba/heatrate' inarg='rtoutput_bug*'+inarg+'*.cdf' files=findfile(inarg,count=numf) arg=strmid(files,17,8) ;Set up the plot parameters xra=[0,24] yra=[0,12] pos=[.08,.08,.92,.94] divy=1.0/3.0 divx=2.3/3.0 pos_hrt=[pos[0],pos[1]+(pos[3]-pos[1])*divy,pos[0]+(pos[2]-pos[0])*divx,pos[3]] pos_dhrt=[pos[0]+(pos[2]-pos[0])*divx,pos[1]+(pos[3]-pos[1])*divy,pos[2],pos[3]] pos_tau=[pos[0],pos[1],pos[0]+(pos[2]-pos[0])*divx,pos[1]+(pos[3]-pos[1])*divy] pos_cb=[pos[0]+(pos[2]-pos[0])*divx+0.05,pos[1]+(pos[3]-pos[1])*divy-0.05] pos_cb=[pos_dhrt[0]+0.03,pos_dhrt[1]-0.13,pos_dhrt[2]+0.05,pos_dhrt[1]-0.1] blk=[' ',' ',' ',' ',' ',' ',' ',' ',' ',' '] scale=[-20,20] levels=findgen(31)*(scale[1]-scale[0])/30.0 + scale[0] nlev=n_elements(levels) wh=closest(levels,0,0) wh=wh[0] colors=[fix(findgen(wh)/wh*126)+2,128,fix((findgen(nlev-wh-1)+1)/(nlev-wh-1)*126)+128] strlev=strtrim(string(levels,format='(f5.1)'),2) loadct,41,file='/export/home/mshupe/IDLcode/colorscopy.tbl' !p.color=1 months=['January','February','March','April','May','June','July','Aug','Sept','October','November','December'] ;Loop over all files for i=0,numf-1 do begin ;Read in the data and make necessary calculatiions cd,'/data1/sheba/heatrate' fid=ncdf_open(files[i]) ncdf_varget,fid,ncdf_varid(fid,'asl'),swhra ncdf_varget,fid,ncdf_varid(fid,'atl'),lwhra ncdf_varget,fid,ncdf_varid(fid,'aslR'),swhrc ncdf_varget,fid,ncdf_varid(fid,'atlR'),lwhrc ;ncdf_varget,fid,ncdf_varid(fid,'time'),time ;ncdf_varget,fid,ncdf_varid(fid,'hl'),height ncdf_varget,fid,ncdf_varid(fid,'tclice'),tclice ncdf_varget,fid,ncdf_varid(fid,'tclwat'),tclwat ncdf_close,fid farg='rtinput*'+arg[i]+'*.cdf' file=findfile(farg) fid=ncdf_open(file[0]) ncdf_varget,fid,ncdf_varid(fid,'time'),time ncdf_varget,fid,ncdf_varid(fid,'hl'),height ncdf_varget,fid,ncdf_varid(fid,'wcil'),iwc ncdf_varget,fid,ncdf_varid(fid,'wcwl'),lwc ncdf_varget,fid,ncdf_varid(fid,'rcil'),ire ncdf_varget,fid,ncdf_varid(fid,'rcwl'),lre ncdf_close,fid hrt=lwhra+swhra d_hrt=total(hrt,1)/n_elements(time) d_hrtc=total(lwhrc+swhrc,1)/n_elements(time) tau=total(tclice[*,*,0],2)+total(tclwat[*,*,0],2) datestr=months[fix(strmid(arg[i],4,2))-1]+' '+strmid(arg[i],6,2)+', '+strmid(arg[i],0,4) title='!17Heating Rate, '+strupcase(site)+', '+datestr ;Make the plots contour,hrt,time,height,/nodata, position=pos_hrt,/xstyle,xrange=xra,font=-1,$ title=title,ytitle='Height (km, AGL)', background=0,yrange=yra,/ystyle,xtickname=blk contour,hrt,time,height,position=pos_hrt, levels=levels,c_colors=colors,/cell_fill,font=-1,$ /xstyle,xrange=xra,/ystyle,yrange=yra,/noerase,clip=[xra[0],yra[0],xra[1],yra[1]],xtickname=blk contour,iwc,time,height,position=pos_hrt, levels=[0.0001,10],/follow,c_labels=[0,0,0],$ /xstyle,xrange=xra,/ystyle,yrange=yra,/noerase,xtickname=blk contour,lwc,time,height,position=pos_hrt, levels=[0.0001,10],/follow,c_labels=[0,0,0],$ /xstyle,xrange=xra,/ystyle,yrange=yra,/noerase,xtickname=blk ;******Add contour on cloud bounds instread of IWC/LWC plot,d_hrt,height,position=pos_dhrt,font=-1,/xstyle,/ystyle,yrange=yra,/noerase,ytickname=blk,xrange=[-3,3],$ xminor=2,xtitle='Daily HRT (K/day)' oplot,d_hrtc,height,linestyle=2 plots,[0,0],yra plot,time,tau,position=pos_tau,font=-1,/xstyle,/ystyle,xrange=xra,/noerase,yrange=[0,20],$ xtitle='!17Time (GMT)',ytitle='SW Extinction Tau' cbxwid=(pos_cb[2]-pos_cb[0])/nlev cb_x=[pos_cb[0],pos_cb[0],pos_cb[0]+cbxwid,pos_cb[0]+cbxwid] cb_y=[pos_cb[1],pos_cb[3],pos_cb[3],pos_cb[1]] for h = 0,nlev-1 do begin polyfill,cb_x,cb_y,color=colors[h],/normal if h mod 10 eq 0 then xyouts,cb_x[0],cb_y[0]-0.03,strlev[h],/norm,font=-1,alignment=0.5 cb_x=cb_x+cbxwid endfor xyouts,mean([pos_cb[0],pos_cb[2]]),pos_cb[1]-0.06,'!17Heating Rate (K/day)',alignment=0.5,font=-1,/normal xyouts,.9,.03,/norm,alignment=0.5,font=-1,'!5NOAA/ETL',charsize=1 ;Write the gif file cd,'/data1/sheba/heatrate/webplots' fname=site+'web_hrt.'+arg[i]+'.gif' write_gif,fname,tvrd() endfor end