/[MITgcm]/MITgcm/verification/global_ocean.90x40x15/diags_matlab/mit_overturning.m
ViewVC logotype

Contents of /MITgcm/verification/global_ocean.90x40x15/diags_matlab/mit_overturning.m

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


Revision 1.1 - (show annotations) (download)
Tue Oct 22 13:30:40 2002 UTC (21 years, 11 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint58l_post, checkpoint48f_post, checkpoint46k_post, checkpoint51k_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint55c_post, checkpoint53b_pre, checkpoint48d_pre, checkpoint51l_post, checkpoint51j_post, branch-exfmods-tag, checkpoint47e_post, checkpoint57m_post, checkpoint47i_post, checkpoint52l_pre, checkpoint48i_post, checkpoint52e_pre, checkpoint58e_post, checkpoint57v_post, checkpoint57g_pre, checkpoint52j_post, checkpoint47f_post, checkpoint48d_post, checkpoint51o_pre, checkpoint57f_post, checkpoint50e_post, checkpoint52e_post, checkpoint50c_post, checkpoint57s_post, checkpoint51n_pre, checkpoint47d_post, checkpoint57j_post, checkpoint58b_post, checkpoint58m_post, checkpoint47a_post, checkpoint57b_post, checkpoint46l_pre, checkpoint53c_post, checkpoint53d_post, checkpoint57f_pre, checkpoint48a_post, checkpoint55d_pre, checkpoint46n_post, checkpoint51f_pre, checkpoint57g_post, checkpoint48e_post, checkpoint57a_post, checkpoint48h_post, checkpoint55j_post, checkpoint56b_post, checkpoint50c_pre, checkpoint57h_pre, checkpoint57y_post, branchpoint-genmake2, checkpoint46l_post, checkpoint58g_post, checkpoint57x_post, checkpoint52j_pre, checkpoint54a_post, branch-netcdf, checkpoint50d_pre, checkpoint55h_post, checkpoint51r_post, checkpoint52b_pre, checkpoint52n_post, checkpoint54b_post, checkpoint58h_post, checkpoint51i_post, checkpoint57e_post, checkpoint54d_post, checkpoint47h_post, checkpoint48c_post, checkpoint56c_post, checkpoint54e_post, checkpoint58j_post, checkpoint55b_post, checkpoint51e_post, checkpoint51b_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint51c_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint55a_post, checkpoint57c_pre, checkpoint48, checkpoint49, checkpoint47b_post, checkpoint53b_post, checkpoint57o_post, checkpoint55g_post, checkpoint57r_post, checkpoint51o_post, checkpoint48g_post, checkpoint57k_post, checkpoint57d_post, checkpoint55f_post, checkpoint57i_post, checkpoint51q_post, checkpoint52l_post, checkpoint52k_post, checkpoint58, checkpoint57a_pre, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52d_post, checkpoint46m_post, checkpoint51b_pre, checkpoint52a_post, checkpoint57h_done, checkpoint47g_post, checkpoint58f_post, checkpoint52b_post, checkpoint53g_post, checkpoint52f_post, checkpoint57n_post, checkpoint52c_post, checkpoint58d_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint51h_pre, checkpoint58a_post, checkpoint50g_post, checkpoint58i_post, checkpoint57q_post, checkpoint51g_post, ecco_c52_e35, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint48b_post, checkpoint50b_post, eckpoint57e_pre, checkpoint58c_post, checkpoint58k_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52a_pre, checkpoint47d_pre, checkpoint51d_post, checkpoint48c_pre, checkpoint51m_post, checkpoint51t_post, checkpoint53d_pre, checkpoint47, checkpoint55e_post, checkpoint54c_post, checkpoint50h_post, checkpoint52i_post, checkpoint51a_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51p_post, checkpoint51n_post, checkpoint55i_post, checkpoint51i_pre, checkpoint57l_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, checkpoint50b_pre, checkpoint56a_post, checkpoint51s_post, checkpoint55d_post
Branch point for: netcdf-sm0, branch-genmake2, branch-nonh, tg2-branch, checkpoint51n_branch, release1, branch-exfmods-curt
 fixed the verification/global_ocean.90x40x15 experiment:
 - new bathymetry (the world according to A., JMC, and M.)
 - new initial fields and forcing fields (*.bin files)
 - new POLY3.COEFFS (for the next release one should switch to a full
   equation of state: JMD95P or MDJWF)
 - fixed several errors and redundancies in the data file
 - experiment uses looped cells
 - added matlab directory with diagnostic scripts for plotting of output

1 function [psi, psimask] = mit_overturning(v,vmask,dx,dz,addlayer);
2 %function [psi, psimask] = mit_overturning(v,vmask,dx,dz);
3 % overturning stream function for mitgcm model, time slabs are handled as
4 % cell objects, integration from bottom to top.
5
6 if nargin < 5
7 addlayer = 0;
8 elseif (nargin > 5 & nargin < 4)
9 error('needs 4 or 5 arguments')
10 end
11 [nx ny nz] = size(vmask);
12 for kz=1:nz
13 dxdzs(:,:,kz) = (vmask(:,:,kz).*dx)*dz(kz);
14 end
15
16 % mask for stream function
17 pmask = change(squeeze(nanmean(vmask)),'~=',NaN,1);
18 % add another psi-point at the bottom of each column
19 for ky=1:ny;
20 iz = min(find(isnan(pmask(ky,:))));
21 if ~isempty(iz) & iz > 1
22 pmask(ky,iz) = 1;
23 end
24 end
25 if iscell(v)
26 nt = length(v);
27 psi = cell(size(v));
28 for k=1:nt
29 vdxdz = v{k}(:,:,:).*dxdzs; %(dxdzs.*vmask);
30 zave = fliplr(change(squeeze(nansum(vdxdz)),'==',NaN,0));
31 psi{k} = -fliplr(cumsum(zave,2)).*pmask;
32 end
33 else
34 nt = size(v,4);
35 for k=1:nt
36 vdxdz = squeeze(v(:,:,:,k)).*dxdzs; %(dxdzs.*vmask);
37 zave = fliplr(squeeze(sum(change(vdxdz,'==',NaN,0),1)));
38 psi(:,:,k) = -fliplr(cumsum(zave,2)).*pmask;
39 end
40 end
41 % add another layer at the bottom; psi is zero in the layer by definition
42 if addlayer
43 disp('mit_overturning: adding a layer with psi = 0 at the bottom')
44 pmask = [pmask pmask(:,end)];
45 if iscell(psi)
46 nt = length(psi);
47 for k=1:nt
48 psi{k} = [psi{k} change(psi{k}(:,end),'~=',NaN,0)];
49 end
50 else
51 psi = cat(2,psi,change(psi(:,end,:),'~=',NaN,0));
52 end
53 end
54 if nargout == 2
55 psimask = pmask;
56 end
57
58 return
59
60
61
62
63

  ViewVC Help
Powered by ViewVC 1.1.22