APSIM

Runs APSIM Next Generation crop simulations from weather and soil inputs to validated yield outputs.

155|6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill apsim-lzwei196
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: APSIM
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/APSIM
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill apsim-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, xarray, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running the APSIM Next Generation crop model correctly requires deep operational knowledge: converting global weather and soil datasets into APSIM's exact .met and layered soil formats, avoiding fatal unit traps (radiation in W/m² vs MJ/m², temperature in Kelvin, population per hectare vs per m²), assembling valid .apsimx JSON, and recovering from silent failures. This Skill externalizes that expertise so an AI agent can run, check, and validate real APSIM simulations end to end. ## Core Features & Use Cases - Deterministic pipeline tools: Five scripts cover the full workflow — convert_soil.py (HWSD/SoilGrids to APSIM soil JSON), convert_met.py (CMFD/NASA POWER/ERA5 to .met), build_apsimx.py (assemble .apsimx), run_apsim.py (execute the real .NET 8 binary), and parse_output.py (SQLite .db to CSV). - Diagnostic recovery: A preflight check verifies the binary, .NET runtime, and Python environment, and 20 symptom-to-remedy diagnostic triplets map known failure modes to fixes. - Validation conventions: dag.yaml defines headline outputs (Grain.Wt in g/m²) with obs-shape-aware metric rules, including mandatory detrending when comparing point simulations to regional yield aggregates like FAOSTAT or SPAM. - Use Case: Simulate wheat yield at a field site by converting NASA POWER weather and HWSD soil data, running APSIM with auto-sowing rules, and scoring grain yield against FAOSTAT national statistics with PBIAS and detrended correlation. ## Quick Start Run python preflight_check.py in this directory to verify the APSIM binary and environment, then ask the agent to simulate wheat yield at your site using the pipeline tools.

Frequently Asked Questions about APSIM

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an APSIM Next Generation crop simulation?

Convert weather data to .met format with convert_met.py, build soil JSON with convert_soil.py, assemble the .apsimx file with build_apsimx.py, then execute with run_apsim.py calling the apsim CLI binary. Run preflight_check.py first to verify the .NET 8 runtime and binary.

How to convert ERA5 or CMFD weather data to APSIM .met format?

Use convert_met.py, which handles the critical unit conversions: radiation from W/m² to MJ/m²/day (multiply by 0.0864), temperature from Kelvin to Celsius, and sub-daily rainfall summed to daily totals. The header must also include tav and amp metadata for the soil temperature model.

Why does my APSIM simulation produce massively inflated biomass?

The most common cause is supplying solar radiation in W/m² instead of MJ/m²/day, which inflates biomass 10-50x. Check diagnostic triplet dt_001 in diagnostics/triplets.yaml and verify radiation values fall in the typical 5-30 MJ/m²/day range.

What units does APSIM use for grain yield and plant population?

APSIM reports grain and biomass weights in g/m² (multiply by 10 for kg/ha, divide by 100 for t/ha). Sowing population is plants per m², not per hectare — supplying plants/ha values creates impossibly dense crops.

Can APSIM point simulations be compared to FAOSTAT or SPAM regional yields?

Yes, but regional aggregates are a regional_aggregate_time_series obs shape requiring detrended trend metrics and PBIAS, not raw NSE. National statistics carry a technology trend that a constant-management point simulation cannot reproduce.

What are the limitations of APSIM Next Generation for spatial modeling?

APSIM operates at single point or field scale with a 1-D soil column and daily timestep; it does not perform regional gridded aggregation, river routing, or internal weather generation. Regional estimates require running multiple point simulations and aggregating with area weights.