Script for running LUKE This script is automatically generated by irunluke_jd. by J. Decker (joan.decker@cea.fr) and Y. Peysson (yves.peysson@cea.fr)
0001 % Script for running LUKE 0002 % 0003 % This script is automatically generated by irunluke_jd. 0004 % by J. Decker (joan.decker@cea.fr) and Y. Peysson (yves.peysson@cea.fr) 0005 % 0006 clear all 0007 clear mex 0008 clear functions 0009 close all 0010 warning('off','all') 0011 pause(1) 0012 % 0013 % remote computing parameters 0014 % 0015 remnum = 0;% remote profile number. Use 0 for local sequential calculations 0016 remtimout = 0;% timeout for remote calculations, in minutes. Use (0) to return later and check results by running this script again 0017 rempause = 1;% pause between job checks (in minutes) (only for remtimout > 0) 0018 remstart = 0;% (1) start new simulation; (0) check older simulation (only for remtimout = 0) 0019 remdebugmode = 0;% debug mode (0) off (1) on 0020 remclean = 2;% clean job files/folders : both on remote and local (2), only on remote (1) or not at all (0) 0021 % 0022 % distributed computing parameters 0023 % 0024 mdce_mode_coll_dke_jd = 0;% mdce mode for wave_solver_yp : (0) none (1) jobs (2) dcluke (3) parfor (-remnum) remote on profile remnum 0025 mdce_mode_eecoll_dke_yp = 0;% mdce mode for wave_solver_yp : (0) none (1) jobs (2) dcluke (3) parfor (-remnum) remote on profile remnum 0026 mdce_mode_rfdiff_dke_jd = 0;% mdce mode for rfdiff_dke_jd : (0) none (1) jobs (2) dcluke (3) parfor (-remnum) remote on profile remnum 0027 mdce_mode_wave_solver_yp = 0;% mdce mode for wave_solver_yp : (0) none (1) jobs (2) dcluke (3) parfor (-remnum) remote on profile remnum 0028 mdce_mode_main_C3PO_jd = 0;% mdce mode for main_C3PO_jd : (0) none (1) jobs (2) dcluke (3) parfor (-remnum) remote on profile remnum 0029 % 0030 % backup & save options 0031 % 0032 opt.save = 0;% (1): save LUKE_RESULTS or return error (0): return results or error 0033 opt.fields = NaN;% selected fields in returned lukestructs. Use NaN for all fields 0034 opt.backup = 0;% (1) save fluctuation time steps (0) do not save 0035 opt.waves = 0;% (1) save waves at each time step (0) do not save 0036 % 0037 % *********************** Specify LUKE structures ***************************** 0038 % 0039 locid_simul = '';%Simulation ID 0040 path_simul = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0041 % 0042 id_dkepath = '';%For all paths used by DKE solver 0043 path_dkepath = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0044 % 0045 id_equil = 'ITER_Scen2_200103121816_430_129';%For plasma equilibrium 0046 path_equil = 'EQUIL/';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0047 % 0048 id_dkeparam = 'EC_RT';%For DKE code parameters 0049 path_dkeparam = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0050 % 0051 id_rtparam = 'EC';%For C3PO code parameters 0052 path_rtparam = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0053 % 0054 id_dkedisplay = 'NO_DISPLAY';%For output code display 0055 path_dkedisplay = '';%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0056 % 0057 ids_launch = {'NTM_32'};%For RF waves contribution (put all the type of waves needed) 0058 paths_launch = {''};%if nothing is specified, the working directory is first used and then MatLab is looking in all the path 0059 % 0060 %************************************************************************************************************************************ 0061 % 0062 % SPECIFIC PARAMETERS 0063 % 0064 % LAUNCH parameters 0065 % 0066 P_L = 1e-3;% [MW] linear limit 0067 % 0068 % C3PO parameters 0069 % 0070 % C3PO Equilibrium parameters 0071 % 0072 fitparam.nharm = 32;%default value has since been changed to 64 0073 % 0074 % C3PO ray-tracing parameters 0075 % 0076 rayparam.tau_lim = 20;%value of optical depth beyond which the wave is considered absorbed 0077 rayparam.kextra = 50;%extra points if QL absorption is delayed 0078 % 0079 % C3PO Wave parameters 0080 % 0081 waveparam.mmode = -1;% cold plasma mode (1) m (-1) p, (slow/fast LH wave: -1/+1, O/X mode: -1/+1) :1 0082 waveparam.nchi = 4;%Number of angular positions for beamlets 0083 waveparam.n_rf_list = 1:2;% harmonic numbers to be considered 0084 % 0085 % C3PO Display parameters 0086 % 0087 C3POdisplay = struct; 0088 % 0089 % C3PO computing parameters 0090 % 0091 C3POparam.clustermode.main_C3PO_jd.scheduler.mode = 0;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1) 0092 % 0093 %************************************************************************************************************************************ 0094 % 0095 [dkepath,equil,dkeparam,rtparam,dkedisplay,launchs] = load_structures_yp('dkepath',id_dkepath,path_dkepath,'equil',id_equil,path_equil,'dkeparam',id_dkeparam,path_dkeparam,'rtparam',id_rtparam,path_rtparam,'dkedisplay',id_dkedisplay,path_dkedisplay,'launchs',ids_launch,paths_launch); 0096 % 0097 %************************************************************************************************************************************ 0098 % 0099 dkeparam.clustermode.coll_dke_jd.scheduler.mode = mdce_mode_coll_dke_jd;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1) 0100 dkeparam.clustermode.eecoll_dke_yp.scheduler.mode = mdce_mode_eecoll_dke_yp;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1) 0101 dkeparam.clustermode.wave_solver_yp.scheduler.mode = mdce_mode_wave_solver_yp;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1) 0102 dkeparam.clustermode.rfdiff_dke_jd.scheduler.mode = mdce_mode_rfdiff_dke_jd;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2) for the function coll_dke_jd.m (MDC toolbox must be installed for option 1) 0103 % 0104 % wavestruct 0105 % 0106 launch = launchs{1}; 0107 launch.yP_L = P_L*1e6; 0108 % 0109 fitparam = conc_struct_jd(rtparam.fitparam,fitparam); 0110 rayparam = conc_struct_jd(rtparam.rayparam,rayparam); 0111 waveparam = conc_struct_jd(rtparam.waveparam,waveparam); 0112 C3POdisplay = conc_struct_jd(rtparam.C3POdisplay,C3POdisplay); 0113 C3POparam = conc_struct_jd(rtparam.C3POparam,C3POparam); 0114 % 0115 wavestruct.wavesolver = 'C3PO'; 0116 wavestruct.launch = launch; 0117 wavestruct.id = [wavestruct.wavesolver,'_',wavestruct.launch.id]; 0118 wavestruct.fitequilparam = fitparam; 0119 wavestruct.rayparam = rayparam; 0120 wavestruct.waveparam = waveparam; 0121 wavestruct.raydisplay = C3POdisplay; 0122 wavestruct.C3POparam = C3POparam; 0123 % 0124 wavestructs = {wavestruct}; 0125 % 0126 %************************************************************************************************************************************ 0127 % 0128 simul.id = make_luke_simulid_jd(equil,'','','','',wavestructs,locid_simul); 0129 simul.path = path_simul; 0130 % 0131 %************************************************************************************************************************************ 0132 % 0133 filename = [simul.path,'LUKE_RESULTS_',simul.id,'.mat']; 0134 % 0135 if remtimout == 0 && remstart == 0 && exist(filename,'file') && input_dke_yp('Do you want to check, import or reload results (y/n) ','y') == 'y',% load existing simulation 0136 % 0137 load(filename,'lukestructs'); 0138 % 0139 else% new simulation 0140 % 0141 lukestructs.simul = simul; 0142 lukestructs.equil = equil; 0143 lukestructs.dkeparam = dkeparam; 0144 lukestructs.dkedisplay = dkedisplay; 0145 lukestructs.wavestructs = wavestructs; 0146 lukestructs.opt = opt; 0147 % 0148 end 0149 % 0150 dkepath.remnum = remnum; 0151 dkepath.remtimout = remtimout; 0152 dkepath.rempause = rempause; 0153 dkepath.debugmode = remdebugmode; 0154 dkepath.clean = remclean; 0155 % 0156 lukestructs = run_lukert(lukestructs,dkepath); 0157 % 0158 %************************************************************************************************************************************ 0159 % 0160 % ---------------------------------------------- Save LUKE or job results ---------------------------------------------- 0161 % 0162 % if remnum > 0 && remtimout == 0, only the job infos are saved in 0163 % filename. In this case, run the script again to check/load results 0164 % 0165 save(filename); 0166 info_dke_yp(2,['LUKE Results saved in ',filename]); 0167 % 0168 % process results if available 0169 % 0170 if isfield(lukestructs,'output'), 0171 opt.ir_display = 0; 0172 opt.rho = 'g'; 0173 opt.peakmode = 0; 0174 opt.peak = 'n'; 0175 opt.wave = 'n'; 0176 opt.spec = 0; 0177 opt.diaryname = ['res_',lukestructs.simul.id,'.log']; 0178 % 0179 proc_luke_jd(lukestructs.output,opt); 0180 end 0181 %