gs2
Skill30 starsChanged 51 days agoBSD-2-ClauseView on GitHub
Gyrokinetics simulation code GS2. Use when installing GS2, writing or modifying GS2 input namelists, configuring species/grid/field/collision parameters, or launching GS2 runs on local machines or HPC clusters.
In this repository30 other files it gives its agents.
- skills/academy/agents.mdAGENTS.md
- academySkill
- amsc-data-movement-apiSkill
- amsc-magSkill
- amsc-python-clientSkill
- globus-computeSkill
- i2-apiSkill
- iri-apiSkill
- skill-explorerSkill
- croissant-validatorSkill
- datacard-generatorSkill
- hdmf-schema-builderSkill
- skill-creatorSkill
- well-convertSkill
- card-eval-updaterSkill
- agentic-vulnerabilities-scanSkill
- ai-fingerprintSkill
- battleprintSkill
- fingerprintingSkill
- uncertainty-quantificationSkill
- uq-metrics-evaluatorSkill
- skill-searchSkill
- auroraSkill
- frontierSkill
- pbsSkill
- perlmutterSkill
- slurmSkill
- literature-searchSkill
- multi-agent-systemsSkill
- gkeyllSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If your HPC system is not in Makefiles/, create a new Makefile.$GK_SYSTEM.
- Distinctive: line 53
Start from an existing example rather than writing from scratch:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GS2 — Gyrokinetics Simulation Code
GS2 is an Eulerian gyrokinetic flux-tube code for studying low-frequency turbulence and instabilities in magnetized plasmas. It solves the nonlinear gyrokinetic equation for multiple species with optional electromagnetic fields.
Installation
# Clone with all submodules
git clone --recurse-submodules https://bitbucket.org/gyrokinetics/gs2.git
cd gs2
# Set the system name (see references/installation.md for supported systems)
export GK_SYSTEM=your_system_name
# Build
make -I MakefilesIf your HPC system is not in Makefiles/, create a new Makefile.$GK_SYSTEM. See references/installation.md for dependencies, supported systems, and build flags.
Input File Basics
GS2 uses Fortran namelist format (.in files):
&namelist_name
parameter = value ! inline comments allowed
/Key namelists (order in file does not matter):
| Namelist | Purpose |
knobs | Timestep, beta, run duration |
species_parameters_N | Per-species mass, charge, temperature, density |
theta_grid_knobs | Magnetic geometry / poloidal grid |
fields_knobs | Field equation algorithm |
dist_fn_knobs | Distribution function evolution |
collisions_knobs | Collision operator |
kt_grids_knobs | Perpendicular wavenumber grid type |
init_g_knobs | Initial condition for distribution function |
gs2_diagnostics_knobs | Output frequency and diagnostics |
hyper_knobs | Hyperviscosity/hyperresistivity |
Start from an existing example rather than writing from scratch:
ls tests/linear_tests/cyclone_itg_collisional/See references/namelists.md for parameter details.
Running Simulations
# Validate input before running
gs2 --check-input run.in
# Serial run
gs2 run.in
# MPI parallel run
mpirun -np 128 gs2 run.in
# Restart from checkpoint
mpirun -np 128 gs2 run.in --restartOutput goes to run.out (text) and run.nc (NetCDF diagnostics).
See references/running.md for MPI decomposition strategies, HPC job scripts, convergence checks, and restart workflow.
Quick Reference
gs2 --help # list all command-line options
gs2 --check-input # validate namelists without runningCommon build flags:
make -I Makefiles DEBUG=on # debug build
make -I Makefiles USE_MPI=on # explicit MPI enableAdditional Resources
- Installation details
- Namelist parameter reference
- Running and HPC workflow
- GS2 docs: https://gyrokinetics.gitlab.io/gs2/
- Namelist reference: https://gyrokinetics.gitlab.io/gs2/page/namelists/index.html
- Source: https://bitbucket.org/gyrokinetics/gs2
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

