pro get_tau_cldtopP_histos, fname, tau_bins, cldtopP_bins, tau_cldtopP_histo_total ; check to see if the file exists OPENR, 1, fname, ERROR = err if err eq 0 then begin close, 1 ; file exists, read the data cdfid=ncdf_open(fname,/nowrite) print, 'reading ',fname tau_cldtopP_histo_total_id=ncdf_varid(cdfid, 'tau_cldtopP_histo_total') ncdf_varget, cdfid, tau_cldtopP_histo_total_id, tau_cldtopP_histo_total_id NCDF_CLOSE, cdfid endif else begin ;OPENR, 1, fname, ERROR = err ; file does not exist, create it write_tau_cldtopP_histos, fname, tau_bins, cldtopP_bins, tau_cldtopP_histo_total endelse ;OPENR, 1, fname, ERROR = err return end