0001 function proc_Dr0_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:nDr0;
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,'_Dr0_',num2str(Dr0_list(iproc))];
0041
0042 data_proc = fproc_data(savepath,id_simul,opt);
0043
0044 if ~isempty(data_proc),
0045
0046 zI(iproc) = data_proc.scalar.I_tot;
0047 zP(iproc) = data_proc.scalar.p_rf_2piRp*2*pi*equil.Rp;
0048 zxJ(iproc,:) = data_proc.radial.J_tot;
0049 zxP(iproc,:) = data_proc.radial.P_rf;
0050 zxrho(iproc,:) = data_proc.radial.xrho;
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 end
0064
0065 end
0066
0067 style0 = 'none';
0068 style = '-';
0069 style2 = '--';
0070 marker = 'none';
0071 marker1 = '+';
0072 marker2 = 'o';
0073 marker3 = 's';
0074 marker4 = '.';
0075 color = NaN;
0076 color1 = 'k';
0077 color2 = 'r';
0078 color3 = 'b';
0079 color4 = 'g';
0080 color5 = 'm';
0081 color6 = 'c';
0082
0083 width = 0.5;
0084 width2 = 2;
0085 siz = 20;
0086
0087 red = 0.9;
0088 lspace = 0.7;
0089 lspace2 = 0.5;
0090 bspace = 0.7;
0091 bspace2 = 0.5;
0092
0093 xmask = find(~isnan(zI));
0094
0095 x = Dr0_list;
0096 xlim = [min(Dr0_list),max(Dr0_list)];
0097 xtick = Dr0_list;
0098 xlab = 'D_r (m^2/s)';
0099
0100 figure(1),clf,set(1,'Name','Current')
0101
0102 ylab = 'I (kA)';
0103 ylim = NaN;
0104 tit = '';
0105
0106
0107
0108 graph1D_jd(x(xmask),zI(xmask)*1e3,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker2,color2,width2,siz,gca,red,lspace,bspace);
0109
0110
0111
0112 set(gca,'xtick',xtick);
0113
0114 print_jd(opt.print,'Fig_D0_scan_I');
0115
0116 figure(2),clf,set(2,'Name','Current profiles')
0117
0118 xlab = 'r/a';
0119 xlim = [0:1];
0120 xtick = 0:0.2:1;
0121
0122 ylab = 'J (kA/m^2)';
0123 ylim = NaN;
0124 tit = '';
0125
0126 graph1D_jd(zxrho(xmask,:).',zxJ(xmask,:).'*1e3,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color,width,siz,gca,red,lspace,bspace);
0127
0128
0129 set(gca,'xtick',xtick);
0130
0131 print_jd(opt.print,'Fig_D0_scan_J');
0132
0133 figure(3),clf,set(3,'Name','PRF profiles')
0134
0135 xlab = 'r/a';
0136 xlim = [0:1];
0137 xtick = 0:0.2:1;
0138
0139 ylab = 'P_{rf} (MW/m^3)';
0140 ylim = NaN;
0141 tit = '';
0142
0143 graph1D_jd(zxrho(xmask,:).',zxP(xmask,:).',0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color,width,siz,gca,red,lspace,bspace);
0144
0145
0146 set(gca,'xtick',xtick);
0147
0148 print_jd(opt.print,'Fig_D0_scan_J');
0149
0150
0151
0152
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