cam-skill
NewDeep skill / knowledge package for the Community Atmosphere Model (CAM). SKILL.md routing hub plus reference/ deep-dive docs covering architecture, physics packages, CESM case workflow, history output, debugging, and contributing.
Overview
CAM (Community Atmosphere Model) Complete Guide
CAM = Community Atmosphere Model, the atmospheric component of the
Community Earth System Model (CESM).
Maintainer: NSF NCAR / Atmosphere Model Working Group (AMWG)
Source: https://github.com/ESCOMP/CAM
Wiki: https://github.com/ESCOMP/CAM/wiki
Docs: https://ncar.github.io/CAM/doc/build/html/
Scientific reference: Danabasoglu et al. 2020, JAMES (CESM2 paper),
doi:10.1029/2019MS001916
Skill author: Koutian Wu ([email protected])
What CAM does: Solves the primitive equations of atmospheric motion on a global grid, coupled to a full physics suite (radiation, turbulence, clouds, convection, microphysics, aerosols, optionally chemistry). Runs as the atmospheric component of CESM, paired with land (CLM), ocean (POP / MOM6), sea ice (CICE), and runoff (MOSART) components. Three main scientific configurations: standard CAM (climate), CAM-Chem (tropospheric chemistry), WACCM (whole atmosphere with stratosphere and mesosphere chemistry).
Who this skill is for: Agents, students, and researchers who want to download, build, configure, run, customize, debug, and contribute to CAM inside the CESM modeling framework.
Quick Decision Tree
"What do I need?"
│
├─ 🆕 First time, what is CAM and how do I get the code?
│ └─ Read: reference/getting-started.md
│ (CESM vs CAM-standalone, ESCOMP/CAM branches, git-fleximod, prereqs)
│
├─ 🚀 I want to run a CAM case end-to-end
│ └─ Read: reference/running-cesm-case.md
│ (create_newcase, case.setup, case.build, case.submit, xmlchange)
│
├─ 🧩 I want to understand how CAM is organized
│ └─ Read: reference/architecture.md
│ (src tree, dycores FV/SE/MPAS, physics package layer, CCPP-style suites)
│
├─ ⚙️ I want to know what physics is in CAM6 / CAM7
│ └─ Read: reference/physics-packages.md
│ (CLUBB, MG2/MG3, ZM, RRTMG/RRTMGP, MAM4, gravity wave drag, COSP)
│
├─ 🌫️ I'm running CAM-Chem or WACCM (chemistry, stratosphere)
│ └─ Read: reference/chemistry-waccm.md
│ (MOZART-T1/TS1, WACCM6 high-top, WACCM-X ionosphere, gravity waves)
│
├─ 📤 I need to control output / add a history field
│ └─ Read: reference/output-and-history.md
│ (h0/h1/.../h9 tapes, fincl/fexcl, mfilt, nhtfrq, addfld/outfld, IOPs)
│
├─ 🐛 The build fails / case crashes / output looks wrong
│ └─ Read: reference/debugging.md
│ (DEBUG=TRUE, atm.log vs cesm.log, cam_pio_dump_field, snapshots, timing)
│
└─ 🤝 I want to submit a pull request to ESCOMP/CAM
└─ Read: reference/contributing-pr.md
(fork, cam_development, ChangeLog, Externals_CAM.cfg, code review)What's Inside CAM (cam_development branch)
CAM/ ← top level (ESCOMP/CAM)
├── bin/
│ └── git-fleximod ← external manager (replaces manage_externals)
├── cime_config/ ← CIME glue: compsets, namelist defaults, build
│ ├── config_compsets.xml
│ ├── config_pes.xml
│ └── buildnml · buildlib
├── doc/
│ └── ChangeLog ← MUST update on every PR
├── Externals_CAM.cfg ← pins atmospheric_physics, chem_proc, MPAS, etc.
├── src/
│ ├── control/ ← top-level driver, namelist read, time control
│ ├── physics/
│ │ ├── cam/ ← shared physics (cam_diagnostics, physpkg, tphysbc)
│ │ ├── clubb/ ← CLUBB unified turb / shallow conv / cloud macro
│ │ ├── rrtmg/ · rrtmgp/ ← longwave + shortwave radiation
│ │ ├── carma/ ← sectional aerosol / cloud microphysics
│ │ └── waccm/ ← WACCM-specific (gw_drag, qbo, sad, lbc)
│ ├── chemistry/
│ │ ├── mozart/ ← MOZART chemistry preprocessor outputs
│ │ ├── modal_aero/ ← MAM3/MAM4/MAM7 modal aerosol
│ │ └── pp_*/ ← per-mechanism preprocessed code
│ ├── dynamics/
│ │ ├── fv/ ← Finite Volume (lat-lon)
│ │ ├── se/ ← Spectral Element (cubed sphere; CAM7 default)
│ │ ├── mpas/ ← MPAS-A unstructured Voronoi
│ │ ├── fv3/ ← GFDL FV3 (cubed sphere)
│ │ └── eul/ · sld/ ← legacy Eulerian / semi-Lagrangian
│ ├── infrastructure/ ← physics_buffer, cam_history, cam_pio, abortutils
│ └── advection/
├── bld/
│ ├── build-namelist ← perl namelist generator
│ ├── namelist_files/
│ │ ├── namelist_definition.xml ← every namelist variable defined here
│ │ └── namelist_defaults_cam.xml ← per-compset defaults
│ └── configure ← legacy; CAM7 uses CIME directly
├── test/ ← CIME tests + unit tests
└── tools/CAM is not a runnable program by itself. You build and run it through CIME (Common Infrastructure for Modeling the Earth) inside a CESM checkout: $CESMROOT/cime/scripts/create_newcase .... See reference/running-cesm-case.md.
Critical Rules
- Never clone the `main` branch alone.
ESCOMP/CAM:maincontains only a
README and Code of Conduct. Source code lives on: - cam_development (active dev, unsupported) - cam_cesm2_2_rel (CESM2.2 release) - cam_cesm2_1_rel (CESM2.1 release) - Tagged release branches like cam6_3_162
After checkout, run bin/git-fleximod update to pull externals (atmospheric_physics, chem_proc, MPAS, etc.). For science work, use a release tag, not cam_development.
- You almost always want a CESM checkout, not a CAM-standalone checkout.
Clone ESCOMP/CESM and let its Externals.cfg pull CAM. The CAM-standalone path exists but is for CAM-only developers and still requires CIME.
- CAM7 dropped the FV dycore. CAM7 production runs use the Spectral
Element (SE) dycore on a cubed sphere (ne30pg3 is the standard 1-degree grid). FV is still available in CAM6.
- Edit XML, not bash. CAM cases are configured by
xmlchangeediting
env_*.xml files in the case directory. Do not edit the case bash scripts directly: those are regenerated by case.setup.
- `case.build` is heavy. It uses parallel make and can saturate a node.
On NCAR Derecho run qcmd -- ./case.build, never on a login node.
- Master MPI task writes to `atm.log`. Other tasks write to `cesm.log`.
Buffered output may not flush at crash. To see a fatal error, read both, and search for endrun calls.
- History file tapes are numbered `h0` through `h9` in CAM6, but **CAM7
splits each tape into h0i (instantaneous) and h0a (averaged)** because their timestamps differ. Set nhtfrq, mfilt, and fincl1..fincl10 per tape; empty_htapes=.true. disables defaults so you write only what you ask for.
- Every PR to ESCOMP/CAM needs a ChangeLog entry. Edit
doc/ChangeLog with the standard heading (Tag, Originator, Date, Purpose, Bugs fixed, Files changed, Test status). Without it, the PR will not be reviewed.
Quick Start (CESM2.2 + CAM6, 1-month FHIST run on Derecho)
# 1. Get CESM (which pulls CAM via Externals)
git clone -b release-cesm2.2.2 https://github.com/ESCOMP/CESM
cd CESM
./bin/git-fleximod update # or: ./manage_externals/checkout_externals (older)
# 2. Create a case (1-degree FV CAM6, AMIP-like SST)
cd cime/scripts
./create_newcase \
--case /glade/derecho/scratch/$USER/cases/F2000climo.f09.test \
--compset F2000climo \
--res f09_f09_mg17 \
--machine derecho --project $PROJECT
cd /glade/derecho/scratch/$USER/cases/F2000climo.f09.test
# 3. Set up, change run length, build, submit
./case.setup
./xmlchange STOP_OPTION=nmonths,STOP_N=1
./xmlchange JOB_WALLCLOCK_TIME=01:00:00
qcmd -- ./case.build
./case.submit
# 4. Find output
./xmlquery RUNDIR,DOUT_S_ROOT
ls $RUNDIR/*.cam.h0.*.nc→ Full walkthrough: reference/running-cesm-case.md.
Reference Documents
| Document | What's inside |
|---|---|
reference/getting-started.md | CESM vs CAM-standalone, ESCOMP branches, git-fleximod, externals, prereqs |
reference/architecture.md | src tree, dycores (FV / SE / SE-CSLAM / MPAS / FV3), physics layer, infrastructure (cam_history, physics_buffer) |
reference/running-cesm-case.md | create_newcase, env_*.xml, case.setup / build / submit, xmlchange, compsets, resolutions |
reference/physics-packages.md | CAM6 suite: CLUBB, MG2, MG3, ZM, RRTMG, RRTMGP, MAM4, GW drag, COSP. Per-package switches |
reference/chemistry-waccm.md | CAM-Chem (MOZART-T1, TS1), WACCM6 (high-top, MOZART-TSMLT1), WACCM-X (ionosphere) |
reference/output-and-history.md | h0/h1/... tapes, CAM7 i/a split, fincl/fexcl, mfilt, nhtfrq, addfld/outfld, IOPs, COSP |
reference/debugging.md | DEBUG=TRUE, atm.log/cesm.log, endrun, cam_pio_dump_field, snapshots, timing mismatches, mass conservation |
reference/contributing-pr.md | Fork, branch off cam_development, ChangeLog format, Externals_CAM.cfg, code review committee, aux_cam tests |
Where this skill comes from
Grounded in:
ESCOMP/CAMGitHub README and wiki- CAM7.0 / CAM6.3 / CAM6 User's Guides at https://ncar.github.io/CAM/doc/build/html/
- CESM2 description paper: Danabasoglu et al. 2020, JAMES, doi:10.1029/2019MS001916
- CAM6 physics: Bogenschutz et al. 2018 JAMES (CLUBB), Gettelman & Morrison 2015 (MG2), Liu et al. 2016 (MAM4)
- CESM Quickstart: https://escomp.github.io/CESM/release-cesm2/
When a source could not be fetched, the relevant reference doc says so and links out.
Install & Usage
mkdir -p .claude/skillsmkdir -p .claude/skills && curl -o .claude/skills/cam-skill.md https://raw.githubusercontent.com/earth-space-ai/cam-skill/main/SKILL.md/cam-skillFrequently Asked Questions
What is cam-skill?
Deep skill / knowledge package for the Community Atmosphere Model (CAM). SKILL.md routing hub plus reference/ deep-dive docs covering architecture, physics packages, CESM case workflow, history output, debugging, and contributing.
How to install cam-skill?
To install cam-skill, create the .claude/skills directory in your project, then run the curl command to download the skill file. Once installed, invoke it in Claude Code with /cam-skill.
What is cam-skill best for?
cam-skill is a community categorized under Documentation. Created by earth-space-ai.