function [nt,dayfrac,nmax,hmax,tec,nz,nlat,ht,htne,lon] = get_teclon_nc(Fname,jj)

% open .nc file Fname
    nc=netcdf(Fname,'nowrite');

clear height
clear ne

    time=nc{'mtime'}(:);        % (day, ut_hour, ut_min)
    dayfrac=time(:,1)+time(:,2)/24.+time(:,3)/1440.;
    height=nc{'ZG'}(:);
    ilev=nc{'ilev'}(:);
    lat=nc{'lat'}(:);
    lon=nc{'lon'}(:);
% Units are m/s for ExB components
    ne=nc{'NE'}(:); 
    nmf2=nc{'NMF2'}(:);
    hmf2=nc{'HMF2'}(:);
    tecarr=nc{'TEC'}(:);
    close(nc)
    
    clear nc

nt = length(dayfrac);
nz = length(ilev);
nlat = length(lat);

for it=1:nt
 for ii=1:nlat
% Convert from cm-3 to 1.e-12 m-3
nmax(it,ii) = nmf2(it,ii,jj)*1.e-6;
hmax(it,ii) = hmf2(it,ii,jj);
% Convert from cm-2 to m-2  PUT IN TECU!! or ~e+40!
tec(it,ii) = tecarr(it,ii,jj)*1.e+4;
% Convert from electrons/m2 to TEC units (1e+16 m-2 = 1 TECU)
tec(it,ii) = tec(it,ii)*1.e-16;
% Tn, Un, and composition are on midpts between ZG levels
   for kk=1:nz
% Convert from cm to km
    ht(it,kk,ii) = height(it,kk,ii,jj)*1.e-5;
% Convert from cm-3 to m-3
    htne(it,kk,ii) = ne(it,kk,ii,jj)*1.e+6;
   end
 end
end

    clear time

