/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_IO/ncopen.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_IO/ncopen.m

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


Revision 1.1 - (hide annotations) (download)
Sun Jan 24 17:05:13 2016 UTC (9 years, 5 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
- move routines from MITprof/profiles_misc/ to gcmfaces/gcmfaces_IO/
  to allow for nctiles IO without having to rely on MITprof
- these wrapper routines were originally provided by F. Roquet
  that work both with the native implememtation of ncetcf in recent
  Matlab versions and the third party mex codes used earlier

1 gforget 1.1 function [nc] = ncopen(theNetCDFFile, varargin);
2     % open a netcdf file.
3     % mode: 'write','nowrite'
4    
5     global useNativeMatlabNetcdf;
6     if isempty(useNativeMatlabNetcdf); useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); end;
7    
8     mode=0;
9     if nargin>1,
10     mode=varargin{1};
11     end
12    
13     if useNativeMatlabNetcdf;
14     nc=netcdf.open(theNetCDFFile,mode);
15     else;%try to use old mex stuff
16     if mode==0,
17     nc=netcdf(theNetCDFFile);
18     else
19     nc=netcdf(theNetCDFFile,mode);
20     end
21     end;
22    
23    
24    

  ViewVC Help
Powered by ViewVC 1.1.22