%% read the NetCDF format seafloor topography model and save the variables to a MATLAB .mat format file
%   Junjun Yang
%   October 28, 2021

diary contents.ncdisp.txt;
ncdisp('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc');
diary off;

x = ncread('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc','x');
y = ncread('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc','y');
bed = ncread('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc','bed')';
geoid = ncread('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc','geoid')';
SID = ncread('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.nc','SID')';

[x,y] = meshgrid(x,y);

save('gravity_estimated_seafloor_topography_beneath_the_Amery_Ice_Shelf.mat','x','y','bed','geoid','SID');
