0001 function [] = make_wave_RFP
0002
0003
0004
0005
0006
0007
0008
0009 close all
0010
0011 make_rayinit_RFP;
0012
0013
0014
0015 id_dkepath = '';
0016 path_dkepath = '';
0017
0018
0019 id_wave = 'RFP';
0020 flag_analytic = 6;
0021 p_opt = -1;
0022
0023
0024
0025 id_equil = 'RFP';
0026 path_equil = '../EQUIL/';
0027
0028
0029
0030 ids_rayinit = {'LH'};
0031 paths_rayinit = {''};
0032
0033
0034
0035 mdce_mode_main_C3PO_jd = 0;
0036
0037
0038
0039 C3POdisplay_numeric.ray = 1;
0040 C3POdisplay_numeric.equilibrium = 0;
0041 C3POdisplay_numeric.p_opt = 2;
0042
0043 C3POdisplay_analytic.ray = 0;
0044 C3POdisplay_analytic.equilibrium = 0;
0045 C3POdisplay_analytic.p_opt = 2;
0046
0047
0048
0049 waveparam.mmode = -1;
0050 waveparam.kmode = 0;
0051
0052
0053
0054
0055
0056
0057 waveparam.opt_rf = 1;
0058
0059 waveparam.dsmin = Inf;
0060 waveparam.cut_fac = Inf;
0061
0062 n_rf_list = 0;
0063
0064
0065
0066
0067
0068
0069
0070 fitparam.mode_equil = 1;
0071 fitparam.method = 'spline';
0072 fitparam.nharm = NaN;
0073 fitparam.ngridresample = 1001;
0074
0075
0076
0077 rayparam.testmode = 0;
0078 rayparam.tensortype = waveparam.kmode;
0079 rayparam.t0 = 0;
0080 rayparam.tfinal = 1000;
0081 rayparam.dt0 = 1.e-4;
0082 rayparam.dS = 1.e-4;
0083 rayparam.tol = 1e-12;
0084 rayparam.kmax = 60000;
0085 rayparam.ncyclharm = 3;
0086 rayparam.reflection = 1;
0087 rayparam.rel_opt = 1;
0088 rayparam.nperp = 10000;
0089 rayparam.pperpmax = 10;
0090 rayparam.tau_lim = Inf;
0091 rayparam.kextra = 1000;
0092
0093
0094
0095
0096 [dkepath,equil,rayinits] = load_structures_yp('dkepath',id_dkepath,path_dkepath,'equil',id_equil,path_equil,'rayinits',ids_rayinit,paths_rayinit);
0097
0098
0099
0100 equil_fit = fitequil_yp(equil,fitparam.mode_equil,fitparam.method,fitparam.ngridresample,fitparam.nharm);
0101 info_dke_yp(2,['Vectorial form of the magnetic equilibrium ',equil.id,' is calculated.']);
0102 if C3POdisplay_numeric.equilibrium,testfitequil_yp(equil,equil_fit);end
0103
0104
0105
0106 C3POparam.clustermode.main_C3PO_jd.scheduler.mode = mdce_mode_main_C3PO_jd;
0107
0108
0109
0110 wave_numeric = main_C3PO_jd(dkepath,[id_wave,'_numeric'],equil,'',rayinits{1},waveparam,fitparam,rayparam,C3POdisplay_numeric,C3POparam,[],[],0);
0111
0112 info_dke_yp(2,'Ray trajectories calculated (interpolated magnetic equilibrium)');
0113
0114 rayparam.tfinal = 600;
0115 wave_analytic = main_C3PO_jd(dkepath,[id_wave,'_analytic'],equil,'',rayinits{1},waveparam,fitparam,rayparam,C3POdisplay_analytic,C3POparam,[],[],flag_analytic);
0116
0117 info_dke_yp(2,'Ray trajectories calculated (analytic magnetic equilibrium)');
0118
0119 save_str = ['WAVE_',id_wave,'.mat'];
0120 save(save_str,'id_wave','wave_numeric','wave_analytic');
0121
0122 info_dke_yp(2,'Wave parameters saved');
0123
0124
0125
0126 rays = {wave_numeric.rays{1},wave_analytic.rays{1}};
0127
0128 legs = {'Numeric','Analytic'};
0129
0130 filename = ['Fig_',id_wave];
0131
0132 opt.p_opt = C3POdisplay_numeric.p_opt;
0133 opt.ntheta_fit = 65;
0134 opt.nrho_fit = 15;
0135 opt.propvar = 1;
0136
0137 graph_comp_RT_jd(rays,legs,'',filename,opt)
0138
0139
0140
0141 diaryname = ['res_',id_wave,'.log'];
0142 [LUKEversion,matver] = LUKEversion_jd;
0143
0144 if exist(diaryname,'file'),
0145 delete(diaryname)
0146 end
0147
0148 diary(diaryname)
0149
0150 disp(['Simulation id: ',id_wave]);
0151 disp(['Simulation date: ',timeid_jd(timeid_jd(clock))]);
0152 disp(['User id: ',userid_jd]);
0153 disp(['LUKE Version: ',LUKEversion]);
0154 disp(['MATLAB Version: ',matver]);
0155 disp(['MACHINE: ',dkepath.hostname]);
0156
0157 disp(['----------------------'])
0158
0159 for iray = 1:10,
0160 disp(['Npar(numeric) = ',num2str(wave_numeric.rays{1}.sNpar(iray),'%17.15f'),' - Npar(analytic) = ',num2str(wave_analytic.rays{1}.sNpar(iray),'%17.15f')])
0161 end
0162 disp(['----------------------'])
0163
0164 diary off