Last change
on this file since 6389 was 6389, checked in by Eric.Larour, 14 years ago |
Finished debugging io_gather mode for I/O file output. Works great on astrid.
|
File size:
873 bytes
|
Rev | Line | |
---|
[1] | 1 | function results=parseresultsfromdisk(filename)
|
---|
| 2 | %PARSERESULTSFROMDISK - ...
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
| 5 | % results=parseresultsfromdisk(filename)
|
---|
| 6 |
|
---|
| 7 | %Open file
|
---|
| 8 | fid=fopen(filename,'rb');
|
---|
| 9 | if(fid==-1),
|
---|
| 10 | error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
|
---|
| 11 | end
|
---|
[643] | 12 | results=struct();
|
---|
[1] | 13 |
|
---|
| 14 | %Read fields until the end of the file.
|
---|
[672] | 15 | result=ReadData(fid);
|
---|
| 16 | while ~isempty(result),
|
---|
[1] | 17 |
|
---|
[4319] | 18 | %Get time and step
|
---|
| 19 | results(result.step).step=result.step;
|
---|
| 20 | results(result.step).time=result.time;
|
---|
[4240] | 21 |
|
---|
[4319] | 22 | %Add result
|
---|
[6389] | 23 | if (length(results)>=result.step & isfield(results,result.fieldname)),
|
---|
| 24 | results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
|
---|
| 25 | else
|
---|
| 26 | results(result.step).(result.fieldname)=result.field;
|
---|
| 27 | end
|
---|
[4319] | 28 |
|
---|
[4240] | 29 | %read next result
|
---|
[1] | 30 | result=ReadData(fid);
|
---|
[672] | 31 |
|
---|
[1] | 32 | end
|
---|
[1591] | 33 |
|
---|
[4319] | 34 | %process patch if necessary
|
---|
[4439] | 35 | results=MatlabProcessPatch(results);
|
---|
[4319] | 36 |
|
---|
[1591] | 37 | fclose(fid);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.