diff --git a/matlab/load/read_namelist.m b/matlab/load/read_namelist.m index 74f64c696c5c828d92d9046c5bcf61c62bd0f848..5dbbda9337ba82b2ff2674d9d30573dc51ba30e5 100644 --- a/matlab/load/read_namelist.m +++ b/matlab/load/read_namelist.m @@ -1,4 +1,3 @@ - function S = read_namelist(filename) % S = READ_NAMELIST(FILENAME) returns the struct S containg namelists and % variables in the file FILENAME organised in hierachical way: @@ -80,11 +79,7 @@ while i < c; nmlst_bdy = [nmlst_bdy ' ' line]; end % Parse current namelist (set of variables) - switch namelst - case 'info' - otherwise - S.(namelst) = parse_namelist(nmlst_bdy); - end + S.(namelst) = parse_namelist(nmlst_bdy); end end function S = parse_namelist(strng) @@ -126,9 +121,7 @@ for k = 1:nvars, if k > 1, arg_end(k - 1) = i; end vars{k} = ['S.' strng(i + 1: j)]; end -if numel(arg_end) > 0 arg_end(end) = length(strng); -end % This variables are used in the eval function to evaluate True/False, % so don't remove it! T = '.true.'; @@ -137,6 +130,7 @@ F = '.false.'; for k = 1:nvars, arg = strng(arg_start(k):arg_end(k)); arglit = islit(arg_start(k):arg_end(k))'; + % Remove commas in non literal string... commas = ~arglit & arg == ','; if any(commas) diff --git a/matlab/plot/imagesc_custom.m b/matlab/plot/imagesc_custom.m index 8183267986feee4dc1851770cf80954a72124e71..186a496450a0f61ea6961a6485bcbcd1b507efe8 100644 --- a/matlab/plot/imagesc_custom.m +++ b/matlab/plot/imagesc_custom.m @@ -1,12 +1,13 @@ function [ fig ] = imagesc_custom( XX,YY,FF) % CUSTOM IMAGESC this custom function is meant to be used exaclty as pcolor % but plotting array values in pixels (like imagesc) and not in vertices (like pcolor). - -fig = imagesc( XX(1,:), YY(:,1), FF); +x = reshape(XX(1,:),[numel(XX(1,:)), 1]); +y = reshape(YY(:,1),[numel(YY(:,1)), 1]); +fig = imagesc( x, y, FF); set(gca,'YDir','normal') -xticks(XX(1,:)); -xticklabels(num2str(XX(1,:))); -yticks(YY(:,1)); -yticklabels(num2str(YY(:,1))); +xticks(x); +xticklabels(num2str(x)); +yticks(y); +yticklabels(num2str(y)); end diff --git a/matlab/plot/photomaton.m b/matlab/plot/photomaton.m index a7af7038c227e5bb11c9a3618ef8482397ebf7f6..67b02747b9ca4d0f12ce50d12ff2a476018ecc3e 100644 --- a/matlab/plot/photomaton.m +++ b/matlab/plot/photomaton.m @@ -14,7 +14,7 @@ Nrows = ceil(Nframes/4); Ncols = ceil(Nframes/Nrows); % if OPTIONS.LOGSCALE - toplot.FIELD = max(abs(toplot.FIELD),1e-20); + toplot.FIELD = max(abs(toplot.FIELD),1e-40); toplot.FIELD = log(toplot.FIELD); end TNAME = []; diff --git a/wk/lin_run_script.m b/wk/lin_run_script.m index b4832e7da8a2dc06bf8c925f311142352b0c82c2..eddd7273611d1ccf7f977f4915f18d6420c6d9fd 100644 --- a/wk/lin_run_script.m +++ b/wk/lin_run_script.m @@ -15,34 +15,33 @@ addpath(genpath([gyacomodir,'matlab/load'])) % Add load folder addpath(genpath([gyacomodir,'wk/parameters'])) % Add parameters folder %% Setup run or load an executable -RUN = 0; % To run or just to load +RUN = 1; % To run or just to load default_plots_options % EXECNAME = 'gyacomo23_sp_save'; % single precision -EXECNAME = 'gyacomo23_sp'; % single precision -% EXECNAME = 'gyacomo23_dp'; % double precision +% EXECNAME = 'gyacomo23_sp'; % single precision +EXECNAME = 'gyacomo23_dp'; % double precision % EXECNAME = 'gyacomo23_debug'; % double precision %% Setup parameters % run lin_DTT_HM_rho85 % run lin_DTT_HM_rho98 -% run lin_DTT_LM_rho90 -% run lin_DTT_LM_rho95 +run lin_DIIID_LM_rho90 +% run lin_DIIID_LM_rho95 % run lin_JET_rho97 % run lin_Entropy -run lin_ITG +% run lin_ITG % run lin_KBM %% Change parameters EXBRATE = 0.0; % Background ExB shear flow -NY = 40; -NX = 8; -PMAX = 16; -JMAX = PMAX/2; -ky = 0.05; -LY = 2*pi/ky; -DT = 5e-3; -TMAX = 50; -% % SIGMA_E = 0.04; -% TMAX = 10; +NY = 2; +NX = 4; +% PMAX = 4; +% JMAX = PMAX/2; +ky = 0.8; LY = 2*pi/ky; +DT = 1e-4; +TAU = 2.1; +% SIGMA_E = 0.02; +% TMAX = 50; % DTSAVE0D = 200*DT; % DTSAVE3D = TMAX/50; %%------------------------------------------------------------------------- @@ -53,8 +52,8 @@ setup if RUN MVIN =['cd ../results/',SIMID,'/',PARAMS,'/;']; % RUN =['time ',mpirun,' -np 2 ',gyacomodir,'bin/',EXECNAME,' 1 2 1 0;']; - % RUN =['time ',mpirun,' -np 4 ',gyacomodir,'bin/',EXECNAME,' 1 2 2 0;']; - RUN =['time ',mpirun,' -np 8 ',gyacomodir,'bin/',EXECNAME,' 2 2 2 0;']; + RUN =['time ',mpirun,' -np 4 ',gyacomodir,'bin/',EXECNAME,' 1 2 2 0;']; + % RUN =['time ',mpirun,' -np 8 ',gyacomodir,'bin/',EXECNAME,' 2 2 2 0;']; % RUN =['time ',mpirun,' -np 1 ',gyacomodir,'bin/',EXECNAME,' 1 1 1 0;']; % RUN = ['./../../../bin/gyacomo23_sp 0;']; MVOUT='cd ../../../wk;'; @@ -88,6 +87,7 @@ options.iz = 'avg'; % Compressing z options.ik = 1; % options.GOK2 = 0; % plot gamma/k^2 options.fftz.flag = 0; % Set fftz.flag option to 0 +options.FIELD = 'phi'; [fig, kykx, wkykx, ekykx] = mode_growth_meter(data,options); % Call the function mode_growth_meter with data and options as input arguments, and store the result in fig end @@ -98,7 +98,7 @@ if data.inputs.BETA > 0 [data.PSI, data.Ts3D] = compile_results_3D(LOCALDIR,J0,J1,'psi'); end options.time_2_plot = [120]; -options.kymodes = [0.25]; +options.kymodes = [0.2 0.3 0.4]; options.normalized = 1; options.PLOT_KP = 0; % options.field = 'phi'; diff --git a/wk/parameters/lin_DIIID_LM_rho90.m b/wk/parameters/lin_DIIID_LM_rho90.m index 43d9ea4fd87134e422c4d92411865dafe49d545c..c8ff82e27f3ceebee4d0ddb69aea3da9f0e873ad 100644 --- a/wk/parameters/lin_DIIID_LM_rho90.m +++ b/wk/parameters/lin_DIIID_LM_rho90.m @@ -1,7 +1,7 @@ %% Reference values % See Neiser et al. 2019 Gyrokinetic GENE simulations of DIII-D near-edge L-mode plasmas %% Set simulation parameters -SIMID = 'lin_DTT_HM_rho90'; % Name of the simulation +SIMID = 'lin_DIID_LM_rho90'; % Name of the simulation %% Set up physical parameters CLUSTER.TIME = '99:00:00'; % Allocation time hh:mm:ss NU = 1.0; %(0.00235 in GENE) @@ -20,8 +20,8 @@ P = 2; J = P/2;%P/2; PMAX = P; % Hermite basis size JMAX = J; % Laguerre basis size -NX = 8; % real space x-gridpoints -NY = 2; % real space y-gridpoints +NX = 2; % real space x-gridpoints +NY = 4; % real space y-gridpoints LX = 2*pi/0.1; % Size of the squared frequency domain in x direction LY = 2*pi/0.3; % Size of the squared frequency domain in y direction NZ = 32; % number of perpendicular planes (parallel grid) @@ -45,8 +45,8 @@ SHIFT_Y = 0.0; % Shift in the periodic BC in z NPOL = 1; % Number of poloidal turns PB_PHASE = 0; %% TIME PARAMETERS -TMAX = 15; % Maximal time unit -DT = 1e-3; % Time step +TMAX = 10; % Maximal time unit +DT = 5e-4; % Time step DTSAVE0D = 0.5; % Sampling time for 0D arrays DTSAVE2D = -1; % Sampling time for 2D arrays DTSAVE3D = 0.5; % Sampling time for 3D arrays diff --git a/wk/test_ExB_shear.m b/wk/test_ExB_shear.m index 8da0614ba155e5fe31a2afbadef0d5f927b1cdd8..d04abbcd83468bba1cf647a1c731cb2300069491 100644 --- a/wk/test_ExB_shear.m +++ b/wk/test_ExB_shear.m @@ -13,15 +13,15 @@ EXECDIR = [curdir(1:end-2),'bin/']; % EXECNAME = 'gyacomo23_dp_O1'; % EXECNAME = 'gyacomo23_dp'; % EXECNAME = 'gyacomo23_sp'; -% EXECNAME = 'gyacomo23_test'; -EXECNAME = 'gyacomo23_debug'; +EXECNAME = 'gyacomo23_test'; +% EXECNAME = 'gyacomo23_debug'; % ------ -NP = '1'; PARA = '1 1 1'; +% NP = '1'; PARA = '1 1 1'; % NP = '2'; PARA = '1 2 1'; -% NP = '6'; PARA = '1 6 1'; +NP = '6'; PARA = '1 6 1'; %------ % Picture, const. zonal mode in phi in nonlin term -% INNAME = '0'; +INNAME = '0'; % Picture, bckg ExB shear % INNAME = '1'; % NL with padrallel modes initialization no ExB shear @@ -35,7 +35,7 @@ NP = '1'; PARA = '1 1 1'; % Mcmillan et al. 2019 correction % INNAME = '6'; % Single mode single step -INNAME = '7'; +% INNAME = '7'; %------- RUN = [MPIRUN,' -np ',NP,' ',EXECDIR,EXECNAME,' ',PARA,' ',INNAME]; system([MVIN,'; ',RUN,'; ',MVOUT]);