function []=check3dmask(T) % check3dmask(datafile) % % Load 3D data in "datafile", calculate a missing % value mask and compare to pmask.bin. % They should always be the same!!! % % Created 11/11/99 by adcroft@mit.edu % Modified by % Maintained by adcroft@mit.edu, abiastoch@ucsd.edu load VGRID.mat nzc load MASKS Tmsk=1+0*T; Tmsk( find(T==0) )=0; Tmsk( find(isnan(T)) )=0; oops=0; for k=1:nzc nmis=prod(size(find(msk(:,:,k)~=Tmsk(:,:,k)))); ndil=prod(size(find(msk(:,:,k)==0&Tmsk(:,:,k)==1))); nwnd=prod(size(find(msk(:,:,k)==1&Tmsk(:,:,k)==0))); if nmis~=0 | ndil~=0 | nwnd~=0 disp(... sprintf('Lev k=%3i: Mis = %i, Data/land = %i, Water/no data = %i, Unacc = %i',... k,nmis,ndil,nwnd,nmis-ndil-nwnd )); oops=1; end end if oops disp( sprintf('file = %s, mask-file = %s',datafile,pmaskfile) ); error('Some masks were inconsistent!') end