/[MITgcm]/MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/mit_plotmeandrift.m
ViewVC logotype

Contents of /MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/mit_plotmeandrift.m

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


Revision 1.1 - (show annotations) (download)
Sat Aug 12 19:37:25 2006 UTC (17 years, 9 months ago) by jmc
Branch: MAIN
moved from verification/global_ocean.90x40x15/diags_matlab ;
 add Header and Name; use "quiver" instead of NaNquiver (<- not standard);

1 % m-file: mit_plotmeandrift.m
2 % mean temperature and salinity drift
3
4 % $Header: $
5 % $Name: $
6
7 if ~isempty(msg_spinup)
8 % extracted from the monitor output with a script by jmc
9 global_mt = load('spinup.t_A');
10 global_ms = load('spinup.s_A');
11 global_mt(itim) = [];
12 global_ms(itim) = [];
13 else
14 % or computed `on the fly'
15 global_mt = zeros(size(kt));
16 global_ms = zeros(size(kt));
17 for k=kt;
18 if meanfields
19 % read the snapshots
20 tk=rdmds('T',timesteps(k));
21 sk=rdmds('S',timesteps(k));
22 if strcmp(grd.buoyancy,'OCEANICP')
23 % turn fields upside down
24 tk=tk(:,:,end:-1:1).*grd.cmask;
25 sk=sk(:,:,end:-1:1).*grd.cmask;
26 end
27 else
28 % snapshots are already available
29 if iscell(t)
30 tk = t{k};
31 else
32 tk = t(:,:,:,k);
33 end
34 if iscell(s)
35 sk = s{k};
36 else
37 sk = s(:,:,:,k);
38 end
39 end
40 global_mt(k)= nansum(tk(:).*grd.volc(:))/nansum(grd.volc(:));
41 global_ms(k)= nansum(sk(:).*grd.volc(:))/nansum(grd.volc(:));
42 end
43 end
44 figure
45 subplot(2,1,1);
46 plot(tim,global_mt)
47 title('Drift of Mean Temperature'); xlabel(['Time [' timeunit ']']); ylabel('T [degC]')
48 subplot(2,1,2);
49 plot(tim,global_ms)
50 title('Drift of Mean Salinity'); xlabel(['Time [' timeunit ']']); ylabel('S [PSU]')
51 suptitle(['experiment ' dname])
52

  ViewVC Help
Powered by ViewVC 1.1.22