/[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.1 - (hide annotations) (download)
Thu Nov 1 19:07:16 2012 UTC (12 years, 8 months ago) by gforget
Branch: MAIN
- more modular, and suposedly more user-friendly, version
  of ecco_v4/comp_driver.m and basic_diags_ecco.m

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    
30     %physical diagnostics
31     for iChunk=listChunk;
32     diags_select(dirModel,dirMat,setDiags,12,iChunk);
33     end;
34    
35     elseif ~isempty(listChunk);
36    
37     %physical diagnostics
38     for iChunk=listChunk;
39     diags_select(dirModel,dirMat,'A',12,iChunk);
40     diags_select(dirModel,dirMat,'B',12,iChunk);
41     diags_select(dirModel,dirMat,'C',12,iChunk);
42     if myswitch.doBudget;
43     budget_list=1;
44     if ~isempty(dir([dirMat 'diags_select_budget_list.mat']));
45     eval(['load ' dirMat 'diags_select_budget_list.mat;']);
46     end;
47     for kk=budget_list;
48     diags_select(dirModel,dirMat,{'D',kk},52,iChunk);
49     end;
50     end;
51     end;
52    
53     else;
54    
55     %in situ profiles fit
56     if myswitch.doProfiles; insitu_diags(dirModel,dirMat,1); end;
57    
58     %altimeter fit
59     if myswitch.doCost; cost_altimeter(dirModel,dirMat); end;
60    
61     %other cost terms
62     if myswitch.doCost; cost_sst(dirModel,dirMat,1); end;
63     if myswitch.doCost; cost_bp(dirModel,dirMat,1); end;
64    
65     %controls
66     if myswitch.doCtrl; cost_xx(dirModel,dirMat,1); end;
67    
68     end;
69    

  ViewVC Help
Powered by ViewVC 1.1.22