make_wavert_cronos

PURPOSE ^

SYNOPSIS ^

function wavestruct = make_wavert_cronos(launch,par)

DESCRIPTION ^

 Create the structures waveparam,fitequilparam,rayparam,raydisplay used by C3PO for CRONOS

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function wavestruct = make_wavert_cronos(launch,par)
0002 %
0003 % Create the structures waveparam,fitequilparam,rayparam,raydisplay used by C3PO for CRONOS
0004 %
0005 if nargin < 2,
0006     par = '';
0007 end
0008 %
0009 if strcmp(launch.type,'LH');%For the Lower Hybrid wave simulations
0010 %
0011 % Wave parameters
0012 %
0013 %   waveparam.mmode = -1;%cold plasma mode [1] : (-1) m (1) p, p is the slow mode when kperp > 0 (ex : LH slow wave)
0014     waveparam.kmode = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0015 %
0016 %Option parameter for FLR effects and cross-comparison between old FP code:
0017 %    - (0): all FLR effects
0018 %    - (1): small FLR effects and 1/vpar dependence
0019 %    - (2): small FLR effects and no 1/vpar dependence and old grid technique for DQL calculations (Karney, Shoucri) (see rfdiff_dke_jd)
0020 %
0021     waveparam.opt_rf = 1;
0022     waveparam.dsmin = Inf;
0023     waveparam.cut_fac = 2;
0024     %
0025     waveparam.n_rf_list = 0;
0026 %
0027 % Equilibrium parameters for the ray-tracing
0028 %
0029     fitequilparam.mode_equil = 1;%Magnetic equilibrium grid type: (1): (psi-theta), (2): (x-y)
0030     fitequilparam.method = 'spline';%nearest,spline,pchip,cubic
0031     fitequilparam.nharm = NaN;%Number of harmonics in the magnetic equilibrium interpolation (less than ntheta_equil/2)
0032     fitequilparam.ngridresample = 1001;%Number of grid points for resampling the radial profile of magnetic equilibrium parameters
0033     fitequilparam.opt_load = 0;%Reload existing vectorial magnetic equilibrium (1) or overwrite it (0).
0034 %
0035 % Global parameters for the ray-tracing
0036 %
0037     rayparam.testmode = 0;
0038     rayparam.tensortype = waveparam.kmode;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0039     rayparam.t0 = 0;
0040     rayparam.tfinal = 100000;
0041     if isfield(launch,'aloha') && sum(launch.aloha.mode) > 0.
0042         rayparam.dS = 1.e-2;
0043         rayparam.kextra = 1000;%number of extra points after linear absorption
0044     else
0045         rayparam.dS = 1.e-3;
0046         rayparam.kextra = 5000;%number of extra points after linear absorption
0047     end
0048     rayparam.dt0 = 1.e-4;
0049     rayparam.tol = 1e-12;%when tolerance is increased (less accurate calculation of D=0), tfinal must be increased accordingly
0050     rayparam.kmax = 100000;
0051     rayparam.ncyclharm = 50;%number of cyclotron harmonics (just for hot and relativistic dielectric tensors)
0052     rayparam.reflection = 1;%1:Enforce wave reflection at plasma boundary, 0: the code calculates itself if the ray must leave of not the plasma
0053     rayparam.rel_opt = 1;%option for (1) relativistic or (0) non-relativistic calculations
0054     rayparam.nperp = 1000;%number of points in pperp integration for damping calculations
0055     rayparam.pperpmax = 10;%maximum value of pperp in damping calculations
0056     rayparam.tau_lim = 20;%value of optical depth beyond which the wave is considered absorbed
0057 %
0058 % Ray display mode
0059 %
0060    raydisplay.ray = 0;
0061    raydisplay.equilibrium = 0;
0062    raydisplay.p_opt = -1;%Printing or saving option of the figures
0063 %
0064 elseif strcmp(launch.type,'EC') || strcmp(launch.type,'EBW'),%For the Electron Cyclotron or EBW wave simulations
0065 
0066 % Wave parameters
0067 %
0068 %   waveparam.mmode = 1;%cold plasma mode [1] : (-1) m (1) p, p is the slow mode when kperp > 0 (ex : LH slow wave)
0069     waveparam.kmode = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0070 %
0071 %Option parameter for FLR effects and cross-comparison between old FP code:
0072 %    - (0): all FLR effects
0073 %    - (1): small FLR effects and 1/vpar dependence
0074 %    - (2): small FLR effects and no 1/vpar dependence and old grid technique for DQL calculations (Karney, Shoucri) (see rfdiff_dke_jd)
0075 %
0076     waveparam.opt_rf = 0;
0077     waveparam.dsmin = 0.01;
0078     waveparam.cut_fac = Inf;
0079     %
0080     waveparam.n_rf_list = 1:3;
0081 %
0082 % Equilibrium parameters for the ray-tracing
0083 %
0084     fitequilparam.mode_equil = 1;%Magnetic equilibrium grid type: (1): (psi-theta), (2): (x-y)
0085     fitequilparam.method = 'spline';%nearest,spline,pchip,cubic
0086     fitequilparam.nharm = NaN;%Number of harmonics in the magnetic equilibrium interpolation (less than ntheta_equil/2)
0087     fitequilparam.ngridresample = 1001;%Number of grid points for resampling the radial profile of magnetic equilibrium parameters
0088     fitequilparam.opt_load = 0;%Reload existing vectorial magnetic equilibrium (1) or overwrite it (0).
0089 %
0090 % Global parameters for the ray-tracing
0091 %
0092     rayparam.testmode = 0;
0093     rayparam.tensortype = 0;%(0:cold,1:warm,2:hot;3:weak realtivistic,4:full relativistic)
0094     rayparam.t0 = 0;
0095     rayparam.tfinal = 100000;
0096     rayparam.dt0 = 1.e-5;
0097     rayparam.dS = 1.e-4;
0098     rayparam.tol = 1e-12;%when tolerance is increased (less accurate calculation of D=0), tfinal must be increased accordingly
0099     rayparam.kmax = 100000;
0100     rayparam.ncyclharm = 50;%number of cyclotron harmonics (just for hot and relativistic dielectric tensors)
0101     rayparam.reflection = 0;%1:Enforce wave reflection at plasma boundary, 0: the code calculates itself if the ray must leave of not the plasma
0102     rayparam.rel_opt = 1;%option for (1) relativistic or (0) non-relativistic calculations
0103     rayparam.nperp = 1000;%number of points in pperp integration for damping calculations
0104     rayparam.pperpmax = 10;%maximum value of pperp in damping calculations
0105     rayparam.tau_lim = Inf;%value of optical depth beyond which the wave is considered absorbed
0106     rayparam.kextra = 1000;%number of extra points after linear absorption
0107 %
0108 % Ray display mode
0109 %
0110     raydisplay.ray = 0;
0111     raydisplay.equilibrium = 0;
0112     raydisplay.p_opt = -1;%Printing or saving option of the figures
0113 %
0114 else
0115    error('The wavert configuration name does not exists')      
0116 end
0117 %
0118 % C3PO computing parameters
0119 %
0120 if isfield(par,'distray'),
0121     C3POparam.clustermode.main_C3PO_jd.scheduler.mode = par.distray;%MatLab distributed computing environment disabled (0), enabled with the dedicated toolbox (1), enabled with a private method (2)for the function main_C3PO_jd.m (MDC toolbox must be installed for option 1)
0122 else
0123     C3POparam.clustermode.main_C3PO_jd.scheduler.mode = 0;
0124 end
0125 %
0126 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)
0127 C3POparam.clustermode.main_C3PO_jd.scheduler.memory = 500;%required memory (in mb)
0128 %
0129 if isfield(par,'conf'),
0130     wavestruct.id = [par.conf,'_',launch.id];
0131 else
0132     wavestruct.id = launch.id;
0133 end
0134 %
0135 wavestruct.launch = launch;
0136 if ~isfield(launch,'w0')
0137   wavestruct.launch.w0 = NaN;
0138 end
0139 if ~isfield(launch,'z_L')
0140   wavestruct.launch.z_L = NaN;
0141 end
0142 %
0143 wavestruct.waveparam = waveparam;
0144 wavestruct.fitequilparam = fitequilparam;
0145 wavestruct.rayparam = rayparam;
0146 wavestruct.raydisplay = raydisplay;
0147 %
0148 if isfield(par,'raydisplay')
0149     wavestruct.raydisplay.ray = par.raydisplay.ray;
0150 end
0151 %
0152 wavestruct.C3POparam = C3POparam;
0153 %
0154 wavestruct.wavesolver = 'C3PO';
0155 wavestruct.waveparam.mmode = launch.mmode;% cold mode (+1 for m; -1 for p)
0156 %
0157 if isfield(launch,'a_sdNpar')
0158     wavestruct.waveparam.a_sdNpar = launch.a_sdNpar;
0159 else
0160     wavestruct.waveparam.a_sdNpar = 0;
0161 end
0162 %
0163 if isfield(par,'kmode')
0164     wavestruct.waveparam.kmode = par.kmode;%
0165 else
0166     wavestruct.waveparam.kmode = 0;%Dielectric tensor (0:cold,1:warm,2:hot;3:weak relativistic,4:full relativistic)
0167 end
0168 %
0169 wavestruct.rayparam.tensortype = wavestruct.waveparam.kmode;%(0:cold,1:warm,2:hot;3:weak relativistic,4:full relativistic)
0170 if isfield(par,'ray_tfinal')
0171     wavestruct.rayparam.tfinal = par.ray_tfinal;
0172 end
0173 %
0174 if isfield(par,'oneray') && strcmp(par.oneray,'Yes') && strcmp(wavestruct.launch.type,'LH'),
0175     wavestruct.launch.rZ0 = mean(wavestruct.launch.rZ0);
0176 end
0177 %

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