Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
703b7bd7
Commit
703b7bd7
authored
Feb 11, 2013
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename some missed variables
parent
d59b9c5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
fvcom_prepro/get_POLCOMS_tsobc.m
fvcom_prepro/get_POLCOMS_tsobc.m
+19
-19
No files found.
fvcom_prepro/get_POLCOMS_tsobc.m
View file @
703b7bd7
...
...
@@ -61,7 +61,7 @@ varlist = {'lon', 'lat', 'ETWD', 'x1XD', 'time', 'depth', 'pdepthD'};
% 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
);
...
...
@@ -86,8 +86,8 @@ if ftbverbose
end
for
t
=
1
:
nt
% Get the current 3D array of PML POLCOMS-ERSEM results.
amm
temp3
=
pc
.
ETWD
.
data
(:,
:,
:,
t
);
amm
salt3
=
pc
.
x1XD
.
data
(:,
:,
:,
t
);
pc
temp3
=
pc
.
ETWD
.
data
(:,
:,
:,
t
);
pc
salt3
=
pc
.
x1XD
.
data
(:,
:,
:,
t
);
% Preallocate the intermediate results arrays.
itempz
=
nan
(
nf
,
nz
);
...
...
@@ -97,14 +97,14 @@ for t = 1:nt
for
j
=
1
:
nz
% Now extract the relevant layer from the 3D subsets. Transpose the
% data to be (x, y) rather than (y, x).
ammtemp2
=
amm
temp3
(:,
:,
j
)
'
;
ammsalt2
=
amm
salt3
(:,
:,
j
)
'
;
amm
depth2
=
squeeze
(
pc
.
depth
.
data
(:,
:,
j
,
t
))
'
;
pctemp2
=
pc
temp3
(:,
:,
j
)
'
;
pcsalt2
=
pc
salt3
(:,
:,
j
)
'
;
pc
depth2
=
squeeze
(
pc
.
depth
.
data
(:,
:,
j
,
t
))
'
;
% Create new arrays which will be flattened when masking (below).
t
ammtemp2
=
amm
temp2
;
t
ammsalt2
=
amm
salt2
;
t
ammdepth2
=
amm
depth2
;
t
pctemp2
=
pc
temp2
;
t
pcsalt2
=
pc
salt2
;
t
pcdepth2
=
pc
depth2
;
tlon
=
lon
;
tlat
=
lat
;
...
...
@@ -113,10 +113,10 @@ for t = 1:nt
% 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
% the PML POLCOMS-ERSEM data is irregularly spaced).
mask
=
t
amm
depth2
>
20000
;
t
amm
temp2
(
mask
)
=
[];
t
amm
salt2
(
mask
)
=
[];
t
amm
depth2
(
mask
)
=
[];
mask
=
t
pc
depth2
>
20000
;
t
pc
temp2
(
mask
)
=
[];
t
pc
salt2
(
mask
)
=
[];
t
pc
depth2
(
mask
)
=
[];
% Also apply the masks to the position arrays so we can't even find
% positions outside the domain, effectively meaning if a value is
% outside the domain, the nearest value to the boundary node will
...
...
@@ -145,9 +145,9 @@ for t = 1:nt
% parallelisation.
plon
=
tlon
(
ixy
);
plat
=
tlat
(
ixy
);
ptemp
=
t
amm
temp2
(
ixy
);
psal
=
t
amm
salt2
(
ixy
);
pdepth
=
t
amm
depth2
(
ixy
);
ptemp
=
t
pc
temp2
(
ixy
);
psal
=
t
pc
salt2
(
ixy
);
pdepth
=
t
pc
depth2
(
ixy
);
% Use a triangulation to do the horizontal interpolation.
tritemp
=
TriScatteredInterp
(
plon
', plat'
,
ptemp
', '
natural
'
);
...
...
@@ -160,9 +160,9 @@ for t = 1:nt
% Check all three, though if one is NaN, they all will be.
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
)
itempobc
(
i
)
=
t
amm
temp2
(
ii
(
1
));
isalobc
(
i
)
=
t
amm
salt2
(
ii
(
1
));
idepthobc
(
i
)
=
t
amm
depth2
(
ii
(
1
));
itempobc
(
i
)
=
t
pc
temp2
(
ii
(
1
));
isalobc
(
i
)
=
t
pc
salt2
(
ii
(
1
));
idepthobc
(
i
)
=
t
pc
depth2
(
ii
(
1
));
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment