1 |
% Compare MITgcm/verification/seaice_obcs |
2 |
% results to ../lab_sea/input.salt_plume |
3 |
|
4 |
% preamble |
5 |
%cd MITgcm/verification/seaice_obcs/input |
6 |
nx=20; ny=16; nz=18; nt=10; ix=8:17; iy=4:11; |
7 |
p1='../../lab_sea/tr_run.salt_plume/'; |
8 |
p2='../run/'; |
9 |
|
10 |
% compare U/V/T/S |
11 |
for f={'T','S','U','V'} |
12 |
J=0; |
13 |
fn=[p1 f{1} '.' myint2str(nt,10) '.data']; |
14 |
tmp=readbin(fn,[nx ny nz]); tmp1=tmp(ix,iy,:); |
15 |
fn=[p2 f{1} '.' myint2str(nt,10) '.data']; |
16 |
tmp2=readbin(fn,[length(ix) length(iy) nz]); |
17 |
for k=1:nz |
18 |
clf, subplot(311), mypcolor(tmp1(:,:,k)'); thincolorbar |
19 |
title(['lab sea ' f{1} ', level ' int2str(k)]); |
20 |
subplot(312), mypcolor(tmp2(:,:,k)'); thincolorbar |
21 |
title(['seaice obcs ' f{1} ', level ' int2str(k)]); |
22 |
tmp3=tmp2(:,:,k)-tmp1(:,:,k); |
23 |
subplot(313), mypcolor(tmp3'); thincolorbar |
24 |
title('difference'), pause(.2) |
25 |
J=J+sum(sum(tmp3(2:(end-1),2:(end-1)).^2)); |
26 |
end |
27 |
disp([f{1} ': ' num2str(J)]) |
28 |
end |
29 |
|
30 |
% compare sea ice |
31 |
for f={'UICE','VICE','AREA','HSNOW','HSALT','HEFF'} |
32 |
J=0; |
33 |
for t=0:nt |
34 |
fn=[p1 f{1} '.' myint2str(t,10) '.data']; |
35 |
tmp=readbin(fn,[nx ny]); tmp1=tmp(ix,iy,:); |
36 |
fn=[p2 f{1} '.' myint2str(t,10) '.data']; |
37 |
tmp2=readbin(fn,[length(ix) length(iy)]); |
38 |
clf, subplot(311), mypcolor(tmp1'); cx=caxis; thincolorbar |
39 |
title(['lab sea ' f{1} ', time step ' int2str(t)]); |
40 |
subplot(312), mypcolor(tmp2'); caxis(cx), thincolorbar |
41 |
title(['seaice obcs ' f{1} ', time step ' int2str(t)]); |
42 |
tmp3=tmp2-tmp1; |
43 |
subplot(313), mypcolor(tmp3'); thincolorbar |
44 |
title('difference'), pause(.2) |
45 |
J=J+sum(sum(tmp3(2:(end-1),2:(end-1)).^2)); |
46 |
end |
47 |
disp([f{1} ': ' num2str(J)]) |
48 |
end |