pro read_newoutput_alldays_v3,monthofinterest,aot440m_min,filename,ddfittolerance,sza_min,sza_max,$ day_plot,month_plot,year_plot, $ hour,min_aer,sec,day,month,dayofyear,year,$ cv,cvf,cvc,rv,rvf,rvc,s,sf,sc,$ aot1020m,aot870m,aot670m,aot500m,aot440m,aot380m,aot340m,$ aot440,aot670,aot870,aot1020,w440,w670,w870,w1020,ri440,ri670,ri870,ri1020,rr440,rr670,rr870,rr1020,water,sphericity,sky_error,sun_error,$ sza_mfrsr,hour_mfrsr,min_mfrsr,sec_mfrsr, ozone,pres_md12, m_tau368,m_w368,a_tau368,dd_calc368,dd_mfrsr368,niter368, i1,count,m_total,m_dif,ct_meas,n_real,k_real,no2,asym368,$ jac_dk_dpar,jac_dw_dk,f_vbias,e_tot_aer,$ alb440,alb670,alb870,alb1020 ; 08_08.15: return more var: suf albedo (440, 670, 870, 1020), sf, sc ; 06_26.15: return more var: corrected transmittance (e_tot_aer) ; 04_21.14: add more outputs (w870, w1020) ; 03_26.14: niter368 should be greater than 0 in order to escape the same SSA from AERONET, which is not our retrieval but AERONET retrieval ; 03_26.14: Add nighttime bias (f_vbias) [mV] ; 12_09.13: Add jacobians to teh output ; 01_18.13: process new format outout: add asym and Jacobian columns to the end ; 09_07.12: process new format outout ; 07_28.05: process measurements with NO2 ; 04_15.04: turn-off day selection: get all days ; 04_09.04: read new output from the fitting program openr,1,filename nrows = file_lines(filename)-1 nrecords=nrows/2 & print,filename, nrows,'nrecords=',nrecords x='' & a=dblarr(73) & b=dblarr(7) day =dblarr(nrecords) month=dblarr(nrecords) year=dblarr(nrecords) hour=dblarr(nrecords) min_aer =dblarr(nrecords) sec =dblarr(nrecords) dayofyear=dblarr(nrecords) aot1020m=dblarr(nrecords) aot870m =dblarr(nrecords) aot670m =dblarr(nrecords) aot500m =dblarr(nrecords) aot440m =dblarr(nrecords) aot380m =dblarr(nrecords) aot340m =dblarr(nrecords) aot440 =dblarr(nrecords) aot670 =dblarr(nrecords) aot870 =dblarr(nrecords) aot1020 =dblarr(nrecords) w440 =dblarr(nrecords) w670 =dblarr(nrecords) w870 =dblarr(nrecords) w1020 =dblarr(nrecords) rr440 =dblarr(nrecords) rr670 =dblarr(nrecords) rr870 =dblarr(nrecords) rr1020 =dblarr(nrecords) ri440 =dblarr(nrecords) ri670 =dblarr(nrecords) ri870 =dblarr(nrecords) ri1020 =dblarr(nrecords) cvf =dblarr(nrecords) cvc =dblarr(nrecords) rvf =dblarr(nrecords) rvc =dblarr(nrecords) sf =dblarr(nrecords) sc =dblarr(nrecords) hour_mfrsr =dblarr(nrecords) min_mfrsr =dblarr(nrecords) sec_mfrsr =dblarr(nrecords) sza_mfrsr =dblarr(nrecords) ozone =dblarr(nrecords) ; True measured ozone no2 =dblarr(nrecords) ; True measured No2 pres_md12 =dblarr(nrecords) ; surf. presure n_real =dblarr(nrecords) k_real =dblarr(nrecords) m_tau368 =dblarr(nrecords) ; MFRSR AOT m_w368 =dblarr(nrecords) a_tau368 =dblarr(nrecords) ; aeronet AOT extrapolated to MFRSR time and effective wavelength tau_ray =dblarr(nrecords) tau_oz =dblarr(nrecords) l_rad =dblarr(nrecords) ; Effective wavelength for MFRSR channel m_total =dblarr(nrecords) ; total V0 norm irradiance m_dif =dblarr(nrecords) ; diffuse V0 normalized irradiance m_dirn =dblarr(nrecords) ; direct normal norm irradiance m_v0raw =dblarr(nrecords) ; V0 raw (measured, not adjusted e_dir_ray368 =dblarr(nrecords) ; zenith Rayleigh e_dir_rat368 =dblarr(nrecords) ;& e_dir_aer=e_dir_ray368*e_dir_rat368 e_dif_ray368 =dblarr(nrecords) e_dif_rat368 =dblarr(nrecords) ;& e_dif_aer=e_dif_ray368*e_dif_rat368 ct_meas =dblarr(nrecords) ; ct_meas_d=(m_dirn*cos(!pi/180.*sza_mfrsr)+m_dif)/e_tot_ray dd_calc368 =dblarr(nrecords) dd_mfrsr368 =dblarr(nrecords) niter368 =dblarr(nrecords) asym368 =dblarr(nrecords) jac_dk_dpar =dblarr(nrecords) jac_dw_dk =dblarr(nrecords) jac_dasym_dk =dblarr(nrecords) water =dblarr(nrecords) ; [cm] sphericity =dblarr(nrecords) ; [% ] sky_error =dblarr(nrecords) ; [% ] sun_error =dblarr(nrecords) ; [% ] f_vbias =dblarr(nrecords) ;nighttime voltage bias [mV] e_tot_aer =dblarr(nrecords) ;corrected transmittance alb440 =dblarr(nrecords) ;surface albedo 440 nm (AERONET) alb670 =dblarr(nrecords) ;surface albedo 670 nm (AERONET) alb870 =dblarr(nrecords) ;surface albedo 870 nm (AERONET) alb1020 =dblarr(nrecords) ;surface albedo 1020 nm (AERONET) for i=0,0 do readf,1,x & print,x ; read header ;readf,1,a ; read aeronet dump ;close,1 for i=0,nrecords-1 do begin readf,1,a readf,1,b day(i) =reform(a(0)) month(i)=reform(a(1)) year(i)=reform(a(2)) hour(i)=reform(a(3)) min_aer (i)=reform(a(4)) sec (i)=reform(a(5)) dayofyear(i)=reform(a(6)) ; AERONET measured AOT at the inversion time aot1020m(i)=reform(a(7)) aot870m (i)=reform(a(8)) aot670m (i)=reform(a(9)) aot500m (i)=reform(a(10)) aot440m (i)=reform(a(11)) aot380m (i)=reform(a(12)) aot340m (i)=reform(a(13)) ; AERONET fitted AOTs at inversion time aot440 (i)=reform(a(14)) aot670 (i)=reform(a(15)) aot870 (i)=reform(a(16)) aot1020 (i)=reform(a(17)) ; AERONET inversion parameters w440 (i)=reform(a(18)) w670 (i)=reform(a(19)) w870 (i)=reform(a(20)) w1020 (i)=reform(a(21)) rr440 (i)=reform(a(22)) rr670 (i)=reform(a(23)) rr870 (i)=reform(a(24)) rr1020 (i)=reform(a(25)) ri440 (i)=reform(a(26)) ri670 (i)=reform(a(27)) ri870 (i)=reform(a(28)) ri1020 (i)=reform(a(29)) cvf (i)=reform(a(30)) ;volume concentration (fine mode) cvc (i)=reform(a(31)) ;volume concentration (coarse mode) rvf (i)=reform(a(32)) rvc (i)=reform(a(33)) sf (i)=reform(a(34)) sc (i)=reform(a(35)) ; MFRSR measurement time hour_mfrsr (i)=reform(a(36)) min_mfrsr (i)=reform(a(37)) sec_mfrsr (i)=reform(a(38)) ;& timeofday_mfrsr(i)=double(hour_mfrsr + min_mfrsr/60. + sec_mfrsr/3600.) sza_mfrsr (i)=reform(a(39)) ozone (i)=reform(a(40)) ; True measured ozone no2 (i)=reform(a(41)) ; True measured No2 pres_md12 (i)=reform(a(42)) ; surf. presure n_real (i)=reform(a(44)) k_real (i)=reform(a(45)) m_tau368 (i)=reform(a(46)) ; MFRSR AOT m_w368 (i)=reform(a(47)) a_tau368 (i)=reform(a(48)) ; aeronet AOT extrapolated to MFRSR time and effective wavelength tau_ray (i)=reform(a(49)) tau_oz (i)=reform(a(50)) l_rad (i)=reform(a(51)) ; Effective wavelength for MFRSR channel m_total (i)=reform(a(52)) ; total V0 norm irradiance m_dif (i)=reform(a(53)) ; diffuse V0 normalized irradiance m_dirn (i)=reform(a(54)) ; direct normal norm irradiance m_v0raw (i)=reform(a(55)) ; V0 raw (measured, not adjusted e_dir_ray368 (i)=reform(a(58)) ; zenith Rayleigh e_dir_rat368 (i)=reform(a(59)) e_dif_ray368 (i)=reform(a(60)) e_dif_rat368 (i)=reform(a(61)) ; CT_calc e_dir_aer=e_dir_ray368(i)*e_dir_rat368(i) e_dif_aer=e_dif_ray368(i)*e_dif_rat368(i) e_tot_ray=e_dir_ray368(i)+e_dif_ray368(i) e_tot_aer (i)=e_dir_aer + e_dif_aer ct_calc = e_tot_aer/e_tot_ray ct_meas(i)=m_total(i)/e_tot_ray ; ct_meas_d=(m_dirn*cos(!pi/180.*sza_mfrsr)+m_dif)/e_tot_ray dd_calc368 (i)=reform(a(62)) dd_mfrsr368 (i)=reform(a(63)) niter368 (i)=reform(a(64)) asym368 (i)=reform(a(67)) ; Jacobians jac_dk_dpar (i)= reform(a(68)) jac_dw_dk (i)= reform(a(69)) jac_dasym_dk (i)= reform(a(70)) ; AERONET water water (i)=reform(a(71)) ; [cm] ;AERONET diagnostics sphericity [i]=reform(a(72)) ; [% ] sky_error (i)=reform(b(0)) ; [%] sun_error (i)=reform(b(1)) ; [%] ;Nighttime bias f_vbias [i]=reform(b(2)) ; [mV] ;surface albedo from AERONET data alb440 [i]=reform(b(3)) alb670 [i]=reform(b(4)) alb870 [i]=reform(b(5)) alb1020 [i]=reform(b(6)) endfor ; FILTERING THE DATA i1=where( $ (sza_mfrsr ge sza_min and sza_mfrsr le sza_max) $ and (aot440m ge aot440m_min) $ ; select only days with AOT440m > aot440m_min ; and (month eq monthofinterest) $ ; select only data for specific month ; and (year eq 2005 ) $ ; select only data for specific year ; and (day eq day_plot and month eq month_plot and year eq year_plot) $ ; and (m_tau368 gt 0.0 )$ ; and (e_dir_ray368 gt 0.0 ) $ and (niter368 ge 1 ) $ ;number of iteration = 0 means just use AERONET SSA ; and (niter368 le 6 ) $ and (abs(dd_calc368 - dd_mfrsr368) lt ddfittolerance )$ and (k_real ge 0.0 and k_real le 1.0 )$ ; This filter removes non retrievals ,count ) print,'read_newoutput: Number of points i1= ',count return end