/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/rdnetcdf.m
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/rdnetcdf.m

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


Revision 1.1.1.1 - (hide annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (21 years, 8 months ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 cnh 1.1 function [a,x,y,t] = rdnetcdf(filename)
2    
3     nc=netcdf(filename,'nowrite');
4     v=var(nc)
5    
6     at=att( nc{ name(v{4}) } )
7     for j=1:length(at)
8     at{j}
9     eval( sprintf( '%s=at{j}(:);', name( at{j} ) ) )
10     end
11    
12     x=nc{'X'}(:);
13     y=nc{'Y'}(:);
14     t=nc{'T'}(:);
15     a=nc{name(v{4})}(:);
16     a(find(a==missing_value))=NaN;
17     a=permute(a,[3 2 1])*scale_factor+add_offset;
18    
19     disp(['Variable name: ''' long_name ''' Units: ''' units ''' '])
20     disp( sprintf('Missing value: %g Scale_factor: %g Offset: %g', ...
21     missing_value,scale_factor,add_offset) )

  ViewVC Help
Powered by ViewVC 1.1.22