load /Users/yang146/Aerosol_Variaiton/OBS/ncfile/sites.mat
year=1981:2007;

dust=zeros(length(siteID),length(year));
for site_ID=1:length(siteID)
    
    site_ID
    
    file=importdata('/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-1980.TXT');
    site_infile=file(:,1);
    month=file(:,5);
    for i=1:length(site_infile)
        if site_infile(i)==siteID(site_ID) && month(i)==12
            dust(site_ID,1)=dust(site_ID,1)+1;
        end
    end
    
    file=importdata('/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-1981.TXT');
    site_infile=file(:,1);
    month=file(:,5);
    for i=1:length(site_infile)
        if site_infile(i)==siteID(site_ID) && month(i)==1
            dust(site_ID,1)=dust(site_ID,1)+1;
        end
    end
    
    file=importdata('/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-1981.TXT');
    site_infile=file(:,1);
    month=file(:,5);
    for i=1:length(site_infile)
        if site_infile(i)==siteID(site_ID) && month(i)==2
            dust(site_ID,1)=dust(site_ID,1)+1;
        end
    end
    
    for yearID=1:length(year)
        file=importdata(['/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-',num2str(year(yearID)-1),'.TXT']);
        site_infile=file(:,1);
        month=file(:,5);
        for i=1:length(site_infile)
            if site_infile(i)==siteID(site_ID) && month(i)==12
                dust(site_ID,yearID)=dust(site_ID,yearID)+1;
            end
        end
        file=importdata(['/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-',num2str(year(yearID)),'.TXT']);
        site_infile=file(:,1);
        month=file(:,5);
        for i=1:length(site_infile)
            if site_infile(i)==siteID(site_ID) && month(i)==1
                dust(site_ID,yearID)=dust(site_ID,yearID)+1;
            end
        end
        file=importdata(['/Users/yang146/Aerosol_Variaiton/OBS/dat/china_dust/SURF_CLI_CHN_WEP_DAY_DSS-',num2str(year(yearID)),'.TXT']);
        site_infile=file(:,1);
        month=file(:,5);
        for i=1:length(site_infile)
            if site_infile(i)==siteID(site_ID) && month(i)==2
                dust(site_ID,yearID)=dust(site_ID,yearID)+1;
            end
        end
    end

end

save('Dust_1981_2007','dust','lon_site','lat_site')










                
    