equil_prof_jd

PURPOSE ^

SYNOPSIS ^

function equil_prof = equil_prof_jd(filename,type,prho,pspsin,pspsinT,display_mode,p_opt,dispname,savename,Zeff)

DESCRIPTION ^

 This function reads the equilibrium profile data from the 
 file "filename". 

    INPUTS:

        - filename: equilibrium data and save name
        - type: profile data type:(0) for ascii; (1) for .mat
        - display_mode: option for figure display
        - p_opt: option for printing

 by J. Decker (jodecke@alum.mit.edu) 11/01/04

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function equil_prof = equil_prof_jd(filename,type,prho,pspsin,pspsinT,display_mode,p_opt,dispname,savename,Zeff)
0002 %
0003 % This function reads the equilibrium profile data from the
0004 % file "filename".
0005 %
0006 %    INPUTS:
0007 %
0008 %        - filename: equilibrium data and save name
0009 %        - type: profile data type:(0) for ascii; (1) for .mat
0010 %        - display_mode: option for figure display
0011 %        - p_opt: option for printing
0012 %
0013 % by J. Decker (jodecke@alum.mit.edu) 11/01/04
0014 %
0015 if nargin < 10,% & type == 3
0016     Zeff = NaN;
0017 end
0018 if nargin < 9,
0019     savename = filename;
0020 end
0021 if nargin < 8,
0022     dispname = filename;
0023 end
0024 %
0025 if nargin < 7,
0026     p_opt = -1;
0027 end
0028 %
0029 if nargin < 6,
0030     display_mode = 0;
0031 end
0032 %
0033 method = 'spline';%'linear';
0034 %
0035 % Reads profile T and n data
0036 %
0037 [yrho,yspsin,yspsinT,yTe,yne,yzTi,yzni,zZi,zmi] = Teneprof_jd(filename,type,display_mode,p_opt,Zeff,dispname,savename);
0038 %
0039 if ~isempty(yrho),% profiles given on rho grid
0040     pTe = interp1(yrho,yTe,prho,method);
0041     pne = interp1(yrho,yne,prho,method);
0042     pzTi = interp1(yrho,yzTi.',prho,method).';
0043     pzni = interp1(yrho,yzni.',prho,method).';
0044     %
0045 elseif ~isempty(yspsin),% profiles given on poloidal flux based grid
0046     if isstruct(yspsin),% different rho grid for each parameter
0047         pTe = interp1(yspsin.pTe,yTe,pspsin,method);
0048         pne = interp1(yspsin.pne,yne,pspsin,method);
0049         pzTi = interp1(yspsin.pzTi,yzTi.',pspsin,method).';
0050         pzni = interp1(yspsin.pzni,yzni.',pspsin,method).'; 
0051     else
0052         pTe = interp1(yspsin,yTe,pspsin,method);
0053         pne = interp1(yspsin,yne,pspsin,method);
0054         pzTi = interp1(yspsin,yzTi.',pspsin,method).';
0055         pzni = interp1(yspsin,yzni.',pspsin,method).'; 
0056     end
0057     %
0058 elseif ~isempty(yspsinT),% profiles given on toroidal flux based grid
0059     pTe = interp1(yspsinT,yTe,pspsinT,method);
0060     pne = interp1(yspsinT,yne,pspsinT,method);
0061     pzTi = interp1(yspsinT,yzTi.',pspsinT,method).';
0062     pzni = interp1(yspsinT,yzni.',pspsinT,method).';    
0063     %
0064 end
0065 %
0066 % equil structure
0067 %
0068 equil_prof.zZi = zZi;
0069 equil_prof.zmi = zmi;
0070 equil_prof.pTe = pTe;
0071 equil_prof.pne = pne;
0072 equil_prof.pzTi = pzTi;
0073 equil_prof.pzni = pzni;
0074 equil_prof.prof_src = filename;
0075 %

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