/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_driver.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_driver.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (hide annotations) (download)
Wed Apr 3 14:11:58 2013 UTC (12 years, 3 months ago) by gforget
Branch: MAIN
Changes since 1.3: +1 -0 lines
- add cost_seaicearea computation.

1 gforget 1.1 function []=diags_driver(dirModel,dirMat,listChunk,setDiags);
2     %object: compute the various cost and physics
3     % diagnosits from model output
4     %input: dirModel is the model directory containing sudirectories 'diags/' etc.
5     % dirMat is the directory where diagnozed .mat files will be saved
6     % -> set it to '' to use the default [dirModel 'mat/']
7     % listChunk states which part of the computation should be done
8     % set it to e.g. 1:4 to do the first 4 years of physics diags
9     % set listChunk to [] to compute cost terms
10     % setDiags is
11     %notes : eventually should also use dirMat, dirTex interactively for listChunk=[];
12    
13     gcmfaces_global; global myparms;
14    
15     %%%%%%%%%%%%%%%
16     %pre-processing
17     %%%%%%%%%%%%%%%
18    
19     myswitch=diags_pre_process(dirModel,dirMat);
20    
21     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22     %now do the selected computation chunk:
23     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24    
25     dirModel=[dirModel '/'];
26     if isempty(dirMat); dirMat=[dirModel 'mat/']; else; dirMat=[dirMat '/']; end;
27    
28     if ~isempty(who('setDiags'));
29 gforget 1.2
30     if iscell(setDiags); lChunk=52;
31     elseif strcmp(setDiags,'B')&(~isempty(find(listChunk==1)));
32     lChunk=1; listChunk=[1:myparms.recInAve(2)];
33     elseif strcmp(setDiags,'B'); lChunk=0;
34     elseif strcmp(setDiags,'D'); lChunk=52;
35     else; lChunk=12;
36     end;
37 gforget 1.1
38     %physical diagnostics
39     for iChunk=listChunk;
40 gforget 1.2 diags_select(dirModel,dirMat,setDiags,lChunk,iChunk);
41 gforget 1.1 end;
42    
43     elseif ~isempty(listChunk);
44    
45     %physical diagnostics
46     for iChunk=listChunk;
47     diags_select(dirModel,dirMat,'A',12,iChunk);
48 gforget 1.2 if iChunk==1; diags_select(dirModel,dirMat,'B',1,[1:myparms.recInAve(2)]); end;
49 gforget 1.1 diags_select(dirModel,dirMat,'C',12,iChunk);
50     if myswitch.doBudget;
51     budget_list=1;
52     if ~isempty(dir([dirMat 'diags_select_budget_list.mat']));
53     eval(['load ' dirMat 'diags_select_budget_list.mat;']);
54     end;
55     for kk=budget_list;
56     diags_select(dirModel,dirMat,{'D',kk},52,iChunk);
57     end;
58     end;
59     end;
60    
61     else;
62    
63     %in situ profiles fit
64 gforget 1.3 if myswitch.doProfiles; insitu_diags(dirMat,1); end;
65 gforget 1.1
66     %altimeter fit
67     if myswitch.doCost; cost_altimeter(dirModel,dirMat); end;
68    
69     %other cost terms
70     if myswitch.doCost; cost_sst(dirModel,dirMat,1); end;
71     if myswitch.doCost; cost_bp(dirModel,dirMat,1); end;
72 gforget 1.4 if myswitch.doCost; cost_seaicearea(dirModel,dirMat,1); end;
73 gforget 1.1
74     %controls
75     if myswitch.doCtrl; cost_xx(dirModel,dirMat,1); end;
76    
77     end;
78    

  ViewVC Help
Powered by ViewVC 1.1.22