1 |
|
clear all;%close all; |
2 |
|
|
3 |
|
addpath(pwd) |
4 |
|
cdir = pwd; |
5 |
|
|
6 |
|
% the directory with adjoint output |
7 |
|
addir = '/net/ross/raid1/ifenty/MITgcm_20130115/MITgcm/verification/1D_ocean_ice_column/temp/mnc_test_0001/' |
8 |
|
|
9 |
|
% how many vertical cells out output |
10 |
|
dep_ind = 5; |
11 |
|
|
12 |
|
% the experiment name |
13 |
|
exp_name = 'temp' |
14 |
|
|
15 |
|
% boolean for writing the figure to a png file |
16 |
|
do_print = 1 ; |
17 |
|
|
18 |
|
% cd([dirRoot rdir '/' addir]) |
19 |
|
cd(addir) |
20 |
|
|
21 |
|
add = dir('adstate*'); |
22 |
|
ads = dir('adseaice*'); |
23 |
|
ade = dir('adexf*'); |
24 |
|
|
25 |
|
adseaice = nc_getall(ads(1).name); |
26 |
|
adstate = nc_getall(add(1).name); |
27 |
|
adexf = nc_getall(ade(1).name); |
28 |
|
|
29 |
|
T = adseaice.T.data; |
30 |
|
adheff = permute(adseaice.adheff.data,[ 3 2 1]); |
31 |
|
adarea = permute(adseaice.adarea.data,[ 3 2 1]); |
32 |
|
|
33 |
|
adqnet = permute(adstate.adQnet.data,[3 2 1]); |
34 |
|
adatemp = permute(adexf.adatemp.data,[3 2 1]); |
35 |
|
advwind = permute(adexf.advwind.data,[3 2 1]); |
36 |
|
adswdown = permute(adexf.adswdown.data,[3 2 1]); |
37 |
|
adT = permute(adstate.adT.data,[4 3 2 1 ]); |
38 |
|
adS = permute(adstate.adS.data,[4 3 2 1 ]); |
39 |
|
|
40 |
|
ipt=1;if(size(adheff,1)==5);ipt=3;end; |
41 |
|
|
42 |
|
figure(2);clf; |
43 |
|
|
44 |
|
subplot(423); hold on; |
45 |
|
plot(T,squeeze(adarea(ipt,ipt,:)));grid;title('adarea'); |
46 |
|
tenPercentAboveBelowLeftRight; |
47 |
|
nn = find(isnan(squeeze(adarea(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
48 |
|
|
49 |
|
subplot(424); hold on; |
50 |
|
plot(T,squeeze(adheff(ipt,ipt,:)));axis tight;grid;title('adheff') |
51 |
|
tenPercentAboveBelowLeftRight; |
52 |
|
nn = find(isnan(squeeze(adheff(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
53 |
|
|
54 |
|
subplot(425); hold on; |
55 |
|
plot(T,squeeze(adqnet(ipt,ipt,:)));axis tight;grid;title('adqnet'); |
56 |
|
tenPercentAboveBelowLeftRight; |
57 |
|
nn = find(isnan(squeeze(adqnet(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
58 |
|
|
59 |
|
subplot(426); hold on; |
60 |
|
plot(T,squeeze(advwind(ipt,ipt,:)));axis tight;grid;title('advwind'); |
61 |
|
tenPercentAboveBelowLeftRight; |
62 |
|
nn = find(isnan(squeeze(advwind(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
63 |
|
|
64 |
|
subplot(421); hold on; |
65 |
|
plot(T,squeeze(adT(ipt,ipt,1:dep_ind,:))');axis tight;grid;title('adT') |
66 |
|
tenPercentAboveBelowLeftRight; |
67 |
|
nn = find(isnan(squeeze(adT(ipt,ipt,1,:)))); plot(T(nn),T(nn).*0,'rx') |
68 |
|
h=legend('l1','l2','l3', 'l4','Location','SouthWest'); |
69 |
|
set(h,'FontSize',6) |
70 |
|
|
71 |
|
subplot(422); hold on; |
72 |
|
plot(T,squeeze(adS(ipt,ipt,1:dep_ind,:))');axis tight;grid;title('adS') |
73 |
|
tenPercentAboveBelowLeftRight; |
74 |
|
|
75 |
|
subplot(427); hold on; |
76 |
|
plot(T,squeeze(adatemp(ipt,ipt,:)));axis tight;grid;title('adatemp'); |
77 |
|
tenPercentAboveBelowLeftRight; |
78 |
|
nn = find(isnan(squeeze(adatemp(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
79 |
|
|
80 |
|
subplot(428); hold on; |
81 |
|
plot(T,squeeze(adswdown(ipt,ipt,:)));axis tight;grid;title('adswdown'); |
82 |
|
tenPercentAboveBelowLeftRight; |
83 |
|
nn = find(isnan(squeeze(adswdown(ipt,ipt,:)))); plot(T(nn),T(nn).*0,'rx') |
84 |
|
|
85 |
|
% cd(cdir) |
86 |
|
|
87 |
|
set(gcf,'Position',[350 120 600 1000]) |
88 |
|
|
89 |
|
if (do_print) |
90 |
|
set(gcf,'PaperPosition',[0 0 8 12]) |
91 |
|
print('-dpng','-r100',['AdjointAnalysis_' exp_name]) |
92 |
|
['printing ' exp_name] |
93 |
|
end |
94 |
|
|
95 |
|
%cd(cdir) |