agentleFS
AI-ModConAI-ModCon/genesis-skills/skills/plasma-sim-skills/gs2/SKILL.md

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.

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
  1. Very specific:

    If your HPC system is not in Makefiles/, create a new Makefile.$GK_SYSTEM.

    line 26
  2. Distinctive:

    Start from an existing example rather than writing from scratch:

    line 53

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 Makefiles

If 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):

NamelistPurpose
knobsTimestep, beta, run duration
species_parameters_NPer-species mass, charge, temperature, density
theta_grid_knobsMagnetic geometry / poloidal grid
fields_knobsField equation algorithm
dist_fn_knobsDistribution function evolution
collisions_knobsCollision operator
kt_grids_knobsPerpendicular wavenumber grid type
init_g_knobsInitial condition for distribution function
gs2_diagnostics_knobsOutput frequency and diagnostics
hyper_knobsHyperviscosity/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 --restart

Output 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 running

Common build flags:

make -I Makefiles DEBUG=on       # debug build
make -I Makefiles USE_MPI=on     # explicit MPI enable

Additional Resources

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.