/[MITgcm]/MITgcm/utils/matlab/gluemnc.m
ViewVC logotype

Contents of /MITgcm/utils/matlab/gluemnc.m

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


Revision 1.1 - (show annotations) (download)
Thu Jun 8 13:45:08 2006 UTC (18 years, 1 month ago) by baylor
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58u_post, checkpoint58r_post, checkpoint58n_post, checkpoint58t_post, checkpoint58q_post, checkpoint58j_post, checkpoint58i_post, checkpoint58o_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint58m_post
This is David Wang's nice little matlab script for gluing together different tiles into a global file.

1 function foo = gluemnc(diags,nIter0)
2 % gluemnc.m
3 % written by david wang, ldeo
4 %
5 % purpose: use mnc_assembly.m to glue the multi-tile *.*.nc mnc output
6 % into a single "global" nc file, which is subject to further
7 % manipulation (e.g., adding/modifying coordiates/attributes)
8 % if necessary.
9 %
10 % diags: diagnostics name
11 % nIter0: 10-digit iterate #
12 % EXAMPLE:
13 % foo = gluemnc('state','0000000000');
14
15 if nargin ~= 2, error('there have to be two input arguments!'); end
16
17 nc_in = [diags,'.',nIter0,'.t%03d.nc'];
18 nc_inone = [diags,'.',nIter0,'.t001.nc'];
19 nc_inall = [diags,'.',nIter0,'.t*.nc'];
20 nc_out = [diags,'_',nIter0,'.nc'];
21
22 varlist = ncload(nc_inone);
23 nvars = length(varlist);
24 vars = struct([]);
25
26 for i = 1:nvars,
27 vars(i).name = char(varlist(i));
28 end
29
30 [nt,nf] = mnc_assembly(nc_in, vars, nc_out);
31
32 reply = input('delete the original tiled files? [y/n] ','s');
33 if isempty(reply), reply = 'y'; end
34 if strcmpi(reply,'y'), delete(nc_inall); end
35
36 return

  ViewVC Help
Powered by ViewVC 1.1.22