--- MITgcm_contrib/gmaze_pv/compute_density.m 2007/01/30 22:10:10 1.3 +++ MITgcm_contrib/gmaze_pv/compute_density.m 2007/09/19 14:45:59 1.5 @@ -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) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -38,6 +38,7 @@ %% Path and extension to find them: pathname = strcat('netcdf-files',sla,snapshot); +%pathname = '.'; ext = strcat('.',netcdf_suff); %% Load netcdf files: @@ -159,19 +160,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