function [mn]=idma_area_mean(fld,msk); % IDMA_AREA_MEAN computes area-weighted average of a % field (fld; 2D or 3D) over a region defined by % a 0/1 mask (msk). Both fld and msk are of % the gcmfaces class. If fld has a third dimension % (e.g., for depth or time) then mn is a vector % % Example: box_l=[-180 -140]; box_L=[-10 10]-30; % msk=(mygrid.XC>=box_l(1)&mygrid.XC=box_L(1)&mygrid.YC