# GSPy-MODFLOW Interface Parameter Configuration

## Updated JSON Configuration
The `gspy_modflow.json` file now accepts 7 input parameters from GoldSim:

### Input Parameters (in order):
1. **Daily_Seepage_Flux_LpT** (m/day) - Recharge rate from watershed model
2. **storage_rate** (0.1-0.8) - Controls response speed (higher = faster)
3. **max_additional** (m³/s) - Maximum additional flow above baseline
4. **base_flow** (m³/s) - Baseline return flow 
5. **hk** (m/day) - Hydraulic conductivity (for MODFLOW mode)
6. **sy** (-) - Specific yield (for MODFLOW mode)
7. **river_conductance** (m²/day) - River conductance (for MODFLOW mode)

### Output Parameters:
1. **GW_Return_Flow_m3s** (m³/s) - Groundwater return flow

## Recommended Parameter Values

### For Controlled Response Mode (default, more reliable):
- **storage_rate**: 0.4 (baseline), 0.2 (slow), 0.7 (fast)
- **max_additional**: 0.35 m³/s (gives ~0.25 m³/s at 0.075 m/day)
- **base_flow**: 0.06 m³/s (baseline return flow)

### For MODFLOW Mode (experimental):
- **hk**: 8.0 m/day (higher = faster response)
- **sy**: 0.18 (higher = faster drainage)
- **river_conductance**: 50.0 m²/day (higher = more discharge)

## Parameter Effects

### storage_rate (Primary control for response speed):
- 0.1-0.2: Slow response, takes 7-10 days to reach equilibrium
- 0.4: Moderate response, reaches ~90% equilibrium in 4-5 days  
- 0.6-0.8: Fast response, reaches equilibrium in 2-3 days

### max_additional (Controls maximum flow amplitude):
- 0.25: Conservative response, max ~0.31 m³/s total
- 0.35: Moderate response, max ~0.41 m³/s total
- 0.45: High response, max ~0.51 m³/s total

### base_flow (Sets minimum return flow):
- 0.03: Low baseline (~0.03 m³/s minimum)
- 0.06: Moderate baseline (~0.06 m³/s minimum)
- 0.10: High baseline (~0.10 m³/s minimum)

## Example GoldSim Setup

Create scalar elements in GoldSim:
```
Recharge_Rate = 0.075  # m/day (from your watershed model)
Storage_Rate = 0.4     # Response speed
Max_Additional = 0.35  # m³/s
Base_Flow = 0.06       # m³/s  
HK_Value = 8.0         # m/day
SY_Value = 0.18        # dimensionless
River_Cond = 50.0      # m²/day
```

Connect these to your External element inputs in the same order.

## Expected Results (0.075 m/day recharge):
- Day 1: ~0.13 m³/s
- Day 2: ~0.17 m³/s  
- Day 3: ~0.20 m³/s
- Day 4: ~0.21 m³/s
- Day 5: ~0.22 m³/s
- Equilibrium: ~0.23 m³/s

## Dynamic Behavior:
✓ Persistent state between time steps
✓ Exponential approach to equilibrium  
✓ Configurable response speed and amplitude
✓ Realistic groundwater storage effects
✓ Full parameter control from GoldSim