% This a Matlab script that calls the BAO tower plotting
% functions one at a time with the beginning and ending
% year-day or month and the year.

try
    cd('z:\BAO\Tower\Programs');
    userpath('z:\BAO\Tower\Programs');
    
    d = load ('z:\BAO\Tower\Raw\dates.dat');
    
    by = d(1);
    bm = d(2);
    bd = d(3);
    ey = d(4);
    em = d(5);
    ed = d(6);
    
    ct = clock();
    
    retval = bao10100300_24hour_func( );
    
    retval = BAOPLTSFC_loop_func(by,bm,bd,ey,em,ed);
    retval = BAOPLT10_loop_func_new(by,bm,bd,ey,em,ed);
    retval = BAOPLT100_loop_func(by,bm,bd,ey,em,ed);
    retval = BAOPLT300_loop_func(by,bm,bd,ey,em,ed);
    
    retval = bao10100300_daily_func(by,bm,bd,ey,em,ed);
    retval = baoozone_daily_func( by,bm,bd,ey,em,ed);
    
    retval = baotls_loop_func( by, bm, bd, ey, em, ed );
    
    if (mod(ct(4),4) == 0) && (ct(5) > 5 && ct(5) < 11)
        retval = BAOPLTSFC_month_loop_func(by,bm,bd,ey,em,ed);
        retval = BAOPLT10_month_loop_func_new(by,bm,bd,ey,em,ed);
        retval = BAOPLT100_month_loop_func(by,bm,bd,ey,em,ed);
        retval = BAOPLT300_month_loop_func(by,bm,bd,ey,em,ed);
        
        %retval = bao10300_month_loop_func(by,bm,bd,ey,em,ed);
        retval = bao10100300_month_loop_func(by,bm,bd,ey,em,ed);
        retval = baoozone_monthly_func( by,bm,bd,ey,em,ed);
        
        retval = bao10300_month_rosehist_func( by, bm, bd, ey, em, ed );
    end
    
    cd('z:\BAO\Tower\Programs');
    
catch ME
    dd = clock;
    fid = fopen( 'c:\matlab\logs\matlab_try.log','a');
    fprintf(fid,'%4d-%02d-%02d %02d:%02d:%02d %s\n',...
        dd(1),dd(2),dd(3),dd(4),dd(5),dd(6),ME.message);
    exit
end

exit

