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

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

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

revision 1.2 by roquet, Wed Apr 13 20:49:14 2011 UTC revision 1.4 by roquet, Wed Apr 20 20:26:58 2011 UTC
# Line 1  Line 1 
1  function [FillVal]=ncgetFillVal(ncid,varname);  function [FillVal]=ncgetFillVal(ncid,varname);
2  % [FillVal]=ncgetFillVal(ncid,varname)  % [FillVal]=ncgetFillVal(ncid,varname)
3  %           return the missing_value or _FillValue of varname  %           return the missing_value or _FillValue of varname
4    %  return an error if varname does not exist
5    
6  global useNativeMatlabNetcdf;  global useNativeMatlabNetcdf;
7  if isempty(useNativeMatlabNetcdf); useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); end;  if isempty(useNativeMatlabNetcdf); useNativeMatlabNetcdf = ~isempty(which('netcdf.open')); end;
# Line 19  if useNativeMatlabNetcdf; Line 20  if useNativeMatlabNetcdf;
20          FillVal=double(FillVal);          FillVal=double(FillVal);
21      end      end
22  else  else
23      FillVal = ncid{varname}.missing_value(:);      eval(['FillVal = ncid{''' varname '''}.missing_value(:);']);
24      if isempty(FillVal);      if isempty(FillVal);
25          FillVal = ncid{varname}.FillValue_(:);          eval(['FillVal = ncid{''' varname '''}.FillValue_(:);']);
26      end      end
27  end  end
28    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22