/[MITgcm]/MITgcm_contrib/gmaze_pv/subfct/coordfromnc.m
ViewVC logotype

Diff of /MITgcm_contrib/gmaze_pv/subfct/coordfromnc.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by gmaze, Fri Jun 16 21:14:02 2006 UTC revision 1.3 by gmaze, Wed Sep 19 15:24:41 2007 UTC
# Line 1  Line 1 
 %  
1  % [X,Y,Z] = COORDFROMNC(NC)  % [X,Y,Z] = COORDFROMNC(NC)
2  %  %
3  % Given a netcdf file, return 3D coordinates values  % Given a netcdf file, return 3D coordinates values
# Line 6  Line 5 
5  %  %
6    
7    
8  function [X Y Z] = coordfromnc(nc)  function varargout = coordfromnc(nc)
9    
10    co = coord(nc);
11    
 X=nc{'X'}(:);  
 Y=nc{'Y'}(:);  
 Z=nc{'Z'}(:);  
12    
13      switch nargout
14     case 1
15      varargout(1) = {co{1}(:)};
16     case 2
17      varargout(1) = {co{1}(:)};
18      varargout(2) = {co{2}(:)};
19     case 3
20      varargout(1) = {co{1}(:)};
21      varargout(2) = {co{2}(:)};
22      varargout(3) = {co{3}(:)};
23     case 4
24      varargout(1) = {co{1}(:)};
25      varargout(2) = {co{2}(:)};
26      varargout(3) = {co{3}(:)};
27      varargout(4) = {co{4}(:)};
28    end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22