iluke_wave_jd

PURPOSE ^

SYNOPSIS ^

function [waves,it_flag,itn_flag] = iluke_wave_jd(dkepath,equils,wavestructss,calc_mask,wavesolverparam)

DESCRIPTION ^

 Calculate the waves possibly including fluctuations effects 
 May use distributed processing for reducing the overall computational time

 INPUT
    - dkepath structure
    - equil structures
    - wavestruct structures
    - calculation mask
    - wavesolverparam structure

 OUTPUT:
    - wave structures

 By Joan Decker (CEA-DRFC, joan.decker@cea.fr) and Yves Peysson (CEA-DRFC, yves.peysson@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [waves,it_flag,itn_flag] = iluke_wave_jd(dkepath,equils,wavestructss,calc_mask,wavesolverparam)
0002 %
0003 % Calculate the waves possibly including fluctuations effects
0004 % May use distributed processing for reducing the overall computational time
0005 %
0006 % INPUT
0007 %    - dkepath structure
0008 %    - equil structures
0009 %    - wavestruct structures
0010 %    - calculation mask
0011 %    - wavesolverparam structure
0012 %
0013 % OUTPUT:
0014 %    - wave structures
0015 %
0016 % By Joan Decker (CEA-DRFC, joan.decker@cea.fr) and Yves Peysson (CEA-DRFC, yves.peysson@cea.fr)
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'];% use localdatadir?
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);%MatLab distributed computing environment
0075 %
0076 if dkecluster.scheduler.mode <= 2,
0077     [flag,waves] = mdce_run(@wave_solver_yp,{dkepath,'',''},2,wavestructs(:),dkecluster);
0078 else% remote computing
0079     [flag,waves] = mdce_run(@wave_solver_yp,{'','',''},2,wavestructs(:),dkecluster);
0080 end    
0081 %
0082

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