Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/gluemnc.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5669773747 Bayl*0001 function foo = gluemnc(diags,nIter0)
                0002 % gluemnc.m
                0003 % written by david wang, ldeo
                0004 %
                0005 % purpose: use mnc_assembly.m to glue the multi-tile *.*.nc mnc output 
                0006 %          into a single "global" nc file, which is subject to further 
                0007 %          manipulation (e.g., adding/modifying coordiates/attributes)
                0008 %          if necessary. 
                0009 %
                0010 %          diags:  diagnostics name
                0011 %          nIter0: 10-digit iterate #
                0012 % EXAMPLE:
                0013 %          foo = gluemnc('state','0000000000');
                0014 
                0015 if nargin ~= 2, error('there have to be two input arguments!'); end
                0016 
                0017 nc_in    = [diags,'.',nIter0,'.t%03d.nc'];
                0018 nc_inone = [diags,'.',nIter0,'.t001.nc'];
                0019 nc_inall = [diags,'.',nIter0,'.t*.nc'];
                0020 nc_out   = [diags,'_',nIter0,'.nc'];
                0021 
                0022 varlist = ncload(nc_inone);
                0023 nvars =   length(varlist);
                0024 vars = struct([]);
                0025 
                0026 for i = 1:nvars,
                0027   vars(i).name = char(varlist(i));
                0028 end
                0029 
                0030 [nt,nf] = mnc_assembly(nc_in, vars, nc_out);
                0031 
                0032 reply = input('delete the original tiled files? [y/n] ','s');
                0033 if isempty(reply), reply = 'y'; end
                0034 if strcmpi(reply,'y'), delete(nc_inall); end
                0035 
                0036 return