;Create an all-liquid cloud model experiment arg='19980714' tmlim=[21.9,22.0] ;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] blwp=total(bwcwl*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 brcwl_lm=brcwl*0.0 & bwcwl_lm=brcwl_lm & bqcwl_lm=brcwl_lm & brcwl_fx=brcwl_lm iwh=where(brcwl gt 0) tmp=float(total(brcwl[iwh]*bwcwl[iwh]))/total(bwcwl[iwh]) brcwl_lm[iwh]=tmp brcwl_fx[iwh]=1.0 tmp=mean(bwcwl[iwh]) bwcwl_lm[iwh]=tmp tmp=mean(bqcwl[iwh]) bqcwl_lm[iwh]=tmp expm=[expm,'LayerMeanRe','LayerMeanBoth','0.5LayerMeanRe','0.5LayerMeanBoth','2.0LayerMeanRe','2.0LayerMeanBoth','Re8Fixed','Re10Fixed','Re15Fixed'] 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] wcil=[bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] wcwl=[bwcwl,bwcwl,bwcwl_lm,bwcwl,0.5*bwcwl_lm,bwcwl,2.0*bwcwl_lm,bwcwl,bwcwl,bwcwl] qcil=[bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] qcwl=[bqcwl,bqcwl,bqcwl_lm,bqcwl,0.5*bqcwl_lm,bqcwl,2.0*bqcwl_lm,bqcwl,bqcwl,bqcwl] rcil=[brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] rcwl=[brcwl,brcwl_lm,brcwl_lm,0.5*brcwl_lm,0.5*brcwl_lm,2.0*brcwl_lm,2.0*brcwl_lm,8*brcwl_fx,10*brcwl_fx,15*brcwl_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(bwcwl gt 0,num) e1c=bwcil*0.0 & e1r=e1c & e2c=e1c & e2r=e1c & e3c=e1c & e3r=e1c & e4c=e1c & e4r=e1c e1c[wh]=reverse(bwcwl[wh]) e1r[wh]=reverse(brcwl[wh]) tmp=(findgen(num)+1)/(num) tmpp=total(tmp)*45 e2c[wh]=tmp/tmpp*blwp e2r[wh]=tmp*(brcwl_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*blwp e4r[wh]=tmp*( brcwl_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*LWC','0.5*LWC','2.0*LWC','3.0*LWC','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] wcil=[wcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil,bwcil] wcwl=[wcwl,e1c,e2c,e3c,e4c,0.1*bwcwl,0.5*bwcwl,2.0*bwcwl,bwcwl,bwcwl,bwcwl,0.1*bwcwl,0.5*bwcwl,2.0*bwcwl,3.0*bwcwl,0.0*bwcwl] qcil=[qcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil,bqcil] qcwl=[qcwl,e1c/arho,e2c/arho,e3c/arho,e4c/arho,0.1*bqcwl,0.5*bqcwl,2.0*bqcwl,bqcwl,bqcwl,bqcwl,0.1*bqcwl,0.5*bqcwl,2.0*bqcwl,3.0*bqcwl,0.0*bqcwl] rcil=[rcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil,brcil] rcwl=[rcwl,e1r,e2r,e3r,e4r,0.1*brcwl,0.5*brcwl,2.0*brcwl,0.1*brcwl,0.5*brcwl,2.0*brcwl,brcwl,brcwl,brcwl,brcwl,0.0*brcwl] 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,'IceStraight','IceRealistic','Mixed-phase'] e1c=bwcil*0.0 & e1r=e1c e1c[wh[0]+2:*]=0.003 ;Based on the 5/4 case e1r[wh[0]+2:*]=100.0 time=[time,btime,btime,btime] pl=[pl,bpl,bpl,bpl] pl2=[pl2,bpl2,bpl2,bpl2] tl=[tl,btl,btl,btl] tl2=[tl2,btl2,btl2,btl2] rhl=[rhl,brhl,brhl,brhl] rhl2=[rhl2,brhl2,brhl2,brhl2] o3l=[o3l,bo3l,bo3l,bo3l] o3l2=[o3l2,bo3l2,bo3l2,bo3l2] wcil=[wcil,bwcwl,bwcwl/blwp*40.0,e1c] wcwl=[wcwl,0.0*bwcwl,0.0*bwcwl,bwcwl] qcil=[qcil,bqcwl,bwcwl/blwp*40.0/arho,e1c/arho] qcwl=[qcwl,0.0*bqcwl,0.0*bqcwl,bqcwl] rcil=[rcil,brcwl,brcwl/brcwl_lm[iwh[0]]*100.0,e1r] rcwl=[rcwl,0.0*brcwl,0.0*brcwl,brcwl] ts=[ts,bts,bts,bts] albs=[albs,balbs,balbs,balbs] zen=[zen,bzen,bzen,bzen] lat=[lat,blat,blat,blat] lon=[lon,blon,blon,blon] lwd=[lwd,blwd,blwd,blwd] lwu=[lwu,blwu,blwu,blwu] swd=[swd,bswd,bswd,bswd] swu=[swu,bswu,bswu,bswu] mask=[mask,bmask,bmask,bmask] ;IWP (0-200 g/m2 in 20 g/m2 steps) wcfact=(findgen(11)*20.0)/blwp expm=[expm,'lwp0','lwp20','lwp40','lwp60','lwp80','lwp100','lwp120','lwp140','lwp160','lwp180','lwp200'] 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.lqexp.'+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