% Read any netcdf file

function [out] = read_netcdfFile(fname)

% fname = '20170801_virtualTower_HighRes_tAvg6min_verion1.0.nc';

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
