y = '2012';
m = '09';
for j = 6:6
    if j < 10
        d = strcat('0',num2str(j));
    else
        d = num2str(j);
    end
    if (j==5)
        i_start = 16;
        i_end = 24;
        dir = '/Volumes/boardwalk/coolgroup/bpu/wrf/RUWRF/201209/20120905/3km/rotated/';
    end
    if (j==6)
        i_start = 1;
        i_end = 10;
        dir = '/Volumes/boardwalk/coolgroup/bpu/wrf/RUWRF/201209/20120905/3km/rotated/';
    end
    for i = i_start:i_end
        if i < 11
            h = strcat('0',num2str(i-1));
        else
            h = num2str(i-1);
        end

file_WRF    = strcat(dir,'wrfout_d01_2012-',m,'-',d,'_',h,':00:00_r');

xlong           = ncread(file_WRF,'XLONG');
xlat            = ncread(file_WRF,'XLAT');
u10             = ncread(file_WRF,'U10r');
v10             = ncread(file_WRF,'V10r');
w10             = sqrt((u10).^2 + (v10).^2); %wind speed in m/s

    end
end