| 1 |
gforget |
1.1 |
function []=MITprof_stats_misfit(dirData,listData,listVar,year0,year1,vecLevel,varargin); |
| 2 |
|
|
%[]=MITprof_stats_misfit(dirData,listData,listVar,year0,year1,vecLevel); |
| 3 |
|
|
%object: maps and displays estim-obs at various levels |
| 4 |
|
|
%input: dirData is the data directory name |
| 5 |
|
|
% listData is the data file list (e.g. {'argo_in*'} or {'argo_in*','argo_at*'} ) |
| 6 |
|
|
% listVar is the variable list varCur (e.g. {'T'} or {'T','S'} ) |
| 7 |
|
|
% year0,year1 is the first,last year pair |
| 8 |
|
|
% vecLevel is the vector of depth levels |
| 9 |
|
|
% vecCaxis (optional) is the matrix of colorbar range |
| 10 |
|
|
%output: (none -- figures only) |
| 11 |
|
|
% |
| 12 |
|
|
%for example: |
| 13 |
|
|
% dirData='./'; |
| 14 |
|
|
% listData={'argo_in*'}; listVar={'T','S'}; |
| 15 |
|
|
% MITprof_stats_misfit(dirData,listData,listVar,2004,2008,[10 25 45],[[3 3 1];[0.5 0.5 0.2]]); |
| 16 |
|
|
|
| 17 |
|
|
%load paths and grid: |
| 18 |
|
|
%-------------------- |
| 19 |
|
|
gcmfaces_path; global mygrid; mygrid=[]; grid_load([mydir '/sample_input/GRIDv4/'],5); |
| 20 |
|
|
|
| 21 |
|
|
gcmfaces_bindata;%initialize delaunay triangulation |
| 22 |
|
|
|
| 23 |
|
|
%time limits: |
| 24 |
|
|
date0=datenum(year0,1,1); date1=datenum(year1,12,31); |
| 25 |
|
|
|
| 26 |
|
|
%number of levels: |
| 27 |
|
|
nk=length(vecLevel); |
| 28 |
|
|
|
| 29 |
|
|
%caxis limits: |
| 30 |
|
|
if nargin>6; vecCaxis=varargin{1}; else; vecCaxis=[]; end; |
| 31 |
|
|
|
| 32 |
|
|
figureL; orient tall; |
| 33 |
|
|
|
| 34 |
|
|
for vv=1:length(listVar); |
| 35 |
|
|
varCur=listVar{vv}; |
| 36 |
|
|
|
| 37 |
|
|
%get the cost square root: |
| 38 |
|
|
[MITprof]=MITprof_stats_load(dirData,listData,varCur,1); |
| 39 |
|
|
|
| 40 |
|
|
%mask out values that are not in year range: |
| 41 |
|
|
ii=find(MITprof.prof_date<date0|MITprof.prof_date>date1); |
| 42 |
|
|
MITprof.prof(ii,:)=NaN; |
| 43 |
|
|
|
| 44 |
|
|
|
| 45 |
|
|
%misfit maps: |
| 46 |
|
|
for kkk=1:length(vecLevel); |
| 47 |
|
|
kk=vecLevel(kkk); |
| 48 |
|
|
|
| 49 |
|
|
lon=MITprof.prof_lon; lat=MITprof.prof_lat; obs=MITprof.prof(:,kk); |
| 50 |
|
|
ii=find(~isnan(obs)); lon=lon(ii); lat=lat(ii); obs=obs(ii); |
| 51 |
|
|
misfit_map=gcmfaces_bindata(lon,lat,obs); |
| 52 |
|
|
|
| 53 |
|
|
if isempty(vecCaxis); cc=3*sqrt(nanmean(misfit_map.^2)); else; cc=vecCaxis(vv,kkk); end; |
| 54 |
|
|
subplot(nk,length(listVar),vv+(kkk-1)*length(listVar)); |
| 55 |
|
|
m_map_gcmfaces(misfit_map,-1,[-1 1]*cc); |
| 56 |
|
|
title(sprintf('%s misfits at %dm (%d to %d)',varCur,MITprof.prof_depth(kk),year0,year1)); |
| 57 |
|
|
|
| 58 |
|
|
end; |
| 59 |
|
|
|
| 60 |
|
|
|
| 61 |
|
|
end; |
| 62 |
|
|
|