/[MITgcm]/MITgcm/verification/natl_box_adjoint/results_seaice/lookat_exp8.m
ViewVC logotype

Contents of /MITgcm/verification/natl_box_adjoint/results_seaice/lookat_exp8.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Wed Aug 31 19:42:39 2005 UTC (18 years, 8 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint58l_post, checkpoint58e_post, checkpoint57v_post, checkpoint57s_post, checkpoint58b_post, checkpoint58m_post, checkpoint63h, checkpoint63i, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint58u_post, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint57y_post, checkpoint58g_post, checkpoint57x_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint58w_post, checkpoint58j_post, checkpoint57y_pre, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint58o_post, checkpoint57z_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +7 -7 lines
updating verification/natl_box_adjoint

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 fn='../exe/adxx_atemp.0000000000.001.001.data';
8 a=readbin(fn,[20 16],1,'real*8');
9 fn='../exe/grad-res.txt';
10 fin=fopen(fn,'r'); b=0*a; c=0*a; d=0*a;
11 tmp=fgetl(fin); tmp=fgetl(fin); tmp=fgetl(fin);
12 for i=1:150
13 tmp=fgetl(fin);
14 tmp=fgetl(fin); arr1=sscanf(tmp(10:85),'%f');
15 tmp=fgetl(fin); arr2=sscanf(tmp(10:85),'%f');
16 b(arr1(3),arr1(4))=arr2(6);
17 c(arr1(3),arr1(4))=arr2(7);
18 d(arr1(3),arr1(4))=arr2(8);
19 end
20
21 clf reset, orient tall, wysiwyg
22 cx=[-1 1]; cl=[1 1 1]*.5; sc=3e5;
23 ax=([min(lon) max(lon) min(lat) max(lat)]);
24 subplot(411), mypcolor(lon,lat,b'/sc); caxis(cx), colorbar
25 % plotland('k'), axis(ax), grid
26 % plotland(cl,4), axis(ax)
27 xlabel('Longitude East'), ylabel('Latitude North')
28 title('Adjoint model: gradient of sea-ice volume wrt air temperature')
29 subplot(412), mypcolor(lon,lat,c'/sc); caxis(cx), colorbar
30 % plotland('k'), axis(ax), grid
31 % plotland(cl,4), axis(ax)
32 xlabel('Longitude East'), ylabel('Latitude North')
33 title('Finite-difference: gradient of sea-ice volume w.r.t. air temperature')
34 subplot(413), mypcolor(lon,lat,(c-b)'/sc); caxis(cx/10000), colorbar
35 % plotland('k'), axis(ax), grid
36 % plotland(cl,4), axis(ax)
37 xlabel('Longitude East'), ylabel('Latitude North')
38 title('Finite-difference minus adjoint gradient')
39 subplot(414), mypcolor(lon,lat,d'); caxis([-2 2]), colorbar
40 % plotland('k'), axis(ax), grid
41 % plotland(cl,4), axis(ax)
42 xlabel('Longitude East'), ylabel('Latitude North')
43 title('( adjoint minus finite-difference ) / adjoint')
44
45 % print -djpeg -r0 FIG1
46 % print -dpsc FIG1
47
48 %% orient tall, wysiwyg, clf
49 %% fn='adxx_atemp.0000000000.001.001.data';
50 %% a=readbin(fn,[20 16 12],1,'real*8');
51 %% for i=1:12,subplot(4,3,i)
52 %% mypcolor(lon,lat,a(:,:,i)');
53 %% caxis([-1 1]),colorbar
54 %% title(['dJ/d(air-temp), day ' int2str(i*10-15)])
55 %% end
56 %% print -djpeg -r0 FIG1
57 %%
58 %% clf
59 %% for i=1:11, subplot(4,3,i)
60 %% a=readbin(['AREA.' myint2str(i*240-240,10) '.001.001.data'],[20 16],1,'real*8');
61 %% a(find(a<1&a>.5))=.75; a(find(a<.5&a>0))=.25;
62 %% mypcolor(lon,lat,a'); colorbar
63 %% title(['sea-ice area on day' int2str(i*10-10)])
64 %% end
65 %% print -djpeg -r0 FIG2

  ViewVC Help
Powered by ViewVC 1.1.22