iluke_wavestructsimport

PURPOSE ^

script iluke_wavestructsimport

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 script iluke_wavestructsimport
 
 it assumes (from the enabling of import pushbutton) that external.wave
 exists for the specific curtime

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % script iluke_wavestructsimport
0002 %
0003 % it assumes (from the enabling of import pushbutton) that external.wave
0004 % exists for the specific curtime
0005 %
0006 select = struct;
0007 select.style = style;
0008 %
0009 if curtime == 0,% treat all times from external structure if available
0010     flag_calc = find(status.equil == 1);
0011     [~,flag_calctimes,flag_external] = intersect(shotimes(flag_calc),external.times);
0012     flag_shotimes = flag_calc(flag_calctimes);
0013     %
0014     clear flag_calc flag_calctimes
0015 else% select one time
0016     flag_external = find(external.times == shotimes(curtime));
0017     flag_shotimes = curtime;
0018 end
0019 %
0020 external_wave = external.wave(:,flag_external);
0021 nt = size(external_wave,2);
0022 %
0023 for it = 1:nt,
0024     for iw = 1:size(external_wave,1),
0025         external_wave(iw,it).equil = equils{flag_shotimes(it)};% for distributed computing
0026     end
0027 end
0028 %
0029 clear flag_calc flag_calctimes it nt
0030 %
0031 if length(flag_shotimes) > 1,% more than one time - case with curtime == 0 and external data with multiple times
0032     %
0033     mdce_mode = iselect_jd(dkepath.distprofiles,'Distribution of calc. : ',lukeobj.infopanel.handle,style.distselectstyle,1,'popupmenu') - 1;
0034     %
0035     if mdce_mode > 2,
0036         mdce_mode = 2 - mdce_mode;%use of remcomputing with negative mdce_mode
0037     end
0038     %
0039     dkecluster = clustermode_luke(mdce_mode,'',dkepath);%MatLab distributed computing environment
0040     %
0041     set(lukeobj.busy.handle,'Visible','on');drawnow;
0042     [flag,launchs] = mdce_run('imake_launch_jd',{dkepath,tokamak,'','',workdir,lukeobj.infopanel.handle,select},4,external_wave,dkecluster);
0043     set(lukeobj.busy.handle,'Visible','off');drawnow;
0044     %
0045     clear mdce_mode dkecluster flag 
0046     %
0047 elseif length(flag_shotimes) == 1% treat one time
0048     %
0049     launchs{1} = imake_launch_jd(dkepath,tokamak,'',external_wave,workdir,lukeobj.infopanel.handle,select);
0050     %
0051 end
0052 %
0053 if isfield(launchs,'err'),
0054     lukeobj.infotext.string = {'Error creating structure(s) ''launchs'' : ',launchs.err};
0055 elseif ~isempty(launchs),
0056     %
0057     iluke_newwavestructs;% update wavestructs, status and wavestructids
0058     %
0059 end
0060 %
0061 clear select launchs external_wave flag_shotimes

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