Skip to content

bioepic-data/ecosim-agent / .agents/skills/ecosim-natural-plant-mgmt

ecosim-natural-plant-mgmt

Verified

Prepare, validate, and edit EcoSIM plant management inputs using pft_mgmt_in NetCDF, editable Excel workbooks, and optional PlantMgmtWriter.py JSON files. Use when creating or checking natural PFT management data, converting pft-mngt NetCDF to an Excel sheet for editing, converting edited Excel back to JSON or NetCDF, validating pft_type/pft_pltinfo/pft_mgmt entries, or preparing PlantMgmtWriter.py inputs for EcoSIM.

EcoSIM Natural Plant Management

Overview

Use this skill to build, validate, or edit EcoSIM pft_mgmt_in inputs for natural ecosystems. Natural PFTs normally need planting information; tree PFTs also receive an annual 1% thinning rate spread uniformly over 12 monthly events. Existing NetCDF files can be exported to an Excel workbook for editing, then converted back to JSON or NetCDF.

Read references/plant_mgmt_contract.md when you need exact NetCDF dimensions, Excel sheet columns, variable names, string formats, thinning event fields, or JSON examples.

Workflow

  1. Before selecting PFTs for new or revised site vegetation data, deliberately search site literature and site modeling studies for significant nitrogen-fixing vegetation. Follow the required N-fixer evidence review, even when the land-cover label or existing template contains only grass or non-fixing trees. Record the evidence and the inclusion/omission decision; distinguish species presence, ecological importance, measured fixation and model assumptions. Then identify active PFTs for each topo unit and validate EcoSIM vegetation codes with $ecosim-vegetation-code against the selected parameter table.
  2. Choose the editing path:
    • For an existing .nc, export to Excel, edit the workbook, then convert the edited workbook back to JSON or NetCDF.
    • For a new file, create either JSON directly or an Excel workbook matching the contract schema.
  3. Set pft_dflag = 0 for constant natural vegetation unless year-specific PFT composition or management is needed. With pft_dflag = 0, EcoSIM uses record 1. Store one reusable record (with a valid placeholder year for the JSON/Excel bridge), rather than duplicating it for each forcing year. This is constant management, not constant biomass, species shares, or an imposed ecosystem equilibrium. In the current reader, initial planting is read at initialization and management events are reread from record 1; subsequent annual regeneration is a model process. With pft_dflag = 1, the selected PlantInfoMod.F90 matches the forcing year (yeari) to the NetCDF year record.
  4. Set each topo unit NZ to the active PFT count. Do not exceed maxpfts = 5; only the first NZ PFT entries matter.
  5. For each PFT, set pft_type to the validated six-character EcoSIM code. EcoSIM will use the first four characters plus the grid Koppen code when KoppenClimZone_col > 0, but keep the full validated code for clarity.
  6. For planting, use DDMMYYYY = "01019999" unless the user provides a site-specific date. Derive Planting_population as plants, shoots, tillers, or stems per square meter and Planting_depth in meters.
  7. For non-tree natural PFTs, set mgmt empty. For tree PFTs, add 12 monthly thinning events using FractionCut = 0.01 / 12 = 0.0008333333.

Conversion Commands

Use the bundled bridge for NetCDF, Excel, and JSON conversions:

.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py nc-to-xlsx pft-mngt.nc pft-mngt.xlsx
.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py xlsx-to-json pft-mngt.xlsx pft-mngt.json
.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py xlsx-to-nc pft-mngt.xlsx pft-mngt-edited.nc --json-output pft-mngt-edited.json

JSON remains supported. To create NetCDF directly from JSON, use either the bridge or PlantMgmtWriter.py:

.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py json-to-nc input.json output.nc
.venv-cmip6/bin/python applications/notebooks/scripts/PlantMgmtWriter.py input.json output.nc

Evidence Rules

  • Search the web or literature for typical density and planting depth when values are not provided. Cite sources in the response or derivation note.
  • Prefer species-specific stand density, seedling density, stem density, tiller density, or plant density. Convert all density units to plants m-2.
  • Avoid substituting percent cover, LAI, biomass, or seeding rate for plant density unless no better source exists; if used, label it as an assumption.
  • Convert depths to meters. If evidence is weak, use conservative defaults only with an explicit note: herbaceous PFTs often need shallow depths, tree seedlings need a larger initial depth.

Tree Thinning Convention

Apply monthly thinning only to tree PFTs such as ndlf, ndld, bdlf, bdln, bdlw, bspr, dfir, jpin, lpin, tasp, and woak. Treat bush, busn, and shru as non-tree woody PFTs unless the user asks to include woody shrub thinning.

Use these monthly event dates with year 0000:

31010000 28020000 31030000 30040000 31050000 30060000
31070000 31080000 30090000 31100000 30110000 31120000

Each thinning event should use:

{
  "iHarvType": 0,
  "jHarvType": 0,
  "CutHeight": 1000.0,
  "FractionCut": 0.0008333333,
  "FineFractionLeafHarvested_pft": 1,
  "FineFractionNonleafHarvested_pft": 1,
  "StalkFractionHarvested_pft": 1,
  "StandeadFractionHarvested_pft": 0,
  "FineFractionLeafHarvested_col": 0,
  "FineFractionNonleafHarvested_col": 0,
  "StalkFractionHarvested_col": 0,
  "StandeadFractionHarvested_col": 0
}

This represents natural mortality/thinning without ecosystem biomass export. Flag the mass-flow assumption if changing ecosystem-level export fractions.

For harvested biomass, the ecosystem-level harvest fraction applies to the harvested component, not to the original component pool. Litter return is:

component_pool * pft_harvest_fraction * (1 - ecosystem_harvest_fraction)

For transient yearly schedules, prefer actual calendar years in DDMMYYYY if exact day-of-year alignment matters. The selected PlantInfoMod.F90 treats year 0000 as a leap year when converting dates to ordinal day.

Crop harvest and legacy files

For managed crops, check the consuming branch's PlantDisturbsMod.F90 as well as the reader. A grain-harvest flag with zero PFT removal or zero ecosystem fine-nonleaf export does not encode intended grain export. Check these fractions separately from termination, cutting height, and population fraction. Record any benchmark convention adopted; 0.95 grain export is not a universal default.

The bridge accepts comma-separated, whitespace-separated, and mixed planting strings, matching Fortran list-directed input. Preserve dates and values during normalization and verify NetCDF readback. Validate legacy crop identifiers against the active catalog and grid climate before migrating them.

Validation

Run the bridge round trip on a scratch path and inspect the decoded JSON:

.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py nc-to-json input.nc /tmp/pft-mgmt.json
.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py nc-to-xlsx input.nc /tmp/pft-mgmt.xlsx
.venv-cmip6/bin/python .agents/skills/ecosim-natural-plant-mgmt/scripts/plant_mgmt_excel_bridge.py xlsx-to-nc /tmp/pft-mgmt.xlsx /tmp/pft-mgmt-roundtrip.nc --json-output /tmp/pft-mgmt-roundtrip.json

For fixed-width character fields, inspect raw bytes with automatic masking disabled in addition to decoded JSON. Populate active PFT names, planting strings and management rows with space padding compatible with Fortran; verify only the slots/events selected by NZ and nmgnts when auditing an existing file. Unused fill slots are not active management errors. Refer to ../ecosim-soil-mgmt/references/soil_mgmt_contract.md under "Fixed-width string compatibility" for the NUL-padding failure mechanism and repair validation.

Verify that pft_dflag, year, NH1/NV1/NH2/NV2/NZ, pft_type, pft_pltinfo, nmgnts, and pft_mgmt exist; NZ equals active PFT count; nmgnts equals populated management rows; non-tree PFTs have zero management events unless explicitly managed; tree PFTs have 12 thinning events when using the natural-tree convention.

canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall