/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/ncputvar.m
ViewVC logotype

Diff of /MITgcm_contrib/gael/profilesMatlabProcessing/profiles_misc/ncputvar.m

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

revision 1.1 by gforget, Fri Nov 5 21:41:02 2010 UTC revision 1.3 by roquet, Wed Apr 13 20:49:14 2011 UTC
# Line 1  Line 1 
1  function []=ncputvar(nc,VARname,VARvalue,varargin);  function []=ncputvar(nc,VARname,VARvalue,varargin);
2    % []=ncputvar(ncid,varid,data,[start,count])
3    %   write data to MITprof netcdf file
4    
5  global useNativeMatlabNetcdf; if isempty(useNativeMatlabNetcdf); useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); end;  global useNativeMatlabNetcdf; if isempty(useNativeMatlabNetcdf); useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); end;
6    
7  if (useNativeMatlabNetcdf);  if useNativeMatlabNetcdf
8            
9      %get variable id:      %get variable id:
10      vv = netcdf.inqVarID(nc,VARname);      vv = netcdf.inqVarID(nc,VARname);
# Line 26  if (useNativeMatlabNetcdf); Line 28  if (useNativeMatlabNetcdf);
28            
29            
30  else;%try to use old mex stuff  else;%try to use old mex stuff
31      if nargin>3;      
32      nc{VARname}(varargin{:})=VARvalue;      if nargin>3;
33            nc{VARname}(varargin{:})=VARvalue;
34      else;      else;
35      nc{VARname}(:)=VARvalue;          nc{VARname}(:)=VARvalue;
36      end;      end;
37        
38  end;  end;

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

  ViewVC Help
Powered by ViewVC 1.1.22