run_cronos_C3PO_nofluct

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear all
0002 clear mex
0003 clear functions
0004 close all
0005 warning off
0006 pause(1)
0007 dbstop if error
0008 %
0009 % Script for TORE-SUPRA LH discharge #32299 only
0010 %
0011 root_dir = '';%empty or pwd if local
0012 scenario = 'no_fluct';
0013 %
0014 load ('before_luke@TS_32299_100.0117.mat','equil');%data file from cronos
0015 %
0016 opt_dist = 0;% batch run index in dkepath.remote; (0) for local run, (1) local multicore, (2) remote cephee, (3) remote saturne
0017 opt_save = 1;%In case of crash, to restart simulation from an intermediate step stored in a *.mat file (<0 for launching simulation from backup, 0 no backup, >0 for performing backup)
0018 tn = 10000;%Total normalized integration time.
0019 display_mode = [0,1,1];%option for display [C3PO, LUKE, time evolution]
0020 p_opt = 2;%option for printing
0021 %
0022 dtn = 10000;% LUKE internal time step.
0023 %
0024 % LH wave: positive lobe (co-current)
0025 %
0026 Npar_p = [];%if empty, use the launch power spectrum calculated by CRONOS (negative value)
0027 dNpar_p = [];%if empty, use the launch power spectrum calculated by CRONOS (negative value)
0028 %
0029 % LH wave: negative lobe (counter-current)
0030 %
0031 Npar_m = [];%if empty, use the launch power spectrum calculated by CRONOS (positive value)
0032 dNpar_m = [];%if empty, use the launch power spectrum calculated by CRONOS (positive value)
0033 %
0034 ijob = 1;
0035 %
0036 path_simul = [root_dir,scenario,'/'];
0037 if exist(path_simul) ~= 7, mkdir(path_simul);end
0038 %
0039 if isempty(Npar_p),
0040     shot_ref = '';
0041 else
0042     shot_ref = ['Npar_p',num2str(abs(Npar_p))];
0043 end
0044 %
0045 if isempty(shot_ref),
0046     id_simul = [scenario];
0047 else
0048     id_simul = [scenario,'_',shot_ref];
0049 end
0050 %
0051 if opt_dist == 0,%local calculations
0052     %
0053     [timeid,jobid,dkeparam,dkepath,Znorm,Zcurr,ZP0,dke_out,radialDKE,equilDKE,momentumDKE,gridDKE,Zmomcoef,Zbouncecoef,Zmripple,mksa,XXsinksource] = loop_cronos_C3PO_yp(opt_dist,opt_save,id_simul,root_dir,'',tn,dtn,'',display_mode,Npar_p,Npar_m);
0054     %
0055     % ---------------------------------------------- Save results ----------------------------------------------
0056     %
0057     save_file = ['LUKE_RESULTS_',id_simul,'.mat'];
0058     save([dkeparam.path_simul,save_file]);
0059     info_dke_yp(2,['Data saved in ',dkeparam.path_simul,save_file]);
0060     %
0061     % ---------------------------------------------- Display results ----------------------------------------------
0062     %
0063     display_cronos_C3PO(id_simul,equilDKE,ZP0,Zcurr,dkeparam,mksa,'',p_opt,root_dir)
0064     %
0065 else
0066     [timeid,jobid,dkeparam,dkepath] = loop_cronos_C3PO_yp(opt_dist,opt_save,id_simul,root_dir,'',tn,dtn,'',display_mode,Npar_p,Npar_m);
0067     %
0068     job.id_simul{ijob} = id_simul;
0069     job.id(ijob) = str2num(jobid);
0070     job.timeid(ijob) = str2num(timeid);
0071     job.dtn(ijob) = dtn;
0072     job.hwhm_npar(ijob) = hwhm_npar;
0073     job.state(ijob) = 0;
0074 end    
0075 %
0076 if opt_dist > 0,%distributed calculations
0077     job_file = ['LUKE_JOB_',id_simul,'.mat'];
0078     save(job_file,'job','opt_dist','dkepath','dkeparam');
0079     info_dke_yp(2,['Data saved in ',job_file]);
0080 end

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