1 |
% compare finite difference and adjoint gradient |
2 |
% cost function is total sea-ice volume |
3 |
% control variable is surface air temperature |
4 |
|
5 |
path('../../lab_sea/matlab',path); |
6 |
load SSMI |
7 |
fn1='../../../exe/adxx_atemp.0000000000.001.001.data'; |
8 |
fn2='../../../exe/adxx_atemp.0000000000.002.001.data'; |
9 |
a=zeros(20,16); |
10 |
a(1:10,:)=readbin(fn1,[10 16],1,'real*8',1); |
11 |
a(11:20,:)=readbin(fn2,[10 16],1,'real*8',1); |
12 |
|
13 |
clf reset |
14 |
cx=[-1 1]; cl=[1 1 1]*.5; sc=1e4; |
15 |
ax=([min(lon) max(lon) min(lat) max(lat)]); |
16 |
mypcolor(lon,lat,a'/sc); caxis(cx), colorbar |
17 |
plotland, axis(ax), grid |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
for fld={'aqh','atemp','salt','theta','uwind','vwind'} |
24 |
fn1=['adxx_' fld{1} '.0000000000.001.001.data']; |
25 |
fn2=['adxx_' fld{1} '.0000000000.002.001.data']; |
26 |
a=zeros(20,16); |
27 |
a(1:10,:)=readbin(fn1,[10 16],1,'real*8',1); |
28 |
a(11:20,:)=readbin(fn2,[10 16],1,'real*8',1); |
29 |
clf, mypcolor(a'); colorbar, title(fld{1}), pause |
30 |
end |