## 04/06/2012 - 3:23PM source('h:/watersmart/lib.R') ## define some variables nstate <- 2 # number of 'states' ## for 2 states, the threshhold defaults to the median. I will keep this threshhold for this example. trace.len <- 50 # length of traces nsim <- 1200 # number of traces rdata.file <- paste('leesferry-nhg-',nstate,'-state.RData',sep='') # file name for .RData file (saves output) rdata.file.cc <- paste('leesferry-nhg-',nstate,'-state-cc.RData',sep='') # file name for .RData file (saves output) ## filepath will default to the current working directory. ## therefore, it is noteworth to know whether user has file- ## editing privelages in the current working directory ## I am now setting the current working directory: setwd('h:/watersmart/scriptdata/nhgmc/') ## The directory could also be supplied as filepath='h:/watersmart/' ## read the paleo data (tree rings!) paleo <- 'h:/watersmart/scriptdata/nhgmc/lf_paleo.txt' ## read the observed flow data (Lee's Ferry) x <- 'h:/watersmart/scriptdata/nhgmc/lf_yr_vector.txt' v_cc_nhg(xpath=x,paleopath=paleo,m=nstate,sim.len=trace.len,nsims=nsim,thresh=NULL,filepath=NULL,output.rdata=rdata.file,high.var=FALSE,mean.change=NULL,returnpath=NULL) ## the file 'output/SimFlow-NHG-2-state.txt' will be output, as mean.change is NULL v_cc_nhg(xpath=x,paleopath=paleo,m=nstate,sim.len=trace.len,nsims=nsim,thresh=NULL,filepath=NULL,output.rdata=rdata.file.cc,high.var=TRUE,mean.change=-0.1,returnpath=NULL) ## the file 'output/SimFlow-NHG-cc-2-state.txt' will be output, as mean.change is 10% ## high variance cannot be set to TRUE. for some reason this suppresses all simulation. ## i will look into this ASAP.