clear  all
close all
clc

hycompath = '/project/ganeshgopal_hpc_data/FFT_DARPA/global_hycom/analysis/';
gfspath = '/project/ganeshgopal_hpc_data/FFT_DARPA/gfs/';
eval(['load ' hycompath 'FMT.mat']);

%% hycom is every 3 hour
nt = 193;nx = 871;ny = 626;
hycom_time = rdslice([hycompath 'time_hycom.bin'],[1 nt],1, fmt, Ieee);
hycom_lon = rdslice([hycompath 'lon_hycom.bin'],[nx 1],1, fmt, Ieee);
hycom_lat = rdslice([hycompath 'lat_hycom.bin'],[ny 1],1, fmt, Ieee);

for it = [1 nt]
    u1 = rdslice([hycompath 'hycom_u.bin'],[nx ny],it,fmt, Ieee);
    v1 = rdslice([hycompath 'hycom_v.bin'],[nx ny],it,fmt, Ieee);
    figure
    subplot(1,2,1);pcol(hycom_lon,hycom_lat, u1');colorbar;title(['u :' datestr(hycom_time(it),30)])
    subplot(1,2,2);pcol(hycom_lon,hycom_lat, v1');colorbar;title(['v :' datestr(hycom_time(it),30)])
end

%% GFS  is every 6 hours
gt = 100;
gfs_time = rdslice([gfspath 'gfs_time.bin'],[1 gt],1, fmt, Ieee);
for it = [1 gt]
    u1 = rdslice([gfspath 'gfs_uwind.bin'],[nx ny],it,fmt, Ieee);
    v1 = rdslice([gfspath 'gfs_vwind.bin'],[nx ny],it,fmt, Ieee);
    figure
    subplot(1,2,1);pcol(hycom_lon,hycom_lat, u1');colorbar;title(['uwind :' datestr(gfs_time(it),30)])
    subplot(1,2,2);pcol(hycom_lon,hycom_lat, v1');colorbar;title(['vwind :' datestr(gfs_time(it),30)])
end