fmake_equil_D3D_yp

PURPOSE ^

SYNOPSIS ^

function equil = fmake_equil_D3D_yp(workdir,shotnum,shotime)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function equil = fmake_equil_D3D_yp(workdir,shotnum,shotime)
0002 %
0003 if nargin < 3,error('Not enough input arguments in fmake_equil_D3D_yp.m');end
0004 %
0005 external = load_externaldata_D3D(workdir,shotnum,shotime,'','',0,'');
0006 %
0007 display_mode = 0;
0008 p_opt = -1;
0009 basestr = 'D3D';
0010 %
0011 equil_id =  [basestr,'_',shotnum,'_',shotime];
0012 dispname = [basestr,' #',shotnum,'; t = ',shotime,' s'];
0013 savename = equil_id;
0014 %
0015 % magnetic equil
0016 %
0017 [equil_magnetic,prho1,pspsin1,pspsinT1] = equil_magnetic_EFIT_jd(external.equil.magnetic.eqdsk,display_mode,p_opt,dispname,savename);
0018 %
0019 % profiles
0020 %
0021 keyboard
0022 Zeff = external.equil.prof.species.Zeff;
0023 prho = external.equil.prof.rho;
0024 pne = external.equil.prof.ne;
0025 pTe = external.equil.prof.Te;
0026 pTi = pTe/external.equil.prof.TeTi;
0027 frac_H = external.equil.prof.species.frac_H;
0028 frac_D = external.equil.prof.species.frac_D;
0029 Zimp = external.equil.prof.species.Zimp;
0030 Aimp = external.equil.prof.species.Aimp;
0031 %
0032 % sign management as most equilibrium codes do not account for these.
0033 %
0034 if strcmp(external.equil.jbdirections.Ip,'clockwise')
0035     signs.Ip = 1;
0036 else
0037     signs.Ip = -1;
0038 end
0039 %
0040 if strcmp(external.equil.jbdirections.Bt,'clockwise')
0041     signs.Bt = 1;
0042 else
0043     signs.Bt = -1;
0044 end
0045 %
0046 if signs.Ip*equil_magnetic.psi_apRp(end) < 0,
0047     equil_magnetic.psi_apRp = -equil_magnetic.psi_apRp;
0048     equil_magnetic.ptBx = -equil_magnetic.ptBx;
0049     equil_magnetic.ptBy = -equil_magnetic.ptBy;
0050 end
0051 %
0052 if signs.Bt*equil_magnetic.ptBPHI(1,1) < 0,
0053     equil_magnetic.ptBPHI = -equil_magnetic.ptBPHI;
0054 end
0055 %
0056 save([savename,'.prof'],'prho','pne','pTe','pTi','frac_H','frac_D','Zimp','Aimp','Zeff','-mat');
0057 equil_prof = equil_prof_jd([savename,'.prof'],1.4,prho1,pspsin1,pspsinT1,display_mode,p_opt,dispname,savename,Zeff);
0058 delete([savename,'.prof']);
0059 %
0060 equil = conc_struct_jd(equil_magnetic,equil_prof);
0061 %
0062 equil.id = savename;
0063 %
0064 equil = equilconsistency_yp(equil,'',1);
0065 %
0066 save(['EQUIL_',savename,'.mat'],'equil');
0067 
0068 
0069 
0070 
0071

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