agentsclimarketplace

Glm basics

Skill cxcscmu/SkillLearnBench/skills/human_authored/temperature-simulation/glm-basics

A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill glm-basics

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.8 KB, 692 tokens by cl100k_base, as published. Nobody here has run it

GLM Basics Guide

Overview

GLM (General Lake Model) is a 1D hydrodynamic model that simulates vertical temperature and mixing dynamics in lakes. It reads configuration from a namelist file and produces NetCDF output.

Suggested Skill Flow

For benchmark calibration tasks, use the GLM skills in this order:

  1. glm-basics: inspect files, confirm run mechanics, and identify the task's editable/configuration surface
  2. glm-calibration: search for a physically passing parameter set within the allowed scope
  3. glm-output: compute the final exact task metrics and write /root/metrics.json

This flow tends to work better than jumping straight into calibration or reporting without first checking the run setup and file layout. Once calibration has found a configuration that already passes every task metric, stop searching and move directly to glm-output rather than spending more runs polishing an already passing point.

Running GLM

cd /root
glm

GLM reads glm3.nml in the current directory and produces output in output/output.nc.

Input File Structure

FileDescription
glm3.nmlMain configuration file (Fortran namelist format)
bcs/*.csvBoundary condition files (meteorology, inflows, outflows)

Configuration File Format

glm3.nml uses Fortran namelist format with multiple sections:

&glm_setup
   sim_name = 'LakeName'
   max_layers = 500
/
&light
   Kw = 0.3
/
&mixing
   coef_mix_hyp = 0.5
/
&meteorology
   meteo_fl = 'bcs/meteo.csv'
   wind_factor = 1
   lw_factor = 1
   ch = 0.0013
/
&inflow
   inflow_fl = 'bcs/inflow1.csv','bcs/inflow2.csv'
/
&outflow
   outflow_fl = 'bcs/outflow.csv'
/

Modifying Parameters with Python

import re

def modify_nml(nml_path, params):
    with open(nml_path, 'r') as f:
        content = f.read()
    for param, value in params.items():
        pattern = rf"({param}\s*=\s*)[\d\.\-e]+"
        replacement = rf"\g<1>{value}"
        content = re.sub(pattern, replacement, content)
    with open(nml_path, 'w') as f:
        f.write(content)

# Example usage
modify_nml('glm3.nml', {'Kw': 0.25, 'wind_factor': 0.9})

Common Issues

IssueCauseSolution
GLM fails to startMissing input filesCheck bcs/ directory
No output generatedInvalid nml syntaxCheck namelist format
Simulation crashesUnrealistic parametersUse values within valid ranges

Best Practices

  • Always backup glm3.nml before modifying
  • Run GLM after each parameter change to verify it works
  • Check output/ directory for results after each run

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.