Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/gmt/find_all_iters.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
4e7bfad2e0 Ed H*0001 function [tlev] = find_all_iters(fall, vname)
                0002 
                0003 % Function [tlev] = find_all_iters(fall)
                0004 %
                0005 % INPUTS
                0006 %   fall     either a string containing a file name
                0007 %              or a cell array of file names
                0008 %   vanme    variable name for locating iters (DEF: 'iter')
                0009 %
                0010 % OUTPUTS
                0011 %   tlev     struct with a single field (tlev.iters) containing 
                0012 %              an array of all model iteration values found 
                0013 %              across all specified files
                0014 %
                0015 %
                0016 %  Ed Hill
                0017 if nargin < 2 || isempty(vname)
                0018   vname = 'iter';
                0019 end
                0020 
                0021 tlev.iters = [];
                0022 for ii = 1:length(fall)
                0023   nc = netcdf(fall{ii},'read');
                0024   tlev.iters = union(tlev.iters, nc{vname}(:));
                0025   nc = close(nc);
                0026 end
                0027 tlev.iters = sort(tlev.iters);