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
448937cf
Commit
448937cf
authored
Jan 09, 2013
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for the global ftbverbose variable in the output messages
parent
5c54ae1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
17 deletions
+26
-17
utilities/show_sigma.m
utilities/show_sigma.m
+26
-17
No files found.
utilities/show_sigma.m
View file @
448937cf
...
...
@@ -31,6 +31,8 @@ function show_sigma(meshfile,bathfile,sigmafile,varargin)
close
all
global
ftbverbose
if
nargin
==
4
npts
=
varargin
{
1
};
else
...
...
@@ -48,8 +50,11 @@ C = textscan(fid, '%s %s %s %d', 1);
Nelems
=
C
{
4
};
x
=
zeros
(
Nverts
,
3
);
tri
=
zeros
(
Nelems
,
3
);
fprintf
(
'Nverts: %d\n'
,
Nverts
)
fprintf
(
'Nelems: %d\n'
,
Nelems
)
if
ftbverbose
fprintf
(
'Nverts: %d\n'
,
Nverts
)
fprintf
(
'Nelems: %d\n'
,
Nelems
)
end
for
i
=
1
:
Nelems
C
=
textscan
(
fid
,
'%d %d %d %d %d'
,
1
);
tri
(
i
,
1
)
=
C
{
2
};
...
...
@@ -73,8 +78,10 @@ for i=1:Nverts
x
(
i
,
3
)
=
C
{
3
};
end
fprintf
(
'min topography %f\n'
,
min
(
x
(:,
3
)));
fprintf
(
'max topography %f\n'
,
max
(
x
(:,
3
)));
if
ftbverbose
fprintf
(
'min topography %f\n'
,
min
(
x
(:,
3
)));
fprintf
(
'max topography %f\n'
,
max
(
x
(:,
3
)));
end
% read the sigma file
fid
=
fopen
(
sigmafile
,
'r'
);
...
...
@@ -119,16 +126,17 @@ while ~feof(fid)
end
end
fprintf
(
'nlev %d\n'
,
nlev
)
fprintf
(
'sigtype %s\n'
,
sigtype
)
fprintf
(
'du %d\n'
,
du
)
fprintf
(
'dl %d\n'
,
dl
)
fprintf
(
'min_constant_depth %f\n'
,
min_constant_depth
)
fprintf
(
'ku %d\n'
,
ku
)
fprintf
(
'kl %d\n'
,
kl
)
fprintf
(
'zku %d\n'
,
zku
)
fprintf
(
'zkl %d\n'
,
zkl
)
if
ftbverbose
fprintf
(
'nlev %d\n'
,
nlev
)
fprintf
(
'sigtype %s\n'
,
sigtype
)
fprintf
(
'du %d\n'
,
du
)
fprintf
(
'dl %d\n'
,
dl
)
fprintf
(
'min_constant_depth %f\n'
,
min_constant_depth
)
fprintf
(
'ku %d\n'
,
ku
)
fprintf
(
'kl %d\n'
,
kl
)
fprintf
(
'zku %d\n'
,
zku
)
fprintf
(
'zkl %d\n'
,
zkl
)
end
% generate the sigma coordinates
...
...
@@ -143,9 +151,10 @@ patch('Vertices',[x(:,1),x(:,2)],'Faces',tri,...
axis
equal
% plot to get a line
fprintf
(
'select two end points of a transect with your mouse'
);
fprintf
(
'select two end points of a transect with your mouse
...
'
);
[
xt
,
yt
]
=
ginput
(
2
);
hold
on
fprintf
(
'done.\n'
)
ds
=
(
xt
(
2
)
-
xt
(
1
))/(
npts
-
1
);
xline
=
xt
(
1
):
ds
:
xt
(
2
);
...
...
@@ -179,12 +188,12 @@ switch lower(sigtype)
z
(
i
,
1
:
nlev
)
=
0
:
-
1
/
double
(
nlev
-
1
):
-
1
;
end
otherwise
error
(
'
can
t do that sigtype'
)
error
(
'
Can
''
t do that sigtype'
)
end
for
i
=
1
:
npts
xslice
(
i
,
1
:
nlev
)
=
sline
(
i
);
yslice
(
i
,
1
:
nlev
)
=
z
(
i
,
1
:
nlev
)
*
zline
(
i
);
yslice
(
i
,
1
:
nlev
)
=
z
(
i
,
1
:
nlev
)
*
zline
(
i
);
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