;******************************************************************************************* ; Read in the data from the basic 5min file ;******************************************************************************************* pro get_5min_avg_sb,cdf_file ;******************************************************************************************* ; Commons ;******************************************************************************************* common five_min_data_input, base_time,time_offset,mxrat,$ height,reflectivity,reflectp,reflectc,velocity,spectrum,$ temp,pressure,n_layers,bzl1,tzl1,btl1,ttl1,bzl2,tzl2,btl2,ttl2,$ bzl3,tzl3,btl3,ttl3,bzl4,tzl4,btl4,ttl4,fluxclear,lwp,vceil,vap ; These variables are read in but not passed out ;down_short,down_long,up_short,up_long ;******************************************************************************************* ; Open the netcdf file and get the data ;******************************************************************************************* ; Open the file print,cdf_file cdf_id=ncdf_open(cdf_file) ; Check for reflectivity reflect_id=ncdf_varid(cdf_id,'ReflectivityBestEstimate') ; If reflectivity exists, continue on if reflect_id ge 0 then begin ; Get the variable id's baset_id=ncdf_varid(cdf_id,'base_time') timeo_id=ncdf_varid(cdf_id,'time_offset') height_id=ncdf_varid(cdf_id,'height') ; Get the variables if baset_id ne -1 then ncdf_varget,cdf_id,baset_id,base_time if timeo_id ne -1 then ncdf_varget,cdf_id,timeo_id,time_offset if height_id ne -1 then ncdf_varget,cdf_id,height_id,height reflectp_id=ncdf_varid(cdf_id,'ReflectivityPossiblePoints') reflectc_id=ncdf_varid(cdf_id,'ReflectivityCloudyPoints') if reflect_id ne -1 then ncdf_varget,cdf_id,reflect_id,reflectivity if reflectp_id ne -1 then ncdf_varget,cdf_id,reflectp_id,reflectp if reflectc_id ne -1 then ncdf_varget,cdf_id,reflectc_id,reflectc velocit_id=ncdf_varid(cdf_id,'MeanDopplerVelocity') spectr_id=ncdf_varid(cdf_id,'SpectralWidth') if velocit_id ne -1 then ncdf_varget,cdf_id,velocit_id,velocity if spectr_id ne -1 then ncdf_varget,cdf_id,spectr_id,spectrum temp_id=ncdf_varid(cdf_id,'temp') press_id=ncdf_varid(cdf_id,'pressure') mxrat_id = ncdf_varid(cdf_id,'mxrat') nlayers_id=ncdf_varid(cdf_id,'number_of_layers') if temp_id ne -1 then ncdf_varget,cdf_id,temp_id,temp if press_id ne -1 then ncdf_varget,cdf_id,press_id,pressure if mxrat_id ne -1 then ncdf_varget,cdf_id,mxrat_id,mxrat if nlayers_id ne -1 then ncdf_varget,cdf_id,nlayers_id,n_layers bzl1_id=ncdf_varid(cdf_id,'base_height_layer_1') tzl1_id=ncdf_varid(cdf_id,'top_height_layer_1') btl1_id=ncdf_varid(cdf_id,'base_temp_layer_1') ttl1_id=ncdf_varid(cdf_id,'top_temp_layer_1') if bzl1_id ne -1 then ncdf_varget,cdf_id,bzl1_id,bzl1 if tzl1_id ne -1 then ncdf_varget,cdf_id,tzl1_id,tzl1 if btl1_id ne -1 then ncdf_varget,cdf_id,btl1_id,btl1 if ttl1_id ne -1 then ncdf_varget,cdf_id,ttl1_id,ttl1 bzl2_id=ncdf_varid(cdf_id,'base_height_layer_2') tzl2_id=ncdf_varid(cdf_id,'top_height_layer_2') btl2_id=ncdf_varid(cdf_id,'base_temp_layer_2') ttl2_id=ncdf_varid(cdf_id,'top_temp_layer_2') if bzl2_id ne -1 then ncdf_varget,cdf_id,bzl2_id,bzl2 if tzl2_id ne -1 then ncdf_varget,cdf_id,tzl2_id,tzl2 if btl2_id ne -1 then ncdf_varget,cdf_id,btl2_id,btl2 if ttl2_id ne -1 then ncdf_varget,cdf_id,ttl2_id,ttl2 bzl3_id=ncdf_varid(cdf_id,'base_height_layer_3') tzl3_id=ncdf_varid(cdf_id,'top_height_layer_3') btl3_id=ncdf_varid(cdf_id,'base_temp_layer_3') ttl3_id=ncdf_varid(cdf_id,'top_temp_layer_3') if bzl3_id ne -1 then ncdf_varget,cdf_id,bzl3_id,bzl3 if tzl3_id ne -1 then ncdf_varget,cdf_id,tzl3_id,tzl3 if btl3_id ne -1 then ncdf_varget,cdf_id,btl3_id,btl3 if ttl3_id ne -1 then ncdf_varget,cdf_id,ttl3_id,ttl3 bzl4_id=ncdf_varid(cdf_id,'base_height_layer_4') tzl4_id=ncdf_varid(cdf_id,'top_height_layer_4') btl4_id=ncdf_varid(cdf_id,'base_temp_layer_4') ttl4_id=ncdf_varid(cdf_id,'top_temp_layer_4') if bzl4_id ne -1 then ncdf_varget,cdf_id,bzl4_id,bzl4 if tzl4_id ne -1 then ncdf_varget,cdf_id,tzl4_id,tzl4 if btl4_id ne -1 then ncdf_varget,cdf_id,btl4_id,btl4 if ttl4_id ne -1 then ncdf_varget,cdf_id,ttl4_id,ttl4 down_short_id=ncdf_varid(cdf_id,'down_short') down_long_id=ncdf_varid(cdf_id,'down_long') up_short_id=ncdf_varid(cdf_id,'up_short') up_long_id=ncdf_varid(cdf_id,'up_long') fluxcl_id=ncdf_varid(cdf_id, 'gswfluxdn_clearskyfit') if down_short_id ne -1 then ncdf_varget,cdf_id,down_short_id,down_short if down_long_id ne -1 then ncdf_varget,cdf_id,down_long_id,down_long if up_short_id ne -1 then ncdf_varget,cdf_id,up_short_id,up_short if up_long_id ne -1 then ncdf_varget,cdf_id,up_long_id,up_long if fluxcl_id ne -1 then ncdf_varget,cdf_id,fluxcl_id,fluxclear lwp_id=ncdf_varid(cdf_id,'liq') vap_id=ncdf_varid(cdf_id,'vap') if lwp_id ne -1 then ncdf_varget,cdf_id,lwp_id,lwp if vap_id ne -1 then ncdf_varget,cdf_id,vap_id,vap vceil_id=ncdf_varid(cdf_id,'first_cbh') if vceil_id ne -1 then ncdf_varget,cdf_id,vceil_id,vceil ; Close the netcdf file ncdf_close,cdf_id endif else begin ;this program stops if there is no reflectivity ncdf_close, cdf_id print, reflect_id , ' is reflect_id' stop endelse return end