PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
202 stars 234 forks source link

Design of met, climate, soil uncertainty architecture #648

Open dlebauer opened 8 years ago

dlebauer commented 8 years ago

This issue is a starting point for a discussion that will precede the creation of a new milestone (1.5.1?) with specific tasks with the goal of estimating, propagating, and constraining uncertainty in met, climate, and soil parameters.

Goals:

Issues:

... note that from a scientific point of view, many very important soil properties are easy to measure.

If, for example, annual precipitation is known with an uncertainty of 10% but daily precipitation is known with an uncertainty of 50%, how do we take a met driver and simulate many realizations of this?

Climate

Given historical met and projected climate change, how do we propagate interannual variability?

If the question is about future ecosystem productivity, how to sample over historical weather variability while adapting such datasets to predicted climate change? IPCC / CMIP scenarios are focused on decadal trends, so any given model may have a single realization of a particular trajectory on sub-decadal and within-year weather that is not the focus of the original simulation (or model formulation)

One approach that I am currently using is to sample a set of years with replacement. Currently I have a draft in the run.biocro function that has the boolean argument met.uncertainty. This could be move to a function like load.cfmet so that if met uncertainty is to be evaluated, the years could be randomized.

dlebauer commented 8 years ago

Here is an first draft of how I implemented met uncertainty in the run.biocro function.

In this case I am sampling 15 years from MsTMIP NARR files that run from 1979-2010.

This would need to be generalized

  ## Meteorology

  if(met.uncertainty == TRUE){, 
    start.date <- "1979-01-01"
    end.date <- "2010-12-31"
    years <- sample(year(start.date):year(end.date), 
                                 size = 15, replace = TRUE)
    met <- load.cfmet(met.nc, lat = lat, lon = lon, 
                    start.date = start.date, end.date = end.date)
   ## this uses the data.table package
   ## will re-order according to sample above
    met <- met[year %in% years]
  }
dlebauer commented 8 years ago

For soils, the USCRN site descriptions have low, representative and high values for a few different parameters, for example wsatiated_l wsatiated_r, wsatiated_h.

The library rriskDistributions provides some helpful functions for fitting distributions to quantiles. So I assumed some quantile for the low and high values and I fit beta distributions.

Then I fit a separate beta distribution for each site

library(rriskDistributions)

### assuming in root dir. of git@github.com:aginfo/prototypes
soils <- read.csv("ssurgo_hydro_at_uscrn.csv")

#######water satiated
soils_subset <- soils[!is.na(soils$wsatiated_l) & !is.na(soils$wsatiated_h), ]
prob = seq(from=0,to=1,by=0.1)
parms <- list()
sample<-list()

for(i in 1:nrow(soils_subset)){
  x <- as.data.frame(soils_subset[i,])
  parms[[i]] <-  get.beta.par(p = c(0.025, 0.5, 0.975), 
               q = c(x$wsatiated_l/100, x$wsatiated_r/100, x$wsatiated_h/100))
  sample[[i]]=qbeta(prob, parms[[i]][1], parms[[i]][2], ncp = 0, lower.tail = TRUE, log.p = FALSE)
}
github-actions[bot] commented 4 years ago

This issue is stale because it has been open 365 days with no activity.