R/metGeneratoR.R

#' metGeneratoR package
#' 
#' The metGeneratoR package disaggregates daily NetCDF data to subdaily data.
#' This can be hourly, 3hourly, 6hourly, etc.
#' If needed it converts data to the proper output unit.
#' 
#' @docType package
#' @keywords internal
#' @import Rcpp
#' @importFrom Rcpp evalCpp
#' @useDynLib metGeneratoR
#' @name metGeneratoR
#' @examples
#' 
#' ## Set the latlonbox
#' mgsetLonlatbox(c(92.25, 110.25, 7.25, 36.25))
#' 
#' ## Set the period to run
#' mgsetPeriod(startdate = "1950-1-1", enddate = "1950-1-31")
#' 
#' ## Set the output timesteps in hours
#' mgsetInDt(24)  # 24 hourly input
#' mgsetOutDt(6)  # 6 hourly output
#' 
#' ## Set the input variables
#' mgsetInVars(list(
#'   pr         = list(ncname = "pr",      filename = metGen$internal$ncFileNamePr),
#'   tasmin     = list(ncname = "tasmin",  filename = metGen$internal$ncFileNameTasmin),
#'   tasmax     = list(ncname = "tasmax",  filename = metGen$internal$ncFileNameTasmax),
#'   wind       = list(ncname = "sfcWind", filename = metGen$internal$ncFileNameWind),
#'   swdown     = list(ncname = "rsds",    filename = metGen$internal$ncFileNameswdown),
#'   lwdown     = list(ncname = "rlds",    filename = metGen$internal$ncFileNamelwdown),
#'   relhum     = list(ncname = "hurs",    filename = metGen$internal$ncFileNameRelhum),
#'   psurf      = list(ncname = "ps",      filename = metGen$internal$ncFileNamePs)
#' ))
#' 
#' ## Set the output variables
#' mgsetOutVars(c("tas", "pr", "wind", "vp", "psurf", "swdown", "lwdown"))
#' 
#' ## Set the output filename(s) structure and path(s) 
#' mgsetOutName("output/<VAR>/<VAR>_<SYEAR><SMONTH><SDAY>_<EYEAR><EMONTH><EDAY>.nc", message = TRUE)
#' 
#' ## Run the metGeneratoR based on the settings above
#' metGenRun()

mgsetInit()
wietsefranssen/metGeneratoR documentation built on Nov. 12, 2020, 8:43 p.m.