function [app] = read_aux_vars_from_data_pe_flat_NSF_Alpha(PEFile, ~, ~)

warning off;

if nargin < 1
    error('Not enough inputs. Need PE file');
end

% app contatins the following fields:
% lat, lon, depth, time: as is in the data file
% dx, dy, dz: all in meters
% t0, tEnd, dt: all in seconds
% Nx, Ny, Nz: all dimensionless
% Mask matrix

app.ncFile = PEFile;
ncid = netcdf(app.ncFile);

vgrid = ncid{'vgrid3'}(:);

app.lon = vgrid(1:end-1, 1:end-1, 1, 1);
app.lat = vgrid(1:end-1, 1:end-1, 1, 2);
% app.depth = 3:3:60;             % MANUAL
app.depth = 2;             % MANUAL

app.Nx = ncid{'imt'}(:)-1;
app.Ny = ncid{'jmt'}(:)-1;
app.Nz = 1;

app.dx = ncid{'dxt'}(1)/100;
app.dy = ncid{'dyt'}(1)/100;

u = squeeze(ncid{'vtot'}(1, 1:end-1, 1:end-1, 1, 1));
app.mask = ones(size(u));
app.mask(u > 1000) = 0;

app.time = ncid{'time'}(:);
app.dt = app.time(2) - app.time(1);
app.start_date = datevec(datenum(get_petim0(ncid)) + app.time(1)/86400);
app.time = app.time - app.time(1);
app.t0 = app.time(1);
app.tEnd = app.time(end);

app.a = app.dx*app.Nx;
app.b = app.dy*app.Ny;
