Back to skills
SKILL.md
Docs
ASecurity> **Stage ID**: s1_project_setup > **Pipeline order**: 1 of 10 > **Depends on**: none
- 200 stars
- 0 votes
- 0 copies
- 2 views
- Added September 11, 2026
Works with
Security analysis
100/100Pro scans all 18 files and shows the line behind each finding
npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-codeAre you the author of Docs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/lzwei196-docs-657d9ed9)# Project Structure Setup — Skill Document
> **Stage ID**: s1_project_setup
> **Pipeline order**: 1 of 10
> **Depends on**: none
## Purpose
Create the LDNDC project directory structure and generate the master `project.xml` configuration file that defines simulation schedule, geographic coordinates, input file sources, and output destinations. All subsequent stages depend on this structure existing.
## Prerequisites
Before starting this stage, verify:
- [ ] LDNDC binary is installed and accessible at the expected path
- [ ] Target output directory parent exists and is writable
- [ ] Basin coordinates (lat/lon) and simulation period (start/end dates) are known
- [ ] Python environment activated: `source KISSPATH_PYTHON_ENV/bin/activate`
## Inputs
| Input | Type | Source | Description |
|-------|------|--------|-------------|
| project_dir | directory | User-specified | Root directory for this LDNDC simulation |
| basin_name | string | User-specified | Identifier used for file naming |
| lat | number | Basin delineation or user | Latitude in decimal degrees |
| lon | number | Basin delineation or user | Longitude in decimal degrees |
| start_date | string | User-specified | Simulation start (YYYY-MM-DD) |
| end_date | string | User-specified | Simulation end (YYYY-MM-DD) |
## Procedure
### Step 1: Create project directory structure
```bash
python tools/s1_project_setup/create_project_structure.py
```
Set `project_dir` and `basin_name` before running. This creates:
```
{project_dir}/
input/
output/
```
**Expected result**: Directory exists with `input/` and `output/` subdirectories.
**If this fails**: Check parent directory exists and is writable.
### Step 2: Generate project.xml
```bash
python tools/s1_project_setup/generate_project_xml.py
```
Set `project_dir`, `lat`, `lon`, `start_date`, `end_date` before running.
**Expected result**: `project.xml` exists at `{project_dir}/project.xml` with content like:
```xml
<ldndcproject id="0" lat="33.5" lon="117.2">
<schedule time="2000-01-01/24 -> 2010-12-31"/>
<input>
<sources sourceprefix="input/">
<site source="site.xml"/>
<event source="mana.xml"/>
<setup source="setup.xml"/>
<climate source="climate.txt"/>
<airchemistry source="airchem.txt"/>
<speciesparameters source="parameters_species.xml"/>
<siteparameters source="parameters_site.xml"/>
</sources>
<attributes use="0">
<airchemistry endless="yes"/>
</attributes>
</input>
<output>
<sinks sinkprefix="output/"/>
</output>
</ldndcproject>
```
**If this fails**: See diagnostic triplet dt_001.
## Expected Outputs
| Output | Path | Verification |
|--------|------|--------------|
| Project directory | `{project_dir}/` | Directory exists with input/ and output/ subdirs |
| project.xml | `{project_dir}/project.xml` | Well-formed XML; `xmllint --noout project.xml` returns 0 |
## Validation Checks
1. **Directory structure**: Verify `input/` and `output/` exist inside project_dir
2. **XML validity**: Parse project.xml; check it has `ldndcproject`, `schedule`, `input`, `output` elements
3. **Schedule dates**: Verify start_date < end_date and both are valid ISO 8601 dates
4. **Source prefix**: Verify `sourceprefix` ends with `/`
## Common Pitfalls
> **PITFALL**: sourceprefix missing trailing slash
> The `sourceprefix` attribute in project.xml must end with `/`. Without it, LDNDC concatenates prefix+filename without a separator (e.g., `inputsite.xml` instead of `input/site.xml`).
> **Do this instead**: Always ensure sourceprefix = "input/"
> See diagnostic triplet dt_001 for full details.
> **PITFALL**: Using absolute paths in project.xml
> If project.xml uses absolute paths and the project is moved to a different location, all paths break. Use relative paths from the project.xml directory.
> **Do this instead**: Use relative sourceprefix (e.g., "input/") and run LDNDC from the project directory.
---
*This skill document is part of the ldndc-knowledge-infrastructure package.*
*Stage 1 of 10 | Tools used: create_project_structure, generate_project_xml | Related triplets: dt_001*
Files in this skill
- REFERENCES.md
- format_spec.yaml
- model_couplings.yaml
- papers.json
- s10_vic_coupling_skill.md
- s1_installation_skill.md
- s1_project_setup_skill.md
- s2_site_config_skill.md
- s3_setup_modules_skill.md
- s4_climate_prep_skill.md
- s5_airchemistry_prep_skill.md
- s6_management_config_skill.md
- s7_species_params_skill.md
- s8_execution_skill.md
- s9_coupling_skill.md
- s9_output_parsing_skill.md
- validation_convention.yaml
Attribution
Comments
Loading comments…