15 |
% |
% |
16 |
%example: insitu_cost('./',1,{'listData','argo_in*'}); |
%example: insitu_cost('./',1,{'listData','argo_in*'}); |
17 |
|
|
18 |
%load paths and grid: |
gcmfaces_global; |
19 |
%-------------------- |
global myparms; |
20 |
global mygrid; if isempty(mygrid); grid_load('GRID/',5,'compact'); end; |
|
|
|
|
|
%set more optional paramaters to default values |
|
|
global myparms; year0=myparms.yearInAve(1); year1=myparms.yearInAve(2); |
|
|
listData={'argo_*_1992_to_2007*','argo_*_2008_to_2010*',... |
|
|
'argo_*_2011_to_2012*','climode_*',... |
|
|
'ctd_*','itp_*','seals_*','xbt_*'}; |
|
21 |
listVar={'T','S'}; |
listVar={'T','S'}; |
22 |
listBas={'atlExt','pacExt','indExt','arct'}; |
listBas={'atlExt','pacExt','indExt','arct'}; |
23 |
if sum([90 1170]~=mygrid.ioSize)>0; listBas={}; end; |
if sum([90 1170]~=mygrid.ioSize)>0; listBas={}; end; |
43 |
end; |
end; |
44 |
end; |
end; |
45 |
|
|
46 |
|
if isempty(myparms)|isempty(mygrid); |
47 |
|
load([dirMat 'diags_grid_parms.mat']); |
48 |
|
end; |
49 |
|
|
50 |
|
if isempty(whos('year0')); |
51 |
|
year0=myparms.yearInAve(1); year1=myparms.yearInAve(2); |
52 |
|
end; |
53 |
|
|
54 |
|
if isempty(whos('listData')); |
55 |
|
listData=dir([dirMat 'profiles/output/*.nc']) |
56 |
|
listData={listData(:).name}; |
57 |
|
for ff=1:length(listData); listData{ff}=[listData{ff}(1:end-3) '*']; end; |
58 |
|
end; |
59 |
|
|
60 |
if doComp; |
if doComp; |
61 |
|
|
62 |
%time limits: |
%time limits: |
64 |
|
|
65 |
for vv=1:length(listVar); |
for vv=1:length(listVar); |
66 |
varCur=listVar{vv}; |
varCur=listVar{vv}; |
67 |
|
|
68 |
%get the cost square root: |
%get the cost square root: |
69 |
[MITprof]=MITprof_stats_load([dirData],listData,varCur); |
[MITprof]=MITprof_stats_load([dirData],listData,varCur); |
70 |
|
if ~isfield(MITprof,'prof_point'); |
71 |
|
loc_tile=gcmfaces_loc_tile(90,90,MITprof.prof_lon,MITprof.prof_lat); |
72 |
|
MITprof.prof_point=loc_tile.point; |
73 |
|
end; |
74 |
%mask out values that are not in year range: |
%mask out values that are not in year range: |
75 |
ii=find(MITprof.prof_date<date0|MITprof.prof_date>date1); |
ii=find(MITprof.prof_date<date0|MITprof.prof_date>date1); |
76 |
MITprof.prof(ii,:)=NaN; |
MITprof.prof(ii,:)=NaN; |