predict_subdaily_met.RdThis is the main function of the tdm family workflow. This function predicts subdaily meteorology from daily means using a linear regression modeling approach. It takes a dataset with daily resolution and temporally downscales it to hourly resolution using the statistics generated by gen.subdaily.models(). It references the predict.subdaily.function located in lm_ensemble_sims() which uses a linear regression based approach to downscale. We generate multiple ensembles of possible hourly values dictated from the models and betas generated in gen.subdaily.models. Each ensemble member is saved as a netCDF file in CF conventions and these files are ready to be used in the general PEcAn workflow.
predict_subdaily_met(outfolder, in.path, in.prefix, path.train, direction.filter = "forward", lm.models.base, yrs.predict = NULL, ens.labs = 1:3, resids = FALSE, force.sanity = TRUE, sanity.tries = 25, overwrite = FALSE, verbose = FALSE, seed = format(Sys.time(), "%m%d"), print.progress = FALSE, ...)
| outfolder | - directory where output file will be stored  | 
    
|---|---|
| in.path | - base path to dataset you wish to temporally downscale; Note: in order for parallelization to work, the in.prefix will need to be appended as the final level of the file structure. For example, if prefix is GFDL.CM3.rcp45.r1i1p1, there should be a directory with that title in in.path.  | 
    
| in.prefix | - prefix of model dataset, i.e. if file is GFDL.CM3.rcp45.r1i1p1.2006 the prefix is 'GFDL.CM3.rcp45.r1i1p1'  | 
    
| path.train | - path to CF/PEcAn style training data where each year is in a separate file.  | 
    
| direction.filter | - Whether the model will be filtered backward or forwards in time. options = c("backward", "forwards") (default is forward; PalEON will go backward, anybody interested in the future will go forwards)  | 
    
| lm.models.base | - path to linear regression model folders generated using gen.subdaily.models  | 
    
| yrs.predict | - years for which you want to generate met. if NULL, all years in in.path will be done  | 
    
| ens.labs | - vector containing the labels (suffixes) for each ensemble member; this allows you to add to your ensemble rather than overwriting with a default naming scheme  | 
    
| resids | - logical stating whether to pass on residual data or not  | 
    
| force.sanity | - (logical) do we force the data to meet sanity checks?  | 
    
| sanity.tries | - how many time should we try to predict a reasonable value before giving up? We don't want to end up in an infinite loop  | 
    
| overwrite | logical: replace output file if it already exists?  | 
    
| verbose | logical: should   | 
    
| seed | - manually set seed for results to be reproducible  | 
    
| print.progress | - print the progress bar?  | 
    
Predict Subdaily Meteorology Predict Subdaily Meteorology based off of statistics created in gen.subdaily.models()
Other tdm - Temporally Downscale Meteorology: gen.subdaily.models,
  lm_ensemble_sims,
  model.train, nc.merge,
  save.betas, save.model,
  subdaily_pred,
  temporal.downscale.functions
# NOT RUN { library(PEcAn.data.atmosphere) outfolder = '~/Downscaled_GCM' in.path = '~/raw_GCM' in.prefix = 'GFDL' lm.models.base = 'sf_scratch/US-WCr' dat.train_file = 'Training_data/US-WCr_dat.train.nc' start_date = '2010-01-01' end_date = '2014-12-31' cores.max = 12 n.ens = 3 # }