; ; Read in the average monthly data ; pro get_regrid_average_monthly,fname ; ; common containing the data ; common monthly_averaged_data, base_time,time_offset,height, $ reflectivity, reflectp, reflectc, cbase, ctop, velocity,$ spectrum, lwp, cloud1, vceil,numtimes,numheights ; ; Open the netcdf file ; cdf_id=ncdf_open(fname) ; ; Get the dimension id's ; time_did=ncdf_dimid(cdf_id,'time') height_did=ncdf_dimid(cdf_id,'height') ; ; Get the dimensions ; if time_did ge 0 then ncdf_diminq,cdf_id,time_did,charstring,numtimes if height_did ge 0 then ncdf_diminq,cdf_id,height_did,charstring,numheights ; ; 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') reflect_id=ncdf_varid(cdf_id, 'ReflectivityBestEstimate') reflectp_id=ncdf_varid(cdf_id, 'ReflectivityPossiblePoints') reflectc_id=ncdf_varid(cdf_id, 'ReflectivityUseablePoints') clutter_id=ncdf_varid(cdf_id, 'qc_ReflectivityClutterFlagMode') cbase_id=ncdf_varid(cdf_id, 'CloudBaseBestEstimate') ctop_id=ncdf_varid(cdf_id, 'RadarFirstTop') velocit_id=ncdf_varid(cdf_id, 'MeanDopplerVelocity') spectr_id=ncdf_varid(cdf_id, 'SpectralWidth') psp2_id=ncdf_varid(cdf_id, 'psp2') down_psp_id=ncdf_varid(cdf_id,'down_psp1_mean') down_pir_id=ncdf_varid(cdf_id,'down_pir1_mean') up_psp_id=ncdf_varid(cdf_id,'up_psp1_mean') up_pir_id=ncdf_varid(cdf_id,'up_pir1_mean') fluxcl_id=ncdf_varid(cdf_id, 'twsflux_clearskyfit') solarra_id=ncdf_varid(cdf_id, 'SolarRatio') lwp_id=ncdf_varid(cdf_id, 'liq') cloud1_id=ncdf_varid(cdf_id,'cloud1') vceil_id=ncdf_varid(cdf_id,'first_cbh') ; ; 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 ; ; Calculate Julian Date (jday) and Fractional Hour (hrfrac) ; ijday_ihrfrac_fm_numsec,base_time, time_offset, hrfrac, jday, yy,mm,dd,hh,mi,ss if height_id ne -1 then begin ncdf_varget, cdf_id, height_id, height height=height/1000 ;convert from meters to km endif 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 if cbase_id ne -1 then begin ncdf_varget, cdf_id, cbase_id, cbase result=where(cbase ne -9999, count) if count ne 0 then begin cbase[result]=cbase[result]/1000. ;convert from meters to km endif endif if ctop_id ne -1 then begin ncdf_varget, cdf_id, ctop_id, ctop result=where(ctop ne -9999, count) if count ne 0 then begin ctop[result]=ctop[result]/1000. ;convert from meters to km endif endif if velocit_id ne -1 then begin ncdf_varget, cdf_id, velocit_id, velocity result=where(velocity ne -9999,count) if count ne 0 then begin velocity[result]=velocity[result]/1000. endif endif if spectr_id ne -1 then begin ncdf_varget, cdf_id, spectr_id, spectrum result=where(spectrum ne -9999,count) if count ne 0 then begin spectrum[result]=spectrum[result]/1000. endif endif if psp2_id ne -1 then ncdf_varget, cdf_id, psp2_id, psp2 if down_psp_id ne -1 then ncdf_varget, cdf_id, down_psp_id,down_psp if down_pir_id ne -1 then ncdf_varget, cdf_id, down_pir_id,down_pir if up_psp_id ne -1 then ncdf_varget, cdf_id, up_psp_id,up_psp if up_pir_id ne -1 then ncdf_varget, cdf_id, up_pir_id,up_pir if fluxcl_id ne -1 then ncdf_varget, cdf_id, fluxcl_id, fluxclear if solarra_id ne -1 then ncdf_varget, cdf_id, solarra_id, solarratio if lwp_id ne -1 then begin ncdf_varget, cdf_id, lwp_id, lwp result=where(lwp ne -9999,count) if count ne 0 then begin lwp[result]=lwp[result]*10000 endif endif if cloud1_id ne -1 then begin ncdf_varget, cdf_id, cloud1_id, cloud1 result=where(cloud1 ne -9999, count) if count ne 0 then begin cloud1[result]=cloud1[result]/1000. ;convert from meters to km endif endif if vceil_id ne -1 then begin ncdf_varget, cdf_id, vceil_id, vceil result=where(vceil ne -9999, count) if count ne 0 then begin vceil[result]=vceil[result]/1000. ;convert from meters to km endif endif ; ; Close the netcdf file ; ncdf_close,cdf_id return end