iluke_updateoldsimul

PURPOSE ^

script iluke_updateoldsimul

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 script iluke_updateoldsimul

 This script updates older simulations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % script iluke_updateoldsimul
0002 %
0003 % This script updates older simulations
0004 %
0005 if isfield(lukeobj,'r5x2'),% before sdiag
0006     lukeobj = rmfield(lukeobj,'r5x2');
0007     %
0008     status = rmfield(status,'hxr');
0009     %
0010 end
0011 %
0012 if ~isfield(load([pathname,filename],'sdiags'),'sdiags'),
0013     sdiags = cell(2,size(outputs,2));
0014     sdiags(:) = {{}};
0015     %
0016     status.sdiag = zeros(2,size(status.output,2));
0017     status.sdiag(:,status.output == 1) = 1;% synthetic diagnostics need distribution
0018     %
0019 end
0020 %
0021 if isempty(hxr.param),
0022     hxr.param = load_structures_yp('hxrparam','STANDARD','');
0023 end
0024 %
0025 ntimes = length(shotimes);
0026 %
0027 if ~isfield(load([pathname,filename],'dkeparams'),'dkeparams'),% old wavestructss
0028     %
0029     load([pathname,filename],'dkeparam');
0030     dkeparams = cell(1,ntimes);
0031     %
0032     for it = 1:ntimes,
0033         %
0034         dkeparams{it} = dkeparam;
0035         %
0036     end
0037     %
0038     clear dkeparam
0039     %
0040 end    
0041 %
0042 if ~isfield(load([pathname,filename],'wavestructids'),'wavestructids'),% old wavestructss
0043     %
0044     newwavestructids = cell(0,1);
0045     newwavestructsstatus = zeros(0,ntimes);
0046     newwavestructss = cell(0,ntimes);
0047     %
0048     for it = 1:ntimes,
0049         for iw = 1:length(wavestructss{it});
0050             %
0051             wavestruct = wavestructss{it}{iw};
0052             %
0053             isel = find(strcmp(wavestruct.id,newwavestructids));% compare with existing wavestructids
0054             %
0055             if isempty(isel),% wavestruct id is not listed in newwavestructids
0056                 %
0057                 newwavestructids{end+1,1} = wavestruct.id;
0058                 %
0059                 newwavestructsstatus(end+1,:) = zeros(1,ntimes);
0060                 newwavestructss(end+1,:) = cell(1,ntimes);
0061                 %
0062                 newwavestructsstatus(end,it) = 1;
0063                 newwavestructss{end,it} = wavestruct;
0064                 %
0065             else% wavestruct id is listed in newwavestructids
0066                 %
0067                 newwavestructsstatus(isel,it) = 1;
0068                 newwavestructss{isel,it} = wavestruct;
0069                 %
0070             end
0071         end
0072     end
0073     %
0074     wavestructids = newwavestructids;
0075     status.wavestructs = newwavestructsstatus;
0076     wavestructss = newwavestructss;
0077     %
0078     clear newwavestructids newwavestructsstatus newwavestructss it iw isel wavestruct
0079 end    
0080 %
0081 if ~isfield(status,'fluct'),
0082     status.fluct = zeros(1,ntimes);
0083     fluctparams = cell(1,ntimes);
0084 end
0085

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.