Commit 703b7bd7 authored by Pierre Cazenave's avatar Pierre Cazenave

Rename some missed variables

parent d59b9c5a
...@@ -61,7 +61,7 @@ varlist = {'lon', 'lat', 'ETWD', 'x1XD', 'time', 'depth', 'pdepthD'}; ...@@ -61,7 +61,7 @@ varlist = {'lon', 'lat', 'ETWD', 'x1XD', 'time', 'depth', 'pdepthD'};
% Data format: % Data format:
% %
% amm.ETWD.data and amm.x1XD.data are y, x, sigma, time % pc.ETWD.data and pc.x1XD.data are y, x, sigma, time
% %
pc = get_POLCOMS_netCDF(ts, varlist); pc = get_POLCOMS_netCDF(ts, varlist);
...@@ -86,8 +86,8 @@ if ftbverbose ...@@ -86,8 +86,8 @@ if ftbverbose
end end
for t = 1:nt for t = 1:nt
% Get the current 3D array of PML POLCOMS-ERSEM results. % Get the current 3D array of PML POLCOMS-ERSEM results.
ammtemp3 = pc.ETWD.data(:, :, :, t); pctemp3 = pc.ETWD.data(:, :, :, t);
ammsalt3 = pc.x1XD.data(:, :, :, t); pcsalt3 = pc.x1XD.data(:, :, :, t);
% Preallocate the intermediate results arrays. % Preallocate the intermediate results arrays.
itempz = nan(nf, nz); itempz = nan(nf, nz);
...@@ -97,14 +97,14 @@ for t = 1:nt ...@@ -97,14 +97,14 @@ for t = 1:nt
for j = 1:nz for j = 1:nz
% Now extract the relevant layer from the 3D subsets. Transpose the % Now extract the relevant layer from the 3D subsets. Transpose the
% data to be (x, y) rather than (y, x). % data to be (x, y) rather than (y, x).
ammtemp2 = ammtemp3(:, :, j)'; pctemp2 = pctemp3(:, :, j)';
ammsalt2 = ammsalt3(:, :, j)'; pcsalt2 = pcsalt3(:, :, j)';
ammdepth2 = squeeze(pc.depth.data(:, :, j, t))'; pcdepth2 = squeeze(pc.depth.data(:, :, j, t))';
% Create new arrays which will be flattened when masking (below). % Create new arrays which will be flattened when masking (below).
tammtemp2 = ammtemp2; tpctemp2 = pctemp2;
tammsalt2 = ammsalt2; tpcsalt2 = pcsalt2;
tammdepth2 = ammdepth2; tpcdepth2 = pcdepth2;
tlon = lon; tlon = lon;
tlat = lat; tlat = lat;
...@@ -113,10 +113,10 @@ for t = 1:nt ...@@ -113,10 +113,10 @@ for t = 1:nt
% since we'll be searching for the closest values in such a manner % since we'll be searching for the closest values in such a manner
% as is appropriate for an unstructured grid (i.e. we're assuming % as is appropriate for an unstructured grid (i.e. we're assuming
% the PML POLCOMS-ERSEM data is irregularly spaced). % the PML POLCOMS-ERSEM data is irregularly spaced).
mask = tammdepth2 > 20000; mask = tpcdepth2 > 20000;
tammtemp2(mask) = []; tpctemp2(mask) = [];
tammsalt2(mask) = []; tpcsalt2(mask) = [];
tammdepth2(mask) = []; tpcdepth2(mask) = [];
% Also apply the masks to the position arrays so we can't even find % Also apply the masks to the position arrays so we can't even find
% positions outside the domain, effectively meaning if a value is % positions outside the domain, effectively meaning if a value is
% outside the domain, the nearest value to the boundary node will % outside the domain, the nearest value to the boundary node will
...@@ -145,9 +145,9 @@ for t = 1:nt ...@@ -145,9 +145,9 @@ for t = 1:nt
% parallelisation. % parallelisation.
plon = tlon(ixy); plon = tlon(ixy);
plat = tlat(ixy); plat = tlat(ixy);
ptemp = tammtemp2(ixy); ptemp = tpctemp2(ixy);
psal = tammsalt2(ixy); psal = tpcsalt2(ixy);
pdepth = tammdepth2(ixy); pdepth = tpcdepth2(ixy);
% Use a triangulation to do the horizontal interpolation. % Use a triangulation to do the horizontal interpolation.
tritemp = TriScatteredInterp(plon', plat', ptemp', 'natural'); tritemp = TriScatteredInterp(plon', plat', ptemp', 'natural');
...@@ -160,9 +160,9 @@ for t = 1:nt ...@@ -160,9 +160,9 @@ for t = 1:nt
% Check all three, though if one is NaN, they all will be. % Check all three, though if one is NaN, they all will be.
if isnan(itempobc(i)) || isnan(isalobc(i)) || isnan(idepthobc(i)) if isnan(itempobc(i)) || isnan(isalobc(i)) || isnan(idepthobc(i))
warning('FVCOM boundary node at %f, %f is outside the PML POLCOMS-ERSEM domain. Setting to the closest PML POLCOMS-ERSEM value.', fx, fy) warning('FVCOM boundary node at %f, %f is outside the PML POLCOMS-ERSEM domain. Setting to the closest PML POLCOMS-ERSEM value.', fx, fy)
itempobc(i) = tammtemp2(ii(1)); itempobc(i) = tpctemp2(ii(1));
isalobc(i) = tammsalt2(ii(1)); isalobc(i) = tpcsalt2(ii(1));
idepthobc(i) = tammdepth2(ii(1)); idepthobc(i) = tpcdepth2(ii(1));
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment