0001 function [waves,it_flag,itn_flag] = iluke_wave_jd(dkepath,equils,wavestructss,calc_mask,wavesolverparam)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if nargin < 5,
0019 wavesolverparam.clustermode = 0;
0020 end
0021
0022 if nargin < 4,
0023 error('Wrong number of input arguments in iluke_wave_jd.m.');
0024 end
0025
0026 it_calc = find(any(calc_mask,1));
0027
0028 wavestructs = {};
0029 it_flag = [];
0030 itn_flag = [];
0031
0032 for it = it_calc,
0033
0034 equil = equils{it};
0035
0036 iw_calc = find(calc_mask(:,it)).';
0037
0038 if isempty(iw_calc),
0039 continue
0040 end
0041
0042 equil_fit = fitequil_yp(equil);
0043
0044 if isfield(equil,'fluct') && isfield(equil.fluct,'itnmax'),
0045
0046 equil_fit.fluct_fit = fitfluct_yp(equil.fluct);
0047
0048 for itn = 1:equil.fluct.itnmax,
0049 equil_fit.fluct_fit = fluctphase_yp(equil_fit.fluct_fit);
0050
0051 for iw = iw_calc,
0052 wavestructs{end+1} = wavestructss{iw,it};
0053 wavestructs{end}.equil = equil;
0054 wavestructs{end}.equil_fit = equil_fit;
0055 wavestructs{end}.id = [wavestructs{end}.id,'_itn_',num2str(itn)];
0056 wavestructs{end}.savedir = [pwd,filesep,'WAVE_files'];
0057
0058 it_flag(end+1) = it;
0059 itn_flag(end+1) = itn;
0060 end
0061 end
0062 else
0063 for iw = iw_calc,
0064 wavestructs{end+1} = wavestructss{iw,it};
0065 wavestructs{end}.equil = equil;
0066 wavestructs{end}.equil_fit = equil_fit;
0067
0068 it_flag(end+1) = it;
0069 itn_flag(end+1) = 0;
0070 end
0071 end
0072 end
0073
0074 dkecluster = clustermode_luke(wavesolverparam.clustermode,'wave_solver_yp',dkepath);
0075
0076 if dkecluster.scheduler.mode <= 2,
0077 [flag,waves] = mdce_run(@wave_solver_yp,{dkepath,'',''},2,wavestructs(:),dkecluster);
0078 else
0079 [flag,waves] = mdce_run(@wave_solver_yp,{'','',''},2,wavestructs(:),dkecluster);
0080 end
0081
0082