;Create a mixed-phase model experiment arg='19980504' ;tmlim=[21.75,22.09] tmlim=[21.9,21.98] ;Get all of the rtinput data and cut down to the pertinent profile cd,'/data1/sheba/heatrate' farg='rtinput.'+arg+'.cdf' file=findfile(farg) fid=ncdf_open(file[0]) ncdf_varget,fid,ncdf_varid(fid,'albs'),albs ncdf_varget,fid,ncdf_varid(fid,'hl'),hl ncdf_varget,fid,ncdf_varid(fid,'hl2'),hl2 ncdf_varget,fid,ncdf_varid(fid,'lat'),lat ncdf_varget,fid,ncdf_varid(fid,'lon'),lon ncdf_varget,fid,ncdf_varid(fid,'lwd'),ld ncdf_varget,fid,ncdf_varid(fid,'lwu'),lu ncdf_varget,fid,ncdf_varid(fid,'mask'),mask ncdf_varget,fid,ncdf_varid(fid,'o3l'),o3l ncdf_varget,fid,ncdf_varid(fid,'o3l2'),o3l2 ncdf_varget,fid,ncdf_varid(fid,'pl'),pl ncdf_varget,fid,ncdf_varid(fid,'pl2'),pl2 ncdf_varget,fid,ncdf_varid(fid,'qcil'),qcil ncdf_varget,fid,ncdf_varid(fid,'qcwl'),qcwl ncdf_varget,fid,ncdf_varid(fid,'rcil'),rcil ncdf_varget,fid,ncdf_varid(fid,'rcwl'),rcwl ncdf_varget,fid,ncdf_varid(fid,'rhl'),rhl ncdf_varget,fid,ncdf_varid(fid,'rhl2'),rhl2 ncdf_varget,fid,ncdf_varid(fid,'swd'),sd ncdf_varget,fid,ncdf_varid(fid,'swu'),su ncdf_varget,fid,ncdf_varid(fid,'time'),time ncdf_varget,fid,ncdf_varid(fid,'tl'),tl ncdf_varget,fid,ncdf_varid(fid,'tl2'),tl2 ncdf_varget,fid,ncdf_varid(fid,'ts'),ts ncdf_varget,fid,ncdf_varid(fid,'wcil'),wcil ncdf_varget,fid,ncdf_varid(fid,'wcwl'),wcwl ncdf_varget,fid,ncdf_varid(fid,'zen'),zen ncdf_close,fid iwh=where(time ge tmlim[0] and time le tmlim[1],nump) wh=where(ld gt 0 and lu gt 0,cnt) if cnt gt 0 then begin blwd=interpol(ld[wh],time[wh],time[iwh]) blwu=interpol(lu[wh],time[wh],time[iwh]) endif else begin blwd=fltarr(nump)-999 blwu=blwd endelse wh=where(sd gt 0 and su gt 0,cnt) if cnt gt 0 then begin bswu=interpol(su[wh],time[wh],time[iwh]) bswd=interpol(sd[wh],time[wh],time[iwh]) endif else begin bswu=fltarr(nump)-999 bswd=bswu endelse balbs=albs[iwh] & blat=lat[iwh] & blon=lon[iwh] & bmask=mask[iwh,*] bo3l=o3l[iwh,*] & bo3l2=o3l2[iwh,*] & bpl=pl[iwh,*] & bpl2=pl2[iwh,*] bqcil=qcil[iwh,*] & bqcwl=qcwl[iwh,*] & brcil=rcil[iwh,*] & brcwl=rcwl[iwh,*] brhl=rhl[iwh,*] & brhl2=rhl2[iwh,*] & btime=time[iwh] btl=tl[iwh,*] & btl2=tl2[iwh,*] & bts=ts[iwh] bwcil=wcil[iwh,*] & bwcwl=wcwl[iwh,*] & bzen=zen[iwh] ;get MWR_LWP data cd,'/data2/sheba/microphysics' farg='shbmcrs*'+arg+'*.cdf' file=findfile(farg) fid=ncdf_open(file[0]) ncdf_varget,fid,ncdf_varid(fid,'lwp'),lw ncdf_varget,fid,ncdf_varid(fid,'time'),mtime ncdf_close,fid blwp_mw=interpol(lw,mtime,time) ;get Aircraft data cd,'/data1/sheba/fireace/ncar_c130' restore,'RF01A.idl.dat' wh=where(ftime gt 21.88 and ftime lt 21.902,num) layerthick=fltarr(num) for i=1,num-2 do layerthick[i]=mean(palt[wh[i]-1:wh[i]])-mean(palt[wh[i]:wh[i]+1]) ;wh2=where(lwc_f1[wh] lt 0.5) & clwc_f1=interpol(lwc_f1[wh[wh2]],ftime[wh[wh2]],ftime[wh]) clwc_g=lwc_g[wh] ;wh2=where(re_f1[wh] lt 9) & cre_f1=interpol(re_f1[wh[wh2]],ftime[wh[wh2]],ftime[wh]) wh2=where(re_g[wh] lt 9) cre_g=interpol(re_g[wh[wh2]],ftime[wh[wh2]],ftime[wh]) ;clwp_f1=total(clwc_f1*layerthick) clwp_g=total(clwc_g*layerthick) palt=palt[wh] ;lwc_f1=interpol(clwc_f1,palt,hl*1000.) lwc_g=interpol(clwc_g,palt,hl*1000.) ;re_f1=interpol(cre_f1,palt,hl*1000.) re_g=interpol(cre_g,palt,hl*1000.) wh=where(hl lt 0.6 or hl gt 1.12) ;lwc_f1[wh]=0 ;FSSP LWC corrected profile lwc_g[wh]=0 ;Gerber LWC corrected profile ;re_f1[wh]=0 ;FSSP RE corrected profile re_g[wh]=0 ;Gerber RE corrected profile wh=where(lwc_g gt 0,num) re_flt=re_g*0.0 rerange=[7.0,5.0] re_flt[wh]=reverse((findgen(num)/(num-1))*2.0+5.0) brcwl=transpose(re_flt) ;Baseline Re profile bwcwl=transpose(lwc_g) ;Baseline LWC profile arho=bpl/btl/287.0*100000.0 ;dry air density, in g/m3 bqcwl=bwcwl/arho num=n_elements(hl) layerthick=fltarr(num) for i=1,num-2 do layerthick[i]=mean(hl[i-1:i])-mean(hl[i:i+1]) blwp_flt=total(layerthick*1000.0*bwcwl) expm=['Baseline'] ;Now build the experiments ;Structure wh=where(bwcwl gt 0) e1=bwcwl*0.0 & e2=e1 & e3=e1 & e4=e1 & e5=e1 & e6=e1 & e7=e1 & e8=e1 & e22=e1 & e33=e1 & e44=e1 & e55=e1 & e66=e1 & e77=e1 & e88=e1 e1[wh]=reverse(bwcwl[wh]) e2[281:292]=bwcwl[wh] e22[281:292]=brcwl[wh] e3[286:297]=bwcwl[wh] e33[286:297]=brcwl[wh] e4[275:298]=reverse((findgen(24)/23.0)*(2.0*mean(bwcwl[wh]))) e44[275:298]=reverse((findgen(24)/23.0)*2.0+5.0) e5[274:297]=(findgen(24)/23.0)*(2.0*mean(bwcwl[wh])) e55[274:297]=(findgen(24)/23.0)*2.0+5.0 e6[274:298]=[(findgen(13)/12.0)*(2.0*mean(bwcwl[wh])),reverse( (findgen(12)/12.0)*(2.0*mean(bwcwl[wh])))] e66[274:298]=[(findgen(13)/12.0)*2.0+5.0,reverse((findgen(12)/12.0)*2.0+5.0)] e7[275:297]=mean(bwcwl[wh]) e77[275:297]=6.0 e8[275:297]=[bwcwl[wh]/2.0,bwcwl[wh[0:10]]/2.0] e88[275:297]=[reverse((findgen(12)/11.0)*2.0+5.0),reverse((findgen(11)/10.0)*2.0+5.0)] expm=[expm,'LWC_reverseprof','LWC_basemid','LWC_baselow','LWC_fullhigh','LWC_fulllow','LWC_fullmid','LWC_fullfixed','LWC_twolayer'] time=[btime,btime,btime,btime,btime,btime,btime,btime,btime] pl=[bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[btl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[bwcwl,e1,e2,e3,e4,e5,e6,e7,e8] wcil=[bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[bqcwl,e1/arho,e2/arho,e3/arho,e4/arho,e5/arho,e6/arho,e7/arho,e8/arho] qcil=[bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[brcwl,brcwl,e22,e33,e44,e55,e66,e77,e88] rcil=[brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[bts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[blat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[blon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Re wh=where(brcwl gt 0) e1=brcwl & e2=e1 & e3=e1 & e4=e1 & e5=e1 & e6=e1 & e7=e1 & e8=e1 e1[wh]=e1[wh]-2.0 e2[wh]=e2[wh]-1.0 e3[wh]=e3[wh]+1.0 e4[wh]=e4[wh]+2.0 e5[wh]=e5[wh]+3.0 e6[wh]=e6[wh]+4.0 e7[wh]=reverse(e7[wh]) e8[wh]=6.0 expm=[expm,'Re-2','Re-1','Re+1','Re+2','Re+3','Re+4','ReReverse','ReFix6'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,e1,e2,e3,e4,e5,e6,e7,e8] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;LWP (0-100 g/m2 in 10 g/m2 steps) wcfact=(findgen(11)*10.0)/blwp_flt expm=[expm,'lwp0','lwp10','lwp20','lwp30','lwp40','lwp50','lwp60','lwp70','lwp80','lwp90','lwp100'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl*wcfact[0],bwcwl*wcfact[1],bwcwl*wcfact[2],bwcwl*wcfact[3],bwcwl*wcfact[4],bwcwl*wcfact[5],bwcwl*wcfact[6],bwcwl*wcfact[7],bwcwl*wcfact[8],bwcwl*wcfact[9],bwcwl*wcfact[10]] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bwcwl/arho*wcfact[0],bwcwl/arho*wcfact[1],bwcwl/arho*wcfact[2],bwcwl/arho*wcfact[3],bwcwl/arho*wcfact[4],bwcwl/arho*wcfact[5],bwcwl/arho*wcfact[6],bwcwl/arho*wcfact[7],bwcwl/arho*wcfact[8],bwcwl/arho*wcfact[9],bwcwl/arho*wcfact[10]] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Temperature (Sounding -10C to +10C in 2C steps) expm=[expm,'T-10','T-8','T-6','T-4','T-2','T+2','T+4','T+6','T+8','T+10'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl-10.0,btl-8.0,btl-6.0,btl-4.0,btl-2.0,btl+2.0,btl+4.0,btl+6.0,btl+8.0,btl+10.0] tl2=[tl2,btl2-10.0,btl2-8.0,btl2-6.0,btl2-4.0,btl2-2.0,btl2+2.0,btl2+4.0,btl2+6.0,btl2+8.0,btl2+10.0] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts-10.0,bts-8.0,bts-6.0,bts-4.0,bts-2.0,bts+2.0,bts+4.0,bts+6.0,bts+8.0,bts+10.0] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Albedo (surface albedo 0.3-1.0 in 0.1 steps) expm=[expm,'Alb0.3','Alb0.4','Alb0.5','Alb0.6','Alb0.7','Alb0.8','Alb0.9','Alb1.0'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Zenith Angle (SZA 40-110 in 10 steps) expm=[expm,'Zen40','Zen50','Zen60','Zen70','Zen80','Zen90','Zen100','Zen110'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,40.0,50.0,60.0,70.0,80.0,90.0,100.0,110.0] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;RH and O3 expm=[expm,'RH*0.5','RH*0.75','RH*1.5','RH*2.0','O3*0.5','O3*0.75','O3*1.5','O3*2.0'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl*0.5,brhl*0.75,brhl*1.5<100.0,brhl*2.0<100.0,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2*0.5,brhl2*0.75,brhl2*1.5<100.0,brhl2*2.0<100.0,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l*0.5,bo3l*0.75,bo3l*1.5,bo3l*2.0] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2*0.5,bo3l2*0.75,bo3l2*1.5,bo3l2*2.0] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] cd,'/data1/sheba/heatrate/experiments' ;Write the output ncdf file ;Write netCDF file numbeam=n_elements(time) nhts=n_elements(hl) fname='rtinput.mpexp.'+arg+'.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) bdid=ncdf_dimdef(outfid,'byte',15) 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) wiid=ncdf_vardef(outfid,'wcil',[tdid,hdid],/float) qwid=ncdf_vardef(outfid,'qcwl',[tdid,hdid],/float) qiid=ncdf_vardef(outfid,'qcil',[tdid,hdid],/float) rwid=ncdf_vardef(outfid,'rcwl',[tdid,hdid],/float) riid=ncdf_vardef(outfid,'rcil',[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) exid=ncdf_vardef(outfid,'expm',[tdid,bdid],/byte) 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,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,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,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,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,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,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,exid,'long_name','Experiment name' ncdf_attput,outfid,exid,'comment','Will describe what changes have been made from the baseline run' 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_attput,outfid,/global,'Baseline','Baseline run consists of the following number of profiles from the file beginning: '+strtrim(nump,2) 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,wiid,wcil ncdf_varput,outfid,qwid,qcwl ncdf_varput,outfid,qiid,qcil ncdf_varput,outfid,rwid,rcwl ncdf_varput,outfid,riid,rcil ncdf_varput,outfid,tsid,ts ncdf_varput,outfid,alid,albs ncdf_varput,outfid,zaid,zen ncdf_varput,outfid,ltid,lat ncdf_varput,outfid,lnid,lon ncdf_varput,outfid,ldid,lwd ncdf_varput,outfid,luid,lwu ncdf_varput,outfid,sdid,swd ncdf_varput,outfid,suid,swu ncdf_varput,outfid,mkid,mask ncdf_varput,outfid,exid,transpose(byte(expm)) ncdf_close,outfid end