--- MITgcm_contrib/gmaze_pv/compute_density.m 2007/01/30 22:10:10 1.3 +++ MITgcm_contrib/gmaze_pv/compute_density.m 2007/02/01 17:02:02 1.4 @@ -1,5 +1,5 @@ % -% [RHO,LON,LAT,DPT] = compute_density(SNAPSHOT) +% [RHO] = compute_density(SNAPSHOT) % % For a time snapshot, this program computes the % 3D density from potential temperature and salinity fields. @@ -21,7 +21,7 @@ % -function compute_density(snapshot) +function varargout = compute_density(snapshot) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -159,19 +159,8 @@ % Output: +output = struct('RHO',RHO,'dpt',dpt,'lat',lat,'lon',lon); switch nargout case 1 - varargout(1) = RHO; - case 2 - varargout(1) = RHO; - varargout(2) = lon; - case 3 - varargout(1) = RHO; - varargout(2) = lon; - varargout(3) = lat; - case 4 - varargout(1) = RHO; - varargout(2) = lon; - varargout(3) = lat; - varargout(4) = dpt; + varargout(1) = {output}; end