-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDiff1Dredout.m
More file actions
30 lines (26 loc) · 896 Bytes
/
Diff1Dredout.m
File metadata and controls
30 lines (26 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DIFF1Dredout %
% This script reduces the size of the output of %
% Diff1Dsolve.m %
% %
% Ryan Holmes March 2016 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (NOUT ~= 1)
%Create averaging matrix:
NtOUT = floor(Nt/NOUT);
avMAT = zeros(NtOUT,Nt);
for ii = 1:NtOUT
avMAT(ii,(1+(ii-1)*NOUT):(ii*NOUT)) = 1/NOUT;
end
avMAT = avMAT';
%reduce size of variables:
vars = {'t','shflux','srflux','ssflux','tau_x',...
'tau_y','Hsbl','u','v','w','S','T','b','ks','kt','kv',...
'Tadv','gams','gamt','gamv','dbdy','bulkRiN','bulkRiD'};
for vi = 1:length(vars)
if (exist(vars{vi}))
eval([vars{vi} ' = ' vars{vi} '*avMAT;']);
end
end
clear avMAT vars;
end