make_luke_simulid_jd

PURPOSE ^

SYNOPSIS ^

function simulid = make_luke_simulid_jd(equil,ohm,transpfaste,ripple,waves,wavestructs,locid)

DESCRIPTION ^

 This function creates a generic id for LUKE simulations from input structures

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function simulid = make_luke_simulid_jd(equil,ohm,transpfaste,ripple,waves,wavestructs,locid)
0002 %
0003 % This function creates a generic id for LUKE simulations from input structures
0004 %
0005 if nargin < 7,
0006     locid = '';
0007 end
0008 %
0009 if nargin < 6,
0010     wavestructs = '';
0011 end
0012 %
0013 if nargin < 5,
0014     waves = '';
0015 end
0016 %
0017 if nargin < 4,
0018     ripple = '';
0019 end
0020 %
0021 if nargin < 3,
0022     transpfaste = '';
0023 end
0024 %
0025 if nargin < 2,
0026     ohm = '';
0027 end
0028 %
0029 if nargin < 1
0030     error('The ''equil'' structure must be specified');
0031 end
0032 %
0033 if isfield(equil,'id'),
0034     simulid = equil.id;
0035 else
0036     error('The ''equil'' structure must have a field ''id''');
0037 end
0038 %
0039 if isfield(equil,'fluct') && isfield(equil.fluct,'id'),
0040     simulid = [simulid,'_',equil.fluct.id];
0041 end
0042 %
0043 if isfield(ohm,'id'),
0044     simulid = [simulid,'_',ohm.id];
0045 end
0046 %
0047 if isfield(transpfaste,'id'),
0048     simulid = [simulid,'_',transpfaste.id];
0049 end
0050 %
0051 if isfield(ripple,'id'),
0052     simulid = [simulid,'_',ripple.id];
0053 end
0054 %
0055 if ~isempty(waves),
0056     if isstruct(waves{1}),%no fluctuations
0057         for iw = 1:length(waves),
0058             simulid = [simulid,'_',waves{iw}.id];
0059         end
0060     else %with fluctuations
0061         for iw = 1:length(waves{1}),
0062             is1 = max(strfind(waves{1}{iw},'C3PO_'));%wavess contains wave files
0063             is2 = strfind(waves{1}{iw},'_itn_1.mat') - 1;
0064             %
0065             simulid = [simulid,'_',waves{1}{iw}(is1:is2)];
0066         end        
0067     end
0068 end
0069 %
0070 for iw = 1:length(wavestructs),
0071     simulid = [simulid,'_',wavestructs{iw}.id];
0072 end
0073 %
0074 if ~isempty(locid),
0075     simulid = [simulid,'_',locid];
0076 end

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