;Script to write the sheba cloud stats output file. ; Must have scs.fy.dat loaded into the workspace. ;Create the output filename and file outfile='shebaclouds.19971020.19981001.cdf' fid=ncdf_create(outfile,/clobber) ;Define all dimensions tdid=ncdf_dimdef(fid,'time',n_elements(jtime)) ;Define all variables id0=ncdf_vardef(fid,'dtime',[tdid],/float) id1=ncdf_vardef(fid,'cldpresence',[tdid],/short) id2=ncdf_vardef(fid,'oper_r',[tdid],/short) id3=ncdf_vardef(fid,'oper_l',[tdid],/short) id4=ncdf_vardef(fid,'lb_b',[tdid],/float) id5=ncdf_vardef(fid,'lb_bt',[tdid],/float) id6=ncdf_vardef(fid,'lb_e',[tdid],/float) id7=ncdf_vardef(fid,'lb_et',[tdid],/float) id8=ncdf_vardef(fid,'lb_ei',[tdid],/short) id9=ncdf_vardef(fid,'lb_r',[tdid],/float) id10=ncdf_vardef(fid,'lb_l',[tdid],/float) ;id11=ncdf_vardef(fid,'lb_lt',[tdid],/float) id12=ncdf_vardef(fid,'ht_e',[tdid],/float) id13=ncdf_vardef(fid,'ht_et',[tdid],/float) id14=ncdf_vardef(fid,'ht_ei',[tdid],/short) id15=ncdf_vardef(fid,'ht_r',[tdid],/float) id16=ncdf_vardef(fid,'ht_l',[tdid],/float) id17=ncdf_vardef(fid,'ct_r',[tdid],/float) id18=ncdf_vardef(fid,'ct_l',[tdid],/float) id19=ncdf_vardef(fid,'nl_m',[tdid],/short) id20=ncdf_vardef(fid,'nl_i',[tdid],/short) id21=ncdf_vardef(fid,'nl_r',[tdid],/short) id22=ncdf_vardef(fid,'nl_l',[tdid],/short) id23=ncdf_vardef(fid,'liqpresent',[tdid],/short) id24=ncdf_vardef(fid,'liqheight',[tdid],/float) id25=ncdf_vardef(fid,'liqtemp',[tdid],/float) ;id26=ncdf_vardef(fid,'liqpresent2',[tdid],/short) ;id27=ncdf_vardef(fid,'liqheight2',[tdid],/float) ;id28=ncdf_vardef(fid,'liqtemp2',[tdid],/float) id29=ncdf_vardef(fid,'atten',[tdid],/short) id30=ncdf_vardef(fid,'precip',[tdid],/short) ;Define all attributes ncdf_attput,fid,id0,'long_name','Day number, decimal' ncdf_attput,fid,id0,'comment','Calculated from 1/1/1997' ncdf_attput,fid,id0,'interval','10-minute' ncdf_attput,fid,id1,'long_name','Cloud presence' ncdf_attput,fid,id1,'comment','Cloud present if either radar or lidar measured a return' ncdf_attput,fid,id1,'value','0: No cloud; 1: Cloud; -1: Radar and lidar inoperable' ncdf_attput,fid,id2,'long_name','Radar operational' ncdf_attput,fid,id2,'value','1: Radar was operational; -1: Radar was not operational' ncdf_attput,fid,id3,'long_name','Lidar operational' ncdf_attput,fid,id3,'value','1: Lidar was operational; -1: Lidar was not operational' ncdf_attput,fid,id4,'long_name','Lowest cloud base height, best estimate' ncdf_attput,fid,id4,'comment1','Lidar base is used unless lidar was not operational' ncdf_attput,fid,id4,'comment2','When lidar inoperable, radar base may be biased low by precipitation' ncdf_attput,fid,id4,'units','km AGL' ncdf_attput,fid,id5,'long_name','Temperature at lowest cloud base height, best estimate' ncdf_attput,fid,id5,'comment','Sounding-interpolated temperature for best estimate lowest cloud base' ncdf_attput,fid,id5,'units','Degrees C' ncdf_attput,fid,id6,'long_name','Lowest return height' ncdf_attput,fid,id6,'comment1','Lowest return height measured by radar or lidar' ncdf_attput,fid,id6,'comment2','Lowest return may be due to precipitation if measured by the radar' ncdf_attput,fid,id6,'units','km AGL' ncdf_attput,fid,id7,'long_name','Temperature at lowest return height' ncdf_attput,fid,id7,'comment','Sounding-interpolated temperature for lowest return height' ncdf_attput,fid,id7,'units','Degrees C' ncdf_attput,fid,id8,'long_name','Lowest return height, instrument' ncdf_attput,fid,id8,'comment','Designates which instrument measured the lowest return height' ncdf_attput,fid,id8,'value','0: radar; 1: lidar; 2: both within 45m; -1: both inoperable' ncdf_attput,fid,id9,'long_name','Lowest return height, radar' ncdf_attput,fid,id9,'comment1','Lowest return height measured by the radar' ncdf_attput,fid,id9,'comment2','Lowest return may be due to precipitation if present' ncdf_attput,fid,id9,'units','km AGL' ncdf_attput,fid,id10,'long_name','Lowest return height, lidar' ncdf_attput,fid,id10,'comment','Lowest return height measured by the lidar' ncdf_attput,fid,id10,'units','km AGL' ;ncdf_attput,fid,id11,'long_name','Temperature at lowest return height, lidar' ;ncdf_attput,fid,id11,'comment','Sounding-interpolated lidar return height temperature' ;ncdf_attput,fid,id11,'units','Degrees C' ncdf_attput,fid,id12,'long_name','Highest return height (Highest cloud top, best estimate)' ncdf_attput,fid,id12,'comment','Highest return height measured by radar and lidar' ncdf_attput,fid,id12,'units','km AGL' ncdf_attput,fid,id13,'long_name','Temperature at highest return height' ncdf_attput,fid,id13,'comments','Sounding-interpolated highest return height temperature' ncdf_attput,fid,id13,'units','Degrees C' ncdf_attput,fid,id14,'long_name','Highest return height, instrument' ncdf_attput,fid,id14,'comment','Designates which instrument measured the highest return height' ncdf_attput,fid,id14,'value','0: radar; 1: lidar; 2: both within 45m; -1: both inoperable' ncdf_attput,fid,id15,'long_name','Highest return height, radar' ncdf_attput,fid,id15,'comment','Highest return measured by the radar' ncdf_attput,fid,id15,'units','km AGL' ncdf_attput,fid,id16,'long_name','Highest return height, lidar' ncdf_attput,fid,id16,'comment','Highest return measured by the lidar' ncdf_attput,fid,id16,'units','km AGL' ncdf_attput,fid,id17,'long_name','Total cloud thickness, radar' ncdf_attput,fid,id17,'comment','Total thickness of all return layers measured by the radar' ncdf_attput,fid,id17,'units','km' ncdf_attput,fid,id18,'long_name','Total cloud thickness, lidar' ncdf_attput,fid,id18,'comment','Total thickness of all return layers measured by the lidar' ncdf_attput,fid,id18,'units','km' ncdf_attput,fid,id19,'long_name','Number of cloud layers' ncdf_attput,fid,id19,'comment','The maximum number of cloud layers observed by radar or lidar' ncdf_attput,fid,id20,'long_name','Number of cloud layers, instrument' ncdf_attput,fid,id20,'comment','Designates which instrument saw the most number of cloud layers' ncdf_attput,fid,id20,'value','0: radar; 1: lidar; 2: both same; -1: both inoperable' ncdf_attput,fid,id21,'long_name','Number of cloud layers, radar' ncdf_attput,fid,id21,'comment','May be biased low if layers are joined by precipitation' ncdf_attput,fid,id22,'long_name','Number of cloud layers, lidar' ncdf_attput,fid,id22,'comment','If lidar is attenuated it will miss any upper cloud layers' ncdf_attput,fid,id23,'long_name','Liquid layer present' ncdf_attput,fid,id23,'comment1','Designates whether there was an all-liquid layer in the vertical column' ncdf_attput,fid,id23,'comment2','A liquid layer is defined as having a lidar depolarization ratio less than or equal to 0.11' ncdf_attput,fid,id23,'value','0: No liquid; 1: Liquid layer(s) present; -1: No lidar data' ncdf_attput,fid,id24,'long_name','Height of lowest liquid layer' ncdf_attput,fid,id24,'comment','Lowest height at which a liquid layer occurred (using 0.11 liquid layer definition)' ncdf_attput,fid,id24,'units','km AGL' ncdf_attput,fid,id25,'long_name','Temperature at height of lowest liquid layer' ncdf_attput,fid,id25,'comment','Sounding-interpolated liquid layer temperature (using 0.11 liquid layer definition)' ncdf_attput,fid,id25,'units','Degrees C' ;ncdf_attput,fid,id26,'long_name','Liquid present' ;ncdf_attput,fid,id26,'comment1','Designates whether liquid was present in the vertical column, in all-liquid or mixed-phase layers' ;ncdf_attput,fid,id26,'comment2','Liquid present is defined as depolarization ratios less than or equal to 0.16 (includes mixed phase)' ;ncdf_attput,fid,id26,'value','0: No liquid; 1: Liquid present; -1: No lidar data' ;ncdf_attput,fid,id27,'long_name','Height of lowest liquid' ;ncdf_attput,fid,id27,'comment','Lowest height at which liquid occurred (using 0.16 liquid definition)' ;ncdf_attput,fid,id27,'units','km AGL' ;ncdf_attput,fid,id28,'long_name','Temperature at height of lowest liquid' ;ncdf_attput,fid,id28,'comment','Sounding-interpolated liquid temperature (using 0.16 liquid definition)' ;ncdf_attput,fid,id28,'units','Degrees C' ncdf_attput,fid,id29,'long_name','Lidar attenuated' ncdf_attput,fid,id29,'comment1','Attenuated if (radartop > 1km) and (radartop-lidartop > 200m)' ncdf_attput,fid,id29,'comment2','Attenuated if (radartop < 1km) and (radartop-lidartop > 80m)' ncdf_attput,fid,id29,'comment3','Not official definition of attenuation. May err on either side.' ncdf_attput,fid,id29,'value','0: Not attenuated; 1: Attenuated; -1: No lidar and/or radar data' ncdf_attput,fid,id30,'long_name','Precipitation present' ncdf_attput,fid,id30,'comment1','Precipitation if (lidarbase-radarbase > 90m)' ncdf_attput,fid,id30,'comment2','Not official definition of precipitation. Instead describes when radar return extends significantly below lidar cloud base.' ncdf_attput,fid,id30,'value','0: No precipitation; 1: precipitation; -1: No lidar and/or radar data' ;Define all global attributes ncdf_attput,fid,/global,'file_created','November 17, 2000' ncdf_attput,fid,/global,'experiment','Surface Heat Budget of the Arctic Ocean - SHEBA' ncdf_attput,fid,/global,'file_coverage','October 20, 1997 - October 1, 1998' ncdf_attput,fid,/global,'file_description','This file combines radar, lidar, and sounding measurements to give a comprehensive description of bulk cloud properties during SHEBA' ncdf_attput,fid,/global,'radar_platform','Merged radar cloud boundaries from the MMCR (Uttal)' ncdf_attput,fid,/global,'lidar_platform','Preliminary 10-min CLD files (layer averages) from DABUL (Intrieri)' ncdf_attput,fid,/global,'sounding_platform','Rawinsonde text files (Moritz), interpolated to time-height grid' ncdf_attput,fid,/global,'radar_processing','To degrade from 10-sec resolution, one radar beam is selected every 10 minutes' ncdf_attput,fid,/global,'flags','Missing data values of -999 and -1 were used for floats and shorts, respectively' ncdf_attput,fid,/global,'note','Any analysis utilizing these data should consider the times of operation for each instrument (oper_r and oper_l) and how they may influence statistics.' ncdf_attput,fid,/global,'lidar_note','In the near future a gridded lidar data set will be produced (instead of the current layer-averaged set) which may slightly alter this data set.' ncdf_attput,fid,/global,'contact','Matthew Shupe: matthew.shupe@noaa.gov, 303-497-6471' ncdf_attput,fid,/global,'organization','NOAA, Environmental Technology Laboratory' ;Switch to fill mode from define mode ncdf_control,fid,/fill ncdf_control,fid,/endef ;Write the data to the variable names ncdf_varput,fid,id0,jtime ncdf_varput,fid,id1,cloudpres ncdf_varput,fid,id2,instupr ncdf_varput,fid,id3,instupl ncdf_varput,fid,id4,lowbaseb ncdf_varput,fid,id5,lowbasebt ncdf_varput,fid,id6,lowbasee ncdf_varput,fid,id7,lowbaseet ncdf_varput,fid,id8,lowbasei ncdf_varput,fid,id9,lowbaser ncdf_varput,fid,id10,lowbasel ;ncdf_varput,fid,id11,lowbaselt ncdf_varput,fid,id12,hightope ncdf_varput,fid,id13,hightopet ncdf_varput,fid,id14,hightopi ncdf_varput,fid,id15,hightopr ncdf_varput,fid,id16,hightopl ncdf_varput,fid,id17,cthickr ncdf_varput,fid,id18,cthickl ncdf_varput,fid,id19,numlayc ncdf_varput,fid,id20,numlayi ncdf_varput,fid,id21,numlayr ncdf_varput,fid,id22,numlayl ncdf_varput,fid,id23,liquidl ncdf_varput,fid,id24,liqheight ncdf_varput,fid,id25,liqtemp ;ncdf_varput,fid,id26,liquidl2 ;ncdf_varput,fid,id27,liqheight2 ;ncdf_varput,fid,id28,liqtemp2 ncdf_varput,fid,id29,attenl ncdf_varput,fid,id30,precip ;Close the netCDF file ncdf_close,fid end