From 557aca40c22f21c36959e691be8c03aa39456cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Holl=C3=B3s?= Date: Wed, 13 May 2020 11:01:55 +0200 Subject: [PATCH] soilQuery merge --- RBBGCMuso/NAMESPACE | 7 ++++ RBBGCMuso/R/recent.soi | 63 ++++++++++++++++++++++++++++ RBBGCMuso/R/soilQuery.R | 64 +++++++++++++++++++++++++++++ RBBGCMuso/algo.md | 37 +++++++++++++++++ RBBGCMuso/figure/pressure-1.png | Bin 0 -> 5554 bytes RBBGCMuso/man/alignData.Rd | 13 ++---- RBBGCMuso/man/changemulline.Rd | 10 +---- RBBGCMuso/man/checkMeteoBGC.Rd | 8 +--- RBBGCMuso/man/compareMuso.Rd | 12 ++---- RBBGCMuso/man/createSoilFile.Rd | 11 +++++ RBBGCMuso/man/getMeteoData1BGC.Rd | 21 +++------- RBBGCMuso/man/getSoilDataFull.Rd | 11 +++++ RBBGCMuso/man/musoDate.Rd | 10 +---- RBBGCMuso/man/musoMonte.Rd | 26 +++--------- RBBGCMuso/man/musoQuickEffect.Rd | 13 ++---- RBBGCMuso/man/musoRand.Rd | 3 +- RBBGCMuso/man/musoSensi.Rd | 27 ++++-------- RBBGCMuso/man/optiMuso.Rd | 29 ++++--------- RBBGCMuso/man/paramSweep.Rd | 11 ++--- RBBGCMuso/man/randEpc.Rd | 9 +--- RBBGCMuso/man/readObservedData.Rd | 16 ++------ RBBGCMuso/man/saveAllMusoPlots.Rd | 12 ++---- RBBGCMuso/man/stampAndDir.Rd | 11 +---- RBBGCMuso/man/updateMusoMapping.Rd | 3 +- 24 files changed, 253 insertions(+), 174 deletions(-) create mode 100644 RBBGCMuso/R/recent.soi create mode 100644 RBBGCMuso/R/soilQuery.R create mode 100644 RBBGCMuso/algo.md create mode 100644 RBBGCMuso/figure/pressure-1.png create mode 100644 RBBGCMuso/man/createSoilFile.Rd create mode 100644 RBBGCMuso/man/getSoilDataFull.Rd diff --git a/RBBGCMuso/NAMESPACE b/RBBGCMuso/NAMESPACE index 295055f..72b15fd 100644 --- a/RBBGCMuso/NAMESPACE +++ b/RBBGCMuso/NAMESPACE @@ -7,6 +7,7 @@ export(cleanupMuso) export(compareMuso) export(copyMusoExampleTo) export(corrigMuso) +export(createSoilFile) export(getAnnualOutputList) export(getDailyOutputList) export(getMeteoData1BGC) @@ -68,7 +69,12 @@ importFrom(ggplot2,theme) importFrom(ggplot2,theme_classic) importFrom(ggplot2,xlab) importFrom(ggplot2,ylab) +importFrom(glue,glue) importFrom(gridExtra,grid.arrange) +importFrom(httr,GET) +importFrom(httr,config) +importFrom(httr,content) +importFrom(httr,with_config) importFrom(jsonlite,write_json) importFrom(limSolve,xsample) importFrom(lubridate,leap_year) @@ -85,6 +91,7 @@ importFrom(openxlsx,read.xlsx) importFrom(rmarkdown,pandoc_version) importFrom(rmarkdown,render) importFrom(scales,percent) +importFrom(stats,approx) importFrom(tcltk,tk_choose.dir) importFrom(tcltk,tk_choose.files) importFrom(tibble,rownames_to_column) diff --git a/RBBGCMuso/R/recent.soi b/RBBGCMuso/R/recent.soi new file mode 100644 index 0000000..f69f1ce --- /dev/null +++ b/RBBGCMuso/R/recent.soi @@ -0,0 +1,63 @@ +SOILPROP FILE - lat: 60, lon: 50, created in: Mon Apr 20 10:44:56 2020 +---------------------------------------------------------------------------------------- +NITROGEN AND DECOMPOSITION PARAMETERS +0.1 (prop.) denitrification rate per g of CO2 respiration of SOM +0.2 (prop.) nitrification coefficient 1 +0.07 (prop.) nitrification coefficient 2 +0.02 (prop.) coefficient of N2O emission of nitrification +0.1 (prop.) NH4 mobilen proportion +1.0 (prop.) NO3 mobilen proportion +10 (m) e-folding depth of decomposition rate's depth scalar +0.002 (prop.) fraction of dissolved part of SOIL1 organic matter +0.002 (prop.) fraction of dissolved part of SOIL2 organic matter +0.002 (prop.) fraction of dissolved part of SOIL3 organic matter +0.002 (prop.) fraction of dissolved part of SOIL4 organic matter +0.1 (prop.) minimum WFPS for scalar of nitrification calculation +0.45 (prop.) lower optimum WFPS for scalar of nitrification calculation +0.55 (prop.) higher optimum WFPS for scalar of nitrification calculation +0.2 (prop.) minimum value for saturated WFPS scalar of nitrification calculation +10 (ppm) critical value of dissolved N and C in bottom (inactive layer) +---------------------------------------------------------------------------------------- +RATE SCALARS +0.35 (prop) respiration fractions for fluxes between compartments (l1s1) +0.50 (prop) respiration fractions for fluxes between compartments (l2s2) +0.26 (prop) respiration fractions for fluxes between compartments (l4s3) +0.25 (prop) respiration fractions for fluxes between compartments (s1s2) +0.41 (prop) respiration fractions for fluxes between compartments (s2s3) +0.50 (prop) respiration fractions for fluxes between compartments (s3s4) +0.7 (1/day) rate constant scalar of labile litter pool +0.07 (1/day) rate constant scalar of cellulose litter pool +0.014 (1/day) rate constant scalar of lignin litter pool +0.07 (1/day) rate constant scalar of fast microbial recycling pool +0.014 (1/day) rate constant scalar of medium microbial recycling pool +0.0014 (1/day) rate constant scalar of slow microbial recycling pool +0.0001 (1/day) rate constant scalar of recalcitrant SOM (humus) pool +0.001 (1/day) rate constant scalar of physical fragmentation of coarse woody debris +---------------------------------------------------------------------------------------- +CH4 PARAMETERS +212.5 (DIM) soil CH4 emission bulk density dependence parameter1 +1.81 (DIM) soil CH4 emission bulk density dependence parameter2 +-1.353 (DIM) soil CH4 emission soil water content dependence parameter1 +0.2 (DIM) soil CH4 emission soil water content dependence parameter2 +2 (DIM) soil CH4 emission soil water content dependence parameter3 +6.786 (DIM) soil CH4 emission soil water content dependence parameter4 +0.010 (DIM) soil CH4 emission soil temperature dependence parameter1 +---------------------------------------------------------------------------------------- +SOIL PARAMETERS +2 (m) depth of soil +6 (mm)42 42 43 47 48 49 49 49 51 51 limit of first stage evaporation +20.00 (mm) maximum height of pond water +1 (dimless) curvature of soil stress function +-9999 (dimless) measured runoff curve number (-9999: no measured data, model estimation) +---------------------------------------------------------------------------------------- +SOIL COMPOSITION AND CHARACTERISTIC VALUES (-9999: no measured data) +30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 30.0 (%) sand percentage by volume in rock-free soil +50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 (%) silt percentage by volume in rock-free soil +7.0 7.0 7.0 7.0 7.0 7.0 7.0 7.0 7.0 7.0 (dimless) soil pH (dimless) measured runoff curve number +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (g/cm3) bulk density +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (m3/m3) SWC at saturation +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (m3/m3) SWC at field capacity +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (m3/m3) SWC at wilting point +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (m3/m3) SWC at hygroscopic water content +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (dimless) drainage coefficient +-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 (cm/day) hydraulic condictivity at saturation diff --git a/RBBGCMuso/R/soilQuery.R b/RBBGCMuso/R/soilQuery.R new file mode 100644 index 0000000..b97800a --- /dev/null +++ b/RBBGCMuso/R/soilQuery.R @@ -0,0 +1,64 @@ +#' getSoilDataFull +#' +#' This function collects soil data from a given restapi, de default is soilGrid +#' +#' @author Roland HOLLÓS +#' @name getSoilDataFull +#' @importFrom glue glue +#' @importFrom httr config with_config GET content + +getSoilDataFull <- function(lat, lon, apiURL, port) { + if(missing(apiURL)){ + apiURL <- "https://81.169.232.36" + } + if(missing(port)){ + port <- 4445 + } + apiString <- glue("{apiURL}:{port}/query?lon={lon}&lat={lat}") + soilREST <- with_config(config(ssl_verifypeer=0L, ssl_verifyhost=0L), + GET(apiString)) # This is temporary solution ssl_verification wont bypass + content(soilREST) +} + +#' createSoilFile +#' +#' This function collects soil data from a given restapi, de default is soilGrid +#' +#' @author Roland HOLLOS +#' @name createSoilFile +#' @importFrom glue glue +#' @importFrom stats approx +#' @importFrom magrittr '%>%' +#' @export + +createSoilFile <- function(lat,lon, + outputFile="recent.soi", + method="constant",apiURL, + apiPort,template=system.file("examples/hhs/hhs.soi",package="RBBGCMuso")) { + if(missing(apiURL)){ + apiURL <- "https://81.169.232.36" + } + if(missing(apiPort)){ + apiPort <- 4445 + } + outFile <- suppressWarnings(readLines(template)) + outFile[1] <- sprintf("SOILPROP FILE - lat: %s, lon: %s, created in: %s",lat,lon,date()) + musoCenters <- c(1.5,6.5,20.0,45.0,75.0,105.0,135.0,175.0,300.0,700.0) + soilGridDepths <- c(0,5,15,30,60,100,200) + rest<- getSoilDataFull(lat,lon, apiURL, apiPort) + if(rest$properties$soilmask=="nodata"){ + stop("There is no data for the given coordinates"); + } + + createMusoLayers <- function(values,depths=soilGridDepths,centers=musoCenters,intMethod=method){ + approx(x=depths,y=values, xout = centers, method=intMethod,rule=2)$y %>% + paste(.,collapse="\t") %>% paste0(.," ") + } + soilDepth <- unlist(rest$properties$BDRICM$M)/100 + outFile[42] <- sub("([0-9.]*\\s+){1}",paste0(soilDepth," "),outFile[42], outFile[42]) + outFile[48] <- sub("([0-9.]*\\s+){10}",createMusoLayers(unlist(rest$properties$SNDPPT$M)),outFile[48]) + outFile[49] <- sub("([0-9.]*\\s+){10}",createMusoLayers(unlist(rest$properties$SLTPPT$M)),outFile[49]) + outFile[50] <- sub("([0-9.]*\\s+){10}",createMusoLayers(unlist(rest$properties$PHIHOX$M)/10),outFile[50]) + writeLines(outFile,outputFile) +} +# createSoilFile(60,50) diff --git a/RBBGCMuso/algo.md b/RBBGCMuso/algo.md new file mode 100644 index 0000000..8549364 --- /dev/null +++ b/RBBGCMuso/algo.md @@ -0,0 +1,37 @@ +--- +title: "An easy grouping algorithm" +author: "Hollós Roland" +date: "10/1/2019" +output: pdf_document +--- + + + +## R Markdown + +This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . + +When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: + + +```r +summary(cars) +``` + +``` +## speed dist +## Min. : 4.0 Min. : 2.00 +## 1st Qu.:12.0 1st Qu.: 26.00 +## Median :15.0 Median : 36.00 +## Mean :15.4 Mean : 42.98 +## 3rd Qu.:19.0 3rd Qu.: 56.00 +## Max. :25.0 Max. :120.00 +``` + +## Including Plots + +You can also embed plots, for example: + +![plot of chunk pressure](figure/pressure-1.png) + +Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. diff --git a/RBBGCMuso/figure/pressure-1.png b/RBBGCMuso/figure/pressure-1.png new file mode 100644 index 0000000000000000000000000000000000000000..3045a7301cd6200e27408147d9d9d0cffdbcd251 GIT binary patch literal 5554 zcmc&&cT|(hwnsez(gXqNZ~&zXA_CF{q=|Hp4g%7Hk(wwe(h{UfmlC1^VxdR}i6C7% z(t8Y5L`di@kQdPV&N}a{_tt&yk9+@^HM3{-_suT9*?Z4CH8#|tr{ScbprD}F)4gR% zL2+vLxKW=W&m?T0H=v+6y=;8PT#HPeK7IPknKOU<@yFS-XQ`;DsHv&XojXTELqkhT zOGih?z`$_+{CP%3MkXev3l}ahGc&WWu&}bSUc7jbjg5_+ot=Y&gOih!i;Ih!o12G+ zhnJU^kB{%qKmX+C=NAwV5EK-=bm`LN%a?_OgoK5KMMOkIMMcHL#KgtLB_t%ST)84C zDJdl-b@l31X=!O08JX+Xugl8H%E`&e%gf)maYI2tK~YgrNl8grSy@FzMO9T*O-=3Q z&711#>KYmvnwpxoZr#$-($dz}*3r??)z#J0)4P59w!XgpojZ373=9kn4ULS9jE#*= zOiWBoP0h^A%+1X$EG+Kcy=!S{X=P<)ZEbC1V`FP;YiDO?Z*TA5;Na-!c<(73LPA19Lqo&D!otJDBO)RY z2m}&|jEszY`t)g3R8(|ybWBW4Y;0^?T->u~&k_<65)%`Xl9G~>lT%VsQd3jY($bzk zf1aM6o{^D}nVFfDm4!l~va_?%X!MI0FJ8WU`Rd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=~)2{1gdKMC-WOf~|ujl3v4^nsQ5pU96)<*y33T|1|qizvBGX*->^?`BXg_Dd+&xly~RJXFaWi zb>`Gr`F5@W=67Hy4nSx0H2lBc`YI!^Nxnk`BJjnT3kc!Mm*>R|x$O=~`svy1S-F+t z`$sC;karkUkJNEf@q=ylVAH_2eYsYu;ru}nJKNI%N0l0Rq9eQo#X#eX>J@jrA-2?O zN+p4b<6dna>zBpr90K$DBr5V$YiFb?_BL43Xbhron&1$7T<1Xen_Zn0j@YSW;fuYs znEgh&GG<%hw}q9WI*|*VJt9Rc8F`h18Or<)9Itl`BZOKA{Fu*0gv(~(gaDIAhlNJL zbU&ompUgDBe=jBB3Uj_k-gB!$15jglyyXz6U_L4RyjZTqXIAdI z5oJma!*wh?XQugPQy<+1^O>Y%OY!9jb!grSaGlPd|qgh^FAYDbejV&cT}u@ z7uxa((djiLM5#7w>;4?g{yeuj!+qun%~pzyyQt*lTW0O_Kk(-F64!4#0S65kFi!dc8!tG?g%JGltv6Mq88fAm2cMYjOke)etv0?M2V})x zCgto{%zBYOs`o;=JwJ9}`S=;VQ|_#m`$4JWN|i5q&$n`$Li06}oc9iL@S$bm{@ z)qXL{|g=vMDRN90`@JWPMEjILlE#5H}=R*1KRw4KVnp+FL-SdFw zhqBbI>2^5aUlkAtdd2&^MmxyXGqGv$+dSPp=eaTX^&I*~g<&rbQ8dQ86UCn6%HKM& zG}#)l4wj0Fqyx2aDY8*s_!hn&>E^m7$4MpMvzMtZ)l1EQ*anH+#N~*fRySF1AaLqV hNUGL<`q^d+zPux_;ftzFB)>*c=xG_=D$=+Y`X4rr@n8S| literal 0 HcmV?d00001 diff --git a/RBBGCMuso/man/alignData.Rd b/RBBGCMuso/man/alignData.Rd index 0200b96..3ba4f7f 100644 --- a/RBBGCMuso/man/alignData.Rd +++ b/RBBGCMuso/man/alignData.Rd @@ -4,16 +4,9 @@ \alias{alignData} \title{alignData} \usage{ -alignData( - mdata, - dataCol, - modellSettings = NULL, - startDate = NULL, - endDate = NULL, - formatString = "\%Y-\%m-\%d", - leapYear = TRUE, - continious = FALSE -) +alignData(mdata, dataCol, modellSettings = NULL, startDate = NULL, + endDate = NULL, formatString = "\%Y-\%m-\%d", leapYear = TRUE, + continious = FALSE) } \description{ This function align the data to the model and the model to the data diff --git a/RBBGCMuso/man/changemulline.Rd b/RBBGCMuso/man/changemulline.Rd index e7ec966..7acf438 100644 --- a/RBBGCMuso/man/changemulline.Rd +++ b/RBBGCMuso/man/changemulline.Rd @@ -4,14 +4,8 @@ \alias{changemulline} \title{This is the function which is capable to change multiple specific lines to others using their row numbers.} \usage{ -changemulline( - filePaths, - calibrationPar, - contents, - fileOut, - fileToChange, - modifyOriginal = FALSE -) +changemulline(filePaths, calibrationPar, contents, fileOut, fileToChange, + modifyOriginal = FALSE) } \description{ The function uses the previous changspecline function to operate. diff --git a/RBBGCMuso/man/checkMeteoBGC.Rd b/RBBGCMuso/man/checkMeteoBGC.Rd index 02bdcfa..9d19096 100644 --- a/RBBGCMuso/man/checkMeteoBGC.Rd +++ b/RBBGCMuso/man/checkMeteoBGC.Rd @@ -4,12 +4,8 @@ \alias{checkMeteoBGC} \title{checkMeteoBGC} \usage{ -checkMeteoBGC( - settings = NULL, - skip = 4, - numericReport = FALSE, - type = "normal" -) +checkMeteoBGC(settings = NULL, skip = 4, numericReport = FALSE, + type = "normal") } \arguments{ \item{settings}{The output of setupMuso} diff --git a/RBBGCMuso/man/compareMuso.Rd b/RBBGCMuso/man/compareMuso.Rd index b4c6380..4890945 100644 --- a/RBBGCMuso/man/compareMuso.Rd +++ b/RBBGCMuso/man/compareMuso.Rd @@ -4,15 +4,9 @@ \alias{compareMuso} \title{compareMuso} \usage{ -compareMuso( - settings = NULL, - parameters, - variable = 1, - calibrationPar = NULL, - fileToChange = "epc", - skipSpinup = TRUE, - timeFrame = "day" -) +compareMuso(settings = NULL, parameters, variable = 1, + calibrationPar = NULL, fileToChange = "epc", skipSpinup = TRUE, + timeFrame = "day") } \arguments{ \item{settings}{RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option.} diff --git a/RBBGCMuso/man/createSoilFile.Rd b/RBBGCMuso/man/createSoilFile.Rd new file mode 100644 index 0000000..5eb6bac --- /dev/null +++ b/RBBGCMuso/man/createSoilFile.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/soilQuery.R +\name{createSoilFile} +\alias{createSoilFile} +\title{createSoilFile} +\description{ +This function collects soil data from a given restapi, de default is soilGrid +} +\author{ +Roland HOLLOS +} diff --git a/RBBGCMuso/man/getMeteoData1BGC.Rd b/RBBGCMuso/man/getMeteoData1BGC.Rd index 823eecf..677b2cc 100644 --- a/RBBGCMuso/man/getMeteoData1BGC.Rd +++ b/RBBGCMuso/man/getMeteoData1BGC.Rd @@ -4,24 +4,15 @@ \alias{getMeteoData1BGC} \title{getMeteoData1BGC} \usage{ -getMeteoData1BGC( - startYear = 2017, - endYear = 2017, - lon = 18.8, - lat = 47.3, - timeOut = 7200, - monthList = sprintf("\%02d", 1:12), - dayList = sprintf("\%02d", 1:31), - hourList = sprintf("\%02d:00", 0:23), - destDir = NULL, - apiFile = NULL, - fileDir = NULL -) +getMeteoData1BGC(startYear = 2017, endYear = 2017, lon = 18.8, + lat = 47.3, timeOut = 7200, monthList = sprintf("\%02d", 1:12), + dayList = sprintf("\%02d", 1:31), hourList = sprintf("\%02d:00", + 0:23), destDir = NULL, apiFile = NULL, fileDir = NULL) } \arguments{ \item{startYear}{Start year of the downloading data. It shall be greater than 1978.} -\item{endYear}{End year of the downloading data. It shall be smaller than 2019.} +\item{endYear}{End year of the downloading data. It shall be smaller than 2020.} \item{lon}{Geographical longitude of the selected grid point (negative values: W, positive values: E). It shall be between -180 and 180. The value is rounded to two decimal places.} @@ -35,7 +26,7 @@ getMeteoData1BGC( \item{hourList}{Hour selector (e.g. to download data for 00 UTC then write "00:00", to download data for 01 UTC and 15 UTC then write c("01","15")} -\item{destDir}{Directory where the mtc43 file will be created. If it is NULL then destDir is the same as fileDir.} +\item{destDir}{Directory where the wth file will be created. If it is NULL then destDir is the same as fileDir.} \item{apiFile}{Directory where the cdsapirc file is located} diff --git a/RBBGCMuso/man/getSoilDataFull.Rd b/RBBGCMuso/man/getSoilDataFull.Rd new file mode 100644 index 0000000..4442e72 --- /dev/null +++ b/RBBGCMuso/man/getSoilDataFull.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/soilQuery.R +\name{getSoilDataFull} +\alias{getSoilDataFull} +\title{getSoilDataFull} +\description{ +This function collects soil data from a given restapi, de default is soilGrid +} +\author{ +Roland HOLLÓS +} diff --git a/RBBGCMuso/man/musoDate.Rd b/RBBGCMuso/man/musoDate.Rd index d2d47f6..d8096e7 100644 --- a/RBBGCMuso/man/musoDate.Rd +++ b/RBBGCMuso/man/musoDate.Rd @@ -4,14 +4,8 @@ \alias{musoDate} \title{musoDate} \usage{ -musoDate( - startYear, - endYears = NULL, - numYears, - combined = TRUE, - leapYearHandling = FALSE, - prettyOut = FALSE -) +musoDate(startYear, endYears = NULL, numYears, combined = TRUE, + leapYearHandling = FALSE, prettyOut = FALSE) } \description{ This function generates MuSo compatibla dates for the data diff --git a/RBBGCMuso/man/musoMonte.Rd b/RBBGCMuso/man/musoMonte.Rd index 47b59a2..cffa6ee 100644 --- a/RBBGCMuso/man/musoMonte.Rd +++ b/RBBGCMuso/man/musoMonte.Rd @@ -4,26 +4,12 @@ \alias{musoMonte} \title{musoMonte} \usage{ -musoMonte( - settings = NULL, - parameters = NULL, - inputDir = "./", - outLoc = "./calib", - iterations = 10, - preTag = "mont-", - outputType = "moreCsv", - fun = mean, - varIndex = 1, - outVars = NULL, - silent = TRUE, - skipSpinup = TRUE, - debugging = FALSE, - keepEpc = FALSE, - constrains = NULL, - skipZero = TRUE, - postProcString = NULL, - ... -) +musoMonte(settings = NULL, parameters = NULL, inputDir = "./", + outLoc = "./calib", iterations = 10, preTag = "mont-", + outputType = "moreCsv", fun = mean, varIndex = 1, outVars = NULL, + silent = TRUE, skipSpinup = TRUE, debugging = FALSE, + keepEpc = FALSE, constrains = NULL, skipZero = TRUE, + postProcString = NULL, ...) } \arguments{ \item{settings}{A list of environmental variables for the Monte Carlo experiment. These settings are generated by the setupMuso function. By default the settings parameter is generated automatically.} diff --git a/RBBGCMuso/man/musoQuickEffect.Rd b/RBBGCMuso/man/musoQuickEffect.Rd index a6a7bef..1676a4e 100644 --- a/RBBGCMuso/man/musoQuickEffect.Rd +++ b/RBBGCMuso/man/musoQuickEffect.Rd @@ -4,16 +4,9 @@ \alias{musoQuickEffect} \title{musoQuickEffect} \usage{ -musoQuickEffect( - settings = NULL, - calibrationPar = NULL, - startVal, - endVal, - nSteps = 1, - fileToChange = "epc", - outVar, - parName = "parVal" -) +musoQuickEffect(settings = NULL, calibrationPar = NULL, startVal, + endVal, nSteps = 1, fileToChange = "epc", outVar, + parName = "parVal") } \arguments{ \item{settings}{RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option.} diff --git a/RBBGCMuso/man/musoRand.Rd b/RBBGCMuso/man/musoRand.Rd index d512ce1..208748b 100644 --- a/RBBGCMuso/man/musoRand.Rd +++ b/RBBGCMuso/man/musoRand.Rd @@ -4,7 +4,8 @@ \alias{musoRand} \title{musoRand} \usage{ -musoRand(parameters, iterations = 3000, fileType = "epc", constrains = NULL) +musoRand(parameters, iterations = 3000, fileType = "epc", + constrains = NULL) } \arguments{ \item{parameters}{This is a dataframe (heterogeneous data-matrix), where the first column is the name of the parameter, the second is a numeric vector of the rownumbers of the given variable in the input EPC file, and the last two columns describe the minimum and the maximum of the parameter (i.e. the parameter ranges), defining the interval for the randomization.} diff --git a/RBBGCMuso/man/musoSensi.Rd b/RBBGCMuso/man/musoSensi.Rd index db8a583..b291be2 100644 --- a/RBBGCMuso/man/musoSensi.Rd +++ b/RBBGCMuso/man/musoSensi.Rd @@ -4,26 +4,13 @@ \alias{musoSensi} \title{musoSensi} \usage{ -musoSensi( - monteCarloFile = NULL, - parameters = NULL, - settings = NULL, - inputDir = "./", - outLoc = "./calib", - outVars = NULL, - iterations = 30, - preTag = "mont-", - outputType = "moreCsv", - fun = mean, - varIndex = 1, - outputFile = "sensitivity.csv", - plotName = "sensitivity.png", - plotTitle = "Sensitivity", - skipSpinup = TRUE, - skipZero = TRUE, - postProcString = NULL, - dpi = 300 -) +musoSensi(monteCarloFile = NULL, parameters = NULL, settings = NULL, + inputDir = "./", outLoc = "./calib", outVars = NULL, + iterations = 30, preTag = "mont-", outputType = "moreCsv", + fun = mean, varIndex = 1, outputFile = "sensitivity.csv", + plotName = "sensitivity.png", plotTitle = "Sensitivity", + skipSpinup = TRUE, skipZero = TRUE, postProcString = NULL, + dpi = 300) } \arguments{ \item{parameters}{This is a dataframe (heterogen data-matrix), which first column is the name of the parameters, the second is a numeric vector of the rownumbers of the given variable in the epc-fie, the last two column consist the endpont of the parameter-ranges, where the parameters will be randomized.} diff --git a/RBBGCMuso/man/optiMuso.Rd b/RBBGCMuso/man/optiMuso.Rd index d37f76e..4e4a64d 100644 --- a/RBBGCMuso/man/optiMuso.Rd +++ b/RBBGCMuso/man/optiMuso.Rd @@ -4,27 +4,14 @@ \alias{optiMuso} \title{optiMuso} \usage{ -optiMuso( - measuredData, - parameters = NULL, - startDate = NULL, - endDate = NULL, - formatString = "\%Y-\%m-\%d", - leapYearHandling = TRUE, - dataVar, - outLoc = "./calib", - preTag = "cal-", - settings = NULL, - outVars = NULL, - iterations = 30, - skipSpinup = TRUE, - constrains = NULL, - plotName = "calib.jpg", - likelihood = function(x, y) { exp(-sqrt(mean((x - y)^2))) }, - continious, - modelVar = 3009, - postProcString = NULL -) +optiMuso(measuredData, parameters = NULL, startDate = NULL, + endDate = NULL, formatString = "\%Y-\%m-\%d", + leapYearHandling = TRUE, dataVar, outLoc = "./calib", + preTag = "cal-", settings = NULL, outVars = NULL, + iterations = 30, skipSpinup = TRUE, constrains = NULL, + plotName = "calib.jpg", likelihood = function(x, y) { + exp(-sqrt(mean((x - y)^2))) }, continious, modelVar = 3009, + postProcString = NULL) } \arguments{ \item{parameters}{b} diff --git a/RBBGCMuso/man/paramSweep.Rd b/RBBGCMuso/man/paramSweep.Rd index 8933dce..39d435a 100644 --- a/RBBGCMuso/man/paramSweep.Rd +++ b/RBBGCMuso/man/paramSweep.Rd @@ -4,14 +4,9 @@ \alias{paramSweep} \title{paramSweep} \usage{ -paramSweep( - inputDir = "./", - parameters = NULL, - outputDir = NULL, - iterations = 10, - outVar = "daily_gpp", - htmlOutName = "paramsweep.html" -) +paramSweep(inputDir = "./", parameters = NULL, outputDir = NULL, + iterations = 10, outVar = "daily_gpp", + htmlOutName = "paramsweep.html") } \arguments{ \item{inputDir}{The directory which contains the MuSo model's ini files} diff --git a/RBBGCMuso/man/randEpc.Rd b/RBBGCMuso/man/randEpc.Rd index 4a83540..6087be7 100644 --- a/RBBGCMuso/man/randEpc.Rd +++ b/RBBGCMuso/man/randEpc.Rd @@ -4,13 +4,8 @@ \alias{randEpc} \title{randEpc} \usage{ -randEpc( - parameterFile = "parameters.csv", - location = "./epcDir", - sourceEpc = "maize.epc", - iterations = 1000, - constrains = NULL -) +randEpc(parameterFile = "parameters.csv", location = "./epcDir", + sourceEpc = "maize.epc", iterations = 1000, constrains = NULL) } \arguments{ \item{parameterFile}{parameters.csv file location} diff --git a/RBBGCMuso/man/readObservedData.Rd b/RBBGCMuso/man/readObservedData.Rd index e079014..622b4a3 100644 --- a/RBBGCMuso/man/readObservedData.Rd +++ b/RBBGCMuso/man/readObservedData.Rd @@ -4,19 +4,11 @@ \alias{readObservedData} \title{readMeasuredMuso} \usage{ -readObservedData( - inFile, - naString = NULL, - sep = ",", - leapYearHandling = TRUE, - convert.var = NULL, - convert.scalar = 1, +readObservedData(inFile, naString = NULL, sep = ",", + leapYearHandling = TRUE, convert.var = NULL, convert.scalar = 1, convert.fun = (function(x) { x * convert.scalar }), - convert.file = NULL, - filterCol = NULL, - filterVal = 1, - selVar = NULL -) + convert.file = NULL, filterCol = NULL, filterVal = 1, + selVar = NULL) } \description{ MuSo data reader diff --git a/RBBGCMuso/man/saveAllMusoPlots.Rd b/RBBGCMuso/man/saveAllMusoPlots.Rd index ec4c9d8..79b184b 100644 --- a/RBBGCMuso/man/saveAllMusoPlots.Rd +++ b/RBBGCMuso/man/saveAllMusoPlots.Rd @@ -4,15 +4,9 @@ \alias{saveAllMusoPlots} \title{saveAllMusoPlots} \usage{ -saveAllMusoPlots( - settings = NULL, - plotName = ".png", - silent = TRUE, - type = "line", - outFile = "annual.csv", - colour = NULL, - skipSpinup = FALSE -) +saveAllMusoPlots(settings = NULL, plotName = ".png", silent = TRUE, + type = "line", outFile = "annual.csv", colour = NULL, + skipSpinup = FALSE) } \arguments{ \item{settings}{RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option.} diff --git a/RBBGCMuso/man/stampAndDir.Rd b/RBBGCMuso/man/stampAndDir.Rd index c30516e..c1d2843 100644 --- a/RBBGCMuso/man/stampAndDir.Rd +++ b/RBBGCMuso/man/stampAndDir.Rd @@ -4,15 +4,8 @@ \alias{stampAndDir} \title{stampAndCopy} \usage{ -stampAndDir( - outputLoc, - names, - stampDir, - wrongDir, - type = "output", - errorsign, - logfiles -) +stampAndDir(outputLoc, names, stampDir, wrongDir, type = "output", + errorsign, logfiles) } \arguments{ \item{outputLoc}{This is the location of the output files.} diff --git a/RBBGCMuso/man/updateMusoMapping.Rd b/RBBGCMuso/man/updateMusoMapping.Rd index bbf40b9..8f343b4 100644 --- a/RBBGCMuso/man/updateMusoMapping.Rd +++ b/RBBGCMuso/man/updateMusoMapping.Rd @@ -4,7 +4,8 @@ \alias{updateMusoMapping} \title{updateMusoMapping} \usage{ -updateMusoMapping(excelName, dest = "./", version = getOption("RMuso_version")) +updateMusoMapping(excelName, dest = "./", + version = getOption("RMuso_version")) } \arguments{ \item{excelName}{Name of the excelfile which contains the parameters}