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

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

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


Revision 1.1.2.1 - (show annotations) (download)
Tue Feb 26 16:04:50 2002 UTC (21 years ago) by adcroft
Branch: release1
CVS Tags: release1_p13_pre, release1_p13, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, release1_chkpt44d_post, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, release1_p12_pre
Branch point for: release1_50yr
Changes since 1.1: +1 -1 lines
Merging changes on MAIN between checkpoint43 and checkpoint43a-release1mods
Command: cvs -q update -jcheckpoint43 -jcheckpoint43a-release1mods -d -P

These changes are most of the changes between c43 and c44 except those
that occured after "12:45 11 Jan 2002". As far as I can tell it is
checkpoint43 with the following mods:

  o fix bug in mom_vi_del2uv
  o select when filters are applied ; add options to zonal_filter (data.zonfilt)  o gmredi: fix Pb in the adiabatic form ; add options (.e.g. Bolus advection)
  o update AIM experiments (NCEP input files)
  o improve and extend diagnostics (Monitor, TimeAve with NonLin-FrSurf)
  o added some stuff for AD
  o Jamar wet-points

This update does not contain the following mods that are in checkpoint44

  o bug fix in pkg/generic_advdiff/
    - thread related bug, bi,bj arguments in vertical advection routines
  o some changes to pkg/autodiff, pkg/cost, pkg/exf, pkg/ecco,
    verification/carbon and model/src/ related to adjoint
  o some new Matlab scripts for diagnosing model density
    - utils/matlab/dens_poly3.m and ini_poly3.m

The list of exclusions is accurate based on a "cvs diff". The list of
inclusions is based on the record in doc/tag-index which may not be complete.

1 function [vals] = grepread(file,varargin)
2 % VALS = GREPREAD(FILE,EXPR1,...);
3 %
4 % Extracts the expressions "expr1","expr2",... from the file "file".
5 % This assumes output in the standard form defined by the MITgcm
6 % monitor package and is not a replacement for TEXTREAD.
7 %
8 % e.g.
9 % >> vals=grepread('output.txt','time_secondsf','ke_mean','ke_max');
10 % >> plot(vals(:,1)/86400,vals(:,2:3));
11
12 if nargin<2
13 error('You must supply a filename and at least one search expression!')
14 end
15
16 tfile=sprintf('/tmp/grepexpr%15.15f',rand);
17 for k=1:nargin-1;
18 try
19 eval(['!grep ' varargin{k} ' ' file ' | sed s/.\*=// | sed s/NAN/1.23456789/ >! ' tfile])
20 vals(:,k)=textread(tfile,'%f');
21 delete(tfile)
22 catch
23 delete(tfile)
24 error(sprintf('An error occured while scanning for: %s',varargin{k}));
25 end
26 end

  ViewVC Help
Powered by ViewVC 1.1.22