Back to skills
SKILL.md
Docs
ASecurityRun the EPIC crop model binary for one or more sites using the Geo-EPIC workspace framework. This stage handles workspace assembly, EPICCONT.DAT configuration, parallel execution, and output collection.
- 200 stars
- 0 votes
- 0 copies
- 1 view
- Added September 11, 2026
Security analysis
100/100Pro scans all 21 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-4460036b)# Stage 4: EPIC Model Execution
## Purpose
Run the EPIC crop model binary for one or more sites using the Geo-EPIC workspace
framework. This stage handles workspace assembly, EPICCONT.DAT configuration,
parallel execution, and output collection.
## Prerequisites
- Stages 0-3 completed (config, weather, soil, operations)
- info.csv populated with site list
- All referenced .DLY, .SOL, .SIT, .OPC files exist
## Inputs
| Input | Format | Location |
|-------|--------|----------|
| config.yml | YAML | workspace root |
| info.csv | CSV | workspace root |
| Weather files | .DLY, .WP1, .WND | weather/ |
| Soil files | .SOL | soil/ |
| Site files | .SIT | sites/ |
| Operations | .OPC | opc/ |
| Model files | .DAT + .exe | model/ |
## Outputs
| Output | Format | Location |
|--------|--------|----------|
| {site}.ACY | Text | output/ |
| {site}.DGN | Text | output/ |
| Run logs | Text | log/ |
## Procedure
### Using Geo-EPIC Workspace
```python
from geoEpic.core import Workspace
ws = Workspace('config.yml')
ws.run() # Runs all sites from info.csv
```
### Using the KI wrapper tool
```bash
python tools/run_epic_workspace.py \
--workspace /path/to/workspace \
--timeout 30
```
### Manual single-site execution
```bash
cd model/
# Configure EPICCONT.DAT (line 1: duration, year, month, day)
# Configure EPICRUN.DAT (site_id and flags)
# Ensure all file references are correct
./EPIC1102.exe
```
### Execution Flow (per site)
1. **Copy model directory** to cache (`/dev/shm/geo_epic_{user}/{uuid}/`)
2. **Write file references**:
- `WDLSTCOM.DAT` → `1.DLY`
- `WPM1USEL.DAT` → `1.WP1` with lat/lon/elev
- `WINDUSEL.DAT` → `1.WND`
- `SITECOM.DAT` → `{site}.SIT`
- `SOILCOM.DAT` → `{site}.SOL`
- `OPSCCOM.DAT` → `{site}.OPC`
3. **Write EPICRUN.DAT**: `{site_id:>9s} 1 0 0 0 1 1 1/`
4. **Execute binary** with stdin piped (handles prompts)
5. **Collect outputs** from cache to `output/`
6. **Cleanup** temp directory
### EPICCONT.DAT Configuration
Line 1: `[duration:4][year:4][month:4][day:4]`
```
6201501011.00...
```
Means: 6 years starting 2015-01-01.
### Parallel Execution
Geo-EPIC uses `pebble` for parallel site execution:
```python
ws = Workspace('config.yml')
ws.run(num_workers=8) # 8 parallel processes
```
Each site runs in an isolated temp directory, so concurrent execution is safe.
## Verification
1. **Return code**: EPIC should exit with code 0
2. **Output files exist**: `{site}.ACY` and `{site}.DGN` in output/
3. **Output file size > 0**: Empty files indicate failed simulation
4. **Log check**: No fatal errors in log files
5. **Quick ACY check**: `head -15 output/{site}.ACY` should show yield data
## Traps
| Trap | Symptom | Root Cause | Fix |
|------|---------|------------|-----|
| Windows .exe on Linux | Permission denied or exec format error | PE binary needs Wine | Install Wine or use Linux-compiled EPIC |
| Missing .DLY file | EPIC crashes or uses weather gen | DLY not in correct location | Check WDLSTCOM.DAT points to 1.DLY |
| EPICRUN.DAT format wrong | EPIC reads wrong site | Site ID > 9 chars or wrong flags | Keep SiteID ≤ 9 chars |
| Timeout too short | Sites never complete | Complex simulation | Increase timeout in config.yml |
| /dev/shm full | Cannot create temp dir | Too many parallel runs | Clean up old cache dirs |
| File references wrong | EPIC reads wrong files | COM.DAT files point to wrong paths | Verify all COM.DAT contents |
| EPICCONT dates don't match DLY | Uses weather generator | DLY doesn't cover period | Align DLY date range with EPICCONT |
## Example
```python
from geoEpic.core import Workspace
# Load workspace
ws = Workspace('config.yml')
# Run specific site
ws.run(site_ids=['umstead'])
# Check output
import os
for f in os.listdir('output/'):
print(f, os.path.getsize(f'output/{f}'))
```
Files in this skill
- 01_site_preparation.md
- 02_forcing_conversion.md
- 03_soil_profile.md
- 04_operations_schedule.md
- 05_run_execution.md
- 06_output_parsing.md
- 07_capability_inventory.md
- format_spec.yaml
- papers.json
- s0_configuration_skill.md
- s0_workspace_setup.md
- s1_weather_preparation.md
- s1_weather_preparation_skill.md
- s2_soil_preparation.md
- s2_soil_preparation_skill.md
- s3_execution.md
- s3_operations_management_skill.md
- s4_execution_skill.md
- s4_output_parsing.md
- s5_calibration_validation.md
Attribution
Comments
Loading comments…