clc
clear all
close all

rst_file_1 = '/discover/nobackup/jkolassa/CN51_test_local/GEOSldas_mod/GEOSldas_CN51_local_280_test/output/SMAP_EASEv2_M36/rs/ens0000/Y1980/M01/GEOSldas_CN51_local_280_test.catchcnclm51_internal_rst.19800101_0000';
rst_file_2 = '/discover/nobackup/jkolassa/CN51_test_local/GEOSldas_mod/GEOSldas_CN45_local_390_test/output/SMAP_EASEv2_M36/rs/ens0000/Y1980/M01/GEOSldas_CN45_local_390_test.catchcnclm45_internal_rst.19800101_0000';

cnpft_1 = ncread(rst_file_1,'CNPFT');
cnpft_2 = ncread(rst_file_2,'CNPFT');

tile_1 = ncread(rst_file_1,'TILE_ID');
tile_2 = ncread(rst_file_2,'TILE_ID');

ity_1 = ncread(rst_file_1,'ITY');
ity_2 = ncread(rst_file_2,'ITY');

fveg_1 = ncread(rst_file_1,'FVG');
fveg_2 = ncread(rst_file_2,'FVG');

var_cn51 = NaN*ones(75,6);
var_cn45 = NaN*ones(75,12);

for var = 1:75

    cn51_start_index = (var-1)*6+1;
    cn51_stop_index = var*6;

    cn45_start_index = (var-1)*12+1;
    cn45_stop_index = var*12;

    var_cn51(var,:) = cnpft_1(1,cn51_start_index:cn51_stop_index);
    var_cn45(var,:) = cnpft_2(1,cn45_start_index:cn45_stop_index);
end

rst_file_glob_1 = '/discover/nobackup/jkolassa/restarts/GEOSldas_CNCLM45_NT/output/SMAP_EASEv2_M36/rs/ens0000/Y1980/M01/GEOSldas_CNCLM45_NT.catchcnclm51_internal_rst.19800101_0000';
rst_file_glob_2 = '/discover/nobackup/jkolassa/restarts/GEOSldas_CNCLM45_NT/output/SMAP_EASEv2_M36/rs/ens0000/Y1980/M01/GEOSldas_CNCLM45_NT.catchcnclm45_internal_rst.19800101_0000';

cnpft_glob_1 = ncread(rst_file_glob_1,'CNPFT');
cnpft_glob_2 = ncread(rst_file_glob_2,'CNPFT');
