;Create an all-ice cloud model experiment arg='19980428' ;tmlim=[19.0,19.09] tmlim=[16.1,16.3] ;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] biwp=total(bwcil*45) arho=bpl/btl/287.0*100000.0 ;dry air density, in g/m3 expm=['Baseline'] ;Now build the experiments ;explicit vs bulk ;Get layer-mean microphysical values brcil_lm=brcil*0.0 & bwcil_lm=brcil_lm & bqcil_lm=brcil_lm & brcil_fx=brcil_lm iwh=where(brcil gt 0) tmp=total(brcil[iwh]*bwcil[iwh])/total(bwcil[iwh]) brcil_lm[iwh]=tmp brcil_fx[iwh]=1.0 tmp=mean(bwcil[iwh]) bwcil_lm[iwh]=tmp tmp=mean(bqcil[iwh]) bqcil_lm[iwh]=tmp expm=[expm,'LayerMeanRe','LayerMeanBoth','0.5LayerMeanRe','0.5LayerMeanBoth','2.0LayerMeanRe','2.0LayerMeanBoth','Re30Fixed','Re50Fixed','Re100Fixed'] time=[btime,btime,btime,btime,btime,btime,btime,btime,btime,btime] pl=[bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[btl,btl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[bwcil,bwcil,bwcil_lm,bwcil,0.5*bwcil_lm,bwcil,2.0*bwcil_lm,bwcil,bwcil,bwcil] qcwl=[bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[bqcil,bqcil,bqcil_lm,bqcil,0.5*bqcil_lm,bqcil,2.0*bqcil_lm,bqcil,bqcil,bqcil] rcwl=[brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[brcil,brcil_lm,brcil_lm,0.5*brcil_lm,0.5*brcil_lm,2.0*brcil_lm,2.0*brcil_lm,30*brcil_fx,50*brcil_fx,100*brcil_fx] ts=[bts,bts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[blat,blat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[blon,blon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Structure wh=where(bwcil gt 0,num) e1c=bwcil*0.0 & e1r=e1c & e2c=e1c & e2r=e1c & e3c=e1c & e3r=e1c & e4c=e1c & e4r=e1c e1c[wh]=reverse(bwcil[wh]) e1r[wh]=reverse(brcil[wh]) tmp=(findgen(num)+1)/(num) tmpp=total(tmp)*45 e2c[wh]=tmp/tmpp*biwp e2r[wh]=tmp*(brcil_lm[iwh[0]]*total(e2c[wh])/total(e2c[wh]*tmp)) e3c[wh]=reverse(e2c[wh]) e3r[wh]=reverse(e2r[wh]) hnum=fix(num/2.0) if num mod 2 eq 0 then tmp=[(findgen(hnum)+1)/(hnum+1),reverse((findgen(hnum)+1)/(hnum))] else tmp=[(findgen(hnum+1)+1)/(hnum+1),reverse((findgen(hnum)+1)/(hnum+1))] tmpp=total(tmp)*45 e4c[wh]=tmp/tmpp*biwp e4r[wh]=tmp*( brcil_lm[iwh[0]] * total(e4c[wh]) / total(e4c[wh]*tmp)) expm=[expm,'Inverted','LinearLow','LinearHigh','LinearMid','0.1*Both','0.5*Both','2.0*Both','0.1*Re','0.5*Re','2.0*Re','0.1*IWC','0.5*IWC','2.0*IWC','3.0*IWC','Clear'] time=[time,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime,btime] pl=[pl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] wcil=[wcil,e1c,e2c,e3c,e4c,0.1*bwcil,0.5*bwcil,2.0*bwcil,bwcil,bwcil,bwcil,0.1*bwcil,0.5*bwcil,2.0*bwcil,3.0*bwcil,0.0*bwcil] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] qcil=[qcil,e1c/arho,e2c/arho,e3c/arho,e4c/arho,0.1*bqcil,0.5*bqcil,2.0*bqcil,bqcil,bqcil,bqcil,0.1*bqcil,0.5*bqcil,2.0*bqcil,3.0*bqcil,0.0*bqcil] rcwl=[rcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl,brcwl] rcil=[rcil,e1r,e2r,e3r,e4r,0.1*brcil,0.5*brcil,2.0*brcil,0.1*brcil,0.5*brcil,2.0*brcil,brcil,brcil,brcil,brcil,0.0*brcil] ts=[ts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts,bts] albs=[albs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen,bzen] lat=[lat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat,blat] lon=[lon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask,bmask] ;Phase study expm=[expm,'LiquidStraight','LiquidRealistic'] time=[time,btime,btime] pl=[pl,bpl,bpl] pl2=[pl2,bpl2,bpl2] tl=[tl,btl,btl] tl2=[tl2,btl2,btl2] rhl=[rhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2] wcwl=[wcwl,bwcil,bwcil/biwp*50.0] wcil=[wcil,0.0*bwcil,0.0*bwcil] qcwl=[qcwl,bqcil,bwcil/biwp*50.0/arho] qcil=[qcil,0.0*bqcil,0.0*bqcil] rcwl=[rcwl,brcil,brcil/brcil_lm[iwh[0]]*9.0] rcil=[rcil,0.0*brcil,0.0*brcil] ts=[ts,bts,bts] albs=[albs,balbs,balbs] zen=[zen,bzen,bzen] lat=[lat,blat,blat] lon=[lon,blon,blon] lwd=[lwd,blwd,blwd] lwu=[lwu,blwu,blwu] swd=[swd,bswd,bswd] swu=[swu,bswu,bswu] mask=[mask,bmask,bmask] ;IWP (0-100 g/m2 in 10 g/m2 steps) wcfact=(findgen(11)*10.0)/biwp expm=[expm,'iwp0','iwp10','iwp20','iwp30','iwp40','iwp50','iwp60','iwp70','iwp80','iwp90','iwp100'] 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] wcil=[wcil,bwcil*wcfact[0],bwcil*wcfact[1],bwcil*wcfact[2],bwcil*wcfact[3],bwcil*wcfact[4],bwcil*wcfact[5],bwcil*wcfact[6],bwcil*wcfact[7],bwcil*wcfact[8],bwcil*wcfact[9],bwcil*wcfact[10]] wcwl=[wcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl,bwcwl] qcil=[qcil,bwcil/arho*wcfact[0],bwcil/arho*wcfact[1],bwcil/arho*wcfact[2],bwcil/arho*wcfact[3],bwcil/arho*wcfact[4],bwcil/arho*wcfact[5],bwcil/arho*wcfact[6],bwcil/arho*wcfact[7],bwcil/arho*wcfact[8],bwcil/arho*wcfact[9],bwcil/arho*wcfact[10]] qcwl=[qcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl,bqcwl] 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.icexp.'+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',16) 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