Appendix D: Extract results

1. Reading RIFLEX results in MATLAB

The contents of the binary additional result files from DYNMOD may be read:

fid=fopen('noddis.bin');
F=fread(fid,[156 500],'float32');
F=F';

The binary additional result files contain two columns more than the corresponding ASCII files. For RIFLEX version before RIFLEX 3.6.7 (or development versions before 3.7.8), please add 1 to the specified column number and note that an extra column appears after the described columns with data. For RIFLEX 3.6.7 (3.7.8) and higher, the column numbers on the key file are correct.

ASCII file; e.g .res and .mpf files; may be read using fscanf:

fid = fopen(`armour_sa_ANGLES_outmod.res'); fseek(fid,5176,`bof');
angle1=fscanf(fid,`%g %g %g %g %g %g',[6,600]); fseek(fid,766,`cof');
angle2=fscanf(fid,`%g %g %g %g %g %g',[6,600]); status = fclose(fid);

Matrices on a .mpf file may alternatively be read using get_matrix.m.

1.1. get_matrix.m

function matrix=get_matrix(mpffile,title)

%   Matlab function to get the matrices that match the string title
%   from the mpf file mpffile.
%

% *** Open mpf file
fid = fopen(mpffile,'r');


% *** Read entire file into character string

filetext = fscanf(fid,'%c');
fclose(fid);

nlen = length(filetext);


% *** Find start of all matrices on file + dummy pointer at end
ixmat = findstr('MATRIX',filetext);
nmat = length(ixmat);
ixmat(nmat+1) = nlen;


% *** Find start of all matrices of "title"
text = [ 'MATRIX    ' , title ];
ix0 = findstr(text,filetext);
nmat = length(ix0);


% *** Get matrices from file

nlin = 0;
for i=1:nmat

%  fprintf(1,'%s \n', filetext(ix0(i):ix0(i)+60));

   % Find which matrix
   imat=find(ixmat == ix0(i));

   % Start of values - add 10 to skip 'VALUES    '
   ix1 = ixmat(imat) + findstr('VALUES',filetext(ixmat(imat)+1:ixmat(imat+1))) + 10;

   % Values end at start of next matrix
   ix2 = ixmat(imat+1) - 1;

   values = str2num(filetext(ix1:ix2));

   if (i  == 1)
     all_values = shiftdim(values,1);
   else
   all_values = [ all_values , shiftdim(values,1) ];
   end

end


matrix = shiftdim(all_values,1);

2. Utility programs for STARTIMES files

The utility program prtsc may be used to list the contents of a Startimes file.

The utility program tsprn may be used to extract time series from a Startimes file.

SINTEF Ocean customers may download the utilities from the MSE e-room.

3. Stress time series

Stress time series from OUTMOD are available in two ways:

  • Printed on the _outmod.res file if PRINT is specified and STARTIMES is not specified

  • Stored in Startimes format on on the _outmod.ts file if STARTIMES is specified

If stored in Startimes format, time series may be viewed / accessed in several ways:

  • Using the utility MatrixPlot

  • Converted to ASCII format using the utility TSPRN (see Utility programs for STARTIMES files below)

  • Port-processed using the Startimes package for time series