% Code to read cryosphere_energy_imbalance.h5
% Straneo et al., in review

fname = 'cryosphere_energy_imbalance.h5';
time = h5read(fname,'/time'); %Time in years

%Energy uptake by both floating and grounded components
total = h5read(fname,'/total'); %in zetajoules
total_err = h5read(fname,'/total_error'); %95% confidence interval, also in zetajoules

greenland = h5read(fname,'/greenland'); %Grreenland ice sheet (including floating components)
greenland_err = h5read(fname,'/greenland_error');

antarctica = h5read(fname,'/antarctica'); %Antarctic ice sheet (including ice shelves)
antarctica_err = h5read(fname,'/antarctica_error');

glaciers = h5read(fname,'/glaciers'); %Mountain glaciers
glaciers_err = h5read(fname,'/glaciers_error');

seaice = h5read(fname,'/sea_ice'); %Sea ice
seaice_err = h5read(fname,'/sea_ice_error');

%Energy uptake by grounded components ONLY
total_grounded = h5read(fname,'/total_grounded'); %in zetajoules
total_grounded_err = h5read(fname,'/total_grounded_error'); %95% confidence interval, also in zetajoules

greenland_grounded = h5read(fname,'/greenland_grounded'); %Grreenland ice sheet (grounded only)
greenland_grounded_err = h5read(fname,'/greenland_grounded_error');

antarctica_grounded = h5read(fname,'/antarctica_grounded'); %Antarctic ice sheet (grounded only)
antarctica_grounded_err = h5read(fname,'/antarctica_grounded_error');

glaciers_grounded = h5read(fname,'/glaciers_grounded'); %Mountain glaciers
glaciers_grounded_err = h5read(fname,'/glaciers_grounded_error');