1 |
gforget |
1.1 |
function []=example_IO(); |
2 |
|
|
% |
3 |
|
|
% EXAMPLE_IO computes and displays a standard deviation field |
4 |
|
|
% |
5 |
|
|
% stand-alone call: addpath gcmfaces/sample_analysis/; example_IO; |
6 |
|
|
% |
7 |
|
|
% needed input files: |
8 |
|
|
% mkdir release1 |
9 |
|
|
% wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology/ETAN |
10 |
|
|
% mv mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology release1/. |
11 |
|
|
|
12 |
|
|
gcmfaces_global; |
13 |
|
|
|
14 |
|
|
input_list_check('example_IO',nargin); |
15 |
|
|
|
16 |
|
|
%expected location: |
17 |
|
|
myenv.nctilesdir=fullfile(pwd,'/release1/nctiles_climatology/ETAN/'); |
18 |
|
|
%if ETAN is not found then try old location: |
19 |
|
|
if ~isdir(myenv.nctilesdir); |
20 |
|
|
%if not found then try old location: |
21 |
|
|
tmpdir=fullfile(pwd,'/gcmfaces/sample_input/nctiles_climatology/ETAN/'); |
22 |
|
|
if isdir(tmpdir); myenv.nctilesdir=tmpdir; end; |
23 |
|
|
end; |
24 |
|
|
%if ETAN is still not found then issue warning and skip example_IO |
25 |
|
|
if ~isdir(myenv.nctilesdir); |
26 |
|
|
help example_IO; |
27 |
|
|
warning('example_IO requires release1/nctiles_climatology/ETAN that was not found ---> abort!'); |
28 |
|
|
return; |
29 |
|
|
end; |
30 |
|
|
|
31 |
|
|
%%%%%%%%%%%%%%%%% |
32 |
|
|
%load grid: |
33 |
|
|
%%%%%%%%%%%%%%%%% |
34 |
|
|
|
35 |
|
|
if isempty(mygrid); |
36 |
|
|
grid_load; |
37 |
|
|
end; |
38 |
|
|
|
39 |
|
|
%%%%%%%%%%% |
40 |
|
|
%get field: |
41 |
|
|
%%%%%%%%%%% |
42 |
|
|
fld=read_nctiles([myenv.nctilesdir 'ETAN'],'ETAN'); |
43 |
|
|
fld=std(fld,[],3); fld(find(fld==0))=NaN; |
44 |
|
|
cc=[0:0.1:1]*0.10; |
45 |
|
|
|
46 |
|
|
%%%%%%%%%%%% |
47 |
|
|
%plot field: |
48 |
|
|
%%%%%%%%%%%% |
49 |
|
|
if ~myenv.lessplot; |
50 |
|
|
figureL; gcmfaces_sphere(fld,cc,[],[],1); |
51 |
|
|
end; |
52 |
|
|
|
53 |
|
|
|