0001 function wave = imake_wave_ART_jd(workdir,equil,opt_gui)
0002
0003
0004
0005 wave = '';
0006 [qe,me,mp,mn,e0,mu0,re,mc2,clum] = pc_dke_yp;
0007
0008 [ART_file,ART_path] = igetfile_jd(opt_gui,'*.*',['Please select the ART output file'],workdir);
0009
0010 if ART_file == 0,
0011 return
0012 end
0013 load([ART_path,ART_file],'ARTsimdat');
0014
0015 P0 = input('Wave power (kW) :');
0016 if isempty(P0) | ~isnumeric(P0),
0017 disp('-----> Invalid Wave power');
0018 return
0019 end
0020
0021 freq = input('Wave frequency (GHz) [82.7]:');
0022 if isempty(freq),
0023 freq = 82.7;
0024 end
0025 if ~isnumeric(freq),
0026 disp('-----> Invalid Wave frequency');
0027 return
0028 end
0029
0030 dNpar = input('Spectral width [0.2]:');
0031 if isempty(dNpar),
0032 dNpar = 0.2;
0033 end
0034 if ~isnumeric(dNpar),
0035 disp('-----> Invalid Spectral width');
0036 return
0037 end
0038
0039 kmode = input('Plasma model for wave propagation : (0:cold, 1:kinetic) [1] :');
0040 if isempty(kmode),
0041 kmode = 1;
0042 end
0043 if ~isnumeric(kmode) | ~any(kmode == [0:4]),
0044 disp('-----> Invalid plasma model option');
0045 return
0046 end
0047
0048 opt_rf = input('FLR effects : (0:all, 1:small) [0] :');
0049 if isempty(opt_rf),
0050 opt_rf = 0;
0051 end
0052 if ~isnumeric(opt_rf) | ~any(opt_rf == [0:1]),
0053 disp('-----> Invalid FLR effects option');
0054 return
0055 end
0056
0057 wave_id_o = ['ART'];
0058
0059 wave_id = input(['Please provide an id for the wave [',wave_id_o,'] : '],'s');
0060 if isempty(wave_id),
0061 wave_id = wave_id_o;
0062 end
0063
0064 omega_rf = 2*pi*freq*1e9;
0065
0066 smask = [1;1+find((diff(ARTsimdat.R.data) ~= 0) | (diff(ARTsimdat.Phi.data) ~= 0) | (diff(ARTsimdat.z.data) ~= 0))];
0067
0068 ray.P0_2piRp = 1e3*P0/(2*pi*equil.Rp);
0069
0070 ray.sx = ARTsimdat.R.data(smask).'*1e-2 - equil.Rp;
0071
0072 ray.sphi = ARTsimdat.Phi.data(smask).'*pi/180;
0073 ray.sy = ARTsimdat.z.data(smask).'*1e-2;
0074
0075 ray.ss = [];
0076 ray.spsin = [];
0077 ray.stheta = [];
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 disp('Sign changed in imake_wave_ART_jd.m ter');
0088 ray.skx = ARTsimdat.NR.data(smask).'*omega_rf/clum;
0089 ray.sn = ARTsimdat.Nphi.data(smask).'.*ARTsimdat.R.data(smask).'*1e-2*omega_rf/clum;
0090 ray.sky = ARTsimdat.Nz.data(smask).'*omega_rf/clum;
0091
0092 ray.sNpar_comp = ARTsimdat.Npar.data(smask).';
0093 ray.sNpar = [];
0094 ray.sNperp = [];
0095 ray.sdNpar = dNpar*ones(1,length(smask));
0096
0097
0098 ray.sepol_pmz = [];
0099 ray.sphi_xyz = [];
0100
0101 rays{1} = ray;
0102
0103 wave.id = wave_id;
0104 wave.omega_rf = omega_rf;
0105 wave.opt_rf = opt_rf;
0106 wave.opt_disp = 1 + kmode;
0107 wave.equil_id = equil.id;
0108 wave.kextra = 0;
0109 wave.rays = rays;
0110
0111 wave.info.type = 'RT';
0112 wave.info.RT = 'ART';
0113 wave.info.rays = [ART_path,ART_file];
0114