Changeset 2617


Ignore:
Timestamp:
11/05/09 15:12:39 (15 years ago)
Author:
Mathieu Morlighem
Message:

Faster way to read files (no more readfile)

Location:
issm/trunk/src/m
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/QueueJobPeekGeneric.m

    r1 r2617  
    1111
    1212%read log files onto  fields
    13 md.errlog=readfile([md.name '.errlog']);
    14 md.outlog=readfile([md.name '.outlog']);
     13md.errlog=char(textread([md.name '.errlog'],'%s','delimiter','\n'));
     14md.outlog=char(textread([md.name '.outlog'],'%s','delimiter','\n'));
    1515
    1616%cat those two files
  • issm/trunk/src/m/classes/public/geography.m

    r2588 r2617  
    1616%some checks on list of arguments
    1717if ((nargin~=3) | (nargout~=1)),
    18         geographyusage();
     18        help geography
    1919        error('geography error message');
    2020end
    2121if ((~ischar(iceshelfname)) | (~ischar(icesheetname))  )
    22         geographyusage();
     22        help geography
    2323        error('geography error message');
    2424end
     
    2626if md.counter>=2,
    2727        choice=input('This model already has a geometry. Are you sure you want to go ahead? (y/n)','s');
    28         if ~strcmp(choice,'y')
    29                 error('no geometry done ... exiting');
    30         end
     28        if ~strcmp(choice,'y'), error('no geometry done ... exiting'); end
    3129else
    32         if (md.counter~=1)
    33                 error('geography error message: you need to run mesh.m first on this model');
    34         else
    35                 md.counter=2;
    36         end
     30        if (md.counter~=1), error('geography error message: you need to run mesh.m first on this model'); end
    3731end
    3832
     
    4236elements=md.elements;
    4337
     38%Fist recover arrays of ice shelf grids and elements, and ice sheet grids and elements.
    4439invert=0;
    45 
    46 %Fist recover arrays of ice shelf grids and elements, and ice sheet grids and elements.
    4740if strcmp(iceshelfname,''), %no iceshelf contour file, we are dealing with a pure ice sheet.
    4841        gridoniceshelf=zeros(md.numberofgrids,1);
     
    7871
    7972%Return:
     73md.counter=2;
     74
    8075md.elementoniceshelf=elementoniceshelf;
    8176md.gridoniceshelf=gridoniceshelf;
     
    8883
    8984%Keep track of input files
    90 %if strcmp(iceshelfname,''), md.iceshelfoutline=''; elseif strcmp(iceshelfname,'all'), md.iceshelfoutline='all'; else md.iceshelfoutline=readfile(iceshelfname); end
    91 %if strcmp(icesheetname,''), md.icesheetoutline=''; elseif strcmp(icesheetname,'all'), md.icesheetoutline='all'; else md.icesheetoutline=readfile(icesheetname); end
    92 
    93 function geographyusage(),
    94 disp('INPUT md=geography(md,iceshelfname,icesheetname)');
    95 disp('geography:  establish boundaries between grounded and floating ice.');
    96 disp('     By default, ice is considered grounded. The contour iceshelfname defines grids ');
    97 disp('     for which ice is floting. The contour icesheetname defines grids inside an iceshelf, ');
    98 disp('     that are grounded (ie: ice rises, islands, etc ...)');
    99 disp('     All input files are in the Argus format (extension .exp');
     85if (strcmp(iceshelfname,'') | strcmp(iceshelfname,'all')),
     86        md.iceshelfoutline=iceshelfname;
     87else
     88        md.iceshelfoutline=char(textread(iceshelfname,'%s','delimiter','\n'));
     89end
     90if (strcmp(icesheetname,'') | strcmp(icesheetname,'all')),
     91        md.icesheetoutline=icesheetname;
     92else
     93        md.icesheetoutline=char(textread(icesheetname,'%s','delimiter','\n'));
     94end
  • issm/trunk/src/m/classes/public/loadresultsfromcluster.m

    r2188 r2617  
    2727
    2828%read log files onto  fields
    29 md.errlog=readfile([md.name '.errlog']);
    30 md.outlog=readfile([md.name '.outlog']);
     29md.errlog=char(textread([md.name '.errlog'],'%s','delimiter','\n'));
     30md.outlog=char(textread([md.name '.outlog'],'%s','delimiter','\n'));
    3131
    3232if ~isempty(md.errlog),
  • issm/trunk/src/m/classes/public/mesh/mesh.m

    r2402 r2617  
    8383
    8484%outline names
    85 md.domainoutline=readfile(domainname);
     85md.domainoutline=char(textread(domainname,'%s','delimiter','\n'));
    8686if strcmp(riftname,''),
    8787        md.riftoutline='';
    8888else
    89         md.riftoutline=readfile(riftname);
     89        md.riftoutline=char(textread(riftname,'%s','delimiter','\n'));
    9090end
    9191
  • issm/trunk/src/m/classes/public/parameterize.m

    r2564 r2617  
    6363
    6464%Keep track of parameter file
    65 md.parameterfile=readfile(parametername);
     65md.parameterfile=char(textread(parametername,'%s','delimiter','\n'));
    6666
    6767%Name and notes
  • issm/trunk/src/m/classes/public/postsolveparallel.m

    r2023 r2617  
    2626
    2727        %reread onto md.errlog
    28         md.errlog=readfile([md.name '.errlog']);
     28        md.errlog=char(textread([md.name '.errlog'],'%s','delimiter','\n'));
    2929        md.memoryleaks=memoryleaks;
    3030
Note: See TracChangeset for help on using the changeset viewer.