-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathswe_run_rmodel.m
36 lines (31 loc) · 1.3 KB
/
swe_run_rmodel.m
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
31
32
33
34
35
36
function swe_run_rmodel(varargin)
% Harvests job structure to run model stored in SwE.mat.
% =========================================================================
% FORMAT: swe_run_rmodel(job)
% -------------------------------------------------------------------------
% Inputs:
% - job: harvested job data structure (see matlabbatch help)
% =========================================================================
% Written by Tom Maullin (05/09/2018)
% Version Info: $Format:%ci$ $Format:%h$
% Job variable
% -------------------------------------------------------------------------
job = varargin{1};
% Obtain SwE structure
% -------------------------------------------------------------------------
load(job.des{1});
% Check compatability
% -------------------------------------------------------------------------
if isfield(SwE, 'ver')
swe_checkCompat(SwE.ver, swe('ver'))
else
warning(['SwE.mat file has no recorded version number. If this `.mat` ',...
'file was created with SwE v1.2.11 or less, running this anal',...
'ysis will likely run into errors. To avoid this, please re-e',...
'nter the job specification in the batch window.']);
end
% Compute model.
% -------------------------------------------------------------------------
cd(SwE.swd);
swe_cp(SwE);
end