/[MITgcm]/MITgcm_contrib/ESMF/global_ocean.128x64x15/diags_matlab/mit_readfield.m
ViewVC logotype

Annotation of /MITgcm_contrib/ESMF/global_ocean.128x64x15/diags_matlab/mit_readfield.m

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


Revision 1.1.1.1 - (hide annotations) (download) (vendor branch)
Sun Feb 15 22:28:31 2004 UTC (21 years, 5 months ago) by cnh
Branch: MAIN, Initial
CVS Tags: adoption_1_0_pre_A, Baseline, HEAD
Changes since 1.1: +0 -0 lines
Initial checkin

1 cnh 1.1 function h = mit_readfield(fname,dims,accuracy)
2     %function h = mit_readfield(fname,dims,accuracy)
3    
4     ieee='ieee-be';
5    
6     [fid message] = fopen(fname,'r',ieee);
7     if fid <= 0
8     error([message ', filename: ', [fname]])
9     end
10    
11     v = fread(fid,accuracy);
12     if length(v) == prod(dims)
13     h = reshape(v,dims);
14     elseif length(v) == prod(dims(1:end-1))
15     h = reshape(v,dims(1:end-1));
16     else
17     error('dimensions do not match')
18     end
19     fclose(fid);
20    
21     return

  ViewVC Help
Powered by ViewVC 1.1.22