% Read any netcdf file

function [out] = read_netcdfFile(fname)

if ~exist(fname,'file')
    out = [];
    return
end

finfo = ncinfo(fname);

for i = 1:length(finfo.Variables)
    out.(finfo.Variables(i).Name) = ncread(fname,finfo.Variables(i).Name);
%     out.Att(i).att = finfo.Variables(i).Attributes;
%     out.DataType(i).type = finfo.Variables(i).Datatype;
end
