write_equil_ITM

PURPOSE ^

LUKE - Function that writes a LUKE magnetic equilibrium structure into ITM MDS+ database using the CPO format

SYNOPSIS ^

function [status,result] = write_equil_ITM(equil,numshot,numrun,time)

DESCRIPTION ^

LUKE - Function that writes a LUKE magnetic equilibrium structure into ITM MDS+ database using the CPO format

Function that writes a LUKE magnetic equilibrium structure into ITM MDS+ database using the CPO format

WARNING: steps for writing into a ITM database

   - check that in the.cshrc file the following command is written: source /afs/efda-itm.eu/project/switm/scripts/ITMv1 kepler luke 4.09a >/dev/null ('luke' is the fake tokamak name, and 4.09a is the UAL version)
   - type 'env' to given the environment variables of the user. A list of directories with the base name MDSPLUS_TREE_BASE_0=/afs/efda-itm.eu/user/p/peysson/public/itmdb/itm_trees/luke/4.09a/mdsplus/1
   - type ls MDSPLUS_TREE_BASE_0=/afs/efda-itm.eu/user/p/peysson/public/itmdb/itm_trees/luke/4.09a/mdsplus/1. If it is empty the tree of the database must be first created
   - type which ITMv1 (the same ITM version setup in the .cshrc), and in the example the answer is: /opt/switm/scripts.bin/ITMv1
   - type ls /opt/switm/scripts.bin/ITMv1 to see the list of functions
   - type create_user_itm_dir to get the usage -> Usage: create_user_itm_dir <tokamak name> <Data Structure version>. Here <tokamak name> = luke and <Data Structure version> = 4.09a
   - type create_user_itm_dir luke 4.09a for creating the database for luke.

Once the previous steps have been done, this routine may be operational. To have details on the ITM matlab functions (euitm_create,...), type ls /afs/efda-itm.eu/project/switm/ual/4.09a/matlabinterface/ in matlab

by Y.Peysson CEA-IRFM <yves.peysson@cea.fr> and Joan Decker CEA-IRFM (joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [status,result] = write_equil_ITM(equil,numshot,numrun,time)
0002 %LUKE - Function that writes a LUKE magnetic equilibrium structure into ITM MDS+ database using the CPO format
0003 %
0004 %Function that writes a LUKE magnetic equilibrium structure into ITM MDS+ database using the CPO format
0005 %
0006 %WARNING: steps for writing into a ITM database
0007 %
0008 %   - check that in the.cshrc file the following command is written: source /afs/efda-itm.eu/project/switm/scripts/ITMv1 kepler luke 4.09a >/dev/null ('luke' is the fake tokamak name, and 4.09a is the UAL version)
0009 %   - type 'env' to given the environment variables of the user. A list of directories with the base name MDSPLUS_TREE_BASE_0=/afs/efda-itm.eu/user/p/peysson/public/itmdb/itm_trees/luke/4.09a/mdsplus/1
0010 %   - type ls MDSPLUS_TREE_BASE_0=/afs/efda-itm.eu/user/p/peysson/public/itmdb/itm_trees/luke/4.09a/mdsplus/1. If it is empty the tree of the database must be first created
0011 %   - type which ITMv1 (the same ITM version setup in the .cshrc), and in the example the answer is: /opt/switm/scripts.bin/ITMv1
0012 %   - type ls /opt/switm/scripts.bin/ITMv1 to see the list of functions
0013 %   - type create_user_itm_dir to get the usage -> Usage: create_user_itm_dir <tokamak name> <Data Structure version>. Here <tokamak name> = luke and <Data Structure version> = 4.09a
0014 %   - type create_user_itm_dir luke 4.09a for creating the database for luke.
0015 %
0016 %Once the previous steps have been done, this routine may be operational. To have details on the ITM matlab functions (euitm_create,...), type ls /afs/efda-itm.eu/project/switm/ual/4.09a/matlabinterface/ in matlab
0017 %
0018 %by Y.Peysson CEA-IRFM <yves.peysson@cea.fr> and Joan Decker CEA-IRFM (joan.decker@cea.fr)
0019 %
0020 if nargin < 3,error('Not enough input arguments in write_equil_ITM.m');end
0021 if nargin == 3,
0022     time = [0];%Only one default time slice is written in the ITM MDS+ database
0023 end
0024 %
0025 status = 0;
0026 result = '';
0027 %
0028 import ualmemory.javainterface.*;
0029 %
0030 ntime = length(time);
0031 %
0032 try,    
0033     expIdx = euitm_create('euitm',numshot,numrun,numshot,0);%type help euitm_create to get the infos on this function.
0034     equilCPO = CPO_create('equilibrium',ntime);
0035     coreprofCPO = CPO_create('coreprof',ntime);
0036     %
0037     for it = 1:ntime,
0038         %
0039         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 'equilibrium' CPO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0040         %
0041         % datainfo element
0042         %
0043         equilCPO(it).datainfo.dataprovider = 'Yves Peysson & Joan Decker, CEA/DSM/IRFM';
0044         equilCPO(it).datainfo.putdate = date;
0045         equilCPO(it).datainfo.source = 'LUKE package';
0046         equilCPO(it).datainfo.comment = 'For validation use';
0047         equilCPO(it).datainfo.isref = 0;
0048         equilCPO(it).datainfo.whatref.user = 'LUKE code';
0049         equilCPO(it).datainfo.whatref.machine = equil.id;
0050         equilCPO(it).datainfo.whatref.shot = numshot;
0051         equilCPO(it).datainfo.whatref.run = numrun;
0052 %        equilCPO(it).datainfo.whatref.occurence = 0;
0053         %
0054         % eqgeometry element
0055         %
0056         equilCPO(it).eqgeometry.source = '';
0057         equilCPO(it).eqgeometry.boundarytype = '';
0058         equilCPO(it).eqgeometry.boundary.r = '';
0059         equilCPO(it).eqgeometry.boundary.z = '';
0060         equilCPO(it).eqgeometry.geom_axis.r = equil.Rp;
0061         equilCPO(it).eqgeometry.geom_axis.z = equil.Zp;
0062         equilCPO(it).eqgeometry.a_minor = equil.ptx(end,1);
0063 %        equilCPO(it).eqgeometry.elongation = '';
0064 %        equilCPO(it).eqgeometry.tria_upper = '';
0065 %        equilCPO(it).eqgeometry.tria_lower = '';
0066 %        equilCPO(it).eqgeometry.xpts.r = '';
0067 %        equilCPO(it).eqgeometry.xpts.z = '';
0068 %        equilCPO(it).eqgeometry.left_low_st.r = '';
0069 %        equilCPO(it).eqgeometry.left_low_st.z = '';
0070 %        equilCPO(it).eqgeometry.right_low_st.r = '';
0071 %        equilCPO(it).eqgeometry.right_low_st.z = '';
0072 %        equilCPO(it).eqgeometry.left_up_st.r = '';
0073 %        equilCPO(it).eqgeometry.left_up_st.z = '';
0074 %        equilCPO(it).eqgeometry.right_up_st.r = '';
0075 %        equilCPO(it).eqgeometry.right_up_st.z = '';
0076 %        equilCPO(it).eqgeometry.active_limit.r = '';
0077 %        equilCPO(it).eqgeometry.active_limit.z = '';
0078         %
0079         % global_param element
0080         %
0081 %        equilCPO(it).global_param.beta_pol = '';
0082 %        equilCPO(it).global_param.beta_tor = '';
0083 %        equilCPO(it).global_param.beta_normal = '';
0084 %        equilCPO(it).global_param.i_plasma = '';
0085 %        equilCPO(it).global_param.li = '';
0086 %        equilCPO(it).global_param.volume = '';
0087 %        equilCPO(it).global_param.area = '';
0088 %        equilCPO(it).global_param.psi_ax = equil.psi_apRp(1);
0089         if isinf(equil.Rp),
0090             equilCPO(it).global_param.psi_bound = equil.psi_apRp(end);%Cylindrical case
0091         else
0092             equilCPO(it).global_param.psi_bound = equil.psi_apRp(end)*equil.Rp/equil.ptx(end,1);,%Toroidal case
0093         end
0094         equilCPO(it).global_param.mag_axis.position.r = equil.Rp;
0095         equilCPO(it).global_param.mag_axis.position.z = equil.Zp;
0096         equilCPO(it).global_param.mag_axis.bphi = equil.ptBPHI(1,1);
0097 %        equilCPO(it).global_param.mag_axis.q = '';
0098 %        equilCPO(it).global_param.q95 = '';
0099 %        equilCPO(it).global_param.q_min = '';
0100         %
0101         % profiles_1d element
0102         %
0103         if isinf(equil.Rp),
0104             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.psi',equil.psi_apRp);%Cylindrical case
0105         else
0106             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.psi',equil.psi_apRp*equil.Rp/equil.ptx(end,1));%Toroidal case
0107         end
0108         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.phi','');
0109         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.pressure','');
0110         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.F_dia','');
0111         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.pprime','');
0112         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.ffprime','');
0113         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.jphi','');
0114         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.jparallel','');
0115         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.q','');
0116         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.r_inboard','');
0117         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.r_outboard','');
0118         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.rho_tor','');
0119         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.rho_vol','');
0120         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.elongation','');
0121         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.tria_upper','');
0122         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.tria_lower','');
0123         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.volume','');
0124         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.vprime','');
0125         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.area','');
0126         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.aprime','');
0127         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.ftrap','');
0128         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm1','');
0129         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm2','');
0130         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm3','');
0131         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm4','');
0132         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm5','');
0133         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm6','');
0134         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm7','');
0135         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm8','');
0136         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_1d.gm9','');
0137         %
0138         % profiles_2d element
0139         %
0140         equilCPO(it).profiles_2d.grid_type = '(poloidal psi,theta)';
0141         if isinf(equil.Rp),
0142             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.grid.dim1',equil.psi_apRp);%Cylindrical case
0143         else
0144             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.grid.dim1',equil.psi_apRp*equil.Rp/equil.ptx(end,1));%Toroidal case
0145         end
0146         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.grid.dim2',equil.theta);
0147         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.grid.connect','');
0148         if isinf(equil.Rp),
0149             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.psi_grid',equil.psi_apRp(:)*ones(size(equil.theta)));%Cylindrical case
0150         else
0151             equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.psi_grid',(equil.psi_apRp(:)*ones(size(equil.theta)))*equil.Rp/equil.ptx(end,1));%Toroidal case
0152         end
0153         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.jphi_grid','');
0154         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.jpar_grid','');
0155         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.br',equil.ptBx);
0156         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.bz',equil.ptBy);
0157         equilCPO(it) = allocate_equilibrium(equilCPO(it),'profiles_2d.bphi',equil.ptBPHI);
0158         %
0159         % coord_sys element
0160         %
0161         equilCPO(it).coord_sys.grid_type = '(poloidal psi,theta)';
0162         if isinf(equil.Rp),
0163             equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.grid.dim1',equil.psi_apRp(:));%Cylindrical case
0164         else
0165             equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.grid.dim1',equil.psi_apRp(:)*equil.Rp/equil.ptx(end,1));%Toroidal case
0166         end
0167         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.grid.dim2',equil.theta);
0168         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.jacobian','');
0169         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_11','');
0170         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_12','');
0171         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_13','');
0172         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_22','');
0173         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_23','');
0174         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.g_33','');
0175         if isinf(equil.Rp),
0176             equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.position.r',equil.ptx);
0177         else
0178             equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.position.r',equil.ptx+equil.Rp);
0179         end        
0180         equilCPO(it) = allocate_equilibrium(equilCPO(it),'coord_sys.position.z',equil.pty+equil.Zp);        
0181         %
0182         % codeparam element
0183         %
0184         equilCPO(it).codeparam.codename ='LUKE';        
0185         equilCPO(it).codeparam.codeversion = [LUKEversion_jd,' - MATLAB ',version];        
0186         equilCPO(it).codeparam.parameters = '';        
0187         equilCPO(it).codeparam.output_diag = '';        
0188         equilCPO(it).codeparam.output_flag = 0;        
0189         %
0190         % time element
0191         %
0192         equilCPO(it).time = time(it);
0193         %
0194         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 'coreprof' CPO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0195         %
0196         % datainfo element
0197         %
0198         coreprofCPO(it).datainfo.dataprovider = 'Yves Peysson & Joan Decker, CEA/DSM/IRFM';
0199         coreprofCPO(it).datainfo.putdate = date;
0200         coreprofCPO(it).datainfo.source = 'LUKE package';
0201         coreprofCPO(it).datainfo.comment = 'For validation use';
0202         coreprofCPO(it).datainfo.isref = 0;
0203         coreprofCPO(it).datainfo.whatref.user = 'LUKE code';
0204         coreprofCPO(it).datainfo.whatref.machine = equil.id;
0205         coreprofCPO(it).datainfo.whatref.shot = numshot;
0206         coreprofCPO(it).datainfo.whatref.run = numrun;
0207 %        coreprofCPO(it).datainfo.whatref.occurence = 1;
0208         %
0209 %        coreprofCPO(it).rho_tor_norm = '';
0210 %        coreprofCPO(it).rho_tor = '';
0211 %        coreprofCPO(it).drhodt = '';
0212         %
0213         % toroidal_field element
0214         %
0215 %        coreprofCPO(it).toroidal_field.b0 = '';
0216 %        coreprofCPO(it).toroidal_field.b0prime = '';
0217 %        coreprofCPO(it).toroidal_field.r0 = '';
0218 %        coreprofCPO(it).toroidal_field.time = '';
0219         %
0220         % composition element
0221         %
0222         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'composition.amn',equil.zmi);
0223         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'composition.zn',equil.zZi);
0224         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'composition.zion',equil.zZi);
0225         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'composition.imp_flag',zeros(size(equil.zZi)));
0226         %
0227         % psi element
0228         %
0229         if isinf(equil.Rp),
0230             coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.value',equil.psi_apRp);%Cylindrical case
0231         else
0232             coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.value',equil.psi_apRp*equil.Rp/equil.ptx(end,1));%Toroidal case
0233         end
0234         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.source','LUKE code');
0235         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.flag',3);
0236 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.boundary.value','');
0237 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.boundary.source','');
0238 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.boundary.type','');
0239 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.boundary.rho','');
0240 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.jni.value','');
0241 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.jni.integral','');
0242 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.jni.source','');
0243 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.sigma_par.value','');
0244 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'psi.sigma_par.source','');
0245         %
0246         % te element
0247         %
0248         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.value',equil.pTe);
0249         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.source','LUKE code');    
0250         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.flag',3);
0251 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.boundary.value','');
0252 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.boundary.source','');
0253 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.boundary.type','');
0254 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.boundary.rho_tor','');
0255 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.source_term.value','');
0256 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.source_term.integral','');
0257 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.source_term.source','');
0258 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.transp_coef.diff','');
0259 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.transp_coef.vconv','');
0260 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.transp_coef.source','');
0261 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.flux.dv','');
0262 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.flux_interp','');
0263 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'te.time_deriv','');
0264         %
0265         % ti element
0266         %
0267         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.value',transpose(equil.pzTi));
0268         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.source',repmat('LUKE code',length(equil.zZi),1));    
0269         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.flag',3*ones(size(equil.zZi)));
0270 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.boundary.value','');
0271 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.boundary.source','');
0272 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.boundary.type','');
0273 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.boundary.rho_tor','');
0274 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.source_term.value','');
0275 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.source_term.integral','');
0276 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.source_term.source','');
0277 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.transp_coef.diff','');
0278 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.transp_coef.vconv','');
0279 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.transp_coef.source','');
0280 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.flux.dv','');
0281 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.flux_interp','');
0282 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ti.time_deriv','');
0283         %
0284         % ne element
0285         %
0286         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.value',equil.pne);
0287         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.source','LUKE code');    
0288         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.flag',3);
0289 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.boundary.value','');
0290 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.boundary.source','');
0291 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.boundary.type','');
0292 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.boundary.rho_tor','');
0293 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.source_term.value','');
0294 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.source_term.integral','');
0295 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.source_term.source','');
0296 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.transp_coef.diff','');
0297 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.transp_coef.vconv','');
0298 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.transp_coef.source','');
0299 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.flux.dv','');
0300 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.flux_interp','');
0301 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ne.time_deriv','');
0302         %
0303         % ni element
0304         %
0305         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.value',transpose(equil.pzni));
0306         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.source',repmat('LUKE code',length(equil.zZi),1));    
0307         coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.flag',3*ones(size(equil.zZi)));
0308 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.boundary.value','');
0309 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.boundary.source','');
0310 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.boundary.type','');
0311 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.boundary.rho_tor','');
0312 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.source_term.value','');
0313 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.source_term.integral','');
0314 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.source_term.source','');
0315 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.transp_coef.diff','');
0316 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.transp_coef.vconv','');
0317 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.transp_coef.source','');
0318 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.flux.dv','');
0319 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.flux_interp','');
0320 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'ni.time_deriv','');
0321         %
0322         % profiles_1d element
0323         %
0324 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pe.value','');
0325 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pe.source','');
0326 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pi.value','');
0327 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pi.source','');
0328 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_th.value','');
0329 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_th.source','');
0330 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_perp.value','');
0331 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_perp.source','');
0332 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_parallel.value','');
0333 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.pr_parallel.source','');
0334 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.jtot.value','');
0335 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.jtot.source','');
0336 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.jini.value','');
0337 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.jini.source','');
0338 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.joh.value','');
0339 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.joh.source','');
0340 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.vloop.value','');
0341 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.vloop.source','');
0342 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.sigmapar.value','');
0343 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.sigmapar.source','');
0344 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.qoh.value','');
0345 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.qoh.source','');
0346 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.eparallel.value','');
0347 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.eparallel.source','');
0348 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.e_b.value','');
0349 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.e_b.source','');
0350 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.q.value','');
0351 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.q.source','');
0352 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.shear.value''');
0353 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.shear.source','');
0354 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.ns.value','');
0355 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.ns.source','');
0356 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.mtor.value','');
0357 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.mtor.source','');
0358 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.wtor.value','');
0359 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.wtor.source','');
0360 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.zeff.value','');
0361 %        coreprofCPO(it) = allocate_coreprof(coreprofCPO(it),'profiles_1d.zeff.source','');
0362         %
0363         % globalparam element
0364         %
0365 %        coreprofCPO(it).globalparam.current_tot = '';
0366 %        coreprofCPO(it).globalparam.current_bnd = '' ;
0367 %        coreprofCPO(it).globalparam.vloop = '';
0368 %        coreprofCPO(it).globalparam.li = '';
0369         %
0370         % codeparam element
0371         %
0372         coreprofCPO(it).codeparam.codename ='LUKE';        
0373         coreprofCPO(it).codeparam.codeversion = [LUKEversion_jd,' - MATLAB ',version];        
0374         coreprofCPO(it).codeparam.parameters = '';        
0375         coreprofCPO(it).codeparam.output_diag = '';        
0376         coreprofCPO(it).codeparam.output_flag = 0;        
0377         %
0378         % time element
0379         %
0380         coreprofCPO(it).time = time(it);
0381     end
0382     %
0383     CPO_put(expIdx,equilCPO);
0384     CPO_put(expIdx,coreprofCPO);
0385     euitm_close(expIdx,'euitm',numshot,numrun);
0386 catch
0387     status = -1;
0388     result = 'WARNING: unsuccessful  attempt to write a LUKE magnetic equilibrium in the ITM-MDS+ database.';
0389 end
0390 %
0391 
0392 
0393 
0394 
0395 
0396 
0397 
0398 
0399

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