pro get_ciret1_5min, ciret1_fname, ciret1_iwc5, $ ciret1_dge5, ciret1_error_frac common five_min_data_input2, hrfrac5,jday5,height5,dbz5,nppts5,npts5,cbase5,ctop5, $ vel5, width5,temp5, pressure5, n_layers5,bzl15,tzl15,btl15,ttl15,bzl25,tzl25,btl25,ttl25, $ bzl35,tzl35,btl35,ttl35,bzl45,tzl45,btl45,ttl45,fluxclear5,solrat5,lwp5,vceil5,vap5 ; puts the iwc and re onto the time-height grid. for jjj=0,n_elements(ciret1_fname)-1 do begin ;help, ciret1_fname ;print, ciret1_fname[jjj], jjj cdfid=ncdf_open(strtrim(ciret1_fname[jjj],2)) ; open the netcdf file print, 'opened ',(strtrim(ciret1_fname[jjj],2)) time_did=ncdf_dimid(cdfid,'time') ncdf_diminq, cdfid, time_did, char_strng, num_times ; get the id's of the variables to be read num_sec_id=ncdf_varid(cdfid,'base_time') time_offset_id=ncdf_varid(cdfid,'time_offset') dbz_id=ncdf_varid(cdfid,'Z_mean') base_id=ncdf_varid(cdfid,'cld_base') top_id=ncdf_varid(cdfid,'top_base') iwc_id=ncdf_varid(cdfid,'IWC_mean') re_id=ncdf_varid(cdfid,'radius_effective_mean') tau_id=ncdf_varid(cdfid,'fl_vis_opt_depth_mean') radrat_id=ncdf_varid(cdfid,'Tb_diff') conc_id=ncdf_varid(cdfid,'Number_total_mean') clrflxobs_id=ncdf_varid(cdfid,'est_clr_flx_obs') clrflxcalc_id=ncdf_varid(cdfid,'clr_flx_calc') calc_sfd_id=ncdf_varid(cdfid,'calc_sfd') bsfd_id=ncdf_varid(cdfid,'bsfd') basetemp_id=ncdf_varid(cdfid,'cld_base_temp') ; get the data ncdf_varget, cdfid, num_sec_id, num_sec ncdf_varget, cdfid, time_offset_id, time_offset ijday_ihrfrac_fm_numsec, num_sec, time_offset, hrfrac, jday, yy, mm, dd, hh, mi, ss ncdf_varget, cdfid, dbz_id, dbz_in ncdf_varget, cdfid, base_id, cld_base_in ncdf_varget, cdfid, top_id, cld_top_in ncdf_varget, cdfid, iwc_id, iwc_in ncdf_varget, cdfid, re_id, re_in ncdf_varget, cdfid, tau_id, tau_in if radrat_id gt 0 then begin ncdf_varget, cdfid, radrat_id, radrat endif else begin radrat=re_in & radrat[*]=0.25 endelse if max(radrat) gt 0.10 then iwc_in[where(radrat gt 0.10)]=-9999. if max(re_in) gt 0.15 then iwc_in[where(re_in gt 0.150)]=-9999. if max(where(iwc_in eq -9999.)) gt -1 then hrfrac[where(iwc_in eq -9999.)]=-9999. ncdf_close, cdfid dbz_in=(10.*alog10(dbz_in))-4. dz_in=cld_top_in-cld_base_in ;ijday_ihrfrac_fm_numsec, num_sec, time_offset, hrfrac, jday, yy, mm, dd, hh, mi, ss ; loop through the observations, match times, then go through heights for j=0,n_elements(jday5)-1 do begin ;time_index=where( (abs(hrfrac[j]-hrfrac5)) le 0.25 ) time_index=where( (abs(jday-jday5[j])) le 0.0035 ) ;print, jday5[j],min( (abs(jday-jday5[j])) ),where( (abs(jday-jday5[j])) le 0.007 ) if max(time_index) gt -1 then begin for jjj=0,n_elements(time_index)-1 do begin z_index=where( min(abs(cld_base_in[time_index[jjj]]-height5)) eq abs(cld_base_in[time_index[jjj]]-height5) ) ;print, jjj,z_index,cld_base_in[j],height[z_index] if dbz5[z_index[0],j] ne -9999. then begin while dbz5[z_index[0],j] ne -9999. and z_index[0] gt 0 do begin z_index[0]=z_index[0]-1 endwhile z_index[0]=z_index[0]+1 endif while dbz5[z_index[0],j] ne -9999. do begin ciret1_iwc5[z_index[0],j]=iwc_in[time_index[jjj]] ;convert re to de re=(re_in[time_index[jjj]]*1.e3) ; de expression derived from assumed first order gamma, auer and veal aspect ratios and ; definition of de. dge linear fit comes from drawing a line through Fu (1996) table 2 data. de=-10.6148+(3.2419*re)-(0.02197*(re^2))+((6.652e-5)*re^3) ;ciret1_dge5[z_index[0],j]=(8.+(1.109*de))*1.e-6 ciret1_dge5[z_index[0],j]=(-2.6389+(2.3057*re)-((1.248e-2)*(re^2))-((3.12e-5)*(re^3)))*0.5e-6 ;print, ciret1_dge5[z_index[0],j]/1.e-6,dge_test ; a place holder for the error ciret1_error_frac[z_index[0],j]=0.25 z_index[0]=z_index[0]+1 endwhile ; while height[z_index] lt cld_top_in do begin endfor ;for jjj=0,n_elements(time_index)-1 endif ;if abs(hrfrac[j]-hrfrac5[time_index]) lt (1./1440.) then begin endfor ;for j=0,n_elements(re_in)-1 do begin endfor return end