0001 function proc_a_sdNpar_scan(filename,savepath,opt,locproc_list)
0002
0003 if nargin < 3,
0004 opt.save = 1;
0005 opt.nr_dep = 0;
0006 opt.peak = 'n';
0007 opt.wave = 'n';
0008 opt.rho = 't';
0009 opt.print = -1;
0010 end
0011
0012 if nargin < 2,
0013 savepath = '';
0014 end
0015
0016 load(filename);
0017
0018 if nargin < 4,
0019 locproc_list = 1:na_sdNpar;
0020 end
0021
0022 nproc = length(locproc_list);
0023
0024 basestr = id_simul0(1:find(id_simul0 == '_',1,'first')-1);
0025
0026 if length(dkeparam.rho_S) == 1,
0027 nrho = dkeparam.rho_S + isfield(dkeparam,'rho0');
0028 else
0029 nrho = length(dkeparam.rho_S) - 1;
0030 end
0031
0032 zI = NaN(1,nproc);
0033 zP = NaN(1,nproc);
0034 zxrho = NaN(nproc,nrho);
0035 zxJ = NaN(nproc,nrho);
0036 zxP = NaN(nproc,nrho);
0037
0038 for iproc = 1:nproc,
0039
0040 id_simul = [id_simul0,'_',locid_simul];
0041
0042 for iw = 1:length(waves),
0043 id_simul = [id_simul,'_',ids_wave{iw},'_a_sdNpar_',num2str(a_sdNpar_list(locproc_list(iproc)))];
0044 end
0045
0046 data_proc = fproc_data(savepath,id_simul,opt);
0047
0048 if ~isempty(data_proc),
0049
0050 zI(iproc) = data_proc.scalar.I_tot;
0051 zP(iproc) = data_proc.scalar.p_rf_2piRp*2*pi*equil.Rp;
0052 zxJ(iproc,:) = data_proc.radial.J_tot;
0053 zxP(iproc,:) = data_proc.radial.P_rf;
0054 zxrho(iproc,:) = data_proc.radial.xrho;
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 end
0068
0069 end
0070
0071 style0 = 'none';
0072 style = '-';
0073 style2 = '--';
0074 marker = 'none';
0075 marker1 = '+';
0076 marker2 = 'o';
0077 marker3 = 's';
0078 marker4 = '.';
0079 color = NaN;
0080 color1 = 'k';
0081 color2 = 'r';
0082 color3 = 'b';
0083 color4 = 'g';
0084 color5 = 'm';
0085 color6 = 'c';
0086
0087 width = 0.5;
0088 width2 = 2;
0089 siz = 20;
0090
0091 red = 0.9;
0092 lspace = 0.7;
0093 lspace2 = 0.5;
0094 bspace = 0.7;
0095 bspace2 = 0.5;
0096
0097 xmask = find(~isnan(zI));
0098
0099 x = a_sdNpar_list;
0100 xlim = [min(a_sdNpar_list),max(a_sdNpar_list)];
0101 xtick = a_sdNpar_list;
0102 xlab = 'a_{sdN_{||}}';
0103
0104 figure(1),clf,set(1,'Name','Current')
0105
0106 ylab = 'I (kA)';
0107 ylim = NaN;
0108 tit = '';
0109
0110
0111
0112 graph1D_jd(x(xmask),zI(xmask)*1e3,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker2,color2,width2,siz,gca,red,lspace,bspace);
0113
0114
0115
0116 set(gca,'xtick',xtick);
0117
0118 print_jd(opt.print,'Fig_D0_scan_I');
0119
0120 figure(2),clf,set(2,'Name','Current profiles')
0121
0122 xlab = 'r/a';
0123 xlim = [0:1];
0124 xtick = 0:0.2:1;
0125
0126 ylab = 'J (MA/m^2)';
0127 ylim = NaN;
0128 tit = '';
0129
0130 graph1D_jd(zxrho(xmask,:).',zxJ(xmask,:).',0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color,width,siz,gca,red,lspace,bspace);
0131
0132
0133 set(gca,'xtick',xtick);
0134
0135 print_jd(opt.print,'Fig_D0_scan_J');
0136
0137 figure(3),clf,set(3,'Name','PRF profiles')
0138
0139 xlab = 'r/a';
0140 xlim = [0:1];
0141 xtick = 0:0.2:1;
0142
0143 ylab = 'P_{rf} (MW/m^3)';
0144 ylim = NaN;
0145 tit = '';
0146
0147 graph1D_jd(zxrho(xmask,:).',zxP(xmask,:).',0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color,width,siz,gca,red,lspace,bspace);
0148
0149
0150 set(gca,'xtick',xtick);
0151
0152 print_jd(opt.print,'Fig_D0_scan_J');
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188