From 49badfc9d08ebaaf19a504de22ebfca9e918a60c Mon Sep 17 00:00:00 2001 From: Antoine Hoffmann <antoine.hoffmann@epfl.ch> Date: Wed, 29 Mar 2023 09:39:38 +0200 Subject: [PATCH] clean up --- {scripts => bash scripts}/submit_00.cmd | 0 fort_example.90 | 91 ------------------- scripts/job_pipeline.sh | 44 --------- scripts/scan_kN_pipeline.sh | 59 ------------ wk/analysis_gyacomo.m | 8 +- .../Ajay_scan_CH4_lin_ITG.m | 0 .../CBC_P_J_scan.m | 0 .../CBC_hypcoll_PJ_scan.m | 0 .../CBC_kT_PJ_scan.m | 0 .../CBC_kT_nu_scan.m | 0 .../CBC_nu_PJ_scan.m | 0 .../lin_3D_Zpinch.m | 0 .../lin_ETPY.m | 0 wk/{ => benchmark and scan scripts}/lin_ITG.m | 0 wk/{ => benchmark and scan scripts}/lin_KBM.m | 0 wk/{ => benchmark and scan scripts}/lin_MTM.m | 0 wk/{ => benchmark and scan scripts}/lin_RHT.m | 0 wk/{ => benchmark and scan scripts}/lin_TEM.m | 0 wk/fast_analysis.m | 40 +++++++- .../Zpinch_coll_scan_kN_1.7.m | 0 .../continue_multiple_runs_marconi.m | 0 wk/{ => old scripts}/debug_script.m | 0 wk/{ => old scripts}/local_run.m | 0 wk/{ => old scripts}/marconi_run.m | 0 wk/{ => old scripts}/quick_run.m | 0 wk/{ => old scripts}/save_iFFT.m | 0 26 files changed, 41 insertions(+), 201 deletions(-) rename {scripts => bash scripts}/submit_00.cmd (100%) delete mode 100644 fort_example.90 delete mode 100644 scripts/job_pipeline.sh delete mode 100644 scripts/scan_kN_pipeline.sh rename wk/{benchmark scripts => benchmark and scan scripts}/Ajay_scan_CH4_lin_ITG.m (100%) rename wk/{ => benchmark and scan scripts}/CBC_P_J_scan.m (100%) rename wk/{ => benchmark and scan scripts}/CBC_hypcoll_PJ_scan.m (100%) rename wk/{ => benchmark and scan scripts}/CBC_kT_PJ_scan.m (100%) rename wk/{ => benchmark and scan scripts}/CBC_kT_nu_scan.m (100%) rename wk/{ => benchmark and scan scripts}/CBC_nu_PJ_scan.m (100%) rename wk/{ => benchmark and scan scripts}/lin_3D_Zpinch.m (100%) rename wk/{ => benchmark and scan scripts}/lin_ETPY.m (100%) rename wk/{ => benchmark and scan scripts}/lin_ITG.m (100%) rename wk/{ => benchmark and scan scripts}/lin_KBM.m (100%) rename wk/{ => benchmark and scan scripts}/lin_MTM.m (100%) rename wk/{ => benchmark and scan scripts}/lin_RHT.m (100%) rename wk/{ => benchmark and scan scripts}/lin_TEM.m (100%) rename wk/{ => old scripts}/Zpinch_coll_scan_kN_1.7.m (100%) rename wk/{ => old scripts}/continue_multiple_runs_marconi.m (100%) rename wk/{ => old scripts}/debug_script.m (100%) rename wk/{ => old scripts}/local_run.m (100%) rename wk/{ => old scripts}/marconi_run.m (100%) rename wk/{ => old scripts}/quick_run.m (100%) rename wk/{ => old scripts}/save_iFFT.m (100%) diff --git a/scripts/submit_00.cmd b/bash scripts/submit_00.cmd similarity index 100% rename from scripts/submit_00.cmd rename to bash scripts/submit_00.cmd diff --git a/fort_example.90 b/fort_example.90 deleted file mode 100644 index 667ca822..00000000 --- a/fort_example.90 +++ /dev/null @@ -1,91 +0,0 @@ -&BASIC - nrun = 100000000 !number of maximal time steps - dt = 0.01 !time step - tmax = 500 !maximal physical time - maxruntime = 60 ! 1h 14400 !4h !maximal wallclock run time (in seconds) -/ -&GRID - pmaxe = 6 !maximal degree of Hermite polynomials for e - jmaxe = 3 !maximal degree of Laguerre polynomials for e - pmaxi = 6 !maximal degree of Hermite polynomials for i - jmaxi = 3 !maximal degree of Laguerre polynomials for i - Nx = 200 !resolution in x (=Nkx) - Lx = 120 !box size in x - Ny = 64 !resolution in y (=2(Nky-1)) - Ly = 160 !box size in y - Nz = 24 !resolution in z - Npol = 1 !number of poloidal turns (Lz=2piNpol) - Nexc = 1 !factor to increase Lx in sheared geometry - SG = .f. !staggered grid option (not recommended) -/ -&GEOMETRY - geom = 's-alpha' !magnetic equilibrium geometry (Z-pinch,s-alpha,miller) - q0 = 1.4 !safety factor (s-alpha,miller only) - shear = 0.8 !shear (s-alpha,miller only) - eps = 0.18 !inverse aspect ratio (s-alpha,miller only) - kappa = 1 !elongation (miller only) - delta = 0 !triangularity (miller only) - zeta = 0 !squareness (miller only) - parallel_bc = 'dirichlet' !boundary condition for modes that does not connect due to shear (dirichlet,periodic) -/ -&OUTPUT_PAR - nsave_0d = 50 !period in number of step for time traces - nsave_1d = -1 !unused - nsave_2d = -1 !unused - nsave_3d = 100 !period in number of step for 3D fields (phi,psi,...) - nsave_5d = 1000 !period in number of step for 5D fields (moments) - write_doubleprecision = .t. !for HDF5 output (double precision faster on marconi) - write_gamma = .t. !to write particle flux - write_hf = .t. !to write heat flux - write_phi = .t. !to write ES and EM potentials - write_Na00 = .t. !to write gyrocenter densities - write_Napj = .t. !to write moments - write_Sapj = .f. !to write nonlinear terms - write_dens = .t. !to write particle densities - write_temp = .t. !to write particle temperatures - job2load = -1 !ID of the job to load in a restart (-1 means no restart) -/ -&MODEL_PAR - ! Collisionality - CLOS = 0 !closure model (0: zero-truncation) - NL_CLOS = 0 !NL closure model (-1 is full FLR sum until n=J-j, n>-1 is up to nth term) - LINEARITY = 'nonlinear' !to activate nonlinear term (linear,nonlinear) - KIN_E = .f. !to have a kinetic electron model (adiabatic otherwise) - mu_x = 1.0 !x numerical diffusion coefficient - mu_y = 1.0 !y numerical diffusion coefficient - N_HD = 4 !xy numerical diffusion order - mu_z = 2.0 !z numerical diffusion coefficient (order 4) - mu_p = 0 !p numerical diffusion coefficient (usually not used) - mu_j = 0 !j numerical diffusion coefficient (usually not used) - nu = 0.05 !collision frequency (=0.49*nu_GENE) - tau_e = 1 !electron temperature ratio - tau_i = 1 !ion temperature ratio - sigma_e = 0.023338 !electron mass ratio - sigma_i = 1 !ion mass ratio - q_e = -1 !electron charge - q_i = 1 !ion charge - K_Ne = 2.22 !electron density gradient intensity - K_Te = 6.96 !electron temperature gradient intensity - K_Ni = 2.22 !ion density gradient intensity - K_Ti = 6.96 !ion density temperature intensity - k_gB = 1 !magnetic field gradient strength - k_cB = 1 !magnetic curvature strength - lambdaD = 0 !Debye length (not tested when non zero) -/ -&COLLISION_PAR - collision_model = 'DG' !collision model (DG,SG,LD,LR), all need a matrix except DG - GK_CO = .f. !activate gyrokinetic terms in the CO - INTERSPECIES = .t. !activate INTERSPECIES if CO has some - mat_file = 'LDGK_P10_J5_dk_5e-2_km_5_NFLR_30.h5' !path to find the collision matrix - collision_kcut = 1.8 !maximal wavelength of the CO matrix. For higher kperp, the matrix at collision_kcut will be applied. -/ -&INITIAL_CON - INIT_OPT = 'phi' !initialization option (phi,mom00,allmom,ppj) - ACT_ON_MODES = 'donothing' !to perform numerical experiments (unused) - init_background = 0 !background value for a noise initialization - init_noiselvl = 0.0001 !fluctuation value '' - iseed = 42 !seed of the noise -/ -&TIME_INTEGRATION_PAR - numerical_scheme = 'RK4' !numerical scheme for time-stepping (RK2,RK3,RK4,DOPRI5) -/ diff --git a/scripts/job_pipeline.sh b/scripts/job_pipeline.sh deleted file mode 100644 index 342eaa46..00000000 --- a/scripts/job_pipeline.sh +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/bash -#This script automatizes the launch of multiple job with chain dependency. -nu_=0.01 -dnu=0.01 - -Tm_=2000 -dTm=2000 - -# First submit -lastji=$(sbatch submit_00.cmd) -lastjid=${lastji##* } -echo $lastji -#echo $lastjid - -for i in {1..1}; do - # Setup indices of job id (current and previous one) - im1=$(awk "BEGIN {print $i-1}") - idm1=$(printf '%02d' $im1) - id=$(printf '%02d' $i) - - # Create new submit file from older one - awk -v "ID=$id" '{ - if (NR == 8) print "#SBATCH --error=err_"ID".txt"; - else if (NR == 9) print "#SBATCH --output=out_"ID".txt"; - else if (NR == 12) print "srun --cpu-bind=cores ./gyacomo 2 24 1 "ID; - else print $0}' submit_$idm1.cmd > submit_$id.cmd - - # Create new input file from older one - awk -v "NU=$nu_" -v "TM=$Tm_" -v "J2L=$im1" '{ - if (NR == 04) print " tmax = "TM; - else if (NR == 40) print " job2load = "J2L; - else if (NR == 54) print " nu = "NU; - else print $0}' fort_$idm1.90 > fort_$id.90 - - # Retrieve last jobid and launch next job with dep - lastji=$(sbatch --dependency=afterok:$lastjid submit_0$i.cmd) - lastjid=${lastji##* } - echo $lastjid - - # Increment variables - nu_=$(awk "BEGIN {print $nu_+$dnu}") - Tm_=$(awk "BEGIN {print $Tm_+$dTm}") -done - diff --git a/scripts/scan_kN_pipeline.sh b/scripts/scan_kN_pipeline.sh deleted file mode 100644 index 8b9cef7e..00000000 --- a/scripts/scan_kN_pipeline.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/bash -# lastjid=$(sbatch submit_00.cmd) - -nu_=0.01 -dnu=0.0 -kn_=1.7 -dkn=0.2 -kt_=0.425 -dkt=0.05 -Lx_=150 -dLx=030 - -Tm_=4000 -dTm=1000 - -# First submit -istart=0 -lastji=$(sbatch submit_0$istart.cmd) -lastjid=${lastji##* } -echo $lastji - -for i in {1..5}; do - # Setup indices of job id (current and previous one) - im1=$(awk "BEGIN {print $i-1}") - idm1=$(printf '%02d' $im1) - id=$(printf '%02d' $i) - - # Create new submit file from older one - awk -v "ID=$id" '{ - if (NR == 8) print "#SBATCH --error=err_"ID".txt"; - else if (NR == 9) print "#SBATCH --output=out_"ID".txt"; - else if (NR == 12) print "srun --cpu-bind=cores ./gyacomo 2 24 1 "ID; - else print $0}' submit_$idm1.cmd > submit_$id.cmd - - # Create new fort file from older one - awk -v "NU=$nu_" -v "TM=$Tm_" -v "J2L=$im1" -v "KN=$kn_" -v "KT=$kt_" -v "LX=$Lx_" '{ - if (NR == 04) print " tmax = "TM; - else if (NR == 40) print " job2load = "J2L; - else if (NR == 13) print " Lx = "LX; - else if (NR == 54) print " nu = "NU; - else if (NR == 61) print " K_Ne = "KN; - else if (NR == 62) print " K_Ni = "KN; - else if (NR == 63) print " K_Te = "KT; - else if (NR == 64) print " K_Ti = "KT; - else print $0}' fort_$idm1.90 > fort_$id.90 - - # Retrieve last jobid and launch next job with dep - lastji=$(sbatch --dependency=afterok:$lastjid submit_$id.cmd) - lastjid=${lastji##* } - echo $lastjid - - # Increment variables - Lx_=$(awk "BEGIN {print $Lx_+$dLx}") - nu_=$(awk "BEGIN {print $nu_+$dnu}") - kn_=$(awk "BEGIN {print $kn_+$dkn}") - kt_=$(awk "BEGIN {print $kt_+$dkt}") - Tm_=$(awk "BEGIN {print $Tm_+$dTm}") -done - diff --git a/wk/analysis_gyacomo.m b/wk/analysis_gyacomo.m index cb18516a..188b4796 100644 --- a/wk/analysis_gyacomo.m +++ b/wk/analysis_gyacomo.m @@ -100,20 +100,20 @@ options.INTERP = 0; options.POLARPLOT = 0; options.AXISEQUAL = 0; options.NORMALIZE = 0; -% options.NAME = '\phi'; +options.NAME = '\phi'; % options.NAME = '\psi'; % options.NAME = '\omega_z'; % options.NAME = 'T_i'; % options.NAME = 'n_i'; -options.NAME = '\phi^{NZ}'; +% options.NAME = '\phi^{NZ}'; % options.NAME = 'N_i^{00}'; % options.NAME = 'N_i^{00}-N_e^{00}'; % options.NAME = 's_{Ex}'; % options.NAME = 'Q_x'; % options.NAME = 'k^2n_e'; -options.PLAN = 'xy'; +options.PLAN = 'kxz'; options.COMP = 'avg'; -options.TIME = [80 200]; +options.TIME = [20 30 60]; options.RESOLUTION = 256; data.a = data.EPS * 2e3; diff --git a/wk/benchmark scripts/Ajay_scan_CH4_lin_ITG.m b/wk/benchmark and scan scripts/Ajay_scan_CH4_lin_ITG.m similarity index 100% rename from wk/benchmark scripts/Ajay_scan_CH4_lin_ITG.m rename to wk/benchmark and scan scripts/Ajay_scan_CH4_lin_ITG.m diff --git a/wk/CBC_P_J_scan.m b/wk/benchmark and scan scripts/CBC_P_J_scan.m similarity index 100% rename from wk/CBC_P_J_scan.m rename to wk/benchmark and scan scripts/CBC_P_J_scan.m diff --git a/wk/CBC_hypcoll_PJ_scan.m b/wk/benchmark and scan scripts/CBC_hypcoll_PJ_scan.m similarity index 100% rename from wk/CBC_hypcoll_PJ_scan.m rename to wk/benchmark and scan scripts/CBC_hypcoll_PJ_scan.m diff --git a/wk/CBC_kT_PJ_scan.m b/wk/benchmark and scan scripts/CBC_kT_PJ_scan.m similarity index 100% rename from wk/CBC_kT_PJ_scan.m rename to wk/benchmark and scan scripts/CBC_kT_PJ_scan.m diff --git a/wk/CBC_kT_nu_scan.m b/wk/benchmark and scan scripts/CBC_kT_nu_scan.m similarity index 100% rename from wk/CBC_kT_nu_scan.m rename to wk/benchmark and scan scripts/CBC_kT_nu_scan.m diff --git a/wk/CBC_nu_PJ_scan.m b/wk/benchmark and scan scripts/CBC_nu_PJ_scan.m similarity index 100% rename from wk/CBC_nu_PJ_scan.m rename to wk/benchmark and scan scripts/CBC_nu_PJ_scan.m diff --git a/wk/lin_3D_Zpinch.m b/wk/benchmark and scan scripts/lin_3D_Zpinch.m similarity index 100% rename from wk/lin_3D_Zpinch.m rename to wk/benchmark and scan scripts/lin_3D_Zpinch.m diff --git a/wk/lin_ETPY.m b/wk/benchmark and scan scripts/lin_ETPY.m similarity index 100% rename from wk/lin_ETPY.m rename to wk/benchmark and scan scripts/lin_ETPY.m diff --git a/wk/lin_ITG.m b/wk/benchmark and scan scripts/lin_ITG.m similarity index 100% rename from wk/lin_ITG.m rename to wk/benchmark and scan scripts/lin_ITG.m diff --git a/wk/lin_KBM.m b/wk/benchmark and scan scripts/lin_KBM.m similarity index 100% rename from wk/lin_KBM.m rename to wk/benchmark and scan scripts/lin_KBM.m diff --git a/wk/lin_MTM.m b/wk/benchmark and scan scripts/lin_MTM.m similarity index 100% rename from wk/lin_MTM.m rename to wk/benchmark and scan scripts/lin_MTM.m diff --git a/wk/lin_RHT.m b/wk/benchmark and scan scripts/lin_RHT.m similarity index 100% rename from wk/lin_RHT.m rename to wk/benchmark and scan scripts/lin_RHT.m diff --git a/wk/lin_TEM.m b/wk/benchmark and scan scripts/lin_TEM.m similarity index 100% rename from wk/lin_TEM.m rename to wk/benchmark and scan scripts/lin_TEM.m diff --git a/wk/fast_analysis.m b/wk/fast_analysis.m index 10b931f3..546abd56 100644 --- a/wk/fast_analysis.m +++ b/wk/fast_analysis.m @@ -10,10 +10,11 @@ PARTITION = '/misc/gyacomo23_outputs/'; % resdir = 'paper_2_GYAC23/CBC/Full_NL_7x4x192x96x32_nu_0.05_muxy_1.0_muz_2.0'; %% tests -% resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24_xp'; -resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24_sp'; +% resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24'; +resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24_xp'; +% resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24_sp'; % resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24_Lx_180'; -%% + %% J0 = 00; J1 = 10; % Load basic info (grids and time traces) @@ -21,6 +22,7 @@ DATADIR = [PARTITION,resdir,'/']; data = {}; data = compile_results_low_mem(data,DATADIR,J0,J1); +if 0 %% Plot transport and phi radial profile [data.PHI, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'phi'); @@ -33,6 +35,7 @@ options.ST_FIELD = '\phi'; % chose your field to plot in spacetime diag options.INTERP = 0; options.RESOLUTION = 256; fig = plot_radial_transport_and_spacetime(data,options); +end if 0 %% MOVIES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -59,3 +62,34 @@ data.a = data.EPS * 2000; options.RESOLUTION = 256; create_film(data,options,'.gif') end + +if 0 +%% Hermite-Laguerre spectrum +[data.Nipjz, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'Nipjz'); +data.Nipjz = log(data.Nipjz); +% options.TIME = 'avg'; +options.P2J = 0; +options.ST = 1; +options.NORMALIZED = 0; +options.TIME = [500:800]; +fig = show_moments_spectrum(data,options); +% fig = show_napjz(data,options); +% save_figure(data,fig,'.png'); +end + +if 0 +%% Mode evolution +[data.PHI, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'phi'); + +options.NORMALIZED = 0; +options.TIME = [000:9000]; +options.KX_TW = [1 20]; %kx Growth rate time window +options.KY_TW = [0 20]; %ky Growth rate time window +options.NMA = 1; +options.NMODES = 800; +options.iz = 'avg'; % avg or index +options.ik = 1; % sum, max or index +options.fftz.flag = 0; +fig = mode_growth_meter(data,options); +% save_figure(data,fig,'.png') +end \ No newline at end of file diff --git a/wk/Zpinch_coll_scan_kN_1.7.m b/wk/old scripts/Zpinch_coll_scan_kN_1.7.m similarity index 100% rename from wk/Zpinch_coll_scan_kN_1.7.m rename to wk/old scripts/Zpinch_coll_scan_kN_1.7.m diff --git a/wk/continue_multiple_runs_marconi.m b/wk/old scripts/continue_multiple_runs_marconi.m similarity index 100% rename from wk/continue_multiple_runs_marconi.m rename to wk/old scripts/continue_multiple_runs_marconi.m diff --git a/wk/debug_script.m b/wk/old scripts/debug_script.m similarity index 100% rename from wk/debug_script.m rename to wk/old scripts/debug_script.m diff --git a/wk/local_run.m b/wk/old scripts/local_run.m similarity index 100% rename from wk/local_run.m rename to wk/old scripts/local_run.m diff --git a/wk/marconi_run.m b/wk/old scripts/marconi_run.m similarity index 100% rename from wk/marconi_run.m rename to wk/old scripts/marconi_run.m diff --git a/wk/quick_run.m b/wk/old scripts/quick_run.m similarity index 100% rename from wk/quick_run.m rename to wk/old scripts/quick_run.m diff --git a/wk/save_iFFT.m b/wk/old scripts/save_iFFT.m similarity index 100% rename from wk/save_iFFT.m rename to wk/old scripts/save_iFFT.m -- GitLab