Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e6d78d7
powspace stabscan gridding
d-burg May 1, 2024
37e04e7
broken, but setting up stabscan loop
d-burg May 3, 2024
5632eb3
1st draft gamma calculation
d-burg May 23, 2024
e04745f
WIP: layer inputs routine
d-burg Jun 6, 2024
1d80801
WIP: runs, but netcdf errors
d-burg Jun 27, 2024
c873bd6
WIP: building growthrate outputs
d-burg Jul 4, 2024
7384150
WIP: adding GUI compatibility
d-burg Jul 5, 2024
f636803
WIP: cleaned SLAYER, stability plots
d-burg Jul 26, 2024
ca094bb
WIP: new arraylike inPr handling
d-burg Jul 28, 2024
a06471b
WIP: dynamic gridding root find backup
d-burg Jul 30, 2024
91b3ab0
WIP: backing up SLAYER AMR
Sep 16, 2024
5c48a44
WIP: SLAYER gamma refinement algo
d-burg Oct 3, 2024
2716878
WIP: new centered AMR algo
d-burg Oct 17, 2024
0ae4888
no AMR if small deltaprime
d-burg Oct 27, 2024
27dcf0a
function call bug fixes
d-burg Oct 28, 2024
b29bf49
change gamma scan tolerances
d-burg Nov 8, 2024
a5e4789
clean up slayer growthrate scans
d-burg Nov 14, 2024
09bdb8c
add Pe_flag
d-burg Nov 14, 2024
f1761b1
reverting Pe_flag commit
d-burg Nov 22, 2024
5841610
restoring Pe_flag commit
d-burg Nov 25, 2024
75e1441
WIP: add riccati_del_s function
d-burg Feb 3, 2025
ce180dc
WIP: layer thickness delta.f functions
d-burg Feb 6, 2025
b912356
WIP: slayer LAR gamma netcdf upgrades
d-burg Feb 12, 2025
00c18d7
WIP: adjust error tolerances
d-burg Feb 17, 2025
35514d1
generalized growth rates to full eq!!
d-burg Feb 28, 2025
af3bb30
WIP: layer thickness usability updates
d-burg Mar 17, 2025
295ff40
SLAYER delta netcdf updates
d-burg Mar 31, 2025
4e1e98d
Revert "WIP: layer thickness usability updates"
d-burg Mar 31, 2025
bff2187
netcdf working again, minor slayer fixes
d-burg Apr 4, 2025
74e1c1d
Merge develop into slayer_growthrate
d-burg Apr 4, 2025
25292b2
Bug fixes and ease of use
d-burg Apr 12, 2025
066a371
layfac=tau_R, STRIDE effective rs in netcdf
d-burg Apr 15, 2025
d600258
STRIDE rs flux avg, SLAYER fixes
d-burg Apr 18, 2025
610914f
draft of rfitzp growth rate solve
d-burg Apr 22, 2025
64d45d3
old stabscan architecture backup
d-burg May 6, 2025
096a60d
new architecture! toggle fitz vs JKP
d-burg May 9, 2025
54369b0
bug and sign fixes
d-burg May 9, 2025
5a533c3
SLAYER print statement cleanups
d-burg May 21, 2025
832c9e3
pre-merge updates
d-burg Jun 11, 2025
10529d7
merge with develop
d-burg Jun 11, 2025
633821b
small changes post merge
d-burg Jun 24, 2025
609787f
toroidal Delta_crit
d-burg Jul 2, 2025
56f9dc5
WIP: SLAYER in/out struct overhaul
d-burg Aug 19, 2025
5ff13d5
working: SLAYER structs
d-burg Aug 20, 2025
7e7de3f
WIP: P_perp and P_tor
d-burg Aug 20, 2025
762f854
WIP: 2x2 coupling
d-burg Aug 21, 2025
b90a844
WIP: improved scan logic
d-burg Sep 12, 2025
0348b2a
WIP: backup, working version
d-burg Oct 9, 2025
e6a825f
WIP: reverting coupling workflow to fix gamma bug
d-burg Oct 10, 2025
ee8cef4
Revert "WIP: backup, working version"
d-burg Oct 10, 2025
ce0b1f9
checkpoint: working with brute force scans
d-burg Oct 14, 2025
83465f8
WIP: latest working version
d-burg Dec 15, 2025
b26cf41
WIP: cleanups and prep for PR
d-burg Dec 17, 2025
357aadf
WIP: SLAYER AMR using hash table
d-burg Jan 23, 2026
8f45f09
WIP: AMR V2 with cell types
d-burg Jan 23, 2026
2a73a46
WIP: fixes for coupled AMR scans
d-burg Jan 30, 2026
4849e00
WIP: big cleanup, not compiling yet
d-burg Feb 14, 2026
e5397cb
WIP: fix line excursion
d-burg Feb 14, 2026
aca19c5
WIP: bug fixes
d-burg Feb 19, 2026
c658f45
WIP: fix NF90_GLOBAL integers in read_stride
d-burg Feb 19, 2026
a42fc48
WIP: working on params bug
d-burg Feb 19, 2026
4f5a7d9
WIP: fix tau_perp bug, m_AMR bug
d-burg Feb 19, 2026
7390807
WIP: delta.f speedup attempt
d-burg Feb 19, 2026
2548310
Merge branch 'slayer_growthrate' of github.com:PrincetonUniversity/GP…
d-burg Feb 19, 2026
a072e31
delta.f arithmetic error
d-burg Feb 19, 2026
c61f15e
WIP: AMR speedup
d-burg Feb 19, 2026
175413f
WIP: hashed midpoint computation fix
d-burg Feb 19, 2026
01039e5
WIP: ongoing diagnosing of erroneous nyquist diagrams
d-burg Feb 19, 2026
32985ec
WIP: fix makefile ordering
d-burg Feb 19, 2026
4fb3329
WIP: set coupling via msing_max
d-burg Feb 21, 2026
631b9c8
WIP: fix determinant msing_max case
d-burg Feb 21, 2026
b7c2936
new SLAYER cleanup complete, first pass
d-burg Feb 24, 2026
ab42586
final STRIDE, br_th cleanups
d-burg Feb 24, 2026
0d2eb45
MERGE with origin/develop
d-burg Feb 25, 2026
88f7f7c
fix stale dependencies
d-burg Feb 25, 2026
3acd396
fix version.inc
d-burg Feb 25, 2026
0bd79b0
further module dependency bug fixes
d-burg Feb 25, 2026
7415dda
fix slayer.f line excursion
d-burg Feb 25, 2026
02079a7
fix slayer linking
d-burg Feb 25, 2026
c115854
fix stride_netcdf_out call
d-burg Feb 25, 2026
cd5626c
fix further makefile ordering issues
d-burg Feb 25, 2026
9cc2c66
further deps fixes
d-burg Feb 25, 2026
11370ee
fix slayer line excursion
d-burg Feb 25, 2026
7de735c
address PR review bugs and suggestions
d-burg Feb 25, 2026
cb66042
WIP: STRIDE debug WRITE statements
d-burg Feb 25, 2026
912154e
WIP: more debug statements
d-burg Feb 25, 2026
3ad5ef1
WIP: try changing identityMat to allocatable
d-burg Feb 25, 2026
e0a209b
WIP: remove STRIDE debug statements
d-burg Feb 25, 2026
8955716
address @Claudes comment, a10 example needs future overhaul anyways
d-burg Feb 25, 2026
0c30074
WIP: split off growth rate functionality from gslayer.f
d-burg Mar 3, 2026
2ed9a6c
WIP: clean up dispersion_det gamma specification
d-burg Mar 3, 2026
8512d7a
increase max pts
d-burg Mar 9, 2026
ed3e51b
Merge branch 'stride_allocatable_fix' into slayer_growthrate
d-burg Apr 1, 2026
ee6d765
SLAYER - ENHANCEMENT - Make MAX_PTS a soft limit in AMR
d-burg Apr 1, 2026
f13fcc3
update growthrates.f header
d-burg Apr 1, 2026
ad53d67
WIP - bug fixes to Fitz tau normalization timescale
d-burg Apr 16, 2026
8d4a86d
correct prefactors for toroidal delta_crit
d-burg Apr 18, 2026
77d3419
add no-op delta_c matrix to determinant
d-burg Apr 18, 2026
c834fbc
fix Q_e sign error
d-burg Apr 19, 2026
335ce31
WIP - SLAYER + RMATCH benchmarking patches
d-burg Apr 25, 2026
9ea6367
SLAYER - NEW FEATURE - Allow STRIDE msing > coupled-dispersion msing_max
d-burg Apr 26, 2026
c0988c6
fix dr_rationals to use locstab%f(2) index
d-burg Jun 1, 2026
e3ae7ce
Merge remote-tracking branch 'origin/develop' into slayer_growthrate
d-burg Oct 9, 2026
8ec2df3
SLAYER - BUGFIX - Pass a dummy Jacobian subroutine to LSODE in the no…
d-burg Oct 9, 2026
11098cc
SLAYER - NEW FEATURE - Extract dispersion roots from the AMR scan
d-burg Oct 9, 2026
c4d129a
SLAYER - BUGFIX - Correct the inter-surface Q rescaling in the couple…
d-burg Oct 9, 2026
6ebfdb4
SLAYER, STRIDE - BUGFIX - Convert Delta' to the r_s reference length …
d-burg Oct 9, 2026
af715b7
SLAYER - BUGFIX - Normalize D by the electron diamagnetic share, not …
d-burg Oct 9, 2026
ffa95f1
SLAYER - BUGFIX - Use the shear magnitude in the layer timescales and…
d-burg Oct 9, 2026
d43cfb5
SLAYER - BUGFIX - Carry the toroidal mode number into the diamagnetic…
d-burg Oct 9, 2026
8e59462
SLAYER - NEW FEATURE - Doppler-shift the coupled determinant by the E…
d-burg Oct 9, 2026
6445606
SLAYER - MINOR - Give every real literal in params.f the r8 kind
d-burg Oct 14, 2026
70fec27
SLAYER - BUGFIX - Keep the imaginary part of the Delta' diagonal in t…
d-burg Oct 14, 2026
6b6b73a
SLAYER - BUGFIX - Harden the matched growth-rate path and default to …
d-burg Oct 14, 2026
445d07c
SLAYER, STRIDE - BUGFIX - Remove the toroidal critical-Delta option
d-burg Oct 14, 2026
124b89b
Merge remote-tracking branch 'origin/develop' into slayer_growthrate
d-burg Oct 14, 2026
c540e7b
DOCS - EXAMPLES - Add a SLAYER growth-rate run to the DIII-D example …
d-burg Oct 14, 2026
f4adf3d
SLAYER - MINOR - Restore CRLF line endings in delta.f
d-burg Oct 14, 2026
a508110
SLAYER - MINOR - American spelling in screen output, NetCDF long_name…
d-burg Oct 23, 2026
7e3f2d4
Merge develop into slayer_growthrate
d-burg Oct 23, 2026
ac23400
DOCS - MINOR - Refresh DIII-D SLAYER sample output after the develop …
d-burg Oct 23, 2026
3aabb99
SLAYER - BUG FIX - Initialize lnLamb, use per-surface tau and P_tor i…
logan-nc Oct 24, 2026
c3f9dda
Merge remote-tracking branch 'origin/develop' into pr173-work
logan-nc Oct 24, 2026
2100323
SLAYER - BUG FIX - Report unset namelist inputs, set gamma_fac in nam…
logan-nc Oct 24, 2026
b7fb8a4
SLAYER - BUG FIX - Check qval and the params_flag path in the unset-i…
logan-nc Oct 24, 2026
ba7a17f
SLAYER - BUG FIX - Carry n into the ExB Q, pass ds to the Cole stabsc…
logan-nc Oct 24, 2026
076a1e6
SLAYER - MINOR - rename output file extension to match .out convention
matt-pharr Oct 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/examples/DIIID_ideal_example/README
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ A ``stride.in`` is also included, allowing STRIDE to be run as an alternative st

.. note:: STRIDE does not write ``euler.bin`` (its ``bin_euler`` flag is a dummy variable), so DCON must be run when GPEC will be executed in subsequent steps.

STRIDE also writes ``stride_output_n1.nc``, which holds the outer-region tearing stability matrix Delta' and the rational-surface data that SLAYER needs to compute resistive-layer tearing growth rates. With ``read_eq=t``, the included ``slayer.in`` reads that file together with the kinetic profiles in ``TkMkr_D3Dlike_Hmode.gpeckf``. It then matches each layer response to Delta' on the first three rational surfaces::

slayer

Calculating growth rate on m = 2 rational surface:
Delta_prime (r_s ref.): 5.94 ...
Delta_crit: 33.3
Dispersion roots found: 1, poles: 1
root 1: Q= -1.162293E+00 -4.163214E-02 omega[rad/s]= -1.059284E+04 gamma[1/s]= -3.794248E+02 polished=T

Delta' is converted from STRIDE's normalized-flux reference length to the minor-radius reference that the layer quantities use before matching. With the default ``dc_type="rfitzp"`` critical Delta, the 2/1, 3/1 and 4/1 tearing modes are all damped here, because Delta_crit exceeds Delta' on each surface. Setting ``dc_type="none"`` drops this stabilization and leaves the 2/1 weakly unstable (gamma of about 80 /s). Each root is reported in its surface's ExB frame. The results, including every root and pole found in the scan, are written to ``slayer_output_n1.nc``.

Setting ``coupling_flag=t`` instead solves the coupled multi-surface dispersion relation for the first ``msing_max`` surfaces. Each surface is then Doppler-shifted by its ExB rotation from the kinetic file, so the root is reported in the lab frame. The Doppler shifts spread the branches apart in Re(Q): with the shipped ``msing_max=3`` and ``scan_width=1.5`` the 2/1 branch falls outside the scan window (SLAYER prints a warning), so for the coupled run set ``msing_max=2`` or widen ``scan_width``.

Satisfied with the DCON result, we run GPEC, which computes the ideal plasma response to the external 3D field from the coils defined in ``coil.in``::

gpec
Expand Down
93 changes: 93 additions & 0 deletions docs/examples/DIIID_ideal_example/slayer.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
&SLAYER_INPUT
input_flag=f ! reads profile quantities (n_e, t_e, etc.) from an ascii table
infile='TkMkr_D3Dlike_Hmode.gpeckf' ! Path to the kinetic profile file (read_eq=t), or to an ascii table of surface quantities (input_flag=t)
ncfile='stride_output_n1.nc' ! Path to netCDF file of STRIDE outputs
params_flag=f ! calculates normalized parameters from profile quantities
! >>>
! >>> Input rational surface quantities
! >>>
mm=2 ! poloidal mode number
nn=1 ! toroidal mode number
n_e=5.50E+19 ! electron density [m^-3]
t_e=1000.0 ! electron temperature [eV]
t_i=1000.0 ! ion temperature [eV]
sval=1.5 ! magnetic shear at the layer
bt=2.0 ! toroidal field [T]
rs=0.5 ! minor radius of resonant surface [m]
R0=1.67 ! major radius of magnetic axis [m]
omega=5.00E+03 ! ExB rotation frequency [rad/s]
l_t=0.11 ! temperature gradient scale length
l_n=0.25 ! density gradient scale length
qval=2.0 ! q of resonant surface
mu_i=2.0 ! ion mass ratio to proton mass, 2 for deuterium plasma. Also used when read_eq=t
zeff=2.0 ! plasma Z_effective. Also used when read_eq=t (the kinetic file's Z_eff is not used)
dr_val=-0.1 ! GGJ resistive interchange index D_R (taken from STRIDE when read_eq=t)
dgeo_val=0.0 ! unused (the toroidal critical Delta was removed); accepted so older inputs still read
chi_p_prof=0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 ! Rational surface anomalous perpendicular energy diffusivity profile
chi_t_prof=0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 ! Rational surface anomalous perpendicular ion momentum diffusivity profile
kappa_prof=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 ! Rational surface thermal conductivity profile (NOTE: set > 0 to override chi_p_prof)
! >>>
! >>> Input normalized layer parameters. If read_eq=f, each will individually override internal calcuation using above inputs
! >>>
inpr=0.0 ! Prantdl number. Set /= 0.0 to override internal calculation
inpe=0.0 ! electron viscosity
inQ=1.0 ! normalized ExB frequency. TO DO: update for mode rotation frequency calculation!
inQ_e=0.0 ! normalized electron diamagnetic frequency. Set /= 0.0 to override internal calculation
inQ_i=0.0 ! normalized ion diamagnetic frequency. Set /= 0.0 to override internal calculation
inc_beta=0.0 ! dimensionless measure of the plasma pressure. Set /= 0.0 to override internal calculation
inds=0.0 ! normalized ion sound radius, or normalized ion skin depth. Set /= 0.0 to override internal calculation
intau=1.0 ! ratio of ion to electron temperature
Q0=1.0 ! unnecessary placeholder variable for inQ?
delta_prime=(0.0,0.0) ! input Delta' for the growth rate calculation when read_eq=f, referenced to the minor radius (r_s*Delta')
delta_n_p=(0.01,0.01) ! delta offset used for jxb calculations. Default for latter is (1e-2,1e-2).
ingamma=(0.0,0.0) ! input (Re(Q),Im(Q)) to calculate inner layer Delta. Set /= 0.0 to override internal root finding
/

&SLAYER_CONTROL
inum=400 ! resolution to find error field thresholds.
jnum=100 ! resolution for 2d scan along with Q,omega.
knum=100 ! resolution for 2d scan along with the other.
Q_num=100 ! number of points per axis of the initial Re(Q),Im(Q) scan grid
scan_width=1.5 ! half-width of the Re(Q),Im(Q) scan window, in normalized Q
AMR_passes=4 ! number of adaptive refinement passes of the scan grid
!scan_center=0.0 ! Re(Q) center of the scan window. Unset: 0, or the middle of the Doppler-shifted branches of a coupled scan
msing_max=3 ! number of rational surfaces (counted from the core) to scan, and to couple when coupling_flag=t
dc_type="rfitzp" ! critical Delta model: "rfitzp" (default) or "none"
read_eq=t ! read the equilibrium and Delta' from STRIDE (ncfile) and profiles from the kinetic file (infile)
Pperp_Ptor_flag=t ! Use R. Fitzpatrick formalism (inc. anomalous diffusion) for growth rate calculation
coupling_flag=f ! solve the coupled multi-surface determinant instead of each surface separately. Requires read_eq=t
rotation_flag=t ! Doppler-shift each surface by its ExB rotation in the coupled determinant (root reported in the lab frame)
QPscan_flag=f ! scan (Q,P) space for delta and torque.
Qscan_flag=f ! scan Q space
QPescan_flag=f ! scan (Q,Pe) space for delta and torque.
Qbscan_flag=f ! scan (Q,beta) space for delta and torque.
onscan_flag=f ! scan (omega,n) space for error fields.
otscan_flag=f ! scan (omega,t) space for error fields.
ntscan_flag=f ! scan (n,te) space for error fields.
nbtscan_flag=f ! scan (n,bt) space for error fields.
parflow_flag=f ! set parallel flow on
PeOhmOnly_flag=t ! only include Pe from Ohm's law
Pe_flag=f ! if true, calculate classical inpe value from inpr and include in SLAYER run
layfac=0.02 ! layfac*EXP(ifac*ATAN2(AIMAG(Q-Q_e),REAL(Q-Q_e)) is added to Q_e if ABS(Q-Q_e)<layfac). Default is 0.02.
/

&SLAYER_OUTPUT
verbose=t ! prints progress to terminal
ascii_flag=f ! writes results to ascii files
bin_flag=f ! writes results to binary files
netcdf_flag=f ! writes results to netcdf files
est_gamma_flag=f ! Calculate and output growth rate estimate
match_gamma_flag=t ! match the layer Delta to Delta' and solve for the growth rate
stability_flag=f ! calculate delta dependence on complex Q
stabscan_flag=f ! Generate Re(Q),Im(Q) scan and output as ASCII
coupled_stabscan_flag=f ! uniform-grid scan of the coupled determinant, output as ASCII
amr_flag=t ! adaptive Re(Q),Im(Q) scan and root extraction for match_gamma_flag (results in the netcdf file)
br_th_flag=f ! Calculate br_th
/

&SLAYER_DIAGNOSE
riccati_out=f ! writes LSDOE Riccati integration to an ascii file
riccatiscan_flag=f
params_check=f ! prints the primary parameters to the terminal when they are calculated
bal_flag=f ! calculate the resonant field penetration threshold from torque balance
/
91 changes: 59 additions & 32 deletions input/slayer.in
Original file line number Diff line number Diff line change
@@ -1,44 +1,62 @@
&SLAYER_INPUT

!!! FOR READING IN ASCII TABLE, SET INPUT_FLAG = TRUE
input_flag=f ! reads profile quantities (n_e, t_e, etc.) from an ascii table
infile='' ! Path to ascii table of profile quantities read when using input_flag

!!! FOR MANUALLY ENTERING KINETIC QUANTITIES @ RATIONAL SURFACE, SET PARAMS_FLAG = TRUE
infile='' ! Path to the kinetic profile file (read_eq=t), or to an ascii table of surface quantities (input_flag=t)
ncfile='' ! Path to netCDF file of STRIDE outputs
params_flag=f ! calculates normalized parameters from profile quantities
! >>>
! >>> Input rational surface quantities
! >>>
mm=2 ! poloidal mode number
nn=1 ! toroidal mode number
n_e=7.77E+17 ! electron density [m^-3]
t_e=25.8 ! electron temperature [eV]
t_i=25.8 ! ion temperature [eV]
sval=2.0 ! magnetic shear at the layer
bt=1.0 ! toroidal field [T]
rs=0.17 ! minor radius of resonant surface [m]
R0=2.0 ! major radius of magnetic axis [m]
omega=5.45E+04 ! ExB frequency [1/s]
n_e=5.50E+19 ! electron density [m^-3]
t_e=1000.0 ! electron temperature [eV]
t_i=1000.0 ! ion temperature [eV]
sval=1.5 ! magnetic shear at the layer
bt=2.0 ! toroidal field [T]
rs=0.5 ! minor radius of resonant surface [m]
R0=1.67 ! major radius of magnetic axis [m]
omega=5.00E+03 ! ExB rotation frequency [rad/s]
l_t=0.11 ! temperature gradient scale length
l_n=0.25 ! density gradient scale length
qval=2.0 ! q of resonant surface
mu_i=2.0 ! ion mass ratio to proton ??
zeff=2.0 ! plasma Z_effective
inpr=10.0 ! Prantdl number
inpr_prof=10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0 ! Prandtl number profile
inpe=0.0 ! Electron viscosity (if > 0.0, Pe_flag=t will be overridden and this value used instead)

!!! IF INPUT_FLAG & PARAMS_FLAG ARE FALSE, MANUALLY ENTER DIMENSIONLESS QUANTITIES @ RATIONAL SURFACE HERE
inQ=23.0 ! normalized ExB frequency
inQ_e=2.0 ! normalized electron diamagnetic frequency
inQ_i=-2.0 ! normalized ion diamagnetic frequency
inc_beta=0.7 ! dimensionless measure of the plasma pressure
inds=6.0 ! normalized ion sound radius
intau=1.0 ! ion temperature divided by electron temperature
Q0=4.0 ! unnecessary placeholder variable for inQ?
delta_n_p=(0,0) ! complex delta offset used for jxb calculations. Default is (1e-2,1e-2).
mu_i=2.0 ! ion mass ratio to proton mass, 2 for deuterium plasma. Also used when read_eq=t
zeff=2.0 ! plasma Z_effective. Also used when read_eq=t (the kinetic file's Z_eff is not used)
dr_val=-0.1 ! GGJ resistive interchange index D_R (taken from STRIDE when read_eq=t)
dgeo_val=0.0 ! unused (the toroidal critical Delta was removed); accepted so older inputs still read
chi_p_prof=0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 ! Rational surface anomalous perpendicular energy diffusivity profile
chi_t_prof=0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 ! Rational surface anomalous perpendicular ion momentum diffusivity profile
kappa_prof=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 ! Rational surface thermal conductivity profile (NOTE: set > 0 to override chi_p_prof)
! >>>
! >>> Input normalized layer parameters. If read_eq=f, each will individually override internal calcuation using above inputs
! >>>
inpr=0.0 ! Prantdl number. Set /= 0.0 to override internal calculation
inpe=0.0 ! electron viscosity
inQ=1.0 ! normalized ExB frequency. TO DO: update for mode rotation frequency calculation!
inQ_e=0.0 ! normalized electron diamagnetic frequency. Set /= 0.0 to override internal calculation
inQ_i=0.0 ! normalized ion diamagnetic frequency. Set /= 0.0 to override internal calculation
inc_beta=0.0 ! dimensionless measure of the plasma pressure. Set /= 0.0 to override internal calculation
inds=0.0 ! normalized ion sound radius, or normalized ion skin depth. Set /= 0.0 to override internal calculation
intau=1.0 ! ratio of ion to electron temperature
Q0=1.0 ! unnecessary placeholder variable for inQ?
delta_prime=(0.0,0.0) ! input Delta' for the growth rate calculation when read_eq=f, referenced to the minor radius (r_s*Delta')
delta_n_p=(0.01,0.01) ! delta offset used for jxb calculations. Default for latter is (1e-2,1e-2).
ingamma=(0.0,0.0) ! input (Re(Q),Im(Q)) to calculate inner layer Delta. Set /= 0.0 to override internal root finding
/

&SLAYER_CONTROL
inum=400 ! resolution to find error field thresholds.
jnum=100 ! resolution for 2d scan along with Q,omega.
knum=100 ! resolution for 2d scan alont with the other.
knum=100 ! resolution for 2d scan along with the other.
Q_num=100 ! number of points per axis of the initial Re(Q),Im(Q) scan grid
scan_width=1.5 ! half-width of the Re(Q),Im(Q) scan window, in normalized Q
AMR_passes=4 ! number of adaptive refinement passes of the scan grid
!scan_center=0.0 ! Re(Q) center of the scan window. Unset: 0, or the middle of the Doppler-shifted branches of a coupled scan
msing_max=2 ! number of rational surfaces (counted from the core) to scan, and to couple when coupling_flag=t
dc_type="rfitzp" ! critical Delta model: "rfitzp" (default) or "none"
read_eq=f ! read the equilibrium and Delta' from STRIDE (ncfile) and profiles from the kinetic file (infile)
Pperp_Ptor_flag=t ! Use R. Fitzpatrick formalism (inc. anomalous diffusion) for growth rate calculation
coupling_flag=f ! solve the coupled multi-surface determinant instead of each surface separately. Requires read_eq=t
rotation_flag=t ! Doppler-shift each surface by its ExB rotation in the coupled determinant (root reported in the lab frame)
QPscan_flag=f ! scan (Q,P) space for delta and torque.
Qscan_flag=f ! scan Q space
QPescan_flag=f ! scan (Q,Pe) space for delta and torque.
Expand All @@ -49,18 +67,27 @@
nbtscan_flag=f ! scan (n,bt) space for error fields.
parflow_flag=f ! set parallel flow on
PeOhmOnly_flag=t ! only include Pe from Ohm's law
Pe_flag=f ! Not operational yet. If true, it will calculate classical inpe value from inpr and include in SLAYER run
Pe_flag=f ! if true, calculate classical inpe value from inpr and include in SLAYER run
layfac=0.02 ! layfac*EXP(ifac*ATAN2(AIMAG(Q-Q_e),REAL(Q-Q_e)) is added to Q_e if ABS(Q-Q_e)<layfac). Default is 0.02.
/

&SLAYER_OUTPUT
verbose=t ! prints progress to terminal
ascii_flag=t ! writes results to ascii files
ascii_flag=f ! writes results to ascii files
bin_flag=f ! writes results to binary files
netcdf_flag=f ! writes results to netcdf files
est_gamma_flag=t ! Calculate and output growth rate estimate
match_gamma_flag=t ! match the layer Delta to Delta' and solve for the growth rate
stability_flag=f ! calculate delta dependence on complex Q
stabscan_flag=f ! Generate Re(Q),Im(Q) scan and output as ASCII
coupled_stabscan_flag=f ! uniform-grid scan of the coupled determinant, output as ASCII
amr_flag=t ! adaptive Re(Q),Im(Q) scan and root extraction for match_gamma_flag (results in the netcdf file)
br_th_flag=f ! Calculate br_th
/

&SLAYER_DIAGNOSE
riccati_out=f ! writes LSDOE Riccati integration to an ascii file
params_check=t ! prints the primary parameters to the terminal when they are calculated
riccatiscan_flag=f
params_check=f ! prints the primary parameters to the terminal when they are calculated
bal_flag=f ! calculate the resonant field penetration threshold from torque balance
/
7 changes: 5 additions & 2 deletions install/DEPENDENCIES.inc
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,13 @@

# SLAYER
../slayer/delta.o: ../slayer/sglobal.o
../slayer/gslayer.o: ../slayer/delta.o ../slayer/sglobal.o
../slayer/growthrates.o: ../slayer/delta.o ../slayer/layerinputs.o ../slayer/params.o ../slayer/sglobal.o ../slayer/slayer_netcdf.o
../slayer/gslayer.o: ../slayer/delta.o ../slayer/layerinputs.o ../slayer/params.o ../slayer/sglobal.o ../slayer/slayer_netcdf.o
../slayer/layerinputs.o: ../equil/bicube.o ../equil/equil.o ../equil/spline.o ../pentrc/inputs.o ../slayer/params.o ../slayer/sglobal.o ../slayer/slayer_netcdf.o
../slayer/params.o: ../slayer/sglobal.o
../slayer/sglobal.o: ../equil/local.o
../slayer/slayer.o: ../slayer/delta.o ../slayer/params.o ../slayer/sglobal.o
../slayer/slayer.o: ../slayer/delta.o ../slayer/growthrates.o ../slayer/gslayer.o ../slayer/layerinputs.o ../slayer/sglobal.o
../slayer/slayer_netcdf.o: ../slayer/sglobal.o ../slayer/version.inc

# COIL
../coil/coil.o: ../coil/version.inc ../equil/bicube.o ../equil/fspline.o
Expand Down
2 changes: 1 addition & 1 deletion install/RULES.inc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ FCMULTI = $(FC) $(FFLAGS) -I../equil
$(FCMULTI) $(MODFLAG) ../multi -c $< -o $@

# SLAYER
FCSLAYER = $(FC) $(FFLAGS) $(OMPFLAG) -I$(MATHINC) -I$(NETCDFINC) -I../equil
FCSLAYER = $(FC) $(FFLAGS) $(OMPFLAG) -I$(MATHINC) -I$(NETCDFINC) -I../equil -I../slayer -I../pentrc
../slayer/%.o: ../slayer/%.f
$(FCSLAYER) $(MODFLAG) ../slayer -c $< -o $@
../slayer/%.o: ../slayer/%.F
Expand Down
13 changes: 12 additions & 1 deletion install/TARGETS.inc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,18 @@ rmatch: v neededdeps $(RMATCH_OBJS) equil lsode
$(call print_success,rmatch -> $(BINDIR)/rmatch)

# SLAYER
../slayer/version.inc:
@ver="`git describe --tags --match 'v[0-9]*'`"; \
if [ ! -f $@ ] || ! grep -F "'$$ver'" $@ >/dev/null 2>&1; then \
echo ">>> Updating version file"; \
echo " CHARACTER(len=*), PARAMETER :: version ='$$ver'" | tee $@; \
else \
echo ">>> Git version unchanged!"; \
fi
$(call print_success,version file updated: $@)

SLAYER_LIBS = \
-lpentrc \
-llsode \
-lequil \
$(MATHLIBS) \
Expand All @@ -308,7 +319,7 @@ SLAYER_LIBDIRS = \
-L$(LIBDIR) \
-L$(MATHDIR) \
-L$(NETCDFDIR)
slayer: v neededdeps $(SLAYER_OBJS) lsode equil
slayer: v neededdeps $(SLAYER_OBJS) lsode equil pentrc
mkdir -p $(BINDIR)
rm -f ../slayer/slayer
$(FCSLAYER) -o ../slayer/slayer $(SLAYER_OBJS) $(SLAYER_LIBDIRS) $(SLAYER_LIBS) $(LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion install/gen_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"rmatch": ["equil"],
"sum": ["equil"],
"multi": ["equil"],
"slayer": ["equil"],
"slayer": ["equil", "pentrc"],
"coil": ["equil"],
"gpec": ["equil", "vacuum", "pentrc", "coil", "slayer"],
}
Expand Down
Loading
Loading