Skip to content
Skills Library
Science & research · Review & audit

glm-basics

/glm-basics

Set up and validate the GLM environment for Lake Mendota simulation. Use this skill to verify the configuration file exists, inspect current calibration parameters, and confirm all input data (meteorological forcing, field observations, initial profile) are accessible before running calibration.

Licence
MIT
Last repository change
02.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Set up and validate the GLM environment for Lake Mendota simulation. Use this skill to verify the configuration file exists, inspect current calibration parameters, and confirm all input data (meteorological forcing, field observations, initial profile) are accessible before running calibration.

Original author description

Set up and validate the GLM environment for Lake Mendota simulation. Use this skill to verify the configuration file exists, inspect current calibration parameters, and confirm all input data (meteorological forcing, field observations, initial profile) are accessible before running calibration.

How it works

  1. Overview
  2. Steps
Original SKILL.md headings · 147 lines, 492 words
SKILL.md preview
---
name: glm-basics
description: Set up and validate the GLM environment for Lake Mendota simulation. Use this skill to verify the configuration file exists, inspect current calibration parameters, and confirm all input data (meteorological forcing, field observations, initial profile) are accessible before running calibration.
---

## Overview
Before calibrating GLM parameters, establish a baseline understanding of:
- The configuration file structure and current parameter values
- Available input data and their formats
- The observation dataset that will be used for validation

## Steps

### 1. Inspect the GLM Configuration File

```bash
head -100 /root/glm3.nml
```

Look for the `&calibration` section and note the current values of:
- `Kw`, `coef_mix_hyp`, `wind_factor`, `lw_factor`, `ch`

Also confirm that `sw_factor`, `cd`, `ce`, initialization profile (`the_depths`, `the_temps`, `the_sals`), and simulation dates are unchanged.

### 2. Read Current Calibration Parameters

Create a Python script to extract current parameter values robustly:

```python
import re

def read_current_nml_parameters(nml_path, param_names):
    """
    Extract calibration parameters from GLM .nml file.
    
    Handles:
    - Parameters at line start or after whitespace
    - Scientific notation (e.g., 1.0e-4, 1e-3)
    - Parameters with or without leading/trailing spaces
    
    Returns dict of {param: float_value}, or raises ValueError if any param missing.
    """
    pattern_template = r'{param}\s*=\s*([\d.]+(?:[eE][+-]?\d+)?)'
    
    params = {}
    with open(nml_path, 'r') as f:
        content = f.read()
    
    for param in param_names:
        pattern = pattern_template.format(param=param)
        match = re.search(pattern, content)
        if not match:
            raise ValueError(f"Parameter '{param}' not found in {nml_path}")
        params[param] = float(match.group(1))
    
    print(f"Successfully read {len(params)} parameters from {nml_path}:")
    for p, v in params.items():
        print(f"  {p} = {v}")
    
    return params

# Test extraction
current_params = read_current_nml_parameters(
    '/root/glm3.nml',
    ['Kw', 'coef_mix_hyp', 'wind_factor', 'lw_factor', 'ch']
)
```

### 3. Verify Input Data Availability

```python
import os
import pandas as pd

# Check meteorological/hydrological forcing
bcs_path = '/root/bcs/'
if os.path.isdir(bcs_path):
    files = os.listdir(bcs_path)
    print(f"Found {len(files)} forcing files in {bcs_path}")
    print(f"Files: {sorted(files)}")
else:
    raise FileNotFoundError(f"{bcs_path} not found")

# Check observation data
obs_path = '/root/field_temp_oxy.csv'
if os.path.exists(obs_path):
    obs_df = pd.read_csv(obs_path)
    print(f"\nObservation file: {obs_path}")
    print(f"Shape: {obs_df.shape}")
    print(f"Columns: {list(obs_df.columns)}")
    print(f"Date range: {obs_df.iloc[0:5]}")
else:
    raise FileNotFoundError(f"{obs_path} not found")

# Check output directory
output_dir = '/root/output'
if os.path.isdir(output_dir):
    print(f"\nOutput directory exists: {output_dir}")
else:
    os.makedirs(output_dir, exist_ok=True)
    print(f"Created output directory: {output_dir}")
```

### 4. Validate Calibration Parameter Ranges

```python
def validate_ranges(params, ranges):
    """
    Check that all parameters fall within published calibration ranges.
    
    Args:
        params (dict): Parameter name → value
        ranges (dict): Parameter name → (min, max) tuple
    
    Returns:
        bool: True if all params in range
    
    Raises:
        ValueError: If any param out of range
    """
    for param, value in params.items():
        if param in ranges:
            min_val, max_val = ranges[param]
            if not (min_val <= value <= max_val):
                raise ValueError(
                    f"{param}={value} is outside range [{min_val}, {max_val}]"
                )
    print("All parameters are within published calibration ranges.")
    return True

ranges = {
    'Kw': (0.1, 0.5),
    'coef_mix_hyp': (0.3, 0.7),
    'wind_factor': (0.7, 1.3),
    'lw_factor': (0.7, 1.3),
    'ch': (0.0005, 0.002)
}

validate_ranges(current_params, ranges)
```

### 5. Summary

After completing these steps, you should have:
✓ Confirmed the configuration file is readable and contains all required parameters  
✓ Extracted current calibration parameter values (with validation of scientific notation)  
✓ Verified that forcing data and observation data are accessible  
✓ Confirmed all current parameter values are within published ranges  
✓ Prepared the output directory for simulation results  

You are now ready to proceed to `glm-calibration` to adjust parameters and run the model.

Versions

RepositoryScoreLicence
This page · cxcscmu/SkillLearnBench95MIT
benchflow-ai/skillsbench100Apache-2.0
cxcscmu/SkillLearnBench100MIT

Database snapshot: 13.11.2026 · package version 7957b88c5acc (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100glm-lake-calibration
    Calibrate the General Lake Model (GLM) for lake temperature simulation. Use this skill whenever calibrating GLM parameters, running GLM simulations, or tuning Kw, coef_mix_hyp, wind_factor, lw_factor, or ch to match observed water temperature profiles. Covers Lake Mendota and similar dimictic lakes.
  • 90glm_lake_mendota_setup
    Use this skill to understand the GLM (General Lake Model) configuration for Lake Mendota, including how to read and modify the glm3.nml file, what parameters are allowed to change, and how the model is structured. Apply this before running or calibrating GLM.
  • 100glm-calibration
    Calibrate GLM parameters for water temperature simulation. Use when you need to adjust model parameters to minimize RMSE between simulated and observed temperatures.
  • 100glm-output
    Read and process GLM output files. Use when you need to extract temperature data from NetCDF output, convert depth coordinates, or calculate RMSE against observations.
  • 100glm
    ☕️ cafe · Legacy instructions for delegating work to GLM, a sunset model that runs headless inside Claude Code. Use only when the user explicitly says "/glm", "ask glm", "have glm build/do this", "let glm", or "delegate to glm"; never invoke it automatically for frontend/UI or other work.
  • 98glm-vision
    让纯文本模型(如 glm-5.3)也能"看图":调用智谱 GLM 视觉模型(glm-5.3-flash)把图片转成详细文字描述,或回答针对图片的问题(OCR、截图/图表/UI/报错图分析)。当 read_image 报 "does not declare image input"、用户贴图被拒("当前模型不适合放图片")、用户让看剪贴板/截图/图片路径、或要求识图时使用。

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.