14
R and the Forest Vegetation Simulator Interfacing an old school model with R MASON EARLES D-RUG 02.13.13

R and the forest vegetation simulator

Embed Size (px)

DESCRIPTION

Mason Earles' presentation to the Davis R Users' Group on R and FVS

Citation preview

Page 1: R and the forest vegetation simulator

R and the Forest Vegetation Simulator Interfacing an old school model with R MASON EARLES D-RUG 02.13.13

Page 2: R and the forest vegetation simulator

What’s the forest vegetation simulator (FVS)? What did I want to do with it? Where does R fit in?

Page 3: R and the forest vegetation simulator

What’s FVS? Models forest growth, mortality and fire

Page 4: R and the forest vegetation simulator

What’s FVS?

- Developed and commonly used by US Forest Service - FORTRAN language - Empirically based growth/mortality

- Individual trees modeled

- Tree interactions affect growth and mortality

Page 5: R and the forest vegetation simulator

My goal: Use FVS ‘Monte Carlo style’ with stochastic fire and drought events

Problem: I don’t know the FORTRAN language; FVS is a mess of code maintained by a couple of people

Page 6: R and the forest vegetation simulator

But I know R!

Page 7: R and the forest vegetation simulator

Open-FVS = publicly available source code…API linking FVS to R

Page 8: R and the forest vegetation simulator

FVS can now be run from R!

Page 9: R and the forest vegetation simulator

A few things I’ve done with linked R + FVS

Page 10: R and the forest vegetation simulator

Batch modify keyword code files w/ R

Keyword file

Page 11: R and the forest vegetation simulator

Stochastic fire events

Burn probability = 40 years

Page 12: R and the forest vegetation simulator

%dopar% for parallel simulations

Page 13: R and the forest vegetation simulator

Stochastic drought events

Similar approach for drought events

Page 14: R and the forest vegetation simulator

Simulation Examples: #runs = 100