1 |
gforget |
1.1 |
function [budg]=check_budg(budgIn); |
2 |
|
|
|
3 |
|
|
gcmfaces_global; |
4 |
|
|
|
5 |
|
|
%tend=read_nctiles(fileName,'tend'); |
6 |
|
|
%trU=read_nctiles(fileName,'trU'); |
7 |
|
|
%trV=read_nctiles(fileName,'trV'); |
8 |
|
|
%trWtop=read_nctiles(fileName,'trWtop'); |
9 |
|
|
%trWbot=read_nctiles(fileName,'trWbot'); |
10 |
|
|
|
11 |
|
|
tend=budgIn.tend; |
12 |
|
|
trU=budgIn.trU; |
13 |
|
|
trV=budgIn.trV; |
14 |
|
|
trWtop=budgIn.trWtop; |
15 |
|
|
trWbot=budgIn.trWbot; |
16 |
|
|
|
17 |
|
|
%tend(isnan(tend))=0; |
18 |
|
|
%trU(isnan(trU))=0; trV(isnan(trV))=0; |
19 |
|
|
%trWtop(isnan(trWtop))=0; trWbot(isnan(trWbot))=0; |
20 |
|
|
|
21 |
|
|
%keyboard; |
22 |
|
|
|
23 |
|
|
dt=1; |
24 |
|
|
units = budgIn.specs.units; |
25 |
|
|
|
26 |
|
|
%define northern hemisphere as domain of integration |
27 |
|
|
nameMask='Northern Hemisphere'; |
28 |
|
|
mask=mygrid.mskC.*mk3D(mygrid.YC>0,mygrid.mskC); |
29 |
|
|
if length(size(tend{1}))<3; mask=mask(:,:,1); end; |
30 |
|
|
|
31 |
|
|
%edit plot title accordingly |
32 |
|
|
descr=nameMask; |
33 |
|
|
|
34 |
|
|
%compute northern hemisphere integrals |
35 |
|
|
budg.tend=NaN*dt; |
36 |
|
|
budg.hconv=NaN*dt; |
37 |
|
|
budg.zconv=NaN*dt; |
38 |
|
|
|
39 |
|
|
%compute flux convergence |
40 |
|
|
hconv=calc_UV_conv(trU,trV,{}); |
41 |
|
|
zconv=trWtop-trWbot; |
42 |
|
|
%compute sum over domain |
43 |
|
|
budg.tend=nansum(tend.*mask); |
44 |
|
|
budg.hconv=nansum(hconv.*mask); |
45 |
|
|
budg.zconv=nansum(zconv.*mask); |
46 |
|
|
|
47 |
|
|
budg |
48 |
|
|
budg.tend-budg.hconv-budg.zconv |
49 |
|
|
|