0001 function [varargout] = buildlukestruct_yp(loadstruct,equil,dkeparam_in,display,dkepath,ohm,waves,transpfaste,ripple,XXf0_in,XXsinksource_in)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ischar(loadstruct) && nargout ~= 1,
0017 error('There must be exactly one output argument in buildlukestruct_yp.m when a specific structure is requested.');
0018 end
0019
0020 dkeparam_out = paramconsistency_dke_yp(dkeparam_in,equil);
0021
0022
0023
0024 radialDKE = make_struct_jd(loadstruct,display.display_mode,'radialgrid_dke_jd',equil,dkeparam_out,display);
0025 equilDKE = make_struct_jd(loadstruct,display.display_mode,'equilibrium_jd',equil,radialDKE,display,'spline',dkeparam_out.mfactor);
0026 momentumDKE = make_struct_jd(loadstruct,display.display_mode,'momentumgrid_dke_jd',dkeparam_out,equilDKE,radialDKE);
0027 gridDKE = make_struct_jd(loadstruct,display.display_mode,'matrix3Dgridbuilder_dke_yp',dkeparam_out,display,equilDKE,radialDKE,momentumDKE);
0028
0029 mksa = make_struct_jd(loadstruct,display.display_mode,'mksacoefbuilder_dke_yp',dkeparam_out,display,equilDKE,radialDKE);
0030 if ischar(loadstruct) && strcmp(loadstruct,'mksa'),
0031 varargout{1} = mksa;
0032 return
0033 end
0034
0035 Zmomcoef = make_struct_jd(loadstruct,display.display_mode,'momentumcoefbuilder_dke_yp',gridDKE,mksa);
0036 if ischar(loadstruct) && strcmp(loadstruct,'Zmomcoef'),
0037 varargout{1} = Zmomcoef;
0038 return
0039 end
0040
0041 Zbouncecoef = make_struct_jd(loadstruct,display.display_mode,'bouncecoefbuilder_dke_yp',dkeparam_out,display,equilDKE,gridDKE);
0042 if ischar(loadstruct) && strcmp(loadstruct,'Zbouncecoef'),
0043 varargout{1} = Zbouncecoef;
0044 return
0045 end
0046
0047 XXsinksource = make_struct_jd(loadstruct,display.display_mode,'sinksourcecoeffbuilder_dke_yp',dkeparam_out,display,gridDKE,mksa,Zbouncecoef,XXsinksource_in);
0048 Zmripple = make_struct_jd(loadstruct,display.display_mode,'mripplecoefbuilder_dke_yp',dkeparam_out,display,equil,equilDKE,gridDKE,mksa,ripple);
0049 [ZXXD_a,ZXXF_a] = make_struct_jd(loadstruct,display.display_mode,'rad_dke_yp',dkeparam_out,display,equilDKE,gridDKE,mksa,Zbouncecoef,Zmomcoef,transpfaste);
0050 [ZXXD_c,ZXXF_c,ZXXD_c_tp,ZXXF_c_tp,XXfM,XXILor] = make_struct_jd(loadstruct,display.display_mode,'coll_dke_jd',dkepath,dkeparam_out,display,equilDKE,mksa,gridDKE,Zmomcoef,Zbouncecoef);
0051 [ZXXD_e,ZXXF_e,ZXXD_e_tp,ZXXF_e_tp,xepsi_init,xEfield_validity] = make_struct_jd(loadstruct,display.display_mode,'efield_dke_jd',dkepath,dkeparam_out,display,equilDKE,mksa,gridDKE,Zmomcoef,Zbouncecoef,ohm,ZXXF_c);
0052 [ZXXD_s,ZXXF_s,ZXXD_s_tp,ZXXF_s_tp] = make_struct_jd(loadstruct,display.display_mode,'synchrotron_dke_jd',dkeparam_out,display,equilDKE,mksa,gridDKE,Zmomcoef,Zbouncecoef);
0053 [waveparam,xyprop_dke,xyP0_2piRp_mod,xyP0_2piRp_mod_coll,xyP0_2piRp_mod_noabs,yb,yP0_2piRp,xys] = make_struct_jd(loadstruct,display.display_mode,'rfwave_dke_jd',dkeparam_out,display,equil,equilDKE,gridDKE,Zbouncecoef,mksa,waves);
0054
0055 if isnan(dkeparam_out.pnmin0_KO) || dkeparam_out.pnmin0_KO > max(momentumDKE.pn_S),
0056 dkeparam_out.pnmin0_KO = max(momentumDKE.pn_S);
0057 end
0058 if isnan(dkeparam_out.pnmax2_KO),
0059 dkeparam_out.pnmax2_KO = dkeparam_out.pnmin0_KO;
0060 end
0061 if isnan(dkeparam_out.pnmax1_KO),
0062
0063 end
0064 [XXSavalanches_norm,xnrem_init,xnrep_init,xnre_out_norm] = make_struct_jd(loadstruct,display.display_mode,'avalanche_en',dkepath,dkeparam_out,display,mksa,gridDKE,Zmomcoef,Zbouncecoef,ohm,equilDKE,radialDKE);
0065
0066 if strcmp(waveparam.model,'RT'),
0067 [ZXYD_rf,ZXYF_rf,ZXYD_rf_tp,ZXYF_rf_tp,gridindex_rf] = make_struct_jd(loadstruct,display.display_mode,'loop_rfdiff_dke_jd',dkepath,dkeparam_out,display,equilDKE,gridDKE,Zmomcoef,Zbouncecoef,mksa,radialDKE,waveparam);
0068 elseif strcmp(waveparam.model,'FW_BIL')
0069 [ZXYD_rf,ZXYF_rf,ZXYD_rf_tp,ZXYF_rf_tp,gridindex_rf] = make_struct_jd(loadstruct,display.display_mode,'rfdiff_dke_fw_jd',dkeparam_out,display,equilDKE,gridDKE,Zmomcoef,Zbouncecoef,mksa,radialDKE,waves);
0070 else
0071 error('Wave model not implemented')
0072 end
0073
0074 [XXfinit] = make_struct_jd(loadstruct,display.display_mode,'finit_dke_yp',dkeparam_out,display,equilDKE,gridDKE,mksa,Zmomcoef,waveparam,XXf0_in);
0075
0076 varargout_loc = {dkeparam_out,radialDKE,equilDKE,momentumDKE,gridDKE,mksa,Zmomcoef,Zbouncecoef,...
0077 XXsinksource,Zmripple,XXSavalanches_norm,xnrem_init,xnrep_init,xnre_out_norm,...
0078 ZXXD_a,ZXXF_a,...
0079 ZXXD_c,ZXXF_c,ZXXD_c_tp,ZXXF_c_tp,XXfM,XXILor,...
0080 ZXXD_e,ZXXF_e,ZXXD_e_tp,ZXXF_e_tp,xepsi_init,xEfield_validity,...
0081 ZXXD_s,ZXXF_s,ZXXD_s_tp,ZXXF_s_tp,...
0082 waveparam,xyprop_dke,xyP0_2piRp_mod,xyP0_2piRp_mod_coll,xyP0_2piRp_mod_noabs,yb,yP0_2piRp,xys,...
0083 ZXYD_rf,ZXYF_rf,ZXYD_rf_tp,ZXYF_rf_tp,gridindex_rf,...
0084 XXfinit};
0085
0086 varargout = varargout_loc(1:nargout);
0087