;Title: rtinput.pro ; ;Purpose: Create input files for the RT code to compute heating rate profiles ; from SHEBA data. ; ;Inputs: rtemp,rpress,rhum,ralt,rtime: from sounding [K,Pa,%,km,hours] ; lwc,iwc,lre,idmn,time,height: from retrievals [g/m3,g/m3,microns,microns,hours,km] ; alb,lat,lon: albedo and position variables ; lwds,lwus,swds,swus: broadband fluxes from ASFG [all in W/m2] ; timestamp: string to appear in the output filename (i.e. 19980428.171500) ; ;Outputs: NetCDF files with fields: ; 0) time: time axis [decimal hours GMT] ; 1) pl: layer pressure [mb] (i.e. pl[i]=(pl2[i+1]+pl2[i])/2 ) ; 2) pl2: level pressure [mb] ; 3) hl: layer height [km] ; 4) hl2: level height [km] ; 5) tl: layer temperature [K] ; 6) tl2: level temperature [K] ; 7) rhl: layer relative humidity [%] ; 8) rhl2: level relative humidity [%] ; 9) o3l: layer ozone mixing ration [kg/kg] ; 10) o3l2: level ozone mixing ratio [kg/kg] ; 11) wcll: layer cloud liquid water content [g/m3] ; 12) wcil: layer cloud ice water content [g/m3] ; 13) qcll: layer cloud liquid water mixing ratio [kg/kg] ; 14) qcil: layer cloud ice water mixing ratio [kg/kg] ; 15) rewl: layer water droplet effective radius [microns] ; 16) reil: layer ice particle effective radius [microns] ; 17) ts: surface temperature [K] ; 18) albs: surface albedo, broadband ; 19) zen: solar zenith angle [degrees] ; 20) lwds: ASFG measured LWD at surface [W/m2] ; 21) lwus: ASFG measured LWU at surface [W/m2] ; 22) swds: ASFG measured SWD at surface [W/m2] ; 23) swus: ASFG measured SWU at surface [W/m2] ; 24) lat: Latitude [decimal degrees North] ; 25) lon: Longitude [decimal degrees West] ; ;Subroutine: zenith.pro ; ;Author: Matthew Shupe ;Date: 7/5/01 ;Modified: 1/9/02 ;----------------------------------------------------------------------------- function zenith,jday,hour,lat,lon ;Purpose: Function to calculate the solar senith angle from known position and time of day. ; Adapted from NASA code. ;Inputs: jday: Day of the year ; hour: Decimal hour of the day. ; lat: Decimal latitude (0 to +/-90, positive in N hemisphere) ; lon: Decimal longitude (0 to +/-180, positive west of the prime meridian ;Outputs: result: the solar zenith angle in degrees. ;I/O: result=zenith(jday,dhour,lat,lon) ;Author: Matthew Shupe ;Date: 06/05/01 ;-------------------------------------------------------------------------------------------- sinob=0.3978 dpy=365.242 dph=15.0 rpd=!pi/180.0 dpr=1.0/rpd dang=2.0*!pi*(jday-1.0)/dpy homp=12.0 + 0.12357*sin(2.0*dang) - 0.004289*cos(dang) + 0.153809*sin(2.0*dang) + 0.060783*cos(2.0*dang) hang=dph*(hour-homp)-lon ang=279.9348*rpd+dang sigma=(ang*dpr+0.4087*sin(ang)+1.8724*cos(ang)-0.0182*sin(2.0*ang)+0.0083*cos(2.0*ang))*rpd sindlt=sinob*sin(sigma) cosdlt=sqrt(1.0-sindlt^2) cozena=sindlt*sin(rpd*lat)+cosdlt*cos(rpd*lat)*cos(rpd*hang) zen=acos(cozena)*180.0/!pi return,zen end ;function pro rtinput,timestamp ;Constants Rv=461.0 Tr=273.16 er=611.0 ;Pa eps=0.622 Llv=2.52e6 ;****may want to add in temperature dependence ;Common blocks common com_sonde common com_micro common com_state ;1) Extend radar heights above sounding numbeam=n_elements(time) rnum=n_elements(rtime) ;find the maximum height for each sounding mxht=fltarr(rnum) for i=0,rnum-1 do mxht[i]=max(ralt[i,*]) hnum=n_elements(ralt[0,*]) ;if lowest max height is less than 14 km then splice in previous sounding to the short sounding maxht=min(mxht,mwh) if maxht lt 14.0 then begin if mwh gt 0 then begin ;splice in previous sounding iwh=where(ralt[mwh-1,*] gt mxht[mwh],nm1) ewh=where(ralt[mwh,*] eq mxht[mwh],nm) if ewh[nm-1]+nm1-1 gt hnum-1 then begin iwh=iwh[0:(hnum-ewh[nm-1]-1)] nm1=n_elements(iwh) endif ralt[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=ralt[mwh-1,iwh] rpress[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rpress[mwh-1,iwh] rtemp[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rtemp[mwh-1,iwh] rhum[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rhum[mwh-1,iwh] mxht[mwh]=mxht[mwh-1] endif else begin if mwh eq 0 and rnum gt 1 then begin ;splice in next sounding iwh=where(ralt[mwh+1,*] gt mxht[mwh],nm1) ewh=where(ralt[mwh,*] eq mxht[mwh],nm) if ewh[nm-1]+nm1-1 gt hnum-1 then begin iwh=iwh[0:(hnum-ewh[nm-1]-1)] nm1=n_elements(iwh) endif ralt[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=ralt[mwh+1,iwh] rpress[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rpress[mwh+1,iwh] rtemp[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rtemp[mwh+1,iwh] rhum[mwh,ewh[nm-1]:ewh[nm-1]+nm1-1]=rhum[mwh+1,iwh] mxht[mwh]=mxht[mwh+1] endif else begin maxht=14.0 endelse endelse ;Check for any major jumps around the splice height and smooth these if rtemp[mwh,ewh[nm-1]]-rtemp[mwh,ewh[nm-1]-1] gt 5 then rtemp[mwh,ewh[nm-1]]=(rtemp[mwh,ewh[nm-1]+1]+rtemp[mwh,ewh[nm-1]-1])/2.0 if rhum[mwh,ewh[nm-1]]-rhum[mwh,ewh[nm-1]-1] gt 5 then rhum[mwh,ewh[nm-1]]=(rhum[mwh,ewh[nm-1]+1]+rhum[mwh,ewh[nm-1]-1])/2.0 ;Get new maxht maxht=min(mxht) endif ;Extend the radar heights ext=[14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,27.0,30.0,40.0] ;in km iwh=where(ext le maxht,nx) blk=fltarr(numbeam)*0. if nx gt 0 then begin height=[0.041,height,ext[iwh]] blk2=fltarr(numbeam,nx)*0. ir=[[blk],[ir],[blk2]] ;Extend the microphysics with 0's lr=[[blk],[lr],[blk2]] ic=[[blk],[ic],[blk2]] lc=[[blk],[lc],[blk2]] irr=[[blk],[irr],[blk2]] lrr=[[blk],[lrr],[blk2]] icr=[[blk],[icr],[blk2]] lcr=[[blk],[lcr],[blk2]] ird=[[blk],[ird],[blk2]] lr1=[[blk],[lr1],[blk2]] icd=[[blk],[icd],[blk2]] lc1=[[blk],[lc1],[blk2]] irs=[[blk],[irs],[blk2]] lr2=[[blk],[lr2],[blk2]] ics=[[blk],[ics],[blk2]] lc2=[[blk],[lc2],[blk2]] ixr=[[blk],[ixr],[blk2]] ixd=[[blk],[ixd],[blk2]] ixs=[[blk],[ixs],[blk2]] msk=[[blk],[msk],[blk2]] endif else begin height=[0.041,height] ir=[[blk],[ir]] ;Extend the microphysics with 0's lr=[[blk],[lr]] ic=[[blk],[ic]] lc=[[blk],[lc]] irr=[[blk],[irr]] lrr=[[blk],[lrr]] icr=[[blk],[icr]] lcr=[[blk],[lcr]] ird=[[blk],[ird]] lr1=[[blk],[lr1]] icd=[[blk],[icd]] lc1=[[blk],[lc1]] irs=[[blk],[irs]] lr2=[[blk],[lr2]] ics=[[blk],[ics]] lc2=[[blk],[lc2]] ixr=[[blk],[ixr]] ixd=[[blk],[ixd]] ixs=[[blk],[ixs]] msk=[[blk],[msk]] endelse iwh=where(ic gt 0.3,num) ;Remove any excessively high IWC and LWC values if num gt 0 then ic[iwh]=0.3 iwh=where(lc gt 0.5,num) if num gt 0 then lc[iwh]=0.5 iwh=where(icr gt 0.3,num) if num gt 0 then icr[iwh]=0.3 iwh=where(lcr gt 0.5,num) if num gt 0 then lcr[iwh]=0.5 iwh=where(icd gt 0.3,num) if num gt 0 then icd[iwh]=0.3 iwh=where(lc1 gt 0.5,num) if num gt 0 then lc1[iwh]=0.5 iwh=where(ics gt 0.3,num) ; if num gt 0 then ics[iwh]=0.3 iwh=where(lc2 gt 0.5,num) if num gt 0 then lc2[iwh]=0.5 ;2) Interpolate sounding data to extended radar heights (radar heights has additional level at 41.25m nhts=n_elements(height) rtt=fltarr(rnum,nhts)*0 & rpt=rtt & rht=rtt rt=ic*0 & rp=rt & rh=rt rwh=intarr(rnum) for i=0,rnum-1 do begin iwh=where(rpress[i,*] gt -900) rtt[i,*]=interpol(rtemp[i,iwh],ralt[i,iwh],height) rpt[i,*]=interpol(rpress[i,iwh],ralt[i,iwh],height) rht[i,*]=interpol(rhum[i,iwh],ralt[i,iwh],height) endfor ;2b) Interpolate sounding data to radar times for i=0,nhts-1 do begin rt[*,i]=interpol(rtt[*,i],rtime,time) rp[*,i]=interpol(rpt[*,i],rtime,time) rh[*,i]=interpol(rht[*,i],rtime,time) endfor ;Surface pressure (mb), temperature (K) and RH [%] ps=interpol(rpress[*,0],rtime,time) ts=interpol(rtemp[*,0],rtime,time)+273.16 rhs=interpol(rhum[*,0],rtime,time) ;3) Fill all variables to contain data up to TOA. This is the "layer" data. ; Invert all to be decending from TOA. ; Variables: P,T,RH,LWC,IWC,Lre,Ire if min(rp) gt 10 then begin if min(rp) lt 30 then begin base=fltarr(numbeam)*0 fill=base ;fill micro with 0 rfill=base+0.1 ;fill rh with 0.1 tfill=rt[*,nhts-1] ;fill t with last value pfill=base+10.0 ;fill p with 10 hfill=height[nhts-1]+8.31434/28.9644/9.80665*(rt[0,nhts-1]+273.16)*(alog(rp[0,nhts-1])-alog(10)) nhts=nhts+1 endif else begin base=fltarr(numbeam)*0 fill=[[base],[base]] ;fill micro with 0 and 0 rfill=[[base+0.5],[base+0.1]] ;fill rh with 0.5 and 0.1 tfill=[[rt[*,nhts-1]],[rt[*,nhts-1]]] ;fill t with last value twice pfill=[[base+(min(rp)-(min(rp)-10)/2.)],[base+10.0]] ;fill p with diff between last value and 10, and 10. hfill=[8.31434/28.9644/9.80665*(rt[0,nhts-1]+273.16)*(alog(rp[0,nhts-1])-alog(min(rp)-(min(rp)-10)/2.)),$ 8.31434/28.9644/9.80665*(rt[0,nhts-1]+273.16)*(alog(min(rp)-(min(rp)-10)/2.)-alog(10))]+height[nhts-1] nhts=nhts+2 endelse ir=reverse([[ir],[fill]],2) ;microns lr=reverse([[lr],[fill]],2) ;microns ic=reverse([[ic],[fill]],2) ;g/m3 lc=reverse([[lc],[fill]],2) ;g/m3 irr=reverse([[irr],[fill]],2) ;microns lrr=reverse([[lrr],[fill]],2) ;microns icr=reverse([[icr],[fill]],2) ;g/m3 lcr=reverse([[lcr],[fill]],2) ;g/m3 ird=reverse([[ird],[fill]],2) ;microns lr1=reverse([[lr1],[fill]],2) ;microns icd=reverse([[icd],[fill]],2) ;g/m3 lc1=reverse([[lc1],[fill]],2) ;g/m3 irs=reverse([[irs],[fill]],2) ;microns lr2=reverse([[lr2],[fill]],2) ;microns ics=reverse([[ics],[fill]],2) ;g/m3 lc2=reverse([[lc2],[fill]],2) ;g/m3 ixr=reverse([[ixr],[fill]],2) ixd=reverse([[ixd],[fill]],2) ixs=reverse([[ixs],[fill]],2) msk=reverse([[msk],[fill]],2) ;class mask. rt=reverse([[rt],[tfill]],2)+273.16 ;K rp=reverse([[rp],[pfill]],2) ;mb rh=reverse([[rh],[rfill]],2) ;% height=reverse([height,hfill]) ;km endif else begin ir=reverse(ir,2) lr=reverse(lr,2) ic=reverse(ic,2) lc=reverse(lc,2) irr=reverse(irr,2) lrr=reverse(lrr,2) icr=reverse(icr,2) lcr=reverse(lcr,2) ird=reverse(ird,2) lr1=reverse(lr1,2) icd=reverse(icd,2) lc1=reverse(lc1,2) irs=reverse(irs,2) lr2=reverse(lr2,2) ics=reverse(ics,2) lc2=reverse(lc2,2) ixr=reverse(ixr,2) ixd=reverse(ixd,2) ixs=reverse(ixs,2) msk=reverse(msk,2) rt=reverse(rt,2)+273.16 rp=reverse(rp,2) rh=reverse(rh,2) height=reverse(height) endelse ;4) Calculate necessary fields. ; Layer values: tl,rhl,o3l,wcwl,wcil,qcwl,qwil,rcwl,rcil ; Level values: pl2,tl2,rhl2,o3l2 ; Surface values: ts,zen ;Pressures ;pl > the actual radar heights ;p12 > offset from radar heights. pl=rp tl=rt rhl=rh pl2=pl*0 & tl2=pl2 & rhl2=pl2 for j=0,numbeam-1 do begin ;Calculate level values for i=1,nhts-1 do begin pl2[j,i]=mean([pl[j,i],pl[j,i-1]]) tl2[j,i]=mean([rt[j,i],rt[j,i-1]]) rhl2[j,i]=mean([rh[j,i],rh[j,i-1]]) endfor endfor pl2=[[pl2],[ps]] ;Add on the surface level tl2=[[tl2],[ts]] rhl2=[[rhl2],[rhs]] pl2[*,0]=5 ;Prescribe the top level values tl2[*,0]=tl2[*,1] rhl2[*,0]=rhl2[*,1] ;Create the height variables hl=height ;Layer height (nhts) hl2=fltarr(nhts+1) ;Level height (nhts+1) for i=1,nhts-1 do hl2[i]=mean([height[i],height[i-1]]) hl2[0]=hl[0]+(hl[0]-hl[1])/2 ;Top level height hl2[nhts]=0.0 ;Bottom level height is 0 ;Layer and Level Ozone mixing ratio in kg/kg ; Requires pressure variables to be available o3l2=pl2*0.0 o3l=pl*0.0 for i=0,numbeam-1 do begin o3l2[i,*]=interpol(o3mix,o3pr,pl2[i,*]) o3l[i,*]=interpol(o3mix,o3pr,pl[i,*]) endfor ;Layer cloud microphysics ; liquid and ice water content [g/m3], mixing ratio [kg/kg], and effective radii [microns] wcwl=lc wcil=ic rcwl=lr rcil=ir wcwlr=lcr wcilr=icr rcwlr=lrr rcilr=irr wcwl1=lc1 wcild=icd rcwl1=lr1 rcild=ird wcwl2=lc2 wcils=ics rcwl2=lr2 rcils=irs arho=pl/tl/287.0*100000.0 ;dry air density, in g/m3 qcwl=lc/arho qcil=ic/arho qcwlr=lcr/arho qcilr=icr/arho qcwl1=lc1/arho qcild=icd/arho qcwl2=lc2/arho qcils=ics/arho ;Solar zenith angle yr=float(strmid(timestamp,0,4)) mo=float(strmid(timestamp,4,2)) da=float(strmid(timestamp,6,2)) jd=julday(mo,da,yr)-julday(1,1,yr)+1 jday=fltarr(numbeam)*0.0+jd zen=zenith(jday,time,lat,lon) ;Write netCDF file fname='rtinput.'+timestamp+'.cdf' outfid=ncdf_create(fname,/clobber) tdid=ncdf_dimdef(outfid,'nlen',numbeam) hdid=ncdf_dimdef(outfid,'nlm',nhts) h2did=ncdf_dimdef(outfid,'nlm2',nhts+1) tmid=ncdf_vardef(outfid,'time',[tdid],/float) pid=ncdf_vardef(outfid,'pl',[tdid,hdid],/float) p2id=ncdf_vardef(outfid,'pl2',[tdid,h2did],/float) hid=ncdf_vardef(outfid,'hl',[hdid],/float) h2id=ncdf_vardef(outfid,'hl2',[h2did],/float) tid=ncdf_vardef(outfid,'tl',[tdid,hdid],/float) t2id=ncdf_vardef(outfid,'tl2',[tdid,h2did],/float) qid=ncdf_vardef(outfid,'rhl',[tdid,hdid],/float) q2id=ncdf_vardef(outfid,'rhl2',[tdid,h2did],/float) oid=ncdf_vardef(outfid,'o3l',[tdid,hdid],/float) o2id=ncdf_vardef(outfid,'o3l2',[tdid,h2did],/float) wwid=ncdf_vardef(outfid,'wcwl',[tdid,hdid],/float) wwrid=ncdf_vardef(outfid,'wcwlr',[tdid,hdid],/float) ww1id=ncdf_vardef(outfid,'wcwl1',[tdid,hdid],/float) ww2id=ncdf_vardef(outfid,'wcwl2',[tdid,hdid],/float) wiid=ncdf_vardef(outfid,'wcil',[tdid,hdid],/float) wirid=ncdf_vardef(outfid,'wcilr',[tdid,hdid],/float) widid=ncdf_vardef(outfid,'wcild',[tdid,hdid],/float) wisid=ncdf_vardef(outfid,'wcils',[tdid,hdid],/float) qwid=ncdf_vardef(outfid,'qcwl',[tdid,hdid],/float) qwrid=ncdf_vardef(outfid,'qcwlr',[tdid,hdid],/float) qw1id=ncdf_vardef(outfid,'qcwl1',[tdid,hdid],/float) qw2id=ncdf_vardef(outfid,'qcwl2',[tdid,hdid],/float) qiid=ncdf_vardef(outfid,'qcil',[tdid,hdid],/float) qirid=ncdf_vardef(outfid,'qcilr',[tdid,hdid],/float) qidid=ncdf_vardef(outfid,'qcild',[tdid,hdid],/float) qisid=ncdf_vardef(outfid,'qcils',[tdid,hdid],/float) rwid=ncdf_vardef(outfid,'rcwl',[tdid,hdid],/float) rwrid=ncdf_vardef(outfid,'rcwlr',[tdid,hdid],/float) rw1id=ncdf_vardef(outfid,'rcwl1',[tdid,hdid],/float) rw2id=ncdf_vardef(outfid,'rcwl2',[tdid,hdid],/float) riid=ncdf_vardef(outfid,'rcil',[tdid,hdid],/float) ririd=ncdf_vardef(outfid,'rcilr',[tdid,hdid],/float) ridid=ncdf_vardef(outfid,'rcild',[tdid,hdid],/float) risid=ncdf_vardef(outfid,'rcils',[tdid,hdid],/float) xirid=ncdf_vardef(outfid,'xcilr',[tdid,hdid],/float) xidid=ncdf_vardef(outfid,'xcild',[tdid,hdid],/float) xisid=ncdf_vardef(outfid,'xcils',[tdid,hdid],/float) tsid=ncdf_vardef(outfid,'ts',[tdid],/float) alid=ncdf_vardef(outfid,'albs',[tdid],/float) zaid=ncdf_vardef(outfid,'zen',[tdid],/float) ltid=ncdf_vardef(outfid,'lat',[tdid],/float) lnid=ncdf_vardef(outfid,'lon',[tdid],/float) ldid=ncdf_vardef(outfid,'lwd',[tdid],/float) luid=ncdf_vardef(outfid,'lwu',[tdid],/float) sdid=ncdf_vardef(outfid,'swd',[tdid],/float) suid=ncdf_vardef(outfid,'swu',[tdid],/float) mkid=ncdf_vardef(outfid,'mask',[tdid,hdid],/short) ncdf_attput,outfid,tmid,'long_name','Time' ncdf_attput,outfid,tmid,'units','Hours, GMT' ncdf_attput,outfid,pid,'long_name','Layer Pressure' ncdf_attput,outfid,pid,'units','mb' ncdf_attput,outfid,pid,'comment','Layer pressure i is the mean of level pressures i and i+1' ncdf_attput,outfid,p2id,'long_name','Level Pressure' ncdf_attput,outfid,p2id,'units','mb' ncdf_attput,outfid,p2id,'comment','Level pressures bound layer pressures' ncdf_attput,outfid,hid,'long_name','Layer Height' ncdf_attput,outfid,hid,'units','km, AGL' ncdf_attput,outfid,h2id,'long_name','Level Height' ncdf_attput,outfid,h2id,'units','km, AGL' ncdf_attput,outfid,tid,'long_name','Layer Temperature' ncdf_attput,outfid,tid,'units','K' ncdf_attput,outfid,tid,'source','GLAS rawinsonde system' ncdf_attput,outfid,t2id,'long_name','Level Temperature' ncdf_attput,outfid,t2id,'units','K' ncdf_attput,outfid,t2id,'source','GLAS rawinsonde system' ncdf_attput,outfid,qid,'long_name','Layer Relative Humidity' ncdf_attput,outfid,qid,'units','%' ncdf_attput,outfid,qid,'source','GLAS rawinsonde system' ncdf_attput,outfid,q2id,'long_name','Level Relative Humidity' ncdf_attput,outfid,q2id,'units','%' ncdf_attput,outfid,q2id,'source','GLAS rawinsonde system' ncdf_attput,outfid,oid,'long_name','Layer Ozone Mixing Ratio' ncdf_attput,outfid,oid,'units','kg/kg' ncdf_attput,outfid,oid,'source','McClatchey standard atmosphere' ncdf_attput,outfid,o2id,'long_name','Level Ozone Mixing Ratio' ncdf_attput,outfid,o2id,'units','kg/kg' ncdf_attput,outfid,o2id,'source','McClatchey standard atmosphere' ncdf_attput,outfid,wwid,'long_name','Layer Cloud Liquid Water Content' ncdf_attput,outfid,wwid,'units','g/m3' ncdf_attput,outfid,wwid,'source','Based on LWC retrievals' ncdf_attput,outfid,wwrid,'long_name','Layer Cloud Liquid Water Content -Frisch95' ncdf_attput,outfid,wwrid,'units','g/m3' ncdf_attput,outfid,wwrid,'source','Based on LWC retrievals' ncdf_attput,outfid,ww1id,'long_name','Layer Cloud Liquid Water Content - Empirical Fixed N' ncdf_attput,outfid,ww1id,'units','g/m3' ncdf_attput,outfid,ww1id,'source','Based on LWC retrievals' ncdf_attput,outfid,ww2id,'long_name','Layer Cloud Liquid Water Content - Empirical Variable N' ncdf_attput,outfid,ww2id,'units','g/m3' ncdf_attput,outfid,ww2id,'source','Based on LWC retrievals' ncdf_attput,outfid,wiid,'long_name','Layer Cloud Ice Water Content' ncdf_attput,outfid,wiid,'units','g/m3' ncdf_attput,outfid,wiid,'source','Based on IWC retrievals' ncdf_attput,outfid,wirid,'long_name','Layer Cloud Ice Water Content - Matrosov 99' ncdf_attput,outfid,wirid,'units','g/m3' ncdf_attput,outfid,wirid,'source','Based on IWC retrievals' ncdf_attput,outfid,widid,'long_name','Layer Cloud Ice Water Content - Matrosov 02' ncdf_attput,outfid,widid,'units','g/m3' ncdf_attput,outfid,widid,'source','Based on IWC retrievals' ncdf_attput,outfid,wisid,'long_name','Layer Cloud Ice Water Content - Empirical' ncdf_attput,outfid,wisid,'units','g/m3' ncdf_attput,outfid,wisid,'source','Based on IWC retrievals' ncdf_attput,outfid,qwid,'long_name','Layer Cloud Liquid Water Mixing Ratio' ncdf_attput,outfid,qwid,'units','kg/kg' ncdf_attput,outfid,qwid,'source','Based on LWC retrievals' ncdf_attput,outfid,qwrid,'long_name','Layer Cloud Liquid Water Mixing Ratio - Frisch 95' ncdf_attput,outfid,qwrid,'units','kg/kg' ncdf_attput,outfid,qwrid,'source','Based on LWC retrievals' ncdf_attput,outfid,qw1id,'long_name','Layer Cloud Liquid Water Mixing Ratio - Empirical Fixed N' ncdf_attput,outfid,qw1id,'units','kg/kg' ncdf_attput,outfid,qw1id,'source','Based on LWC retrievals' ncdf_attput,outfid,qw2id,'long_name','Layer Cloud Liquid Water Mixing Ratio - Empirical Variable N' ncdf_attput,outfid,qw2id,'units','kg/kg' ncdf_attput,outfid,qw2id,'source','Based on LWC retrievals' ncdf_attput,outfid,qiid,'long_name','Layer Cloud Ice Water Mixing Ratio' ncdf_attput,outfid,qiid,'units','kg/kg' ncdf_attput,outfid,qiid,'source','Based on IWC retrievals' ncdf_attput,outfid,qirid,'long_name','Layer Cloud Ice Water Mixing Ratio - Matrosov 99' ncdf_attput,outfid,qirid,'units','kg/kg' ncdf_attput,outfid,qirid,'source','Based on IWC retrievals' ncdf_attput,outfid,qidid,'long_name','Layer Cloud Ice Water Mixing Ratio - Matrosov 02' ncdf_attput,outfid,qidid,'units','kg/kg' ncdf_attput,outfid,qidid,'source','Based on IWC retrievals' ncdf_attput,outfid,qisid,'long_name','Layer Cloud Ice Water Mixing Ratio - Empirical' ncdf_attput,outfid,qisid,'units','kg/kg' ncdf_attput,outfid,qisid,'source','Based on IWC retrievals' ncdf_attput,outfid,rwid,'long_name','Layer Cloud Droplet Effective Radius (liquid)' ncdf_attput,outfid,rwid,'units','microns' ncdf_attput,outfid,rwid,'source','Based on liquid Re retrievals' ncdf_attput,outfid,rwrid,'long_name','Layer Cloud Droplet Effective Radius (liquid) - Frisch 95' ncdf_attput,outfid,rwrid,'units','microns' ncdf_attput,outfid,rwrid,'source','Based on liquid Re retrievals' ncdf_attput,outfid,rw1id,'long_name','Layer Cloud Droplet Effective Radius (liquid) - Empirical Fixed N' ncdf_attput,outfid,rw1id,'units','microns' ncdf_attput,outfid,rw1id,'source','Based on liquid Re retrievals' ncdf_attput,outfid,rw2id,'long_name','Layer Cloud Droplet Effective Radius (liquid) - Empirical Variable N' ncdf_attput,outfid,rw2id,'units','microns' ncdf_attput,outfid,rw2id,'source','Based on liquid Re retrievals' ncdf_attput,outfid,riid,'long_name','Layer Cloud Particle Effective Radius (ice)' ncdf_attput,outfid,riid,'units','microns' ncdf_attput,outfid,riid,'source','Based on ice Dmean retrievals' ncdf_attput,outfid,ririd,'long_name','Layer Cloud Particle Effective Radius (ice) - Matrosov 99' ncdf_attput,outfid,ririd,'units','microns' ncdf_attput,outfid,ririd,'source','Based on ice Dmean retrievals' ncdf_attput,outfid,ridid,'long_name','Layer Cloud Particle Effective Radius (ice) - Matrosov 02' ncdf_attput,outfid,ridid,'units','microns' ncdf_attput,outfid,ridid,'source','Based on ice Dmean retrievals' ncdf_attput,outfid,risid,'long_name','Layer Cloud Particle Effective Radius (ice) - Empirical' ncdf_attput,outfid,risid,'units','microns' ncdf_attput,outfid,risid,'source','Based on ice Dmean retrievals' ncdf_attput,outfid,xirid,'long_name','Extinction Coefficient - Matrosov 99' ncdf_attput,outfid,xirid,'units','1/m' ncdf_attput,outfid,xirid,'source','M02 extinction technique, M99 microphysics' ncdf_attput,outfid,xidid,'long_name','Extinction Coefficient - Matrosov 02' ncdf_attput,outfid,xidid,'units','1/m' ncdf_attput,outfid,xidid,'source','M02 extinction technique, M02 microphysics' ncdf_attput,outfid,xisid,'long_name','Extinction Coefficient - Empirical' ncdf_attput,outfid,xisid,'units','1/m' ncdf_attput,outfid,xisid,'source','M02 extinction technique, Emp microphysics' ncdf_attput,outfid,tsid,'long_name','Surface Temperature' ncdf_attput,outfid,tsid,'units','K' ncdf_attput,outfid,tsid,'source','GLAS rawinsonde system' ncdf_attput,outfid,alid,'long_name','Surface Albedo, broadband' ncdf_attput,outfid,alid,'units','unitless' ncdf_attput,outfid,alid,'source','CRREL albedo line' ncdf_attput,outfid,zaid,'long_name','Solar Zenith Angle' ncdf_attput,outfid,zaid,'units','Degrees' ncdf_attput,outfid,zaid,'comment','Calculated from lat, lon, time' ncdf_attput,outfid,ltid,'long_name','Latitude' ncdf_attput,outfid,ltid,'units','Degrees North' ncdf_attput,outfid,lnid,'long_name','Longitude' ncdf_attput,outfid,lnid,'units','Degrees West' ncdf_attput,outfid,ldid,'long_name','Broadband downwelling LW at surface' ncdf_attput,outfid,ldid,'units','W/m2' ncdf_attput,outfid,ldid,'source','Atmospheric Surface Flux Group - hourly averages' ncdf_attput,outfid,luid,'long_name','Broadband upwelling LW at surface' ncdf_attput,outfid,luid,'units','W/m2' ncdf_attput,outfid,luid,'source','Atmospheric Surface Flux Group - hourly averages' ncdf_attput,outfid,sdid,'long_name','Broadband downwelling SW at surface' ncdf_attput,outfid,sdid,'units','W/m2' ncdf_attput,outfid,sdid,'source','Atmospheric Surface Flux Group - hourly averages' ncdf_attput,outfid,suid,'long_name','Broadband upwelling SW at surface' ncdf_attput,outfid,suid,'units','W/m2' ncdf_attput,outfid,suid,'source','Atmospheric Surface Flux Group - hourly averages' ncdf_attput,outfid,mkid,'long_name','Cloud type classification mask' ncdf_attput,outfid,mkid,'comment','Distinguishes each pixel into different cloud/sky types' ncdf_attput,outfid,mkid,'value','0: clear, 1: Rain, 2: Snow, 3: Emp Liquid, 4: R-R Liquid, 5: Drizzle, 6: Emp Ice, 7: R-R Ice, 8: Mixed-phase, 9: Uncertain' ncdf_attput,outfid,/global,'Date',systime(0) ncdf_attput,outfid,/global,'Solar Constant','1354.2 W m-2 for (0.28-4.0 um) at 1 AU' ncdf_attput,outfid,/global,'Platforms','mcrs1microC1.c1, shbglastxtC1.a1' ncdf_control,outfid,/fill ncdf_control,outfid,/endef ncdf_varput,outfid,tmid,time ncdf_varput,outfid,pid,pl ncdf_varput,outfid,p2id,pl2 ncdf_varput,outfid,hid,hl ncdf_varput,outfid,h2id,hl2 ncdf_varput,outfid,tid,tl ncdf_varput,outfid,t2id,tl2 ncdf_varput,outfid,qid,rhl ncdf_varput,outfid,q2id,rhl2 ncdf_varput,outfid,oid,o3l ncdf_varput,outfid,o2id,o3l2 ncdf_varput,outfid,wwid,wcwl ncdf_varput,outfid,wwrid,wcwlr ncdf_varput,outfid,ww1id,wcwl1 ncdf_varput,outfid,ww2id,wcwl2 ncdf_varput,outfid,wiid,wcil ncdf_varput,outfid,wirid,wcilr ncdf_varput,outfid,widid,wcild ncdf_varput,outfid,wisid,wcils ncdf_varput,outfid,qwid,qcwl ncdf_varput,outfid,qwrid,qcwlr ncdf_varput,outfid,qw1id,qcwl1 ncdf_varput,outfid,qw2id,qcwl2 ncdf_varput,outfid,qiid,qcil ncdf_varput,outfid,qirid,qcilr ncdf_varput,outfid,qidid,qcild ncdf_varput,outfid,qisid,qcils ncdf_varput,outfid,rwid,rcwl ncdf_varput,outfid,rwrid,rcwlr ncdf_varput,outfid,rw1id,rcwl1 ncdf_varput,outfid,rw2id,rcwl2 ncdf_varput,outfid,riid,rcil ncdf_varput,outfid,ririd,rcilr ncdf_varput,outfid,ridid,rcild ncdf_varput,outfid,risid,rcils ncdf_varput,outfid,xirid,ixr ncdf_varput,outfid,xidid,ixd ncdf_varput,outfid,xisid,ixs ncdf_varput,outfid,tsid,ts ncdf_varput,outfid,alid,alb ncdf_varput,outfid,zaid,zen ncdf_varput,outfid,ltid,lat ncdf_varput,outfid,lnid,lon ncdf_varput,outfid,ldid,lwds ncdf_varput,outfid,luid,lwus ncdf_varput,outfid,sdid,swds ncdf_varput,outfid,suid,swus ncdf_varput,outfid,mkid,msk ncdf_close,outfid end