close all
clear all
clc

fpath = '/home/ganeshgopal/FROM_ATLAS/NEW_CASE_4DVAR/inputs/';
dpath = ['/home/ganeshgopal/FROM_ATLAS/NEW_CASE_4DVAR/hcast_expt/rev_res/'];

eval(['load ' fpath 'FMT.mat']);
eval(['load ' dpath 'MIT_CCS_LATLON_500m.mat']);
nxc  = length(XC);nyc = length(YC);nzc = length(ZC);
nt = 4656;

%% old packing
time = rdslice([dpath 'TIME_CCS_2007_2019.bin'],[nt 1],1, fmt, Ieee);

for it = [1 nt]
    t =  rdslice([dpath 'T_MIT_CCS_2007_2019_500m.bin'],[nxc nyc nzc],it, fmt, Ieee);
    s =  rdslice([dpath 'S_MIT_CCS_2007_2019_500m.bin'],[nxc nyc nzc],it, fmt, Ieee);
    u =  rdslice([dpath 'U_MIT_CCS_2007_2019_500m.bin'],[nxc nyc nzc],it, fmt, Ieee);
    v =  rdslice([dpath 'V_MIT_CCS_2007_2019_500m.bin'],[nxc nyc nzc],it, fmt, Ieee);
    eta = rdslice([dpath 'Eta_MIT_CCS_2007_2019.bin'],[nxc nyc],it, fmt, Ieee);
    
    figure
    subplot(2,3,1);pcol(XC,YC,t(:,:,1)');title(['T : ' datestr(time(it))]);colorbar
    subplot(2,3,2);pcol(XC,YC,s(:,:,1)');title(['S : ' datestr(time(it))]);colorbar
    subplot(2,3,3);pcol(XC,YC,u(:,:,1)');title(['U : ' datestr(time(it))]);colorbar
    subplot(2,3,4);pcol(XC,YC,v(:,:,1)');title(['V : ' datestr(time(it))]);colorbar
    subplot(2,3,5);pcol(XC,YC,eta');title(['Eta : ' datestr(time(it))]);colorbar
    
end

