← 返回
未分类 中文

glm-basics

Basic usage of the General Lake Model (GLM) for lake temperature simulation. Use when you need to run GLM, understand input files, or modify configuration pa...
通用湖泊模型(GLM)的基础用法,用于湖泊温度模拟。适用于需要运行GLM、理解输入文件或修改配置等场景。
wu-uk wu-uk 来源
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 308
下载
💾 0
安装
1
版本
#latest

概述

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.

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

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 22:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 277 📥 57,473
professional

All-Market Financial Data Hub

financial-ai-analyst
基于东方财富数据库,支持自然语言查询金融数据,覆盖A股、港股、美股、基金、债券等资产,提供实时行情、公司信息、估值、财务报表等,适用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,满足机构与个人需求。返回结果为
★ 122 📥 41,409
professional

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 186 📥 62,071