merge master
This commit is contained in:
commit
8992ddb0d1
@ -1,17 +1,16 @@
|
||||
Package: RBBGCMuso
|
||||
Title: An R package for BiomeBGC-MuSo ecosystem modelling
|
||||
Version: 0.7.0.1
|
||||
Version: 0.7.1
|
||||
Authors@R: person("Roland", "Hollo's", , "hollorol@gmail.com", role = c("aut", "cre"))
|
||||
Description: What the package does (one paragraph).
|
||||
Depends: R (>= 3.3.2)
|
||||
License: GPL-2
|
||||
LazyData: true
|
||||
NeedsCompilation: no
|
||||
Packaged: 2017-07-19 14:00:04 UTCs; hollorol
|
||||
Packaged: Wed 13 Nov 2019 02:41:52 PM CET hollorol
|
||||
Author: Roland Hollo's [aut, cre]
|
||||
Imports:
|
||||
grDevices,
|
||||
lubridate,
|
||||
limSolve,
|
||||
stats,
|
||||
utils,
|
||||
@ -25,12 +24,17 @@ Imports:
|
||||
tidyr,
|
||||
tcltk,
|
||||
digest,
|
||||
data.table,
|
||||
gridExtra
|
||||
LinkingTo: Rcpp
|
||||
SystemRequirements: C++11
|
||||
jsonlite,
|
||||
data.table,
|
||||
gridExtra,
|
||||
lubridate,
|
||||
openxlsx,
|
||||
ncdf4,
|
||||
future,
|
||||
httr,
|
||||
tcltk
|
||||
Maintainer: Roland Hollo's <hollorol@gmail.com>
|
||||
RoxygenNote: 6.1.1
|
||||
RoxygenNote: 7.1.0
|
||||
Suggests: knitr,
|
||||
rmarkdown,
|
||||
VignetteBuilder: knitr
|
||||
|
||||
@ -1,21 +1,26 @@
|
||||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
export(calibMuso)
|
||||
export(changeMusoC)
|
||||
export(calibrateMuso)
|
||||
export(changemulline)
|
||||
export(checkMeteoBGC)
|
||||
export(cleanupMuso)
|
||||
export(compareMuso)
|
||||
export(copyMusoExampleTo)
|
||||
export(corrigMuso)
|
||||
export(createSoilFile)
|
||||
export(getAnnualOutputList)
|
||||
export(getConstMatrix)
|
||||
export(getDailyOutputList)
|
||||
export(getyearlycum)
|
||||
export(getyearlymax)
|
||||
export(mtclim)
|
||||
export(musoDate)
|
||||
export(musoGlue)
|
||||
export(musoMapping)
|
||||
export(musoMappingFind)
|
||||
export(musoMonte)
|
||||
export(musoQuickEffect)
|
||||
export(musoRand)
|
||||
export(musoRandomizer)
|
||||
export(musoSensi)
|
||||
export(normalMuso)
|
||||
export(optiMuso)
|
||||
@ -33,7 +38,6 @@ export(supportedMuso)
|
||||
export(updateMusoMapping)
|
||||
import(ggplot2)
|
||||
import(utils)
|
||||
importFrom(Rcpp,evalCpp)
|
||||
importFrom(data.table,':=')
|
||||
importFrom(data.table,data.table)
|
||||
importFrom(data.table,fread)
|
||||
@ -45,6 +49,7 @@ importFrom(dplyr,mutate)
|
||||
importFrom(dplyr,select)
|
||||
importFrom(dplyr,summarize)
|
||||
importFrom(dplyr,tbl_df)
|
||||
importFrom(future,future)
|
||||
importFrom(ggplot2,aes)
|
||||
importFrom(ggplot2,aes_string)
|
||||
importFrom(ggplot2,element_blank)
|
||||
@ -62,16 +67,23 @@ 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)
|
||||
importFrom(magrittr,'%<>%')
|
||||
importFrom(magrittr,'%>%')
|
||||
importFrom(openxlsx,read.xlsx)
|
||||
importFrom(rmarkdown,pandoc_version)
|
||||
importFrom(rmarkdown,render)
|
||||
importFrom(scales,percent)
|
||||
importFrom(stats,approx)
|
||||
importFrom(tcltk,tk_choose.files)
|
||||
importFrom(tibble,rownames_to_column)
|
||||
importFrom(tidyr,gather)
|
||||
importFrom(tidyr,separate)
|
||||
useDynLib(RBBGCMuso)
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
|
||||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
|
||||
|
||||
#' mtclim
|
||||
#'
|
||||
#' This is the core mtclim function
|
||||
#' @importFrom Rcpp evalCpp
|
||||
#' @useDynLib RBBGCMuso
|
||||
#' @param iniFile is the name of the inifile
|
||||
#' @keywords internal
|
||||
#' @export
|
||||
mtclim <- function(iniFile) {
|
||||
invisible(.Call('_RBBGCMuso_mtclim', PACKAGE = 'RBBGCMuso', iniFile))
|
||||
}
|
||||
|
||||
getWritePositions <- function(a) {
|
||||
.Call('_RBBGCMuso_getWritePositions', PACKAGE = 'RBBGCMuso', a)
|
||||
}
|
||||
|
||||
#' changeMusoC
|
||||
#'
|
||||
#' This function is fastly randomize values based on min and max values
|
||||
#' @importFrom Rcpp evalCpp
|
||||
#' @useDynLib RBBGCMuso
|
||||
#' @param inFile is the big matrix
|
||||
#' @param outFile is the small matrix
|
||||
#' @export
|
||||
changeMusoC <- function(inFile, outFile, inMat) {
|
||||
invisible(.Call('_RBBGCMuso_changeMusoC', PACKAGE = 'RBBGCMuso', inFile, outFile, inMat))
|
||||
}
|
||||
|
||||
randTypeOne <- function(m) {
|
||||
.Call('_RBBGCMuso_randTypeOne', PACKAGE = 'RBBGCMuso', m)
|
||||
}
|
||||
|
||||
randTypeTwo <- function(m) {
|
||||
.Call('_RBBGCMuso_randTypeTwo', PACKAGE = 'RBBGCMuso', m)
|
||||
}
|
||||
|
||||
#' musoRandomizer
|
||||
#'
|
||||
#' This function is fastly randomize values based on min and max values,
|
||||
#' and row indexes.
|
||||
#' @importFrom Rcpp evalCpp
|
||||
#' @useDynLib RBBGCMuso
|
||||
#' @param A is the big matrix
|
||||
#' @param B is the small matrix
|
||||
#' @export
|
||||
musoRandomizer <- function(A, B) {
|
||||
.Call('_RBBGCMuso_musoRandomizer', PACKAGE = 'RBBGCMuso', A, B)
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ readObservedData <- function(inFile,
|
||||
baseData <- as.data.frame(baseData)
|
||||
baseData[baseData[,selVar] == naString,selVar] <- NA
|
||||
} else {
|
||||
baseData <- fread(file = inFile, sep=sep, naString = naString)
|
||||
baseData <- fread(file = inFile, sep=sep, na.strings = naString)
|
||||
baseData <- as.data.frame(baseData)
|
||||
}
|
||||
|
||||
|
||||
31
RBBGCMuso/R/atStart.R
Normal file
31
RBBGCMuso/R/atStart.R
Normal file
@ -0,0 +1,31 @@
|
||||
.onLoad <- function(libname,pkgname){
|
||||
print("This is RBBGCMuso version 0.7")
|
||||
RMuso_version <- 6
|
||||
RMuso_constMatrix <- list(epc=NULL,soil=NULL)
|
||||
RMuso_varTable <- list()
|
||||
#___________________________
|
||||
sapply(names(RMuso_constMatrix),function(fType){
|
||||
sapply(list.files(path=system.file("data",package="RBBGCMuso"),
|
||||
pattern=sprintf("^%sConstMatrix\\d\\.json$",fType), full.names=TRUE),function(fName){
|
||||
constMatrix <- jsonlite::read_json(fName,simplifyVector = TRUE)[,c(1,2,3,4,9,5,6,7,8)]
|
||||
version <- gsub(".*(\\d)\\.json","\\1",fName)
|
||||
RMuso_constMatrix[[fType]][[version]] <<- constMatrix
|
||||
})
|
||||
RMuso_constMatrix
|
||||
# RMuso_constMatrix <<- RMuso_constMatrix
|
||||
})
|
||||
|
||||
|
||||
sapply(list.files(path=system.file("data",package="RBBGCMuso"),
|
||||
pattern="^varTable\\d\\.json$", full.names=TRUE),function(fName){
|
||||
varTable <- jsonlite::read_json(fName,simplifyVector = TRUE)
|
||||
version <- gsub(".*(\\d)\\.json","\\1",fName)
|
||||
RMuso_varTable[[version]] <<- varTable
|
||||
})
|
||||
|
||||
|
||||
options(RMuso_version=RMuso_version,
|
||||
RMuso_constMatrix=RMuso_constMatrix,
|
||||
RMuso_varTable=RMuso_varTable)
|
||||
# getOption("RMuso_constMatrix")$soil[[as.character(getOption("RMuso_version"))]]
|
||||
}
|
||||
@ -24,20 +24,29 @@
|
||||
#' @import utils
|
||||
#' @export
|
||||
|
||||
calibMuso <- function(settings=NULL, calibrationPar=NULL,
|
||||
calibMuso <- function(settings=setupMuso(), calibrationPar=NULL,
|
||||
parameters=NULL, outVars = NULL, timee="d",
|
||||
debugging=FALSE, logfilename=NULL,
|
||||
keepEpc=FALSE, export=FALSE,
|
||||
silent=FALSE, aggressive=FALSE,
|
||||
keepBinary=FALSE,
|
||||
binaryPlace="./", fileToChange="epc",
|
||||
skipSpinup = TRUE, modifyOriginal =FALSE, prettyOut = FALSE,
|
||||
postProcString = NULL){ #
|
||||
binaryPlace = "./", fileToChange = "epc",
|
||||
skipSpinup = TRUE, modifyOriginal = FALSE, prettyOut = FALSE,
|
||||
postProcString = NULL,
|
||||
doBackup=TRUE
|
||||
){ #
|
||||
########################################################################
|
||||
###########################Set local variables and places###############
|
||||
########################################################################
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
if(doBackup){
|
||||
file.copy(eval(parse(text = sprintf("settings$%sInput[2]", fileToChange))),file.path(settings$inputLoc),overwrite=FALSE)
|
||||
}
|
||||
|
||||
bck <- file.path(settings$inputLoc, "bck",
|
||||
basename(eval(parse(text = sprintf("settings$%sInput[2]", fileToChange)))))
|
||||
|
||||
if(!silent){
|
||||
cat("Biome-BGC simulation started\n") # ZOLI
|
||||
}
|
||||
|
||||
Linuxp <-(Sys.info()[1]=="Linux")
|
||||
@ -96,50 +105,27 @@ calibMuso <- function(settings=NULL, calibrationPar=NULL,
|
||||
|
||||
|
||||
|
||||
if(aggressive==TRUE){
|
||||
cleanupMuso(location=outputLoc,deep = TRUE)
|
||||
if(aggressive == TRUE){
|
||||
cleanupMuso(location = outputLoc,deep = TRUE)
|
||||
}
|
||||
|
||||
toModif<-c(epc[2],iniInput[2])
|
||||
|
||||
if(!modifyOriginal & (!is.null(parameters) | !is.null(outVars)))
|
||||
{
|
||||
|
||||
toModif <- sapply(toModif, function (x){
|
||||
paste0(tools::file_path_sans_ext(basename(x)),"-tmp.",tools::file_ext(x))
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
##change the epc file if and only if there are given parameters
|
||||
|
||||
if(!is.null(parameters)){
|
||||
changemulline(filePaths=c(epc[2],iniInput[2]), calibrationPar = calibrationPar,
|
||||
contents = parameters, fileOut=toModif, fileToChange=fileToChange, modifyOriginal=modifyOriginal)
|
||||
changemulline(filePaths = epc[2],
|
||||
calibrationPar = calibrationPar,
|
||||
contents = parameters,
|
||||
src = if(file.exists(bck)){
|
||||
bck
|
||||
} else {
|
||||
NULL
|
||||
})
|
||||
# fileToChange = fileToChange,)
|
||||
}
|
||||
|
||||
|
||||
##We change the working directory becase of the model, but we want to avoid sideeffects, so we save the current location and after that we will change everything to it.
|
||||
if(!modifyOriginal & (!is.null(parameters) | !is.null(outVars))){
|
||||
epc[2]<-file.path(dirname(epc[2]),toModif[1]) # Writing back the lost path
|
||||
toModif[2]<-file.path(dirname(iniInput[2]),toModif[2]) #for the Initmp, also
|
||||
if((!is.null(outVars) | !file.exists(toModif[2])) & !modifyOriginal){
|
||||
file.copy(iniInput[2],toModif[2],overwrite = TRUE)
|
||||
}
|
||||
|
||||
iniInput[2] <- toModif[2]}
|
||||
|
||||
if(!is.null(parameters) & ((fileToChange == "epc") | (fileToChange == "both")) & !modifyOriginal){
|
||||
tmp<-readLines(iniInput[2])
|
||||
tmpInd<-grep("EPC_FILE",tmp)+1
|
||||
tmp[tmpInd]<-file.path(dirname(tmp[tmpInd]),basename(epc[2]))
|
||||
writeLines(tmp,iniInput[2])
|
||||
rm(list=c("tmp","tmpInd"))
|
||||
}
|
||||
if(!is.null(outVars)){
|
||||
outputVarChanges <- putOutVars(iniInput[2], outputVars = outVars, modifyOriginal = !modifyOriginal)
|
||||
settings$outputVars[[1]]<-outputVarChanges[[1]]
|
||||
settings$numData <- round(settings$numData*outputVarChanges[[2]])
|
||||
}
|
||||
|
||||
if(!skipSpinup) {
|
||||
|
||||
@ -239,7 +225,6 @@ calibMuso <- function(settings=NULL, calibrationPar=NULL,
|
||||
setwd((whereAmI))
|
||||
stop("Cannot read binary output, please check if the output type is set 2 in the ini files!")}))
|
||||
)
|
||||
|
||||
if(keepBinary){
|
||||
possibleNames <- tryCatch(getOutFiles(outputLoc = outputLoc,outputNames = outputNames),
|
||||
error=function (e){
|
||||
|
||||
392
RBBGCMuso/R/calibrateMuso.R
Normal file
392
RBBGCMuso/R/calibrateMuso.R
Normal file
@ -0,0 +1,392 @@
|
||||
#' calibrateMuso
|
||||
#'
|
||||
#' This funtion uses the Monte Carlo technique to uniformly sample the parameter space from user defined parameters of the Biome-BGCMuSo model. The sampling algorithm ensures that the parameters are constrained by the model logic which means that parameter dependencies are fully taken into account (parameter dependency means that e.g leaf C:N ratio must be smaller than C:N ratio of litter; more complicated rules apply to the allocation parameters where the allocation fractions to different plant compartments must sum up 1). This function implements a mathematically correct solution to provide uniform distriution for all selected parameters.
|
||||
#' @author Roland HOLLOS
|
||||
#' @importFrom future future
|
||||
#' @export
|
||||
calibrateMuso <- function(measuredData, parameters =read.csv("parameters.csv", stringsAsFactor=FALSE), startDate = NULL,
|
||||
endDate = NULL, formatString = "%Y-%m-%d",
|
||||
dataVar, outLoc = "./calib",
|
||||
preTag = "cal-", settings = setupMuso(),
|
||||
outVars = NULL, iterations = 100,
|
||||
skipSpinup = TRUE, plotName = "calib.jpg",
|
||||
modifyOriginal=TRUE, likelihood, uncertainity = NULL,
|
||||
naVal = NULL, postProcString = NULL,
|
||||
thread_prefix="thread", numCores = (parallel::detectCores()-1), pb = txtProgressBar(min=0, max=iterations, style=3),
|
||||
maxLikelihoodEpc=TRUE,
|
||||
pbUpdate = setTxtProgressBar, outputLoc="./", method="GLUE",lg = FALSE, w=NULL, ...){
|
||||
|
||||
future::plan(future::multisession)
|
||||
file.remove(list.files(path = settings$inputLoc, pattern="progress.txt", recursive = TRUE, full.names=TRUE))
|
||||
file.remove(list.files(path = settings$inputLoc, pattern="preservedCalib.csv", recursive = TRUE, full.names=TRUE))
|
||||
unlink(file.path(settings$inputLoc,"thread"),recursive=TRUE)
|
||||
|
||||
# ____ _ _ _ _
|
||||
# / ___|_ __ ___ __ _| |_ ___ | |_| |__ _ __ ___ __ _ __| |___
|
||||
# | | | '__/ _ \/ _` | __/ _ \ | __| '_ \| '__/ _ \/ _` |/ _` / __|
|
||||
# | |___| | | __/ (_| | || __/ | |_| | | | | | __/ (_| | (_| \__ \
|
||||
# \____|_| \___|\__,_|\__\___| \__|_| |_|_| \___|\__,_|\__,_|___/
|
||||
|
||||
|
||||
|
||||
copyToThreadDirs(thread_prefix, numcores = numCores, runDir = settings$inputLoc)
|
||||
|
||||
# ____ _ _ _
|
||||
# | _ \ _ _ _ __ | |_| |__ _ __ ___ __ _ __| |___
|
||||
# | |_) | | | | '_ \ | __| '_ \| '__/ _ \/ _` |/ _` / __|
|
||||
# | _ <| |_| | | | | | |_| | | | | | __/ (_| | (_| \__ \
|
||||
# |_| \_\\__,_|_| |_| \__|_| |_|_| \___|\__,_|\__,_|___/
|
||||
|
||||
threadCount <- distributeCores(iterations, numCores)
|
||||
|
||||
fut <- lapply(1:numCores, function(i) {
|
||||
# browser()
|
||||
future({
|
||||
tryCatch(
|
||||
musoSingleThread(measuredData, parameters, startDate,
|
||||
endDate, formatString,
|
||||
dataVar, outLoc,
|
||||
preTag, settings,
|
||||
outVars, iterations = threadCount[i],
|
||||
skipSpinup, plotName,
|
||||
modifyOriginal, likelihood, uncertainity,
|
||||
naVal, postProcString, i)
|
||||
, error = function(e){
|
||||
writeLines(as.character(iterations),"progress.txt")
|
||||
})
|
||||
|
||||
# musoSingleThread(measuredData, parameters, startDate,
|
||||
# endDate, formatString,
|
||||
# dataVar, outLoc,
|
||||
# preTag, settings,
|
||||
# outVars, iterations = threadCount[i],
|
||||
# skipSpinup, plotName,
|
||||
# modifyOriginal, likelihood, uncertainity,
|
||||
# naVal, postProcString, i)
|
||||
})
|
||||
})
|
||||
|
||||
# __ ___ _ _
|
||||
# \ \ / / |__ __ _| |_ ___| |__ _ __ _ __ ___ ___ ___ ___ ___
|
||||
# \ \ /\ / /| '_ \ / _` | __/ __| '_ \ | '_ \| '__/ _ \ / __/ _ \/ __/ __|
|
||||
# \ V V / | | | | (_| | || (__| | | | | |_) | | | (_) | (_| __/\__ \__ \
|
||||
# \_/\_/ |_| |_|\__,_|\__\___|_| |_| | .__/|_| \___/ \___\___||___/___/
|
||||
# |_|
|
||||
|
||||
getProgress <- function(){
|
||||
# threadfiles <- list.files(settings$inputLoc, pattern="progress.txt", recursive = TRUE)
|
||||
threadfiles <- list.files(pattern="progress.txt", recursive = TRUE)
|
||||
if(length(threadfiles)==0){
|
||||
return(0)
|
||||
} else {
|
||||
sum(sapply(threadfiles, function(x){
|
||||
partRes <- readLines(x)
|
||||
if(length(partRes)==0){
|
||||
return(0)
|
||||
} else {
|
||||
return(as.numeric(partRes))
|
||||
}
|
||||
|
||||
}))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
progress <- 0
|
||||
while(progress < iterations){
|
||||
Sys.sleep(1)
|
||||
progress <- tryCatch(getProgress(), error=function(e){progress})
|
||||
if(is.null(pb)){
|
||||
pbUpdate(as.numeric(progress))
|
||||
} else {
|
||||
pbUpdate(pb,as.numeric(progress))
|
||||
}
|
||||
}
|
||||
if(!is.null(pb)){
|
||||
close(pb)
|
||||
}
|
||||
|
||||
# ____ _ _
|
||||
# / ___|___ _ __ ___ | |__ (_)_ __ ___
|
||||
# | | / _ \| '_ ` _ \| '_ \| | '_ \ / _ \
|
||||
# | |__| (_) | | | | | | |_) | | | | | __/
|
||||
# \____\___/|_| |_| |_|_.__/|_|_| |_|\___|
|
||||
resultFiles <- list.files(pattern="preservedCalib.*csv$",recursive=TRUE)
|
||||
res0 <- read.csv(grep("thread_1/",resultFiles, value=TRUE),stringsAsFactors=FALSE)
|
||||
resultFilesSans0 <- grep("thread_1/", resultFiles, value=TRUE, invert=TRUE)
|
||||
# results <- do.call(rbind,lapply(resultFilesSans0, function(f){read.csv(f, stringsAsFactors=FALSE)}))
|
||||
resultsSans0 <- lapply(resultFilesSans0, function(f){read.csv(f, stringsAsFactors=FALSE, header=FALSE)})
|
||||
resultsSans0 <- do.call(rbind,resultsSans0)
|
||||
colnames(resultsSans0) <- colnames(res0)
|
||||
results <- (rbind(res0,resultsSans0))
|
||||
|
||||
switch(method,
|
||||
"GLUE"={
|
||||
musoGlue(results, parameters=parameters,settings=settings, w=w, lg=lg)
|
||||
},
|
||||
"agromo"={
|
||||
liks <- results[,sprintf("%s_likelihood",names(likelihood))]
|
||||
epcIndexes <- future::value(fut[[1]], stdout = FALSE, signal=FALSE)
|
||||
epcVals <- results[which.max(liks),1:length(epcIndexes)]
|
||||
epcPlace <- file.path(dirname(settings$inputFiles),settings$epc)[2]
|
||||
changemulline(filePaths= epcPlace, epcIndexes,
|
||||
epcVals, src =epcPlace,# settings$epcInput[2],
|
||||
outFiles = file.path(outputLoc, "maxLikelihood_epc.epc"))
|
||||
names(epcVals) <- epcIndexes
|
||||
xdate <- as.Date(measuredData$date)
|
||||
meanM <- measuredData[,sprintf("mean.%s", names(likelihood))]
|
||||
minsd <- meanM - measuredData[,sprintf("sd.%s", names(likelihood)[1])]
|
||||
maxsd <- meanM + measuredData[,sprintf("sd.%s", names(likelihood)[1])]
|
||||
minM <- measuredData[,sprintf("min.%s", names(likelihood)[1])]
|
||||
maxM <- measuredData[,sprintf("max.%s", names(likelihood)[1])]
|
||||
plot(xdate, minM, type="l", xlab=NA, ylim=c(min(minM)*0.8, max(maxM)*1.1), ylab = names(likelihood)[1])
|
||||
lines(xdate, maxM)
|
||||
polygon(c(xdate,rev(xdate)),c(minM,rev(maxM)), col="gray",border=NA)
|
||||
lines(xdate, minsd)
|
||||
lines(xdate, maxsd)
|
||||
polygon(c(xdate,rev(xdate)),c(minsd,rev(maxsd)), col="gray30",border=NA)
|
||||
points(xdate,meanM)
|
||||
|
||||
varIndex <- match(as.character(dataVar),settings$dailyVarCodes)
|
||||
apriori <- calibMuso(settings)
|
||||
modDates <- as.Date(row.names(apriori), format="%d.%m.%Y")
|
||||
lines(modDates, apriori[,varIndex],col="brown")
|
||||
calibrated <- calibMuso(settings, calibrationPar = as.numeric(names(epcVals)), parameters=epcVals)
|
||||
lines(modDates, calibrated[,varIndex],col="blue")
|
||||
|
||||
},
|
||||
stop(sprintf("method: %s not found, please choose from {GLUE, agromo}. See more about this in the documentation of the function!", method))
|
||||
)
|
||||
}
|
||||
|
||||
copyToThreadDirs <- function(prefix="thread", numcores=parallel::detectCores()-1, runDir="."){
|
||||
dir.create(file.path(runDir,prefix), showWarnings=TRUE)
|
||||
fileNames <- grep(".*thread$", list.files(runDir,full.names=TRUE), value=TRUE, invert=TRUE)
|
||||
invisible(sapply(1:numcores,function(corenum){
|
||||
threadDir <- file.path(runDir,prefix,paste0(prefix,"_",corenum),"")
|
||||
dir.create(threadDir, showWarnings=FALSE)
|
||||
file.copy(from=fileNames,to=threadDir, overwrite=FALSE, recursive=TRUE)
|
||||
}))
|
||||
}
|
||||
|
||||
musoSingleThread <- function(measuredData, parameters = NULL, startDate = NULL,
|
||||
endDate = NULL, formatString = "%Y-%m-%d",
|
||||
dataVar, outLoc = "./calib",
|
||||
preTag = "cal-", settings = setupMuso(),
|
||||
outVars = NULL, iterations = 300,
|
||||
skipSpinup = TRUE, plotName = "calib.jpg",
|
||||
modifyOriginal=TRUE, likelihood, uncertainity = NULL,
|
||||
naVal = NULL, postProcString = NULL, threadNumber) {
|
||||
|
||||
setwd(paste0(settings$inputLoc, "/thread/thread_", threadNumber))
|
||||
|
||||
iniFiles <- file.path(settings$iniInput)
|
||||
# iniFiles <- list.files(pattern=".*ini")
|
||||
# if(length(iniFiles)==1){
|
||||
# iniFiles <- rep(iniFiles, 2)
|
||||
# }
|
||||
settings <- setupMuso(iniInput = iniFiles)
|
||||
# Exanding likelihood
|
||||
|
||||
likelihoodFull <- as.list(rep(NA,length(dataVar)))
|
||||
names(likelihoodFull) <- names(dataVar)
|
||||
if(!missing(likelihood)) {
|
||||
lapply(names(likelihood),function(x){
|
||||
likelihoodFull[[x]] <<- likelihood[[x]]
|
||||
})
|
||||
}
|
||||
defaultLikelihood <- which(is.na(likelihood))
|
||||
if(length(defaultLikelihood)>0){
|
||||
likelihoodFull[[defaultLikelihood]] <- (function(x, y){
|
||||
exp(-sqrt(mean((x-y)^2)))
|
||||
})
|
||||
}
|
||||
|
||||
mdata <- measuredData
|
||||
if(is.null(parameters)){
|
||||
parameters <- tryCatch(read.csv("parameters.csv", stringsAsFactor=FALSE), error = function (e) {
|
||||
stop("You need to specify a path for the parameters.csv, or a matrix.")
|
||||
})
|
||||
} else {
|
||||
if((!is.list(parameters)) & (!is.matrix(parameters))){
|
||||
parameters <- tryCatch(read.csv(parameters, stringsAsFactor=FALSE), error = function (e){
|
||||
stop("Cannot find neither parameters file neither the parameters matrix")
|
||||
})
|
||||
}}
|
||||
|
||||
outLoc <- normalizePath(outLoc)
|
||||
outLocPlain <- basename(outLoc)
|
||||
currDir <- getwd()
|
||||
|
||||
if(!dir.exists(outLoc)){
|
||||
dir.create(outLoc)
|
||||
warning(paste(outLoc," is not exists, so it was created"))
|
||||
}
|
||||
|
||||
outLoc <- normalizePath(outLoc)
|
||||
parameterNames <- parameters[,1]
|
||||
pretag <- file.path(outLoc,preTag)
|
||||
##reading the original epc file at the specified
|
||||
## row numbers
|
||||
print("optiMuso is randomizing the epc parameters now...",quote = FALSE)
|
||||
if(iterations < 3000){
|
||||
randVals <- musoRand(parameters = parameters,constrains = NULL, iterations = 3000)
|
||||
randVals[[2]]<- randVals[[2]][sample(1:3000,iterations),]
|
||||
} else {
|
||||
randVals <- musoRand(parameters = parameters,constrains = NULL, iterations = iterations)
|
||||
}
|
||||
|
||||
origEpc <- readValuesFromFile(settings$epc[2],randVals[[1]])
|
||||
partialResult <- matrix(ncol=length(randVals[[1]])+2*length(dataVar))
|
||||
colN <- randVals[[1]]
|
||||
colN[match(parameters[,2],randVals[[1]])] <- parameters[,1]
|
||||
colN[match(parameters[,2], randVals[[1]])[!is.na(match(parameters[,2],randVals[[1]]))]] <- parameters[,1]
|
||||
colnames(partialResult) <- c(colN,sprintf("%s_likelihood",names(dataVar)),
|
||||
sprintf("%s_rmse",names(dataVar)))
|
||||
numParameters <- length(colN)
|
||||
partialResult[1:numParameters] <- origEpc
|
||||
## Prepare the preservedCalib matrix for the faster
|
||||
## run.
|
||||
|
||||
pretag <- file.path(outLoc,preTag)
|
||||
|
||||
musoCodeToIndex <- sapply(dataVar,function(musoCode){
|
||||
settings$dailyOutputTable[settings$dailyOutputTable$code == musoCode,"index"]
|
||||
})
|
||||
resultRange <- (numParameters + 1):(ncol(partialResult))
|
||||
## Creating function for generating separate
|
||||
## csv files for each run
|
||||
|
||||
settings$iniInput[2] %>%
|
||||
(function(x) paste0(dirname(x),"/",tools::file_path_sans_ext(basename(x)),"-tmp.",tools::file_ext(x))) %>%
|
||||
unlink
|
||||
randValues <- randVals[[2]]
|
||||
|
||||
settings$calibrationPar <- randVals[[1]]
|
||||
|
||||
if(!is.null(naVal)){
|
||||
measuredData <- as.data.frame(measuredData)
|
||||
measuredData[measuredData == naVal] <- NA
|
||||
}
|
||||
|
||||
alignIndexes <- alignMuso(settings,measuredData)
|
||||
if(!is.null(uncertainity)){
|
||||
uncert <- measuredData[alignIndexes$meas,uncertainity]
|
||||
} else {
|
||||
uncert <- NULL
|
||||
}
|
||||
# browser()
|
||||
if(threadNumber == 1){
|
||||
origModellOut <- calibMuso(settings=settings, silent=TRUE, skipSpinup = skipSpinup, postProcString=postProcString, modifyOriginal=modifyOriginal)
|
||||
partialResult[,resultRange] <- calcLikelihoodsAndRMSE(dataVar=dataVar,
|
||||
mod=origModellOut,
|
||||
mes=measuredData,
|
||||
likelihoods=likelihood,
|
||||
alignIndexes=alignIndexes,
|
||||
musoCodeToIndex = musoCodeToIndex,uncert=uncert)
|
||||
write.csv(x=origModellOut, file=paste0(pretag, 1, ".csv"))
|
||||
write.csv(x=partialResult, file="preservedCalib.csv",row.names=FALSE)
|
||||
}
|
||||
print("Running the model with the random epc values...", quote = FALSE)
|
||||
|
||||
# if(!is.null(postProcString)){
|
||||
# colNumb <- length(settings$dailyVarCodes) + 1
|
||||
# }
|
||||
|
||||
|
||||
for(i in 2:(iterations+1)){
|
||||
|
||||
tmp <- tryCatch(calibMuso(settings = settings,
|
||||
parameters = randValues[(i-1),],
|
||||
silent= TRUE,
|
||||
skipSpinup = skipSpinup, modifyOriginal=modifyOriginal, postProcString = postProcString), error = function (e) NULL)
|
||||
if(is.null(tmp)){
|
||||
partialResult[,resultRange] <- NA
|
||||
} else {
|
||||
partialResult[,resultRange] <- calcLikelihoodsAndRMSE(dataVar=dataVar,
|
||||
mod=tmp,
|
||||
mes=measuredData,
|
||||
likelihoods=likelihood,
|
||||
alignIndexes=alignIndexes,
|
||||
musoCodeToIndex = musoCodeToIndex, uncert = uncert)
|
||||
}
|
||||
|
||||
partialResult[1:numParameters] <- randValues[(i-1),]
|
||||
write.table(x=partialResult, file="preservedCalib.csv", append=TRUE, row.names=FALSE,
|
||||
sep=",", col.names=FALSE)
|
||||
write.csv(x=tmp, file=paste0(pretag, (i+1),".csv"))
|
||||
writeLines(as.character(i-1),"progress.txt")
|
||||
}
|
||||
|
||||
if(threadNumber == 1){
|
||||
return(randVals[[1]])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
distributeCores <- function(iterations, numCores){
|
||||
perProcess<- iterations %/% numCores
|
||||
numSimu <- rep(perProcess,numCores)
|
||||
gainers <- sample(1:numCores, iterations %% numCores)
|
||||
numSimu[gainers] <- numSimu[gainers] + 1
|
||||
numSimu
|
||||
}
|
||||
|
||||
prepareFromAgroMo <- function(fName){
|
||||
obs <- read.table(fName, stringsAsFactors=FALSE, sep = ";", header=T)
|
||||
obs <- reshape(obs, timevar="var_id", idvar = "date", direction = "wide")
|
||||
dateCols <- apply(do.call(rbind,(strsplit(obs$date, split = "-"))),2,as.numeric)
|
||||
colnames(dateCols) <- c("year", "month", "day")
|
||||
cbind.data.frame(dateCols, obs)
|
||||
}
|
||||
|
||||
|
||||
calcLikelihoodsAndRMSE <- function(dataVar, mod, mes, likelihoods, alignIndexes, musoCodeToIndex, uncert){
|
||||
|
||||
mes <- as.data.frame(mes)
|
||||
# NOT COMPATIBLE WITH OLD MEASUREMENT DATA, mes have to be a matrix
|
||||
likelihoodRMSE <- sapply(names(dataVar),function(key){
|
||||
modelled <- mod[alignIndexes$mod,musoCodeToIndex[key]]
|
||||
selected <- grep(sprintf("%s$", key), colnames(mes))
|
||||
# browser()
|
||||
|
||||
measured <- mes[alignIndexes$meas,selected]
|
||||
|
||||
if(is.null(dim(measured))){
|
||||
notNA <- !is.na(measured)
|
||||
m <- measured <- measured[notNA]
|
||||
|
||||
} else {
|
||||
notNA <- sapply(1:nrow(measured), function(x){!any(is.na(measured[x,]))})
|
||||
measured <- measured[notNA,]
|
||||
m <- measured[,grep("^mean", colnames(measured))]
|
||||
}
|
||||
modelled <- modelled[notNA]
|
||||
|
||||
# uncert <- uncert[!is.na(measured)]
|
||||
|
||||
# measured <- measured[!is.na(measured)]
|
||||
res <- c(likelihoods[[key]](modelled, measured),
|
||||
sqrt(mean((modelled-m)^2))
|
||||
)
|
||||
# browser()
|
||||
res
|
||||
})
|
||||
names(likelihoodRMSE) <- c(sprintf("%s_likelihood",dataVar), sprintf("%s_rmse",dataVar))
|
||||
return(c(likelihoodRMSE[1,],likelihoodRMSE[2,]))
|
||||
}
|
||||
|
||||
agroLikelihood <- function(modVector,measured){
|
||||
mu <- measured[,grep("mean", colnames(measured))]
|
||||
stdev <- measured[,grep("^sd", colnames(measured))]
|
||||
ndata <- nrow(measured)
|
||||
sum(sapply(1:ndata, function(x){
|
||||
dnorm(modVector, mu[x], stdev[x], log = TRUE)
|
||||
}), na.rm=TRUE)
|
||||
}
|
||||
|
||||
|
||||
|
||||
maxLikelihoodAgromo <- function (results, imgPath, varName, ...) {
|
||||
|
||||
}
|
||||
@ -28,25 +28,28 @@
|
||||
#' @export
|
||||
optiMuso <- function(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)
|
||||
{
|
||||
mdata <- measuredData
|
||||
dataCol <- grep(dataVar, colnames(measuredData))
|
||||
preTag = "cal-", settings = setupMuso(),
|
||||
outVars = NULL, iterations = 30,
|
||||
skipSpinup = TRUE, plotName = "calib.jpg",
|
||||
modifyOriginal=TRUE, likelihood, uncertainity = NULL,
|
||||
naVal = NULL, postProcString = NULL, w=NULL, lg=FALSE, parallel = TRUE) {
|
||||
# Exanding likelihood
|
||||
likelihoodFull <- as.list(rep(NA,length(dataVar)))
|
||||
names(likelihoodFull) <- names(dataVar)
|
||||
if(!missing(likelihood)) {
|
||||
lapply(names(likelihood),function(x){
|
||||
likelihoodFull[[x]] <<- likelihood[[x]]
|
||||
})
|
||||
}
|
||||
defaultLikelihood <- which(is.na(likelihood))
|
||||
if(length(defaultLikelihood)>0){
|
||||
likelihoodFull[[defaultLikelihood]] <- (function(x, y){
|
||||
exp(-sqrt(mean((x-y)^2)))
|
||||
})
|
||||
}
|
||||
|
||||
mdata <- measuredData
|
||||
if(is.null(parameters)){
|
||||
parameters <- tryCatch(read.csv("parameters.csv", stringsAsFactor=FALSE), error = function (e) {
|
||||
stop("You need to specify a path for the parameters.csv, or a matrix.")
|
||||
@ -68,104 +71,241 @@ optiMuso <- function(measuredData, parameters = NULL, startDate = NULL,
|
||||
}
|
||||
|
||||
outLoc <- normalizePath(outLoc)
|
||||
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
}
|
||||
|
||||
parameterNames <- parameters[,1]
|
||||
pretag <- file.path(outLoc,preTag)
|
||||
npar <- length(settings$calibrationPar)
|
||||
|
||||
##reading the original epc file at the specified
|
||||
## row numbers
|
||||
print("optiMuso is randomizing the epc parameters now...",quote = FALSE)
|
||||
if(iterations < 3000){
|
||||
randVals <- musoRand(parameters = parameters,constrains = constrains, iterations = 3000)
|
||||
randVals <- musoRand(parameters = parameters,constrains = NULL, iterations = 3000)
|
||||
randVals[[2]]<- randVals[[2]][sample(1:3000,iterations),]
|
||||
} else {
|
||||
randVals <- musoRand(parameters = parameters,constrains = constrains, iterations = iterations)
|
||||
randVals <- musoRand(parameters = parameters,constrains = NULL, iterations = iterations)
|
||||
}
|
||||
|
||||
origEpc <- readValuesFromFile(settings$epc[2],parameters[,2])
|
||||
|
||||
origEpc <- readValuesFromFile(settings$epc[2],randVals[[1]])
|
||||
partialResult <- matrix(ncol=length(randVals[[1]])+2*length(dataVar))
|
||||
colN <- randVals[[1]]
|
||||
colN[match(parameters[,2],randVals[[1]])] <- parameters[,1]
|
||||
colnames(partialResult) <- c(colN,sprintf("%s_likelihood",names(dataVar)),
|
||||
sprintf("%s_rmse",names(dataVar)))
|
||||
numParameters <- length(colN)
|
||||
partialResult[1:numParameters] <- origEpc
|
||||
## Prepare the preservedCalib matrix for the faster
|
||||
## run.
|
||||
|
||||
pretag <- file.path(outLoc,preTag)
|
||||
|
||||
musoCodeToIndex <- sapply(dataVar,function(musoCode){
|
||||
settings$dailyOutputTable[settings$dailyOutputTable$code == musoCode,"index"]
|
||||
})
|
||||
resultRange <- (numParameters + 1):(ncol(partialResult))
|
||||
## Creating function for generating separate
|
||||
## csv files for each run
|
||||
|
||||
progBar <- txtProgressBar(1,iterations,style=3)
|
||||
colNumb <- which(settings$dailyVarCodes == modelVar)
|
||||
settings$iniInput[2] %>%
|
||||
(function(x) paste0(dirname(x),"/",tools::file_path_sans_ext(basename(x)),"-tmp.",tools::file_ext(x))) %>%
|
||||
unlink
|
||||
randValues <- randVals[[2]]
|
||||
|
||||
settings$calibrationPar <- randVals[[1]]
|
||||
list2env(alignData(measuredData,dataCol = dataCol,modellSettings = settings,startDate = startDate,endDate = endDate,leapYear = leapYearHandling, continious = continious),envir=environment())
|
||||
## modIndex and measuredData are created.
|
||||
|
||||
modellOut <- numeric(iterations + 1) # single variable solution
|
||||
rmse <- numeric(iterations + 1)
|
||||
origModellOut <- calibMuso(settings=settings,silent=TRUE, skipSpinup = skipSpinup)
|
||||
|
||||
|
||||
write.csv(x=origModellOut, file=paste0(pretag,1,".csv"))
|
||||
modellOut[1] <- likelihood(measuredData,origModellOut[modIndex,colNumb])
|
||||
print("Running the model with the random epc values...", quote = FALSE)
|
||||
|
||||
if(!is.null(postProcString)){
|
||||
colNumb <- length(settings$dailyVarCodes) + 1
|
||||
if(!is.null(naVal)){
|
||||
measuredData <- as.data.frame(measuredData)
|
||||
measuredData[measuredData == naVal] <- NA
|
||||
}
|
||||
|
||||
alignIndexes <- alignMuso(settings,measuredData)
|
||||
if(!is.null(uncertainity)){
|
||||
uncert <- measuredData[alignIndexes$meas,uncertainity]
|
||||
} else {
|
||||
uncert <- NULL
|
||||
}
|
||||
# browser()
|
||||
# browser()
|
||||
origModellOut <- calibMuso(settings=settings, silent=TRUE, skipSpinup = skipSpinup, postProcString=postProcString, modifyOriginal=modifyOriginal)
|
||||
partialResult[,resultRange] <- calcLikelihoodsAndRMSE(dataVar=dataVar,
|
||||
mod=origModellOut,
|
||||
mes=measuredData,
|
||||
likelihoods=likelihood,
|
||||
alignIndexes=alignIndexes,
|
||||
musoCodeToIndex = musoCodeToIndex,uncert=uncert)
|
||||
write.csv(x=origModellOut, file=paste0(pretag, 1, ".csv"))
|
||||
print("Running the model with the random epc values...", quote = FALSE)
|
||||
|
||||
# if(!is.null(postProcString)){
|
||||
# colNumb <- length(settings$dailyVarCodes) + 1
|
||||
# }
|
||||
|
||||
write.csv(x=partialResult, file="preservedCalib.csv",row.names=FALSE)
|
||||
for(i in 2:(iterations+1)){
|
||||
# browser()
|
||||
tmp <- tryCatch(calibMuso(settings = settings,
|
||||
parameters = randValues[(i-1),],
|
||||
silent= TRUE,
|
||||
skipSpinup = skipSpinup, postProcString = postProcString)[modIndex,colNumb], error = function (e) NA)
|
||||
skipSpinup = skipSpinup, modifyOriginal=modifyOriginal, postProcString = postProcString), error = function (e) NULL)
|
||||
if(is.null(tmp)){
|
||||
partialResult[,resultRange] <- NA
|
||||
} else {
|
||||
partialResult[,resultRange] <- calcLikelihoodsAndRMSE(dataVar=dataVar,
|
||||
mod=tmp,
|
||||
mes=measuredData,
|
||||
likelihoods=likelihood,
|
||||
alignIndexes=alignIndexes,
|
||||
musoCodeToIndex = musoCodeToIndex, uncert = uncert)
|
||||
}
|
||||
|
||||
modellOut[i]<- likelihood(measuredData,tmp)
|
||||
rmse[i] <- sqrt(mean((measuredData-tmp)^2))
|
||||
write.csv(x=tmp, file=paste0(pretag,(i+1),".csv"))
|
||||
|
||||
partialResult[1:numParameters] <- randValues[(i-1),]
|
||||
write.table(x=partialResult, file="preservedCalib.csv", append=TRUE, row.names=FALSE,
|
||||
sep=",", col.names=FALSE)
|
||||
write.csv(x=tmp, file=paste0(pretag, (i+1),".csv"))
|
||||
setTxtProgressBar(progBar,i)
|
||||
}
|
||||
paramLines <- parameters[,2]
|
||||
paramLines <- order(paramLines)
|
||||
randInd <- randVals[[1]][(randVals[[1]] %in% parameters[,2])]
|
||||
randInd <- order(randInd)
|
||||
|
||||
musoGlue("preservedCalib.csv",w=w, lg = lg)
|
||||
|
||||
|
||||
|
||||
epcStrip <- rbind(origEpc[order(parameters[,2])],
|
||||
randValues[,randVals[[1]] %in% parameters[,2]][,randInd])
|
||||
|
||||
|
||||
preservedCalib <- cbind(epcStrip,rmse,
|
||||
modellOut)
|
||||
columNames <- c(parameterNames[paramLines],"rmse", "likelihood")
|
||||
colnames(preservedCalib) <- columNames
|
||||
write.csv(preservedCalib,"preservedCalib.csv")
|
||||
p<-list()
|
||||
preservedCalib <- preservedCalib[-1,]
|
||||
dontInclude <-c((ncol(preservedCalib)-1),ncol(preservedCalib))
|
||||
for(i in seq_along(colnames(preservedCalib)[-dontInclude])){
|
||||
p[[i]] <- ggplot(as.data.frame(preservedCalib),aes_string(colnames(preservedCalib)[i],"likelihood")) +
|
||||
geom_point(shape='.',size=1,alpha=0.8)
|
||||
}
|
||||
|
||||
ggsave(plotName,grid.arrange(grobs = p, ncol = floor(sqrt(ncol(preservedCalib)-1))),dpi = 300)
|
||||
maxLikelihoodPlace <- which(preservedCalib[,"likelihood"]==max(preservedCalib[,"likelihood"],na.rm = TRUE))
|
||||
resPlot <- plotMusoWithData(mdata = mdata, startDate = startDate, endDate = endDate,
|
||||
dataVar = dataVar, modelVar = modelVar, settings = settings, continious = continious) +
|
||||
plotMuso(settings = settings, parameters = randValues[maxLikelihoodPlace,],
|
||||
postProcString = postProcString, skipSpinup = FALSE, variable = colNumb, layerPlot = TRUE, colour = "green")
|
||||
|
||||
print(resPlot)
|
||||
tempEpc <- paste0(tools::file_path_sans_ext(basename(settings$epcInput[2])),"-tmp.",tools::file_ext(settings$epcInput[2]))
|
||||
file.rename(tempEpc, "optimizedEpc.epc")
|
||||
return(preservedCalib[maxLikelihoodPlace,])
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
alignMuso <- function (settings,measuredData) {
|
||||
# Have to fix for other starting points also
|
||||
modelDates <- seq(from= as.Date(sprintf("%s-01-01",settings$startYear)),
|
||||
by="days",
|
||||
to=as.Date(sprintf("%s-12-31",settings$startYear+settings$numYears-1)))
|
||||
modelDates <- grep("-02-29",modelDates,invert=TRUE, value=TRUE)
|
||||
|
||||
measuredDates <- apply(measuredData,1,function(xrow){
|
||||
sprintf("%s-%s-%s",xrow[1],xrow[2],xrow[3])
|
||||
})
|
||||
|
||||
modIndex <- match(as.Date(measuredDates), as.Date(modelDates))
|
||||
measIndex <- which(!is.na(modIndex))
|
||||
modIndex <- modIndex[!is.na(modIndex)]
|
||||
cbind.data.frame(model=modIndex,meas=measIndex)
|
||||
}
|
||||
|
||||
# calcLikelihoodsAndRMSE <- function(dataVar, mod, mes, likelihoods, alignIndexes, musoCodeToIndex, uncert){
|
||||
#
|
||||
# likelihoodRMSE <- sapply(names(dataVar),function(key){
|
||||
# # browser()
|
||||
# modelled <- mod[alignIndexes$mod,musoCodeToIndex[key]]
|
||||
# measured <- mes[alignIndexes$meas,key]
|
||||
# modelled <- modelled[!is.na(measured)]
|
||||
# # uncert <- uncert[!is.na(measured)]
|
||||
# measured <- measured[!is.na(measured)]
|
||||
# res <- c(likelihoods[[key]](modelled, measured, uncert),
|
||||
# sqrt(mean((modelled-measured)^2))
|
||||
# )
|
||||
# res
|
||||
# })
|
||||
# names(likelihoodRMSE) <- c(sprintf("%s_likelihood",dataVar), sprintf("%s_rmse",dataVar))
|
||||
#
|
||||
# return(c(likelihoodRMSE[1,],likelihoodRMSE[2,]))
|
||||
# }
|
||||
|
||||
#' musoGlue
|
||||
#'
|
||||
#' This function calculates the -users specified- likelihood for random model input.
|
||||
#'
|
||||
#' @author Roland HOLLOS
|
||||
#' @param plotName u
|
||||
#' @export
|
||||
musoGlue <- function(presCalFile, w, delta = 0.17, settings=setupMuso(), parameters=read.csv("parameters.csv",
|
||||
stringsAsFactors=FALSE), lg=FALSE){
|
||||
if(is.data.frame(presCalFile)){
|
||||
preservedCalib <- presCalFile
|
||||
} else {
|
||||
preservedCalib <- read.csv(presCalFile)
|
||||
}
|
||||
paramIndex <- parameters[(match(colnames(preservedCalib),parameters[,1])),2]
|
||||
paramIndex <- paramIndex[!is.na(paramIndex)]
|
||||
paramIndex <- c(paramIndex,
|
||||
as.numeric(gsub("X","",
|
||||
grep("X[0-9]{1,}",
|
||||
colnames(preservedCalib),value=TRUE))))
|
||||
preservedCalib <- preservedCalib[-1,] #original
|
||||
|
||||
likeIndexes <- grep("likelihood",colnames(preservedCalib))
|
||||
if(!is.null(w)){
|
||||
forCombine<- sapply(names(w),function(n){
|
||||
grep(sprintf("%s_likelihood",n),colnames(preservedCalib))
|
||||
})
|
||||
preservedCalib[["combined"]] <- apply(as.data.frame(Map(function(x,y){
|
||||
toNormalize <- preservedCalib[,y]
|
||||
toNormalize <- toNormalize / sqrt(sum(x^2))
|
||||
toNormalize * x
|
||||
|
||||
},w,forCombine)), 1, sum)
|
||||
} else {
|
||||
preservedCalib[["combined"]] <- preservedCalib[,grep("likelihood",colnames(preservedCalib),value=TRUE)]
|
||||
}
|
||||
|
||||
parameterIndexes <- 1:(min(likeIndexes)-1)
|
||||
preservedCalib <- preservedCalib[!is.na(preservedCalib$combined),]
|
||||
unfilteredLikelihood <- preservedCalib$combined
|
||||
top5points <- preservedCalib$combined>quantile(preservedCalib$combined,0.95)
|
||||
preservedCalibtop5 <- preservedCalib[,]
|
||||
optRanges <-t(apply(preservedCalibtop5,2,function(x) quantile(x,c(0.05,0.5,0.95))))
|
||||
pdf("dotplot.pdf")
|
||||
if(lg){
|
||||
plot(Reduce(min, -(unfilteredLikelihood), accumulate=TRUE),type="l", ylab="-log(likelihood)",xlab="iterations")
|
||||
} else {
|
||||
plot(Reduce(min, -log(unfilteredLikelihood), accumulate=TRUE),type="l", ylab="-log(likelihood)",xlab="iterations")
|
||||
}
|
||||
pari <- par(mfrow=c(1,2))
|
||||
for(i in seq_along(colnames(preservedCalib)[parameterIndexes])){
|
||||
plot(preservedCalib[,i],preservedCalib[,"combined"],pch=19,cex=.1, ylab="likelihood",
|
||||
main = colnames(preservedCalib)[i], xlab="")
|
||||
plot(preservedCalibtop5[,i],preservedCalibtop5[,"combined"],pch=19,cex=.1, ylab="likelihood",
|
||||
main = paste0(colnames(preservedCalibtop5)[i]," (behav.)"), xlab="")
|
||||
abline(v=optRanges[i,1],col="blue")
|
||||
abline(v=optRanges[i,2],col="green")
|
||||
abline(v=optRanges[i,3],col="red")
|
||||
|
||||
}
|
||||
|
||||
par(pari)
|
||||
dev.off()
|
||||
maxParValues <- preservedCalibtop5[which.max(preservedCalibtop5$combined),]
|
||||
maxParIndexes <- paramIndex
|
||||
write.csv(cbind.data.frame(calibrationPar=maxParValues,parameters=maxParIndexes),"maxLikelihood.csv")
|
||||
write.csv(optRanges,"optRanges.csv")
|
||||
# browser()
|
||||
# There are some serious problems with this implementation. The uncertainity bouns are not for the parameters, but for the output values. The median is pointwise median for all simulation.
|
||||
# And the 95 and 5 percentile also.
|
||||
# dataVec <- preservedCalibtop5$combined
|
||||
# closestToMedian <- function (dataVec) {
|
||||
# match(sort(dataVec)[min(which(sort(dataVec)>=median(dataVec)))], dataVec)
|
||||
# }
|
||||
#
|
||||
# while(is.null(optimalEpc)){
|
||||
# match(quantile(preservedCalibtop5$combined,0.5), preservedCalibtop5$combined)
|
||||
# optInterval <-t(apply(preservedCalibtop5,2,function(x) quantile(x,c(0.5-delta,0.5+delta))))
|
||||
# optParamRange <- cbind.data.frame(rownames(optInterval)[parameterIndexes],as.numeric(paramIndex),optInterval[parameterIndexes,])
|
||||
# optimalEpc <- tryCatch(musoRand(optParamRange,iterations = 2), error=function(e){NULL})
|
||||
# delta <- delta*1.05
|
||||
# if(delta > 0.5){
|
||||
# delta <- 0.5
|
||||
# }
|
||||
# if((delta == 0.5) && is.null(optimalEpc)){
|
||||
# stop("cannot find optimal value in the given range")
|
||||
# }
|
||||
# }
|
||||
# print("getOptim")
|
||||
# optimalEpc[[2]] <- optimalEpc[[2]][1,]
|
||||
# write.csv(as.data.frame(optimalEpc),"epcOptim.csv")
|
||||
# print(head(optRanges,n=-2))
|
||||
# calibMuso(calibrationPar=optimalEpc[[1]],parameters=optimalEpc[[2]])
|
||||
# file.copy(settings$epcInput[2],"epcOptim.epc")
|
||||
}
|
||||
|
||||
generateOptEpc <- function(optRanges,delta, maxLikelihood=FALSE){
|
||||
if(missing(delta)){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,49 +1,33 @@
|
||||
#' This is the function which is capable to change multiple specific lines to others using their row numbers.
|
||||
#' changemulline
|
||||
#'
|
||||
#' The function uses the previous changspecline function to operate.
|
||||
##From now changespecline is in the forarcheologist file, because itis no longer needed
|
||||
#'
|
||||
#' @author Roland Hollos
|
||||
#' @keywords internal
|
||||
#'
|
||||
|
||||
changemulline <- function(filePaths, calibrationPar, contents, fileOut, fileToChange, modifyOriginal=FALSE){
|
||||
selectFileToWrite <- function(filePaths, fileTochange){
|
||||
if(fileToChange == "epc"){
|
||||
return(1)
|
||||
} else{
|
||||
return(2)
|
||||
}
|
||||
#' @export
|
||||
|
||||
changemulline <- function(filePaths, calibrationPar, contents, src, outFiles=filePaths){
|
||||
# browser()
|
||||
if(is.null(src)){
|
||||
src <- filePaths
|
||||
}
|
||||
|
||||
if(xor(is.list(calibrationPar), is.list(contents)) ){
|
||||
stop("If you change epc and ini files also, you have to use list for calibrationPar, and paramateters.")
|
||||
}
|
||||
|
||||
if(!is.element(fileToChange,c("ini","epc","both"))){
|
||||
stop("RBBGCMuso can only change ini or epc file, so fileToChange can be 'epc/ini/both'")
|
||||
}
|
||||
fileStringVector <- readLines(src)
|
||||
Map(function(index, content){
|
||||
fileStringVector <<- changeByIndex(index, content, fileStringVector)
|
||||
|
||||
if(fileToChange == "epc" | fileToChange == "ini"){
|
||||
parMat<-cbind(calibrationPar, contents)
|
||||
parMat<- parMat[order(parMat[,1]),]
|
||||
changeMusoC(inFile = filePaths[selectFileToWrite(filePaths, fileToChange)],
|
||||
outFile = fileOut[selectFileToWrite(filePaths, fileToChange)],
|
||||
parMat)
|
||||
}
|
||||
}, calibrationPar, contents)
|
||||
writeLines(fileStringVector, outFiles)
|
||||
|
||||
if(fileToChange == "both"){
|
||||
parMat<-list()
|
||||
parMat[[1]]<-cbind(calibrationPar[[1]], contents[[1]])
|
||||
parMat[[1]][order(parMat[[1]][,1]),]
|
||||
parMat[[2]]<-cbind(calibrationPar[[2]], contents[[2]])
|
||||
parMat[[2]][order(parMat[[2]][,1]),]
|
||||
|
||||
changeMusoC(filePaths[1],fileOut[1],parMat[[1]] )
|
||||
changeMusoC(filePaths[2],fileOut[2],parMat[[2]] )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
changeNth <- function (string,place,replacement) {
|
||||
trimws(gsub(sprintf("^((.*?\\s+){%s})(.*?\\s+)", place), sprintf("\\1%s ", replacement), paste0(string," "), perl=TRUE),
|
||||
which="right")
|
||||
}
|
||||
|
||||
changeByIndex <- function (rowIndex, parameter, fileStringVector){
|
||||
h <- round((rowIndex*100) %% 10)
|
||||
i <- as.integer(rowIndex)
|
||||
fileStringVector[i] <- changeNth(fileStringVector[i], h, parameter)
|
||||
fileStringVector
|
||||
}
|
||||
|
||||
103
RBBGCMuso/R/checkMeteoBGC.R
Normal file
103
RBBGCMuso/R/checkMeteoBGC.R
Normal file
@ -0,0 +1,103 @@
|
||||
#' checkMeteoBGC
|
||||
#'
|
||||
#' This function calculates the daily and yearly statistics for a given meteorology file (mtc43).
|
||||
#'
|
||||
#' @author Erzsebet Kristof
|
||||
#' @param settings The output of setupMuso
|
||||
#' @param metFileName The name of the meteorology file (mtc43).
|
||||
#' @param skip Number of header lines in meteorology file.
|
||||
#' @param numericReport If numericReport is set to FALSE, the function returns with a text report. If numericReport is set to TRUE, the function returns with a numeric report.
|
||||
#' @param type meteorology for spinup or normal run
|
||||
#' @return It depends on the numericReport parameter. The function returns with a text report, or with a numeric report.
|
||||
#' @export
|
||||
|
||||
checkMeteoBGC <- function(settings=NULL, skip = 4, numericReport = FALSE,type="normal"){
|
||||
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
}
|
||||
|
||||
metFileName <- settings$metInput[type]
|
||||
|
||||
intMin <- function(x){
|
||||
round(min(x,na.rm = TRUE), digits = 1)
|
||||
}
|
||||
|
||||
intMax <- function(x){
|
||||
round(max(x,na.rm = TRUE), digits = 1)
|
||||
}
|
||||
|
||||
sradAvgShortestDay <- function(x,y){
|
||||
round(mean(x[na.omit(y) == min(y, na.rm=TRUE)]), digits=1)
|
||||
|
||||
}
|
||||
sradAvgLongestDay <- function(x,y){
|
||||
round(mean(x[na.omit(y) == max(y, na.rm=TRUE)]), digits=1)
|
||||
|
||||
}
|
||||
metTable <- tryCatch(read.table(metFileName, skip = skip), error = function(e){
|
||||
stop(sprintf("Cannot read or find meteorology file: %s", metFileName))
|
||||
})
|
||||
|
||||
yearlyPrcpSum <- tapply(metTable$V6,list(metTable$V1), sum)
|
||||
yearlyTempAvg <- tapply(metTable$V5,list(metTable$V1), mean)
|
||||
yearlyVpdAvg <- tapply(metTable$V7,list(metTable$V1), mean)
|
||||
|
||||
|
||||
timeFrame <- range(metTable[,1])
|
||||
if(!numericReport){
|
||||
cat("Daily and yearly statistics of meteorological data for the time period of",
|
||||
timeFrame[1], "-", timeFrame[2], ":\n
|
||||
|
||||
Precipitation data:
|
||||
Minimum and maximum of daily sums:",
|
||||
intMin(metTable$V6), "cm and", intMax(metTable$V6), "cm.
|
||||
Minimum and maximum of yearly sums:",
|
||||
intMin(yearlyPrcpSum), "cm and", intMax(yearlyPrcpSum), "cm.\n
|
||||
|
||||
Temperature data:
|
||||
Lowest and highest daily temperatures (Tmin and Tmax):",
|
||||
intMin(metTable$V4), "deg C and", intMax(metTable$V3), "deg C.
|
||||
Minimum and maximum of yearly averages (based on Tday):",
|
||||
intMin(yearlyTempAvg), "deg C and", intMax(yearlyTempAvg), "deg C.\n
|
||||
|
||||
Solar radiation data:
|
||||
Minimum and maximum of daily values:",
|
||||
intMin(metTable$V8), "W m-2 and", intMax(metTable$V8), "W m-2.
|
||||
Averages of the shortest and longest days:",
|
||||
sradAvgShortestDay(metTable$V8, metTable$V9),"W m-2 and",
|
||||
sradAvgLongestDay(metTable$V8, metTable$V9), "W m-2.\n
|
||||
|
||||
Vapour pressure deficit data:
|
||||
Minimum and maximum of daily values:",
|
||||
intMin(metTable$V7), "Pa and", intMax(metTable$V7), "Pa.
|
||||
Minimum and maximum of yearly averages:",
|
||||
intMin(yearlyVpdAvg), "Pa and", intMax(yearlyVpdAvg), "Pa.\n")
|
||||
|
||||
} else {
|
||||
report <- list()
|
||||
cat("Numeric report:\n")
|
||||
report["Precipitation"] <- list(data.frame(minimum = c(daily = intMin(metTable$V6),
|
||||
yearly = intMin(yearlyPrcpSum)),
|
||||
maximum = c(daily = intMax(metTable$V6),
|
||||
yearly = intMax(yearlyPrcpSum))))
|
||||
|
||||
report["Temperature"] <- list(data.frame(minimum = c(daily = intMin(metTable$V4),
|
||||
yearly = intMin(yearlyTempAvg)),
|
||||
maximum = c(daily = intMax(metTable$V3),
|
||||
yearly = intMax(yearlyTempAvg))))
|
||||
|
||||
report["Solar radiation"] <- list(data.frame(minimum = c(daily = intMin(metTable$V8),
|
||||
shortest_longest_day = sradAvgShortestDay(metTable$V8, metTable$V9)),
|
||||
maximum = c(daily = intMax(metTable$V8),
|
||||
shortest_longest_day = sradAvgLongestDay(metTable$V8, metTable$V9))))
|
||||
|
||||
report["Vapour pressure deficit"] <- list(data.frame(minimum = c(daily = intMin(metTable$V7),
|
||||
yearly = intMin(yearlyVpdAvg)),
|
||||
maximum = c(daily = intMax(metTable$V7),
|
||||
yearly = intMax(yearlyVpdAvg))))
|
||||
|
||||
return(report)
|
||||
}
|
||||
|
||||
}
|
||||
33
RBBGCMuso/R/getOutPutList.R
Normal file
33
RBBGCMuso/R/getOutPutList.R
Normal file
@ -0,0 +1,33 @@
|
||||
#' getDailyOutputList
|
||||
#'
|
||||
#' bla bla
|
||||
#' @param settings bla
|
||||
#' @export
|
||||
|
||||
|
||||
getDailyOutputList <- function(settings=NULL){
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
}
|
||||
varTable <- getOption("RMuso_varTable")$'6'
|
||||
toPrint <- varTable[match(as.numeric(settings$dailyVarCodes),varTable[,1]),]
|
||||
toPrint <- cbind.data.frame(index=1:nrow(toPrint),toPrint)
|
||||
print(toPrint, row.names=FALSE)
|
||||
}
|
||||
|
||||
#' getAnnualOutputList
|
||||
#'
|
||||
#' bla bla
|
||||
#' @param settings bla
|
||||
#' @export
|
||||
|
||||
|
||||
getAnnualOutputList <- function(settings=NULL){
|
||||
if(is.null(settings)){
|
||||
settings<- setupMuso()
|
||||
}
|
||||
varTable <- getOption("RMuso_varTable")$'6'
|
||||
toPrint <- varTable[which(varTable$codes %in% as.numeric(settings$annualVarCodes)),]
|
||||
toPrint <- cbind.data.frame(index=1:nrow(toPrint),toPrint)
|
||||
print(toPrint, row.names=FALSE)
|
||||
}
|
||||
@ -37,6 +37,8 @@ copyMusoExampleTo <- function(example = NULL, destination = NULL){
|
||||
|
||||
if(is.null(example)){
|
||||
cExample<-paste0(system.file("examples","",package = "RBBGCMuso"),"/",chooseExample())
|
||||
} else {
|
||||
cExample <- paste0(system.file("examples","",package = "RBBGCMuso"),"/","hhs")
|
||||
}
|
||||
|
||||
if(is.null(destination)){
|
||||
@ -50,5 +52,5 @@ copyMusoExampleTo <- function(example = NULL, destination = NULL){
|
||||
} else {
|
||||
file.copy(grep("^muso$", list.files(), value = TRUE, invert = TRUE),destination)
|
||||
}
|
||||
setwd(currDir)
|
||||
setwd(destination)
|
||||
}
|
||||
|
||||
@ -31,6 +31,9 @@ musoMonte <- function(settings=NULL,
|
||||
debugging = FALSE,
|
||||
keepEpc = FALSE,
|
||||
constrains = NULL,
|
||||
skipZero = TRUE,
|
||||
postProcString=NULL,
|
||||
modifyOut=TRUE,
|
||||
...){
|
||||
|
||||
|
||||
@ -85,7 +88,11 @@ musoMonte <- function(settings=NULL,
|
||||
outVarNames <- sapply(outVars, musoMapping)
|
||||
}
|
||||
|
||||
parameterNames <- parameters[,1]
|
||||
if(!is.null(postProcString)){
|
||||
outVarNames <- c(outVarNames,gsub("\\s","",unlist(strsplit(procString,"<-"))[1]))
|
||||
}
|
||||
|
||||
parameterNames <- gsub("([\\s]|\\-epc)","",parameters[,1],perl=TRUE)
|
||||
# settings$calibrationPar <- A[,1] #:LATER:
|
||||
pretag <- file.path(outLoc,preTag)
|
||||
npar <- length(settings$calibrationPar)
|
||||
@ -93,10 +100,10 @@ musoMonte <- function(settings=NULL,
|
||||
##reading the original epc file at the specified
|
||||
## row numbers
|
||||
if(iterations < 3000){
|
||||
randVals <- musoRand(parameters = parameters,constrains = constrains, iterations = 3000)
|
||||
randVals <- musoRand(parameters = parameters,fileType="epc", iterations = 3000)
|
||||
randVals[[2]]<- randVals[[2]][sample(1:3000,iterations),]
|
||||
} else {
|
||||
randVals <- musoRand(parameters = parameters,constrains = constrains, iterations = iterations)
|
||||
randVals <- musoRand(parameters = parameters,fileType="epc", iterations = iterations)
|
||||
}
|
||||
|
||||
origEpc <- readValuesFromEpc(settings$epc[2],parameters[,2])
|
||||
@ -121,6 +128,7 @@ musoMonte <- function(settings=NULL,
|
||||
## randValues <- randValues[,randVals[[1]] %in% parameters[,2]][,rank(parameters[,2])]
|
||||
modellOut <- matrix(ncol = numVars, nrow = iterations + 1)
|
||||
|
||||
|
||||
origModellOut <- calibMuso(settings=settings,silent=TRUE)
|
||||
write.csv(x=origModellOut, file=paste0(pretag,1,".csv"))
|
||||
|
||||
@ -129,7 +137,7 @@ musoMonte <- function(settings=NULL,
|
||||
}
|
||||
|
||||
tmp2 <- numeric(numVars)
|
||||
|
||||
# browser()
|
||||
for(j in 1:numVars){
|
||||
tmp2[j]<-funct[[j]](origModellOut[,j])
|
||||
}
|
||||
@ -142,15 +150,21 @@ musoMonte <- function(settings=NULL,
|
||||
skipSpinup = skipSpinup,
|
||||
keepEpc = keepEpc,
|
||||
debugging = debugging,
|
||||
outVars = outVars), error = function (e) NA)
|
||||
modifyOriginal = modifyOut,
|
||||
outVars = outVars,postProcString=postProcString), error = function (e) NA)
|
||||
|
||||
if(!is.na(tmp)){
|
||||
if(length(dim(tmp))>=1){
|
||||
for(j in 1:numVars){
|
||||
tmp2[j]<-funct[[j]](tmp[,j])
|
||||
}
|
||||
if(skipZero){
|
||||
if(tmp2[j]==0){
|
||||
tmp2[j] <- NA
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(j in 1:numVars){
|
||||
tmp2[j]<-rep(NA,length(settings$outputVars[[1]]))
|
||||
tmp2[j]<-NA
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,8 +179,10 @@ musoMonte <- function(settings=NULL,
|
||||
paramLines <- order(paramLines)
|
||||
randInd <- randVals[[1]][(randVals[[1]] %in% parameters[,2])]
|
||||
randInd <- order(randInd)
|
||||
|
||||
|
||||
|
||||
|
||||
# browser()
|
||||
epcStrip <- rbind(origEpc[order(parameters[,2])],
|
||||
randValues[,randVals[[1]] %in% parameters[,2]][,randInd])
|
||||
|
||||
|
||||
@ -8,9 +8,11 @@
|
||||
#' @importFrom limSolve xsample
|
||||
#' @export
|
||||
|
||||
musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
|
||||
if(!is.null(constrains)){
|
||||
musoRand <- function(parameters, iterations=3000, fileType="epc", constrains = NULL){
|
||||
if(is.null(constrains)){
|
||||
constMatrix <- constrains
|
||||
constMatrix <- getOption("RMuso_constMatrix")[[fileType]][[as.character(getOption("RMuso_version"))]]
|
||||
} else {
|
||||
constMatrix <- constrains
|
||||
}
|
||||
|
||||
@ -18,6 +20,7 @@ musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
constMatrix <- constMatrix[,-1]
|
||||
|
||||
depTableMaker <- function(constMatrix,parameters){
|
||||
# browser()
|
||||
parameters <- parameters[order(parameters[,1]),] ## BUG!!!
|
||||
selectedRows <- constMatrix[,"INDEX"] %in% parameters[,1]
|
||||
rankList <- rank(constMatrix[selectedRows,2])
|
||||
@ -28,7 +31,7 @@ musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
constMatrix <- constMatrix[order(apply(constMatrix[,7:8],1,function(x){x[1]/10+abs(x[2])})),]
|
||||
constMatrix
|
||||
}
|
||||
|
||||
# browser()
|
||||
genMat0 <- function(dep){
|
||||
numberOfVariable <- nrow(dep)
|
||||
G <- rbind(diag(numberOfVariable), -1*diag(numberOfVariable))
|
||||
@ -54,7 +57,7 @@ musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# browser()
|
||||
G<-G[dep[,4]!=0,]
|
||||
|
||||
if(is.null(nrow(G))){
|
||||
@ -148,6 +151,7 @@ musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
dependences <- depTableMaker(constMatrix, parameters)
|
||||
dependences <- cbind(dependences,1:nrow(dependences))
|
||||
colnames(dependences)[ncol(dependences)] <- "rowIndex"
|
||||
# browser()
|
||||
numberOfVariable <- nrow(dependences)
|
||||
nonZeroDeps<-dependences[dependences[,"TYPE"]!=0,]
|
||||
if(nrow(nonZeroDeps)!=0){
|
||||
@ -171,6 +175,7 @@ musoRand <- function(parameters, constrains = NULL, iterations=3000){
|
||||
h <- c(Gh0$h,h)
|
||||
E <- do.call(rbind,lapply(Ef,function(x){x$E}))
|
||||
f <- do.call(c,lapply(Ef,function(x){x$f}))
|
||||
# browser()
|
||||
randVal <- suppressWarnings(limSolve::xsample(G=G,H=h,E=E,F=f,iter = iterations))$X
|
||||
} else{
|
||||
Gh0<-genMat0(dependences)
|
||||
|
||||
@ -30,6 +30,9 @@ musoSensi <- function(monteCarloFile = NULL,
|
||||
plotName = "sensitivity.png",
|
||||
plotTitle = "Sensitivity",
|
||||
skipSpinup = TRUE,
|
||||
skipZero = TRUE,
|
||||
postProcString=NULL,
|
||||
modifyOut=TRUE,
|
||||
dpi=300){
|
||||
|
||||
if(is.null(parameters)){
|
||||
@ -42,11 +45,14 @@ musoSensi <- function(monteCarloFile = NULL,
|
||||
stop("Cannot find neither parameters file neither the parameters matrix")
|
||||
})
|
||||
}}
|
||||
|
||||
parameters[,1] <- gsub("([\\s]|\\-epc)","",parameters[,1],perl=TRUE)
|
||||
doSensi <- function(M){
|
||||
# browser()
|
||||
npar <- ncol(M)-1
|
||||
M <- M[which(!is.na(M[,ncol(M)])),]
|
||||
M <- M[-1,]
|
||||
y <- M[,(npar+1)]
|
||||
colnames(M) <- gsub("\\.epc","-epc",colnames(M))
|
||||
M <- M[,colnames(M) %in% parameters[,1]]
|
||||
npar <- ncol(M)
|
||||
M <- apply(M[,1:npar],2,function(x){x-mean(x)})
|
||||
@ -89,7 +95,10 @@ musoSensi <- function(monteCarloFile = NULL,
|
||||
outVars = outVars,
|
||||
fun = fun,
|
||||
varIndex = varIndex,
|
||||
skipSpinup = skipSpinup
|
||||
skipSpinup = skipSpinup,
|
||||
skipZero=skipZero,
|
||||
postProcString=postProcString,
|
||||
modifyOut=modifyOut
|
||||
)
|
||||
M <- cbind(seq_along(M[,1]),M)
|
||||
yInd <- grep("mod.", colnames(M))[varIndex]
|
||||
@ -103,6 +112,7 @@ musoSensi <- function(monteCarloFile = NULL,
|
||||
yInd <- grep("mod.", colnames(M))[varIndex]
|
||||
parNames <- grep("mod.",colnames(M), invert=TRUE, value = TRUE)
|
||||
M <- M[,c(grep("mod.", colnames(M),invert=TRUE),yInd)]
|
||||
# browser()
|
||||
return(doSensi(M))
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,3 +172,14 @@ while(n<=N){
|
||||
}
|
||||
return(randomNorm)
|
||||
}
|
||||
|
||||
#' getConstMatrix
|
||||
#'
|
||||
#' getConstMatrix is a function whith wich you can get the default constrain matrix for your choosen type and version.
|
||||
#' @param filetype It can be "epc" or "soil".
|
||||
#' @param version The version of the MuSo environment
|
||||
#' @export
|
||||
|
||||
getConstMatrix <- function (filetype="epc", version = as.character(getOption("RMuso_version"))) {
|
||||
getOption("RMuso_constMatrix")[[filetype]][[version]]
|
||||
}
|
||||
|
||||
@ -2,20 +2,45 @@
|
||||
#'
|
||||
#' This function updates the Biome-BGCMuSo output code-variable matrix. Within Biome-BGCMuSo the state variables and fluxes are marked by integer numbers. In order to provide meaningful variable names (e.g. 3009 means Gross Primary Production in Biome-BGCMuSo v5) a conversion table is needed which is handled by this function.
|
||||
#' @author Roland HOLLOS
|
||||
#' @param output_map_init The output code-variable bindings are described in output_map_init.c file that is part of the Biome-BGCMuSo source code. Using this function the user can read the output_map_init.c file and pass it to RBBGCMuso for further work.
|
||||
#' @param excelName Name of the excelfile which contains the parameters
|
||||
#' @importFrom openxlsx read.xlsx
|
||||
#' @importFrom jsonlite write_json
|
||||
#' @return The output code-variable matrix, and also the function changes the global variable
|
||||
#' @export
|
||||
#' @usage updateMusoMapping(output_map_init="output_map_init.c")
|
||||
|
||||
updateMusoMapping<-function(output_map_init="output_map_init.c"){
|
||||
|
||||
outputRaw<-grep("\\[",readLines(output_map_init,-1),value=TRUE)
|
||||
updateMusoMapping <- function(excelName, dest="./", version=getOption("RMuso_version")){
|
||||
|
||||
codes <- as.vector(lapply(outputRaw, function (x) as.numeric(unlist(strsplit(unlist(strsplit(x,"\\["))[2],"\\]"))[1])))
|
||||
names <- unlist(lapply(outputRaw, function (x) unlist(strsplit(unlist(strsplit(x,"\\&"))[2],";"))[1]))
|
||||
mMapping <-cbind(codes,names)
|
||||
save(mMapping, file="mMap.RData")
|
||||
return(mMapping)
|
||||
expandRangeRows <- function (ind) {
|
||||
toExpand <- excelDF[ind,]
|
||||
rangeString <- gsub(".*?(\\d*\\-\\d*).*","\\1",toExpand[2])
|
||||
interval <- as.numeric(strsplit(rangeString,split="-")[[1]])
|
||||
result <- do.call(rbind,lapply(interval[1]:interval[2],function(x){
|
||||
toExpand[2] <- x
|
||||
toExpand[1] <- gsub("\\[.*?\\]",sprintf("_%s",(x-interval[1])),toExpand[1])
|
||||
toExpand
|
||||
}))
|
||||
result <- as.data.frame(result,stringsAsFactors = FALSE)
|
||||
result[,2] <- as.numeric(result[,2])
|
||||
colnames(result) <- c("names","codes","units","descriptions")
|
||||
result[,c(2,1,3,4)]
|
||||
}
|
||||
|
||||
excelDF <- read.xlsx(excelName)
|
||||
excelDF <- excelDF[!is.na(excelDF[,2]),]
|
||||
excelDF[,1] <- trimws(excelDF[,1])
|
||||
excelDF[,2] <- trimws(excelDF[,2])
|
||||
excelDF[,3] <- trimws(excelDF[,3])
|
||||
excelDF[,4] <- trimws(excelDF[,4])
|
||||
rangeRows <- grep("-",excelDF[,2])
|
||||
nonRangeMatrix <- excelDF[setdiff(1:nrow(excelDF),rangeRows),]
|
||||
nonRangeMatrix[,2] <- as.numeric(nonRangeMatrix[,2])
|
||||
nonRangeMatrix[,1] <- trimws(nonRangeMatrix[,1])
|
||||
names(nonRangeMatrix) <- c("names","codes","units","descriptions")
|
||||
outMatrix <- rbind.data.frame(do.call(rbind.data.frame,lapply(rangeRows,expandRangeRows)),
|
||||
nonRangeMatrix[,c(2,1,3,4)])
|
||||
outMatrix <- outMatrix[order(outMatrix[,1]),]
|
||||
rownames(outMatrix)<- NULL
|
||||
write_json(outMatrix, file.path(dest,sprintf("varTable%s.json",version)), pretty=TRUE)
|
||||
}
|
||||
|
||||
#' musoMapping
|
||||
@ -29,9 +54,14 @@ updateMusoMapping<-function(output_map_init="output_map_init.c"){
|
||||
#' @usage musoMapping(code, mapData=NULL)
|
||||
|
||||
|
||||
musoMapping <- function(code, mapData=NULL){
|
||||
musoMapping <- function(code,
|
||||
mapData=getOption("RMuso_varTable")[[as.character(getOption("RMuso_version"))]]){
|
||||
if(is.null(mapData)){
|
||||
return(unlist(mMapping[which(mMapping[,1]==code),2])) #mMapping is package-scoped system variable generated by udateMusoMapping
|
||||
return(unlist(tryCatch(mMapping[which(mMapping[,1]==code),2],error = function(e){
|
||||
|
||||
stop(sprintf("The code %s in inifile is not valid muso output variable code",code))
|
||||
|
||||
}))) #mMapping is package-scoped system variable generated by udateMusoMapping
|
||||
} else {
|
||||
return(unlist(mapData[which(mapData[,1]==code),2]))
|
||||
}
|
||||
@ -48,7 +78,8 @@ musoMapping <- function(code, mapData=NULL){
|
||||
#' @usage musoMapping(code, mapData=NULL)
|
||||
|
||||
|
||||
musoMappingFind <- function(variable=NULL){
|
||||
musoMappingFind <- function(variable=NULL,
|
||||
mMapping=getOption("RMuso_varTable")[[as.character(getOption("RMuso_version"))]]){
|
||||
if(is.null(variable)){
|
||||
return(mMapping)
|
||||
} else {
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#' @importFrom data.table ':=' data.table
|
||||
#' @export
|
||||
|
||||
plotMuso <- function(settings = NULL, variable = 1,
|
||||
plotMuso <- function(settings = NULL, variable = "all",
|
||||
##compare, ##plotname,
|
||||
timee = "d", silent = TRUE,
|
||||
calibrationPar = NULL, parameters = NULL,
|
||||
@ -53,14 +53,6 @@ plotMuso <- function(settings = NULL, variable = 1,
|
||||
numberOfYears <- settings$numYears
|
||||
startYear <- settings$startYear
|
||||
dailyVarCodes <- settings$dailyVarCodes
|
||||
## musoData <- rungetMuso(settings=settings,
|
||||
## silent=silent,
|
||||
## timee=timee,
|
||||
## debugging=debugging,
|
||||
## keepEpc=keepEpc,
|
||||
## logfilename=logfilename,
|
||||
## export=export)
|
||||
|
||||
groupByTimeFrame <- function(Data, timeFrame, groupFun){
|
||||
Data <- data.table(Data)
|
||||
Data[,c(variable):=groupFun(get(variable)),get(timeFrame)]
|
||||
@ -84,7 +76,10 @@ plotMuso <- function(settings = NULL, variable = 1,
|
||||
mutate(date=as.Date(as.character(date),"%d.%m.%Y"))
|
||||
} else {
|
||||
if(!is.element("cum_yieldC_HRV",unlist(settings$outputVars[[1]]))){
|
||||
musoData <- calibMuso(postProcString = postProcString,settings,silent = TRUE,skipSpinup=skipSpinup,prettyOut = TRUE)
|
||||
musoData <- calibMuso(postProcString = postProcString,settings,
|
||||
calibrationPar=calibrationPar,
|
||||
parameters = parameters,
|
||||
silent = TRUE,skipSpinup=skipSpinup,prettyOut = TRUE)
|
||||
if(!is.null(selectYear)){
|
||||
musoData <- musoData %>% filter(year == get("selectYear"))
|
||||
}
|
||||
@ -113,13 +108,17 @@ plotMuso <- function(settings = NULL, variable = 1,
|
||||
}
|
||||
|
||||
## numVari <- ncol(musoData)
|
||||
numVari <- ncol(musoData)-5
|
||||
# numVari <- ncol(musoData)-5
|
||||
numVari <- length(settings$dailyVarCodes)
|
||||
|
||||
pointOrLineOrPlot <- function(musoData, variableName, plotType="cts", expandPlot=FALSE, plotName=NULL){
|
||||
if(!inherits(musoData$date[1], "Date")){
|
||||
musoData$date<- as.Date(as.character(musoData$date),"%d.%m.%Y")
|
||||
}
|
||||
if(!expandPlot){
|
||||
if(plotType=="cts"){
|
||||
if(length(variableName)==1){
|
||||
p <- ggplot(musoData,aes_string("date",variableName))+geom_line(colour=colour)+theme(axis.title.x=element_blank())
|
||||
p <- ggplot(musoData,aes_string("date",variableName,group=1))+geom_line(colour=colour)+theme(axis.title.x=element_blank())
|
||||
if(!is.null(plotName)){
|
||||
ggsave(as.character(plotName), plot = p)
|
||||
p
|
||||
@ -191,12 +190,22 @@ plotMuso <- function(settings = NULL, variable = 1,
|
||||
}
|
||||
|
||||
|
||||
|
||||
variableName <- as.character(settings$outputVars[[1]])[variable]
|
||||
if(variable == "all"){
|
||||
variableName <- as.character(settings$outputVars[[1]])
|
||||
}
|
||||
if(is.character(variable)){
|
||||
|
||||
|
||||
if(identical(variable,"all")){
|
||||
variableName <- as.character(settings$outputVars[[1]])
|
||||
variable <- as.character(settings$outputVars[[1]])
|
||||
|
||||
} else {
|
||||
|
||||
if(is.element(variable, settings$dailyVarCodes)){
|
||||
variable <- settings$outputVars[[1]][match(variable,settings$dailyVarCodes)]
|
||||
}
|
||||
|
||||
if(identical(character(0),setdiff(variable,as.character(settings$outputVars[[1]])))){
|
||||
variableName <- variable
|
||||
} else {
|
||||
@ -220,9 +229,10 @@ plotMuso <- function(settings = NULL, variable = 1,
|
||||
}))){
|
||||
variableName <- as.character(settings$outputVars[[1]])[variable]
|
||||
} else {
|
||||
print(numVari)
|
||||
stop("Not all members of the variable parameter are among the output variables")
|
||||
}}
|
||||
|
||||
|
||||
pointOrLineOrPlot(musoData = musoData,
|
||||
variableName = variableName,
|
||||
plotType = plotType,
|
||||
@ -343,25 +353,30 @@ compareMuso <- function(settings=NULL,parameters, variable=1, calibrationPar=NUL
|
||||
|
||||
saveAllMusoPlots <- function(settings=NULL, plotName = ".png",
|
||||
silent = TRUE, type = "line", outFile = "annual.csv",
|
||||
colour = NULL, skipSpinup = FALSE){
|
||||
colour = "blue", skipSpinup = FALSE){
|
||||
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
}
|
||||
|
||||
|
||||
dailyVarCodes <- settings$dailyVarCodes
|
||||
annualVarCodes <-settings$annualVarCodes
|
||||
outputVars <- unlist(settings$outputVars[[1]])
|
||||
musoData <- calibMuso(settings = settings, prettyOut = TRUE, silent = silent, skipSpinup = skipSpinup)
|
||||
musoData$date<- as.Date(musoData$date,"%d.%m.%Y")
|
||||
for(i in seq_along(dailyVarCodes)){
|
||||
bases <- ggplot(data = musoData, mapping = aes_string(x = "date", y = outputVars[i]))
|
||||
object <-ifelse(type == "line",paste0("geom_line(colour = '",colour,"')"),
|
||||
ifelse(type == "point",paste0("geom_line(colour = ",colour,")"),
|
||||
stop("The")))
|
||||
outPlot <- bases + eval(parse(text = object)) + theme_classic() + theme(axis.title.x=element_blank())
|
||||
ggsave(paste0("daily-",dailyVarCodes[i],plotName),outPlot)
|
||||
imName <- paste0("daily-",dailyVarCodes[i],plotName)
|
||||
cat(sprintf("Saving daily output image of %s as %s\n",outputVars[i],imName))
|
||||
suppressMessages(ggsave(imName, outPlot))
|
||||
}
|
||||
if(settings$normOutputFlags["annual"]!=2){
|
||||
return("Annual output graphs was not saved (no annual output from the model)")
|
||||
}
|
||||
|
||||
musoYData <- getyearlyout(settings)
|
||||
write.csv(musoYData,paste0(settings$outputNames[[2]],outFile))
|
||||
for(i in seq_along(annualVarCodes)){
|
||||
|
||||
15
RBBGCMuso/R/postProcString.R
Normal file
15
RBBGCMuso/R/postProcString.R
Normal file
@ -0,0 +1,15 @@
|
||||
#' postProcMuso
|
||||
#'
|
||||
#' This is a function wich provides some minimal post processing capabilities
|
||||
#' @keywords internal
|
||||
postProcMuso <- function(modelData, procString){
|
||||
modelDat <- modelData[,-(1:4)]
|
||||
cNames <- colnames(modelData)
|
||||
tocalc <- gsub("(@)(\\d)","modelDat[,\\2]",procString)
|
||||
newVarName <- gsub("\\s","",unlist(strsplit(procString,"<-"))[1])
|
||||
assign(newVarName,eval(parse(text = unlist(strsplit(tocalc,"<-"))[2])))
|
||||
modelData <- cbind.data.frame(modelData,eval(parse(text = newVarName)))
|
||||
colnames(modelData) <- c(cNames,newVarName)
|
||||
modelData
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#' @importFrom tidyr separate
|
||||
#' @export
|
||||
|
||||
musoQuickEffect <- function(settings = NULL,calibrationPar = NULL, startVal, endVal, nSteps = 1, fileToChange="epc", outVar, parName = "parVal"){
|
||||
musoQuickEffect <- function(settings = setupMuso(), calibrationPar = NULL, startVal, endVal, nSteps = 1, fileToChange="epc",modifyOriginal=TRUE, outVar, parName = "parVal", yearNum=1, year=(settings$startYear + yearNum -1)){
|
||||
|
||||
if(is.character(outVar)){
|
||||
varNames <- as.data.frame(musoMappingFind(outVar))
|
||||
@ -33,9 +33,6 @@ musoQuickEffect <- function(settings = NULL,calibrationPar = NULL, startVal, en
|
||||
outVarIndex<-outVar
|
||||
}
|
||||
|
||||
if(is.null(settings)){
|
||||
settings <- setupMuso()
|
||||
}
|
||||
if(is.null(calibrationPar)){
|
||||
calibrationPar <- settings$calibrationPar
|
||||
}
|
||||
@ -43,21 +40,47 @@ musoQuickEffect <- function(settings = NULL,calibrationPar = NULL, startVal, en
|
||||
parVals <- seq(startVal, endVal, length = (nSteps + 1))
|
||||
parVals <- dynRound(startVal, endVal, seqLen = (nSteps + 1))
|
||||
a <- do.call(rbind,lapply(parVals, function(parVal){
|
||||
calResult <- tryCatch(calibMuso(settings = settings,calibrationPar = calibrationPar, parameters = parVal, outVars = outVarIndex, silent = TRUE,fileToChange = fileToChange), error = function(e){NA})
|
||||
if(all(is.na(calResult))){
|
||||
calResult <- tryCatch(calibMuso(settings = settings,calibrationPar = calibrationPar,
|
||||
modifyOriginal = modifyOriginal,
|
||||
parameters = parVal,
|
||||
outVars = outVarIndex,
|
||||
silent = TRUE,
|
||||
fileToChange = fileToChange), error = function(e){NULL})
|
||||
if(is.null(calResult)){
|
||||
b <- cbind(rep(NA,365),parVal)
|
||||
rownames(b) <- tail(musoDate(startYear = settings$startYear, numYears = settings$numYears),365)
|
||||
rownames(b) <- musoDate(startYear = year, numYears = 1)
|
||||
colnames(b)[1] <- varNames
|
||||
return(b)
|
||||
} else {
|
||||
return(cbind(tail(calResult,365), parVal))
|
||||
if(yearNum >=0){
|
||||
m <- as.data.frame(calResult[musoDate(startYear = year, numYears = 1),])
|
||||
} else{
|
||||
m <- as.data.frame(calResult)
|
||||
}
|
||||
colnames(m) <- colnames(calResult)
|
||||
return(cbind(m, parVal))
|
||||
}
|
||||
|
||||
}))
|
||||
|
||||
a %<>%
|
||||
tbl_df %>%
|
||||
mutate(date=as.Date(rownames(a),"%d.%m.%Y")) %>%
|
||||
select(date,as.character(varNames),parVal)
|
||||
print(suppressWarnings(ggplot(data = a, aes_string(x= "date", y= varNames))+geom_line(aes(alpha = factor(parVal))) + labs(y=varNames, alpha = parName) + scale_alpha_discrete(range=c(0.25,1))))
|
||||
}
|
||||
# calma <- calibMuso(settings = settings,calibrationPar = calibrationPar,
|
||||
# modifyOriginal = modifyOriginal,
|
||||
# parameters = parVal,
|
||||
# outVars = outVarIndex,
|
||||
# silent = TRUE,
|
||||
# fileToChange = fileToChange)
|
||||
# plot(calma[,1])
|
||||
# calma <- calibMuso(settings = settings,calibrationPar = calibrationPar,
|
||||
# modifyOriginal = modifyOriginal,
|
||||
# parameters = parVal,
|
||||
# silent = TRUE,
|
||||
# fileToChange = fileToChange)
|
||||
# calm <- calibMuso(calibrationPar=calibrationPar,parameters=parVal,modifyOriginal=TRUE)
|
||||
# plot(x=as.Date(musoDate(2015,numYears=1),"%d.%m.%Y"),y=calm[musoDate(2015,numYears=1),"daily_gpp"],type="l")
|
||||
# calibrationPar
|
||||
# parVal
|
||||
|
||||
63
RBBGCMuso/R/recent.soi
Normal file
63
RBBGCMuso/R/recent.soi
Normal file
@ -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
|
||||
@ -23,16 +23,6 @@
|
||||
#' keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE)
|
||||
#' @import utils
|
||||
#' @export
|
||||
runMuso <- function(settings=NULL, calibrationPar=NULL,
|
||||
parameters=NULL, outVars = NULL, timee="d",
|
||||
debugging=FALSE, logfilename=NULL,
|
||||
keepEpc=FALSE, export=FALSE,
|
||||
silent=FALSE, aggressive=FALSE,
|
||||
leapYear=FALSE,keepBinary=FALSE,
|
||||
binaryPlace="./", fileToChange="epc",
|
||||
skipSpinup = TRUE, modifyOriginal =FALSE, prettyOut = FALSE){
|
||||
calibMuso(settings, calibrationPar, parameters, outVars, timee,
|
||||
debugging, logfilename, keepEpc, export, silent, aggressive,
|
||||
leapYear,keepBinary, binaryPlace, fileToChange,
|
||||
skipSpinup, modifyOriginal, prettyOut)
|
||||
runMuso <- function(...){
|
||||
calibMuso(...)
|
||||
}
|
||||
|
||||
@ -55,44 +55,45 @@ setupMuso <- function(executable=NULL,
|
||||
epcInput=NULL,
|
||||
mapData=NULL,
|
||||
leapYear=FALSE,
|
||||
version=5,
|
||||
version=6,
|
||||
doCopy=TRUE
|
||||
){
|
||||
|
||||
Linuxp <-(Sys.info()[1]=="Linux")
|
||||
writep <- 0
|
||||
|
||||
if(is.null(mapData)&version==4){
|
||||
mData <- mMapping4
|
||||
}
|
||||
|
||||
# if(is.null(mapData)&version==4){
|
||||
# mData <- mMapping4
|
||||
# }
|
||||
#
|
||||
|
||||
inputParser <- function(string,fileName,counter,value=TRUE){
|
||||
unlist(strsplit(grep(string,fileName,value=TRUE),"[\ \t]"))[counter]
|
||||
unlist(strsplit(grep(string,fileName,value=TRUE, perl = TRUE),"[\ \t]", useBytes = TRUE))[counter]
|
||||
}
|
||||
|
||||
outMaker <- function(inputVar,grepString,filep){
|
||||
tempVar <- eval(parse(text=inputVar))
|
||||
if(is.null(tempVar)){
|
||||
writep <<- writep+1
|
||||
if(filep)
|
||||
{
|
||||
tempVar["spinup"] <- file.path(inputLoc,inputParser(string=grepString,fileName=iniFiles$spinup,counter=1,value=TRUE))
|
||||
tempVar["normal"] <- file.path(inputLoc,inputParser(string=grepString,fileName=iniFiles$normal,counter=1,value=TRUE))
|
||||
} else {
|
||||
tempVar["spinup"] <- inputParser(string=grepString,fileName=iniFiles$spinup,counter=1,value=TRUE)
|
||||
tempVar["normal"] <- inputParser(string=grepString,fileName=iniFiles$normal,counter=1,value=TRUE)
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
iniFiles$spinup[grep(grepString,iniFiles$spinup)] <<- paste0(tempVar[1],"\t ",grepString)
|
||||
|
||||
if(length(tempVar)==2){
|
||||
iniFiles$normal[grep(" grepString",iniFiles$normal)] <<- paste0(tempVar[2],"\t ",grepString)
|
||||
}
|
||||
}
|
||||
return(tempVar)
|
||||
}
|
||||
# outMaker <- function(inputVar,grepString,filep){
|
||||
# tempVar <- eval(parse(text=inputVar))
|
||||
# if(is.null(tempVar)){
|
||||
# writep <<- writep+1
|
||||
# if(filep)
|
||||
# {
|
||||
# tempVar["spinup"] <- file.path(inputLoc,inputParser(string=grepString,fileName=iniFiles$spinup,counter=1,value=TRUE))
|
||||
# tempVar["normal"] <- file.path(inputLoc,inputParser(string=grepString,fileName=iniFiles$normal,counter=1,value=TRUE))
|
||||
# } else {
|
||||
# tempVar["spinup"] <- inputParser(string=grepString,fileName=iniFiles$spinup,counter=1,value=TRUE)
|
||||
# tempVar["normal"] <- inputParser(string=grepString,fileName=iniFiles$normal,counter=1,value=TRUE)
|
||||
#
|
||||
# }
|
||||
#
|
||||
# } else {
|
||||
# iniFiles$spinup[grep(grepString,iniFiles$spinup)] <<- paste0(tempVar[1],"\t ",grepString)
|
||||
#
|
||||
# if(length(tempVar)==2){
|
||||
# iniFiles$normal[grep(" grepString",iniFiles$normal)] <<- paste0(tempVar[2],"\t ",grepString)
|
||||
# }
|
||||
# }
|
||||
# return(tempVar)
|
||||
# }
|
||||
|
||||
if(is.null(inputLoc)){
|
||||
inputLoc<- normalizePath("./")
|
||||
@ -103,12 +104,15 @@ setupMuso <- function(executable=NULL,
|
||||
#iniChangedp <- FALSE
|
||||
|
||||
if(is.null(iniInput)){
|
||||
spinups<-grep("s.ini$",list.files(inputLoc),value=TRUE)
|
||||
normals<-grep("n.ini$",list.files(inputLoc),value=TRUE)
|
||||
spinups<-grep("s.ini$",list.files(inputLoc),value=TRUE, perl = TRUE)
|
||||
normals<-grep("n.ini$",list.files(inputLoc),value=TRUE, perl = TRUE)
|
||||
|
||||
if(length(spinups)==1){
|
||||
iniInput[1]<-file.path(inputLoc,spinups)
|
||||
} else {stop("There are multiple or no spinup ini files, please choose")}
|
||||
iniInput[1] <- file.path(inputLoc,spinups)
|
||||
} else {
|
||||
iniInput[1] <- "no spinup"
|
||||
# stop("There are multiple or no spinup ini files, please choose")
|
||||
}
|
||||
|
||||
|
||||
if(length(normals)==1){
|
||||
@ -120,18 +124,18 @@ setupMuso <- function(executable=NULL,
|
||||
##read the ini files for the further changes
|
||||
|
||||
iniFiles<-lapply(iniInput, function (x) readLines(x,-1))
|
||||
iniFiles[[1]] <- gsub("\\","/", iniFiles[[1]],fixed=TRUE) #replacing \ to /
|
||||
iniFiles[[2]] <- gsub("\\","/", iniFiles[[2]],fixed=TRUE) #replacing \ to /
|
||||
iniFiles[[1]] <- gsub("\\\\","/", iniFiles[[1]], perl = TRUE) #replacing \ to /
|
||||
iniFiles[[2]] <- gsub("\\\\","/", iniFiles[[2]], perl = TRUE) #replacing \ to /
|
||||
names(iniFiles) <- c("spinup","normal")
|
||||
|
||||
|
||||
|
||||
inputs <- lapply(1:nrow(grepHelper), function (x) {
|
||||
|
||||
outMaker(grepHelper[x,1],grepHelper[x,2],grepHelper[x,3])
|
||||
|
||||
})
|
||||
names(inputs) <- grepHelper$inputVar
|
||||
# inputs <- lapply(1:nrow(grepHelper), function (x) {
|
||||
#
|
||||
# outMaker(grepHelper[x,1],grepHelper[x,2],grepHelper[x,3])
|
||||
#
|
||||
# })
|
||||
# names(inputs) <- grepHelper$inputVar
|
||||
## grepHelper is in sysdata.rda it is a table like this:
|
||||
##
|
||||
## inputVar string isFile
|
||||
@ -150,36 +154,41 @@ setupMuso <- function(executable=NULL,
|
||||
# return(inputs) debug element
|
||||
|
||||
|
||||
if(is.null(mapData)){
|
||||
|
||||
outIndex<-grep("DAILY_OUTPUT",iniFiles[[2]])+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][outIndex],"[\ \t]"))[1])
|
||||
# if(is.null(mapData)){
|
||||
#
|
||||
outIndex<-grep("DAILY_OUTPUT",iniFiles[[2]], perl = TRUE)+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][outIndex],"[\ \t]", useBytes = TRUE))[1])
|
||||
dailyVarCodes<-tryCatch(iniFiles[[2]][(outIndex+1):(outIndex+numVar)],
|
||||
error = function(e){
|
||||
stop("Cannot read indexes of output variables from the normal ini file, please make sure you have not skiped a line after the flag: \"DAILY_OUTPUT\"")
|
||||
})
|
||||
dailyVarnames<-lapply(dailyVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1]))
|
||||
|
||||
outIndex<-grep("ANNUAL_OUTPUT",iniFiles[[2]])+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][outIndex],"[\ \t]"))[1])
|
||||
dailyVarCodes<-unlist(lapply(dailyVarCodes, function(x) unlist(strsplit(x,"[\ \t]", useBytes = TRUE))[1]))
|
||||
dailyVarnames<-unlist(lapply(dailyVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]", useBytes = TRUE))[1])))
|
||||
|
||||
outIndex<-grep("ANNUAL_OUTPUT",iniFiles[[2]], perl = TRUE)+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][outIndex],"[\ \t]", useBytes = TRUE))[1])
|
||||
annualVarCodes<-iniFiles[[2]][(outIndex+1):(outIndex+numVar)]
|
||||
annualVarnames<-lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1]))
|
||||
outputVars<-list(dailyVarnames,annualVarnames)} else {
|
||||
|
||||
c<-grep("DAILY_OUTPUT",iniFiles[[2]])+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][c],"[\ \t]"))[1])
|
||||
dailyVarCodes<-iniFiles[[2]][(c+1):(c+numVar)]
|
||||
dailyVarnames<-lapply(dailyVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1],mapData))
|
||||
|
||||
c<-grep("ANNUAL_OUTPUT",iniFiles[[2]])+1
|
||||
numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][c],"[\ \t]"))[1])
|
||||
annualVarCodes<-iniFiles[[2]][(c+1):(c+numVar)]
|
||||
annualVarnames<-lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1],mapData))
|
||||
outputVars<-list(dailyVarnames,annualVarnames)
|
||||
|
||||
|
||||
|
||||
}
|
||||
annualVarCodes<-unlist(lapply(annualVarCodes, function(x) unlist(strsplit(x,"[\ \t]", useBytes = TRUE))[1]))
|
||||
annualVarnames<-unlist(lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]", useBytes = TRUE))[1])))
|
||||
outputVars<-list(dailyVarnames,annualVarnames)
|
||||
# browser()
|
||||
# } else {
|
||||
#
|
||||
# c<-grep("DAILY_OUTPUT",iniFiles[[2]])+1
|
||||
# numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][c],"[\ \t]"))[1])
|
||||
# dailyVarCodes<-iniFiles[[2]][(c+1):(c+numVar)]
|
||||
# dailyVarnames<-lapply(dailyVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1],mapData))
|
||||
#
|
||||
# c<-grep("ANNUAL_OUTPUT",iniFiles[[2]])+1
|
||||
# numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][c],"[\ \t]"))[1])
|
||||
# annualVarCodes<-iniFiles[[2]][(c+1):(c+numVar)]
|
||||
# annualVarnames<-lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1],mapData))
|
||||
# outputVars<-list(dailyVarnames,annualVarnames)
|
||||
#
|
||||
#
|
||||
#
|
||||
# }
|
||||
|
||||
|
||||
|
||||
@ -195,9 +204,10 @@ setupMuso <- function(executable=NULL,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
outputName <- character(2)
|
||||
outputName[1] <- basename(unlist(strsplit(iniFiles[[1]][grep("OUTPUT_CONTROL",iniFiles[[1]])+1],"[\ \t]"))[1])
|
||||
outputName[2] <- basename(unlist(strsplit(iniFiles[[2]][grep("OUTPUT_CONTROL",iniFiles[[2]])+1],"[\ \t]"))[1])
|
||||
outputName[1] <- basename(unlist(strsplit(iniFiles[[1]][grep("OUTPUT_CONTROL",iniFiles[[1]], perl = TRUE)+1],"[\ \t]", useBytes = TRUE))[1])
|
||||
outputName[2] <- basename(unlist(strsplit(iniFiles[[2]][grep("OUTPUT_CONTROL",iniFiles[[2]], perl = TRUE)+1],"[\ \t]", useBytes = TRUE))[1])
|
||||
## outputName <- unlist(strsplit(grep("output",grep("prefix",iniFiles[[2]],value=TRUE),value=TRUE),"[\ \t]"))[1]
|
||||
##THIS IS AN UGLY SOLUTION, WHICH NEEDS AN UPGRADE!!! FiXED (2017.09.11)
|
||||
## outputName <- unlist(strsplit(grep("prefix for output files",iniFiles[[2]],value=TRUE),"[\ \t]"))[1]
|
||||
@ -210,7 +220,7 @@ setupMuso <- function(executable=NULL,
|
||||
|
||||
if(is.null(outputLoc)){
|
||||
## outputLoc<-paste((rev(rev(unlist(strsplit(outputName,"/")))[-1])),collapse="/")
|
||||
outputLoc <- dirname(unlist(strsplit(iniFiles[[2]][grep("OUTPUT_CONTROL",iniFiles[[2]])+1],"[\ \t]"))[1])
|
||||
outputLoc <- dirname(unlist(strsplit(iniFiles[[2]][grep("OUTPUT_CONTROL",iniFiles[[2]], perl = TRUE)+1],"[\ \t]", useBytes = TRUE))[1])
|
||||
if(substr(outputLoc,start = 1,stop = 1)!="/"){
|
||||
##if the outputName is not absolute path make it absolute
|
||||
outputLoc <- file.path(inputLoc,outputLoc)
|
||||
@ -223,13 +233,13 @@ setupMuso <- function(executable=NULL,
|
||||
|
||||
inputFiles<-c(iniInput,epcInput,metInput)
|
||||
numData<-rep(NA,3)
|
||||
numYears <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("TIME_DEFINE",iniFiles[[2]])+2],"[\ \t]"))[1])
|
||||
numYears <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("TIME_DEFINE",iniFiles[[2]], perl = TRUE)+1],"[\ \t]", useBytes = TRUE))[1])
|
||||
## numYears<-unlist(read.table(iniInput[2],skip = 14,nrows = 1)[1])
|
||||
numValues <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("DAILY_OUTPUT",iniFiles[[2]])+1],"[\ \t]"))[1])
|
||||
numValues <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("DAILY_OUTPUT",iniFiles[[2]], perl = TRUE)+1],"[\ \t]", useBytes = TRUE))[1])
|
||||
## numValues will be replaced to numVar
|
||||
## numValues<-unlist(read.table(iniInput[2],skip=102,nrows = 1)[1])
|
||||
startYear <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("TIME_DEFINE",iniFiles[[2]])+3],"[\ \t]"))[1])
|
||||
numData[1] <- numValues * numYears*365 #LEAPYEAR CORRECTION NEEDED
|
||||
startYear <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("TIME_DEFINE",iniFiles[[2]], perl = TRUE)+2],"[\ \t]", useBytes = TRUE))[1])
|
||||
numData[1] <- numValues * numYears * 365 # Have to corrigate leapyears
|
||||
|
||||
numData[2] <- numYears * numValues*12
|
||||
numData[3] <- numYears * numValues
|
||||
@ -241,7 +251,7 @@ setupMuso <- function(executable=NULL,
|
||||
|
||||
if(!is.null(modelOutputs)){
|
||||
outVarChanges <- putOutVars(iniFile = iniInput[2],outputVars = modelOutputs, modifyOriginal = TRUE)
|
||||
numData <- round(numData*outVarChanges[[2]])
|
||||
numData <- round(numDate*outVarChanges[[2]])
|
||||
outputVars[[1]] <-outVarChanges[[1]]
|
||||
}
|
||||
|
||||
@ -249,6 +259,33 @@ setupMuso <- function(executable=NULL,
|
||||
suppressWarnings(file.remove(paste0(file.path(outputLoc,outputName[1]),".log")))
|
||||
## I use file.path additionally because We do not know if outputLoc ends or not to "/"
|
||||
suppressWarnings(file.remove(paste0(file.path(outputLoc,outputName[2]),".log")))
|
||||
|
||||
searchBellow <- function(inFile, key, stringP = TRUE, n=1, management = FALSE){
|
||||
|
||||
if(stringP){
|
||||
unlist(strsplit(inFile[grep(key,inFile, perl=TRUE)+n],split = "\\s+", useBytes = TRUE))[1]
|
||||
} else {
|
||||
as.numeric(unlist(strsplit(inFile[grep(key,inFile,perl=TRUE)+n],split = "\\s+", useBytes = TRUE))[1])
|
||||
}
|
||||
}
|
||||
|
||||
normOutputFlags <- c(
|
||||
daily=searchBellow(iniFiles[[2]], "OUTPUT_CONTROL",stringP=FALSE,n=2),
|
||||
annual=searchBellow(iniFiles[[2]], "OUTPUT_CONTROL",stringP=FALSE,n=5))
|
||||
if(normOutputFlags[1]!=1){
|
||||
warning("You should set your daily output flag to 1 (binary) RBBRMuso work only with binary output...")
|
||||
}
|
||||
searchBellow(iniFiles[[2]], "OUTPUT_CONTROL",stringP=FALSE,n=5)
|
||||
soilFile <- NULL
|
||||
if(version >=6){
|
||||
soilFiles <- tryCatch(sapply(iniFiles,function(x){(searchBellow(x,"SOIL_FILE"))}),error = function(e){""})
|
||||
}
|
||||
epcFiles <- tryCatch(sapply(iniFiles,function(x){(searchBellow(x,"EPC_FILE"))}),error = function(e){""})
|
||||
metInput <- tryCatch(sapply(iniFiles,function(x){(searchBellow(x,"MET_INPUT"))}),error = function(e){""})
|
||||
dailyOutputTable <- cbind.data.frame(seq_along(dailyVarCodes),dailyVarCodes,outputVars[[1]])
|
||||
colnames(dailyOutputTable) <- c("index","code","name")
|
||||
annualOutputTable <- cbind.data.frame(seq_along(annualVarCodes),annualVarCodes,outputVars[[2]])
|
||||
colnames(annualOutputTable) <- c("index","code","name")
|
||||
|
||||
settings = list(executable = executable,
|
||||
calibrationPar = calibrationPar,
|
||||
@ -256,34 +293,61 @@ setupMuso <- function(executable=NULL,
|
||||
outputNames=outputName,
|
||||
inputLoc=inputLoc,
|
||||
iniInput=iniInput,
|
||||
metInput=inputs$metInput,
|
||||
epcInput=inputs$epcInput,
|
||||
thinInput=inputs$thinInput,
|
||||
CO2Input=inputs$CO2Input,
|
||||
mowInput=inputs$mowInput,
|
||||
grazInput=inputs$grazInput,
|
||||
harvInput=inputs$harvInput,
|
||||
plougInput=inputs$plougInput,
|
||||
fertInput=inputs$fertInput,
|
||||
irrInput=inputs$irrInput,
|
||||
nitInput=inputs$nitInput,
|
||||
metInput=metInput,
|
||||
epcInput=epcFiles,
|
||||
# thinInput=inputs$thinInput,
|
||||
# CO2Input=inputs$CO2Input,
|
||||
# mowInput=inputs$mowInput,
|
||||
# grazInput=inputs$grazInput,
|
||||
# harvInput=inputs$harvInput,
|
||||
# plougInput=inputs$plougInput,
|
||||
# fertInput=inputs$fertInput,
|
||||
# irrInput=inputs$irrInput,
|
||||
# nitInput=inputs$nitInput,
|
||||
inputFiles=inputFiles,
|
||||
numData=numData,
|
||||
startYear=startYear,
|
||||
numYears=numYears,
|
||||
outputVars=outputVars,
|
||||
soilFile=soilFiles,
|
||||
dailyVarCodes= gsub("\\s.*","",dailyVarCodes),
|
||||
annualVarCodes = gsub("\\s.*","",annualVarCodes),
|
||||
numVarY = length(outputVars[[2]]),
|
||||
numVarD = length(outputVars[[1]])
|
||||
dailyOutputTable=dailyOutputTable,
|
||||
annualOutputTable=annualOutputTable,
|
||||
normOutputFlags=normOutputFlags
|
||||
)
|
||||
|
||||
# if(getOption("RMuso_version")==6){
|
||||
# manFile <- scan(iniInput[2],what="",n=1,skip=44,sep=" ") # HARDCODED -> UNTIL JSON VERSION
|
||||
# mgm <- readLines(manFile)
|
||||
# mgmConn <- file(manFile,open="r")
|
||||
# manTypes <- c("planting","thinning","mowing","grazing","harvesting","ploughing","fertilizing","irrigating")
|
||||
# mgmFiles <- rep("none",length(manTypes))
|
||||
# if(scan(mgmConn,skip=3,n=1,what=integer())==1){
|
||||
# mgmFiles[1] <- scan(mgmConn,skip=1,n=1,what="", sep = " ")
|
||||
# }
|
||||
# for(i in 2:length(mgmFiles)){
|
||||
# if(scan(mgmConn,skip=2,n=1,what=integer())==1){
|
||||
# mgmFiles[i] <- scan(mgmConn,skip=1,n=1,what="", sep =" " )
|
||||
# } else {
|
||||
# blackhole<-scan(mgmConn,skip =1, n=1,what="")
|
||||
# }
|
||||
# }
|
||||
# names(mgmFiles) <- manTypes
|
||||
# settings[["management"]] <- mgmFiles
|
||||
# close(manConn)
|
||||
# }
|
||||
|
||||
|
||||
if(writep!=nrow(grepHelper)){
|
||||
writeLines(iniFiles[[1]],iniInput[[1]])
|
||||
if(inputs$epcInput[1]!=inputs$epc$Input[2]){ #Change need here
|
||||
writeLines(iniFiles[[2]],iniInput[[2]])
|
||||
}
|
||||
}
|
||||
# if(writep!=nrow(grepHelper)){
|
||||
# writeLines(iniFiles[[1]],iniInput[[1]])
|
||||
# if(inputs$epcInput[1]!=inputs$epc$Input[2]){ #Change need here
|
||||
# writeLines(iniFiles[[2]],iniInput[[2]])
|
||||
# }
|
||||
# }
|
||||
|
||||
suppressWarnings(dir.create(file.path(inputLoc,"bck")))
|
||||
# sapply(iniFiles,epc)
|
||||
return(settings)
|
||||
|
||||
}
|
||||
|
||||
73
RBBGCMuso/R/soilQuery.R
Normal file
73
RBBGCMuso/R/soilQuery.R
Normal file
@ -0,0 +1,73 @@
|
||||
#' 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) {
|
||||
if(missing(apiURL)){
|
||||
apiURL <- "https://81.169.232.36"
|
||||
}
|
||||
apiString <- glue("{apiURL}/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,
|
||||
template=system.file("examples/hhs/hhs.soi",package="RBBGCMuso")) {
|
||||
if(missing(apiURL)){
|
||||
apiURL <- "https://rest.soilgrids.org/soilgrids/v2.0/properties"
|
||||
}
|
||||
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)
|
||||
soilGridDepths <- c(2.5, 10, 22.5, 45, 80, 150)
|
||||
Reduce(function(x,y){(y-x)/2+x},soilGridDepths,accumulate=TRUE)
|
||||
rest<- getSoilDataFull(lat,lon, apiURL)
|
||||
|
||||
|
||||
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 <- tryCatch(getMeanSoil(rest,"bdod")/100,error=function(e){stop("There is no data for the given coordinates")})
|
||||
outFile[55] <- sprintf("%s (%%) percentage of sand by volume in rock free soil",
|
||||
paste(createMusoLayers(getMeanSoil(rest,"sand")/10), collapse="\t"))
|
||||
outFile[56] <- sprintf("%s (%%) percentage of silt by volume in rock free soil",
|
||||
paste(createMusoLayers(getMeanSoil(rest,"silt")/10), collapse="\t"))
|
||||
outFile[57] <- sprintf("%s (dimless) soil PH",
|
||||
paste(createMusoLayers(getMeanSoil(rest,"phh2o")/10), collapse="\t"))
|
||||
# outFile[58] <- sprintf("%s (%%) bulk density",paste(createMusoLayers(soilDepth),collapse="\t"))
|
||||
writeLines(outFile,outputFile)
|
||||
}
|
||||
# createSoilFile(60,50)
|
||||
|
||||
getMeanSoil <- function(rest, name){
|
||||
sapply(
|
||||
rest$properties$layers[sapply(rest$properties$layers,function(x){
|
||||
x$name == name
|
||||
})][[1]]$depths,
|
||||
function(s){
|
||||
s$values$mean
|
||||
}
|
||||
)
|
||||
}
|
||||
Binary file not shown.
37
RBBGCMuso/algo.md
Normal file
37
RBBGCMuso/algo.md
Normal file
@ -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 <http://rmarkdown.rstudio.com>.
|
||||
|
||||
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:
|
||||
|
||||

|
||||
|
||||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
|
||||
BIN
RBBGCMuso/figure/pressure-1.png
Normal file
BIN
RBBGCMuso/figure/pressure-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
27
RBBGCMuso/getOutPutList.R
Normal file
27
RBBGCMuso/getOutPutList.R
Normal file
@ -0,0 +1,27 @@
|
||||
#' getDailyOutputList
|
||||
#'
|
||||
#' bla bla
|
||||
#' @param settings bla
|
||||
#' @export
|
||||
|
||||
|
||||
getDailyOutputList <- function(settings=NULL){
|
||||
if(is.null(settings)){
|
||||
settings<- setupMuso()
|
||||
}
|
||||
settings$dailyOutputTable
|
||||
}
|
||||
|
||||
#' getAnnualOutputList
|
||||
#'
|
||||
#' bla bla
|
||||
#' @param settings bla
|
||||
#' @export
|
||||
|
||||
|
||||
getAnnualOutputList <- function(settings=NULL){
|
||||
if(is.null(settings)){
|
||||
settings<- setupMuso()
|
||||
}
|
||||
settings$annualOutputTable
|
||||
}
|
||||
1
RBBGCMuso/inst/data/constMatrix5.json
Normal file
1
RBBGCMuso/inst/data/constMatrix5.json
Normal file
File diff suppressed because one or more lines are too long
190
RBBGCMuso/inst/data/constMatrix6.json
Normal file
190
RBBGCMuso/inst/data/constMatrix6.json
Normal file
@ -0,0 +1,190 @@
|
||||
[
|
||||
{"X": "1", "NAME": "yearday to start new growth", "INDEX": "9", "UNIT": "yday", "MIN": "0", "MAX": "364", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "2", "NAME": "yearday to end new growth", "INDEX": "10", "UNIT": "yday", "MIN": "0", "MAX": "364", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "3", "NAME": "transfer growth period as fraction of growing season", "INDEX": "11", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "4", "NAME": "litterfall as fraction of growing season", "INDEX": "12", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "5", "NAME": "base temperature", "INDEX": "13", "UNIT": "Celsius", "MIN": "0", "MAX": "12", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "6", "NAME": "minimum temperature for growth displayed on current day", "INDEX": "14", "UNIT": "Celsius", "MIN": "0", "MAX": "10", "DEPENDENCE": "0", "GROUP": "1", "TYPE": "1"},
|
||||
{"X": "7", "NAME": "optimal1 temperature for growth displayed on current day", "INDEX": "15", "UNIT": "Celsius", "MIN": "10", "MAX": "20", "DEPENDENCE": "1", "GROUP": "1", "TYPE": "1"},
|
||||
{"X": "8", "NAME": "optimal2 temperature for growth displayed on current day", "INDEX": "16", "UNIT": "Celsius", "MIN": "20", "MAX": "40", "DEPENDENCE": "2", "GROUP": "1", "TYPE": "1"},
|
||||
{"X": "9", "NAME": "maxmimum temperature for growth displayed on current day", "INDEX": "17", "UNIT": "Celsius", "MIN": "30", "MAX": "50", "DEPENDENCE": "3", "GROUP": "1", "TYPE": "1"},
|
||||
{"X": "10", "NAME": "minimum temperature for carbon assimilation displayed on current day", "INDEX": "18", "UNIT": "Celsius", "MIN": "0", "MAX": "10", "DEPENDENCE": "0", "GROUP": "2", "TYPE": "1"},
|
||||
{"X": "11", "NAME": "optimal1 temperature for carbon assimilation displayed on current day", "INDEX": "19", "UNIT": "Celsius", "MIN": "10", "MAX": "20", "DEPENDENCE": "1", "GROUP": "2", "TYPE": "1"},
|
||||
{"X": "12", "NAME": "optimal2 temperature for carbon assimilation displayed on current day", "INDEX": "20", "UNIT": "Celsius", "MIN": "20", "MAX": "40", "DEPENDENCE": "2", "GROUP": "2", "TYPE": "1"},
|
||||
{"X": "13", "NAME": "maxmimum temperature for carbon assimilation displayed on current day", "INDEX": "21", "UNIT": "Celsius", "MIN": "30", "MAX": "50", "DEPENDENCE": "3", "GROUP": "2", "TYPE": "1"},
|
||||
{"X": "14", "NAME": "annual leaf and fine root turnover fraction", "INDEX": "22", "UNIT": "1/yr", "MIN": "0.1", "MAX": "0.4", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "15", "NAME": "annual live wood turnover fraction", "INDEX": "23", "UNIT": "1/yr", "MIN": "0.5", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "16", "NAME": "annual fire mortality fraction", "INDEX": "24", "UNIT": "1/yr", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "17", "NAME": "whole-plant mortality paramter for vegetation period", "INDEX": "25", "UNIT": "1/vegper", "MIN": "0", "MAX": "0.5", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "18", "NAME": "C:N of leaves", "INDEX": "26", "UNIT": "kgC/kgN", "MIN": "10", "MAX": "100", "DEPENDENCE": "0", "GROUP": "3", "TYPE": "1"},
|
||||
{"X": "19", "NAME": "C:N of leaf litter", "INDEX": "27", "UNIT": "kgC/kgN", "MIN": "10", "MAX": "60", "DEPENDENCE": "1", "GROUP": "3", "TYPE": "1"},
|
||||
{"X": "20", "NAME": "C:N of fine roots", "INDEX": "28", "UNIT": "kgC/kgN", "MIN": "10", "MAX": "60", "DEPENDENCE": "1", "GROUP": "3", "TYPE": "1"},
|
||||
{"X": "21", "NAME": "C:N of fruit", "INDEX": "29", "UNIT": "kgC/kgN", "MIN": "10", "MAX": "60", "DEPENDENCE": "1", "GROUP": "3", "TYPE": "1"},
|
||||
{"X": "22", "NAME": "C:N of softstem", "INDEX": "30", "UNIT": "kgC/kgN", "MIN": "10", "MAX": "60", "DEPENDENCE": "1", "GROUP": "3", "TYPE": "1"},
|
||||
{"X": "23", "NAME": "C:N of live wood", "INDEX": "31", "UNIT": "kgC/kgN", "MIN": "50", "MAX": "100", "DEPENDENCE": "0", "GROUP": "4", "TYPE": "1"},
|
||||
{"X": "24", "NAME": "C:N of dead wood", "INDEX": "32", "UNIT": "kgC/kgN", "MIN": "300", "MAX": "800", "DEPENDENCE": "1", "GROUP": "4", "TYPE": "1"},
|
||||
{"X": "25", "NAME": "dry matter content of leaves", "INDEX": "33", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "26", "NAME": "dry matter content of leaf litter", "INDEX": "34", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "27", "NAME": "dry matter content of fine roots", "INDEX": "35", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "28", "NAME": "dry matter content of fruit", "INDEX": "36", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "29", "NAME": "dry matter content of softstem", "INDEX": "37", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "30", "NAME": "dry matter content of live wood", "INDEX": "38", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "31", "NAME": "dry matter content of dead wood", "INDEX": "39", "UNIT": "kgC/kgDM", "MIN": "0.2", "MAX": "0.6", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "32", "NAME": "leaf litter labile proportion", "INDEX": "40", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "5", "TYPE": "2"},
|
||||
{"X": "33", "NAME": "leaf litter cellulose proportion", "INDEX": "41", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "5", "TYPE": "2"},
|
||||
{"X": "34", "NAME": "fine root labile proportion", "INDEX": "42", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "6", "TYPE": "2"},
|
||||
{"X": "35", "NAME": "fine root cellulose proportion", "INDEX": "43", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "6", "TYPE": "2"},
|
||||
{"X": "36", "NAME": "fruit labile proportion", "INDEX": "44", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "7", "TYPE": "2"},
|
||||
{"X": "37", "NAME": "fruit cellulose proportion", "INDEX": "45", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "7", "TYPE": "2"},
|
||||
{"X": "38", "NAME": "softstem labile proportion", "INDEX": "46", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "8", "TYPE": "2"},
|
||||
{"X": "39", "NAME": "softstem cellulose proportion", "INDEX": "47", "UNIT": "prop", "MIN": "0.1", "MAX": "0.6", "DEPENDENCE": "1", "GROUP": "8", "TYPE": "2"},
|
||||
{"X": "40", "NAME": "dead wood cellulose proportion", "INDEX": "48", "UNIT": "prop", "MIN": "0.5", "MAX": "0.9", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "41", "NAME": "canopy water interception coefficient", "INDEX": "49", "UNIT": "1/LAI/d", "MIN": "0.01", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "42", "NAME": "canopy light extinction coefficient", "INDEX": "50", "UNIT": "dimless", "MIN": "0.2", "MAX": "0.8", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "43", "NAME": "potential radiation use efficiency", "INDEX": "51", "UNIT": "g/MJ", "MIN": "2", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "44", "NAME": "radiation parameter1 (Jiang et al.2015)", "INDEX": "52", "UNIT": "dimless", "MIN": "0.781", "MAX": "0.781", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "45", "NAME": "radiation parameter1 (Jiang et al.2015)", "INDEX": "53", "UNIT": "dimless", "MIN": "-13.596", "MAX": "-13.596", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "46", "NAME": "all-sided to projected leaf area ratio", "INDEX": "54", "UNIT": "dimless", "MIN": "2", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "47", "NAME": "ratio of shaded SLA:sunlit SLA", "INDEX": "55", "UNIT": "dimless", "MIN": "2", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "48", "NAME": "fraction of leaf N in Rubisco", "INDEX": "56", "UNIT": "dimless", "MIN": "0.01", "MAX": "0.2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "49", "NAME": "fraction of leaf N in PeP", "INDEX": "57", "UNIT": "dimless", "MIN": "0.0424", "MAX": "0.0424", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "50", "NAME": "maximum stomatal conductance", "INDEX": "58", "UNIT": "m/s", "MIN": "0.001", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "51", "NAME": "cuticular conductance", "INDEX": "59", "UNIT": "m/s", "MIN": "1E-05", "MAX": "0.0001", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "52", "NAME": "boundary layer conductance", "INDEX": "60", "UNIT": "m/s", "MIN": "0.01", "MAX": "0.09", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "53", "NAME": "maximum height of plant", "INDEX": "61", "UNIT": "m", "MIN": "0.1", "MAX": "10", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "54", "NAME": "stem weight corresponding to maximum height", "INDEX": "62", "UNIT": "kgC", "MIN": "0.1", "MAX": "100", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "55", "NAME": "plant height function shape parameter (slope)", "INDEX": "63", "UNIT": "dimless", "MIN": "0.5", "MAX": "0.5", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "56", "NAME": "maximum depth of rooting zone", "INDEX": "64", "UNIT": "m", "MIN": "0.1", "MAX": "10", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "57", "NAME": "root distribution parameter", "INDEX": "65", "UNIT": "prop", "MIN": "3.67", "MAX": "3.67", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "58", "NAME": "root weight corresponding to max root depth", "INDEX": "66", "UNIT": "kgC/m2", "MIN": "0.4", "MAX": "0.4", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "59", "NAME": "root depth function shape parameter (slope)", "INDEX": "67", "UNIT": "prop", "MIN": "0.5", "MAX": "0.5", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "60", "NAME": "root weight to rooth length conversion factor", "INDEX": "68", "UNIT": "m/kg", "MIN": "1000", "MAX": "1000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "61", "NAME": "growth resp per unit of C grown", "INDEX": "69", "UNIT": "prop", "MIN": "0.1", "MAX": "0.5", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "62", "NAME": "maintenance respiration in kgC/day per kg of tissue N", "INDEX": "70", "UNIT": "kgC/kgN/d", "MIN": "0.1", "MAX": "0.5", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "63", "NAME": "theoretical maximum prop. of non-structural and structural carbohydrates", "INDEX": "71", "UNIT": "dimless", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "64", "NAME": "prop. of non-structural carbohydrates available for maintanance resp", "INDEX": "72", "UNIT": "dimless", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "65", "NAME": "symbiotic+asymbiotic fixation of N", "INDEX": "73", "UNIT": "kgN/m2/yr", "MIN": "0", "MAX": "0.001", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "66", "NAME": "time delay for temperature in photosynthesis acclimation", "INDEX": "74", "UNIT": "day", "MIN": "0", "MAX": "50", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "67", "NAME": "critical VWCratio (prop. to FC-WP) in germination", "INDEX": "79", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "68", "NAME": "critical photoslow daylength", "INDEX": "81", "UNIT": "hour", "MIN": "14", "MAX": "18", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "69", "NAME": "slope of relative photoslow development rate", "INDEX": "82", "UNIT": "dimless", "MIN": "0.005", "MAX": "0.005", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "70", "NAME": "critical vernalization temperature 1", "INDEX": "84", "UNIT": "Celsius", "MIN": "-5", "MAX": "5", "DEPENDENCE": "0", "GROUP": "9", "TYPE": "1"},
|
||||
{"X": "71", "NAME": "critical vernalization temperature 2", "INDEX": "85", "UNIT": "Celsius", "MIN": "0", "MAX": "10", "DEPENDENCE": "1", "GROUP": "9", "TYPE": "1"},
|
||||
{"X": "72", "NAME": "critical vernalization temperature 3", "INDEX": "86", "UNIT": "Celsius", "MIN": "5", "MAX": "15", "DEPENDENCE": "2", "GROUP": "9", "TYPE": "1"},
|
||||
{"X": "73", "NAME": "critical vernalization temperature 4", "INDEX": "87", "UNIT": "Celsius", "MIN": "10", "MAX": "20", "DEPENDENCE": "3", "GROUP": "9", "TYPE": "1"},
|
||||
{"X": "74", "NAME": "slope of relative vernalization development rate", "INDEX": "88", "UNIT": "dimless", "MIN": "0.04", "MAX": "0.04", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "75", "NAME": "required vernalization days (in vernalization development rate)", "INDEX": "89", "UNIT": "dimless", "MIN": "30", "MAX": "70", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "76", "NAME": "critical flowering heat stress temperature 1", "INDEX": "91", "UNIT": "Celsius", "MIN": "30", "MAX": "40", "DEPENDENCE": "0", "GROUP": "10", "TYPE": "1"},
|
||||
{"X": "77", "NAME": "critical flowering heat stress temperature 2", "INDEX": "92", "UNIT": "Celsius", "MIN": "30", "MAX": "50", "DEPENDENCE": "1", "GROUP": "10", "TYPE": "1"},
|
||||
{"X": "78", "NAME": "theoretical maximum of flowering thermal stress mortality", "INDEX": "93", "UNIT": "prop", "MIN": "0", "MAX": "0.4", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "79", "NAME": "VWC ratio to calc. soil moisture limit 1 (prop. to FC-WP)", "INDEX": "96", "UNIT": "prop", "MIN": "0.5", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "80", "NAME": "VWC ratio to calc. soil moisture limit 2 (prop. to SAT-FC)", "INDEX": "97", "UNIT": "prop", "MIN": "0.5", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "81", "NAME": "minimum of soil moisture limit2 multiplicator (full anoxic stress value)", "INDEX": "98", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "82", "NAME": "vapor pressure deficit: start of conductance reduction", "INDEX": "99", "UNIT": "Pa", "MIN": "500", "MAX": "1500", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "83", "NAME": "vapor pressure deficit: complete conductance reduction", "INDEX": "100", "UNIT": "Pa", "MIN": "1500", "MAX": "3500", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "84", "NAME": "maximum senescence mortality coefficient of aboveground plant material", "INDEX": "101", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "85", "NAME": "maximum senescence mortality coefficient of belowground plant material", "INDEX": "102", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "86", "NAME": "maximum senescence mortality coefficient of non-structured plant material", "INDEX": "103", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "87", "NAME": "lower limit extreme high temperature effect on senescence mortality", "INDEX": "104", "UNIT": "Celsius", "MIN": "30", "MAX": "40", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "88", "NAME": "upper limit extreme high temperature effect on senescence mortality", "INDEX": "105", "UNIT": "Celsius", "MIN": "30", "MAX": "50", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "89", "NAME": "turnover rate of wilted standing biomass to litter", "INDEX": "106", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "90", "NAME": "turnover rate of cut-down non-woody biomass to litter", "INDEX": "107", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "91", "NAME": "turnover rate of cut-down woody biomass to litter", "INDEX": "108", "UNIT": "prop", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "92", "NAME": "drought tolerance parameter (critical value of day since water stress)", "INDEX": "109", "UNIT": "n_day", "MIN": "0", "MAX": "100", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "93", "NAME": "crit. amount of snow limiting photosyn.", "INDEX": "112", "UNIT": "kg/m2", "MIN": "0", "MAX": "20", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "94", "NAME": "limit1 (under:full constrained) of HEATSUM index", "INDEX": "113", "UNIT": "Celsius", "MIN": "0", "MAX": "50", "DEPENDENCE": "0", "GROUP": "11", "TYPE": "1"},
|
||||
{"X": "95", "NAME": "limit2 (above:unconstrained) of HEATSUM index", "INDEX": "114", "UNIT": "Celsius", "MIN": "0", "MAX": "100", "DEPENDENCE": "1", "GROUP": "11", "TYPE": "1"},
|
||||
{"X": "96", "NAME": "limit1 (under:full constrained) of TMIN index", "INDEX": "115", "UNIT": "Celsius", "MIN": "-5", "MAX": "5", "DEPENDENCE": "0", "GROUP": "12", "TYPE": "1"},
|
||||
{"X": "97", "NAME": "limit2 (above:unconstrained) of TMIN index", "INDEX": "116", "UNIT": "Celsius", "MIN": "0", "MAX": "10", "DEPENDENCE": "1", "GROUP": "12", "TYPE": "1"},
|
||||
{"X": "98", "NAME": "limit1 (above:full constrained) of VPD index", "INDEX": "117", "UNIT": "Pa", "MIN": "2000", "MAX": "600", "DEPENDENCE": "0", "GROUP": "13", "TYPE": "1"},
|
||||
{"X": "99", "NAME": "limit2 (under:unconstrained) of VPD index", "INDEX": "118", "UNIT": "Pa", "MIN": "500", "MAX": "1500", "DEPENDENCE": "1", "GROUP": "13", "TYPE": "1"},
|
||||
{"X": "100", "NAME": "limit1 (under:full constrained) of DAYLENGTH index", "INDEX": "119", "UNIT": "s", "MIN": "0", "MAX": "0", "DEPENDENCE": "0", "GROUP": "14", "TYPE": "1"},
|
||||
{"X": "101", "NAME": "limit2 (above:unconstrained) of DAYLENGTH index", "INDEX": "120", "UNIT": "s", "MIN": "0", "MAX": "0", "DEPENDENCE": "1", "GROUP": "14", "TYPE": "1"},
|
||||
{"X": "102", "NAME": "moving average (to avoid the effects of extreme events)", "INDEX": "121", "UNIT": "n_day", "MIN": "2", "MAX": "20", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "103", "NAME": "GSI limit1 (greater that limit -> start of vegper)", "INDEX": "122", "UNIT": "dimless", "MIN": "0", "MAX": "0.2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "104", "NAME": "GSI limit2 (less that limit -> end of vegper)", "INDEX": "123", "UNIT": "dimless", "MIN": "0", "MAX": "0.1", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-0", "INDEX": "127.6", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -0", "INDEX": "128.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-0", "INDEX": "129.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -0", "INDEX": "130.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-0", "INDEX": "131.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -0", "INDEX": "132.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -0", "INDEX": "133.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-0", "INDEX": "134.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -0", "INDEX": "135.6", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "15", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-0", "INDEX": "136.6", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-0", "INDEX": "137.6", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-0", "INDEX": "138.6", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-1", "INDEX": "127.61", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -1", "INDEX": "128.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-1", "INDEX": "129.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -1", "INDEX": "130.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-1", "INDEX": "131.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -1", "INDEX": "132.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -1", "INDEX": "133.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-1", "INDEX": "134.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -1", "INDEX": "135.61", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "16", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-1", "INDEX": "136.61", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-1", "INDEX": "137.61", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-1", "INDEX": "138.61", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-2", "INDEX": "127.62", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -2", "INDEX": "128.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-2", "INDEX": "129.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -2", "INDEX": "130.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-2", "INDEX": "131.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -2", "INDEX": "132.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -2", "INDEX": "133.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-2", "INDEX": "134.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -2", "INDEX": "135.62", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "17", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-2", "INDEX": "136.62", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-2", "INDEX": "137.62", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-2", "INDEX": "138.62", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-3", "INDEX": "127.63", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -3", "INDEX": "128.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-3", "INDEX": "129.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -3", "INDEX": "130.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-3", "INDEX": "131.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -3", "INDEX": "132.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -3", "INDEX": "133.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-3", "INDEX": "134.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -3", "INDEX": "135.63", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "18", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-3", "INDEX": "136.63", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-3", "INDEX": "137.63", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-3", "INDEX": "138.63", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-4", "INDEX": "127.64", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -4", "INDEX": "128.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-4", "INDEX": "129.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -4", "INDEX": "130.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-4", "INDEX": "131.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -4", "INDEX": "132.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -4", "INDEX": "133.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-4", "INDEX": "134.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -4", "INDEX": "135.64", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "19", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-4", "INDEX": "136.64", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-4", "INDEX": "137.64", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-4", "INDEX": "138.64", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-5", "INDEX": "127.65", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -5", "INDEX": "128.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-5", "INDEX": "129.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -5", "INDEX": "130.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-5", "INDEX": "131.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -5", "INDEX": "132.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -5", "INDEX": "133.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-5", "INDEX": "134.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -5", "INDEX": "135.65", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "20", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-5", "INDEX": "136.65", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-5", "INDEX": "137.65", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-5", "INDEX": "138.65", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "105", "NAME": "length of phenophase (GDD)-6", "INDEX": "127.6", "UNIT": "Celsius", "MIN": "0", "MAX": "10000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "106", "NAME": "leaf ALLOCATION -6", "INDEX": "128.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "107", "NAME": "fine root ALLOCATION-6", "INDEX": "129.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "108", "NAME": "fruit ALLOCATION -6", "INDEX": "130.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "109", "NAME": "soft stem ALLOCATION-6", "INDEX": "131.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "110", "NAME": "live woody stem ALLOCATION -6", "INDEX": "132.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "111", "NAME": "dead woody stem ALLOCATION -6", "INDEX": "133.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "112", "NAME": "live coarse root ALLOCATION-6", "INDEX": "134.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "113", "NAME": "dead coarse root ALLOCATION -6", "INDEX": "135.66", "UNIT": "prop", "MIN": "0", "MAX": "1", "DEPENDENCE": "1", "GROUP": "21", "TYPE": "-3"},
|
||||
{"X": "114", "NAME": "canopy average specific leaf area-6", "INDEX": "136.66", "UNIT": "m2/kg", "MIN": "0", "MAX": "2", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "115", "NAME": "current growth proportion-6", "INDEX": "137.66", "UNIT": "prop", "MIN": "0", "MAX": "0", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"},
|
||||
{"X": "116", "NAME": "maximal lifetime of plant tissue-6", "INDEX": "138.66", "UNIT": "Celsius", "MIN": "1", "MAX": "20000", "DEPENDENCE": "NA", "GROUP": "0", "TYPE": "0"}
|
||||
]
|
||||
1
RBBGCMuso/inst/data/epcConstMatrix5.json
Normal file
1
RBBGCMuso/inst/data/epcConstMatrix5.json
Normal file
File diff suppressed because one or more lines are too long
1985
RBBGCMuso/inst/data/epcConstMatrix6.json
Normal file
1985
RBBGCMuso/inst/data/epcConstMatrix6.json
Normal file
File diff suppressed because it is too large
Load Diff
1
RBBGCMuso/inst/data/soilConstMatrix5.json
Normal file
1
RBBGCMuso/inst/data/soilConstMatrix5.json
Normal file
File diff suppressed because one or more lines are too long
1495
RBBGCMuso/inst/data/soilConstMatrix6.json
Normal file
1495
RBBGCMuso/inst/data/soilConstMatrix6.json
Normal file
File diff suppressed because it is too large
Load Diff
15507
RBBGCMuso/inst/data/varTable6.json
Normal file
15507
RBBGCMuso/inst/data/varTable6.json
Normal file
File diff suppressed because it is too large
Load Diff
119
RBBGCMuso/inst/examples/hhs/CO2.txt
Normal file
119
RBBGCMuso/inst/examples/hhs/CO2.txt
Normal file
@ -0,0 +1,119 @@
|
||||
1900 296.10
|
||||
1901 296.10
|
||||
1902 296.50
|
||||
1903 296.80
|
||||
1904 297.20
|
||||
1905 297.60
|
||||
1906 298.10
|
||||
1907 298.50
|
||||
1908 298.90
|
||||
1909 299.30
|
||||
1910 299.70
|
||||
1911 300.10
|
||||
1912 300.40
|
||||
1913 300.80
|
||||
1914 301.10
|
||||
1915 301.40
|
||||
1916 301.70
|
||||
1917 302.10
|
||||
1918 302.40
|
||||
1919 302.70
|
||||
1920 303.00
|
||||
1921 303.40
|
||||
1922 303.80
|
||||
1923 304.10
|
||||
1924 304.50
|
||||
1925 305.00
|
||||
1926 305.40
|
||||
1927 305.80
|
||||
1928 306.30
|
||||
1929 306.80
|
||||
1930 307.20
|
||||
1931 307.70
|
||||
1932 308.20
|
||||
1933 308.60
|
||||
1934 309.00
|
||||
1935 309.40
|
||||
1936 309.80
|
||||
1937 310.00
|
||||
1938 310.20
|
||||
1939 310.30
|
||||
1940 310.40
|
||||
1941 310.40
|
||||
1942 310.30
|
||||
1943 310.20
|
||||
1944 310.10
|
||||
1945 310.10
|
||||
1946 310.10
|
||||
1947 310.20
|
||||
1948 310.30
|
||||
1949 310.50
|
||||
1950 310.70
|
||||
1951 311.10
|
||||
1952 311.50
|
||||
1953 311.90
|
||||
1954 312.40
|
||||
1955 313.00
|
||||
1956 313.60
|
||||
1957 314.20
|
||||
1958 314.90
|
||||
1959 315.79
|
||||
1960 316.61
|
||||
1961 317.33
|
||||
1962 318.08
|
||||
1963 318.70
|
||||
1964 319.36
|
||||
1965 320.02
|
||||
1966 321.09
|
||||
1967 321.99
|
||||
1968 322.93
|
||||
1969 324.21
|
||||
1970 325.24
|
||||
1971 326.06
|
||||
1972 327.18
|
||||
1973 328.84
|
||||
1974 329.73
|
||||
1975 330.73
|
||||
1976 331.83
|
||||
1977 333.25
|
||||
1978 334.60
|
||||
1979 336.85
|
||||
1980 338.69
|
||||
1981 339.93
|
||||
1982 341.13
|
||||
1983 342.78
|
||||
1984 344.42
|
||||
1985 345.90
|
||||
1986 347.15
|
||||
1987 348.93
|
||||
1988 351.48
|
||||
1989 352.91
|
||||
1990 354.19
|
||||
1991 355.59
|
||||
1992 356.37
|
||||
1993 357.04
|
||||
1994 358.88
|
||||
1995 360.88
|
||||
1996 362.64
|
||||
1997 363.76
|
||||
1998 366.63
|
||||
1999 368.31
|
||||
2000 369.48
|
||||
2001 372.59
|
||||
2002 374.37
|
||||
2003 378.04
|
||||
2004 380.88
|
||||
2005 383.88
|
||||
2006 385.64
|
||||
2007 385.76
|
||||
2008 386.13
|
||||
2009 387.37
|
||||
2010 389.85
|
||||
2011 391.62
|
||||
2012 393.82
|
||||
2013 396.48
|
||||
2014 398.61
|
||||
2015 400.00
|
||||
2016 401.00
|
||||
2017 402.00
|
||||
2018 404.00
|
||||
@ -1,55 +0,0 @@
|
||||
1961 317.33
|
||||
1962 318.08
|
||||
1963 318.70
|
||||
1964 319.36
|
||||
1965 320.02
|
||||
1966 321.09
|
||||
1967 321.99
|
||||
1968 322.93
|
||||
1969 324.21
|
||||
1970 325.24
|
||||
1971 326.06
|
||||
1972 327.18
|
||||
1973 328.84
|
||||
1974 329.73
|
||||
1975 330.73
|
||||
1976 331.83
|
||||
1977 333.25
|
||||
1978 334.60
|
||||
1979 336.85
|
||||
1980 338.69
|
||||
1981 339.93
|
||||
1982 341.13
|
||||
1983 342.78
|
||||
1984 344.42
|
||||
1985 345.90
|
||||
1986 347.15
|
||||
1987 348.93
|
||||
1988 351.48
|
||||
1989 352.91
|
||||
1990 354.19
|
||||
1991 355.59
|
||||
1992 356.37
|
||||
1993 357.04
|
||||
1994 358.88
|
||||
1995 360.88
|
||||
1996 362.64
|
||||
1997 363.76
|
||||
1998 366.63
|
||||
1999 368.31
|
||||
2000 369.48
|
||||
2001 372.59
|
||||
2002 374.37
|
||||
2003 378.04
|
||||
2004 380.88
|
||||
2005 383.88
|
||||
2006 385.64
|
||||
2007 385.76
|
||||
2008 386.13
|
||||
2009 387.37
|
||||
2010 389.85
|
||||
2011 391.62
|
||||
2012 393.82
|
||||
2013 396.48
|
||||
2014 398.61
|
||||
2015 400.00
|
||||
367
RBBGCMuso/inst/examples/hhs/HU-He2_2012_MEASURED.txt
Normal file
367
RBBGCMuso/inst/examples/hhs/HU-He2_2012_MEASURED.txt
Normal file
@ -0,0 +1,367 @@
|
||||
yyyy mm dd NEE GPP TER LE flag
|
||||
2012 1 1 0.440 0.284 0.724 0.030 0
|
||||
2012 1 2 0.540 0.486 1.026 0.222 0
|
||||
2012 1 3 0.716 0.313 1.030 0.002 0
|
||||
2012 1 4 0.627 0.468 1.095 0.055 0
|
||||
2012 1 5 0.868 0.080 0.948 0.061 0
|
||||
2012 1 6 0.077 0.751 0.828 0.372 0
|
||||
2012 1 7 0.396 0.394 0.791 0.219 0
|
||||
2012 1 8 0.110 0.767 0.877 0.125 0
|
||||
2012 1 9 0.239 0.771 1.010 0.182 0
|
||||
2012 1 10 0.207 0.732 0.938 0.271 0
|
||||
2012 1 11 0.115 1.043 1.158 0.173 0
|
||||
2012 1 12 0.509 0.443 0.952 0.351 0
|
||||
2012 1 13 0.245 0.694 0.940 0.294 0
|
||||
2012 1 14 0.509 0.521 1.030 0.192 0
|
||||
2012 1 15 0.516 0.521 1.037 0.120 0
|
||||
2012 1 16 0.142 0.630 0.772 0.195 0
|
||||
2012 1 17 0.423 0.333 0.756 0.172 0
|
||||
2012 1 18 0.277 0.586 0.863 0.256 0
|
||||
2012 1 19 0.609 0.264 0.873 0.179 0
|
||||
2012 1 20 0.853 0.191 1.043 0.028 0
|
||||
2012 1 21 1.004 0.345 1.349 0.240 0
|
||||
2012 1 22 0.658 0.828 1.486 0.313 0
|
||||
2012 1 23 0.339 0.739 1.078 0.153 0
|
||||
2012 1 24 0.281 0.752 1.032 0.045 0
|
||||
2012 1 25 0.275 0.612 0.886 0.234 0
|
||||
2012 1 26 0.098 0.614 0.712 0.189 0
|
||||
2012 1 27 0.065 0.526 0.591 0.198 0
|
||||
2012 1 28 0.270 0.307 0.577 0.101 0
|
||||
2012 1 29 0.180 0.327 0.507 0.062 0
|
||||
2012 1 30 0.916 0.371 1.287 0.086 0
|
||||
2012 1 31 0.462 0.159 0.621 0.119 0
|
||||
2012 2 1 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 2 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 3 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 4 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 5 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 6 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 7 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 8 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 9 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 10 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 11 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 12 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 13 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 14 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 15 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 16 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 17 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 18 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 19 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 2 20 0.263 0.396 0.660 0.255 0
|
||||
2012 2 21 0.517 0.294 0.811 0.450 0
|
||||
2012 2 22 0.497 0.381 0.878 0.340 0
|
||||
2012 2 23 0.593 0.362 0.955 0.254 0
|
||||
2012 2 24 0.361 0.510 0.872 0.491 0
|
||||
2012 2 25 1.043 0.667 1.710 0.435 0
|
||||
2012 2 26 0.471 0.545 1.016 0.287 0
|
||||
2012 2 27 0.208 0.616 0.825 0.416 0
|
||||
2012 2 28 0.421 0.399 0.820 0.092 0
|
||||
2012 2 29 1.095 0.905 2.000 0.336 0
|
||||
2012 3 1 0.458 1.085 1.542 0.146 0
|
||||
2012 3 2 1.019 1.193 2.212 0.515 0
|
||||
2012 3 3 0.848 1.016 1.865 0.681 0
|
||||
2012 3 4 0.043 1.019 1.063 0.478 0
|
||||
2012 3 5 0.326 0.870 1.196 0.502 0
|
||||
2012 3 6 0.478 0.837 1.315 0.495 0
|
||||
2012 3 7 0.206 0.470 0.675 0.332 0
|
||||
2012 3 8 0.117 0.888 1.005 0.400 0
|
||||
2012 3 9 -0.025 1.098 1.074 0.476 0
|
||||
2012 3 10 0.449 1.011 1.460 0.587 0
|
||||
2012 3 11 1.073 0.594 1.667 0.219 0
|
||||
2012 3 12 1.044 0.590 1.634 0.047 0
|
||||
2012 3 13 0.517 1.387 1.904 0.408 0
|
||||
2012 3 14 0.166 1.769 1.935 0.505 0
|
||||
2012 3 15 0.412 1.703 2.115 0.599 0
|
||||
2012 3 16 0.244 1.535 1.779 0.483 0
|
||||
2012 3 17 0.908 1.756 2.664 0.687 0
|
||||
2012 3 18 0.885 1.659 2.544 0.539 0
|
||||
2012 3 19 -0.386 2.395 2.009 0.502 0
|
||||
2012 3 20 -0.606 2.823 2.217 0.859 0
|
||||
2012 3 21 0.268 2.692 2.960 0.995 0
|
||||
2012 3 22 -0.066 2.926 2.861 0.886 0
|
||||
2012 3 23 0.009 3.536 3.545 0.854 0
|
||||
2012 3 24 0.148 3.509 3.658 0.906 0
|
||||
2012 3 25 -0.373 4.010 3.638 1.150 0
|
||||
2012 3 26 -0.715 3.039 2.325 0.854 0
|
||||
2012 3 27 -1.472 4.040 2.568 1.404 0
|
||||
2012 3 28 -1.693 4.342 2.649 1.060 0
|
||||
2012 3 29 0.028 3.126 3.155 0.736 0
|
||||
2012 3 30 0.353 2.246 2.598 0.348 0
|
||||
2012 3 31 -1.879 5.469 3.589 1.439 0
|
||||
2012 4 1 -2.075 3.925 1.849 0.868 0
|
||||
2012 4 2 -1.823 3.726 1.903 0.912 0
|
||||
2012 4 3 -1.644 4.712 3.068 1.198 0
|
||||
2012 4 4 -1.513 5.074 3.562 1.154 0
|
||||
2012 4 5 -1.560 5.514 3.954 1.246 0
|
||||
2012 4 6 1.817 1.514 3.331 0.048 0
|
||||
2012 4 7 2.102 1.280 3.382 1.149 0
|
||||
2012 4 8 -1.261 4.121 2.861 1.043 0
|
||||
2012 4 9 -0.849 3.436 2.586 1.254 0
|
||||
2012 4 10 -1.403 4.031 2.628 1.119 0
|
||||
2012 4 11 -2.714 5.045 2.331 0.973 0
|
||||
2012 4 12 -0.814 3.435 2.621 0.371 0
|
||||
2012 4 13 -1.430 5.563 4.133 1.196 0
|
||||
2012 4 14 0.886 3.198 4.085 0.124 0
|
||||
2012 4 15 -1.468 5.235 3.767 0.354 0
|
||||
2012 4 16 -0.391 3.663 3.272 0.408 0
|
||||
2012 4 17 -2.404 5.576 3.172 0.967 0
|
||||
2012 4 18 -2.231 5.599 3.368 0.857 0
|
||||
2012 4 19 -4.172 7.629 3.457 1.407 0
|
||||
2012 4 20 -3.302 7.423 4.121 1.344 0
|
||||
2012 4 21 -2.392 6.356 3.965 0.839 0
|
||||
2012 4 22 -1.016 4.731 3.715 0.532 0
|
||||
2012 4 23 -3.809 7.395 3.586 0.974 0
|
||||
2012 4 24 -2.960 6.773 3.813 0.612 0
|
||||
2012 4 25 -4.338 8.789 4.451 2.042 0
|
||||
2012 4 26 -5.087 10.121 5.034 2.478 0
|
||||
2012 4 27 -4.817 8.607 3.790 2.461 0
|
||||
2012 4 28 -4.396 8.659 4.263 2.372 0
|
||||
2012 4 29 -6.780 10.393 3.613 2.607 0
|
||||
2012 4 30 -6.309 9.668 3.358 2.703 0
|
||||
2012 5 1 -3.619 8.815 5.196 2.805 0
|
||||
2012 5 2 -4.568 10.142 5.574 2.899 0
|
||||
2012 5 3 -3.377 7.731 4.355 1.086 0
|
||||
2012 5 4 -0.910 5.555 4.645 0.711 0
|
||||
2012 5 5 -5.536 11.269 5.733 2.516 0
|
||||
2012 5 6 -6.022 11.611 5.589 2.154 0
|
||||
2012 5 7 -1.552 6.454 4.903 0.780 0
|
||||
2012 5 8 -4.539 11.023 6.485 2.654 0
|
||||
2012 5 9 -6.838 12.291 5.453 2.248 0
|
||||
2012 5 10 -6.109 13.095 6.986 2.653 0
|
||||
2012 5 11 -6.404 13.728 7.324 2.453 0
|
||||
2012 5 12 -3.041 11.038 7.998 1.494 0
|
||||
2012 5 13 -2.685 8.466 5.781 1.701 0
|
||||
2012 5 14 -1.911 7.159 5.247 0.614 0
|
||||
2012 5 15 -4.420 10.143 5.723 1.881 0
|
||||
2012 5 16 -2.677 7.455 4.778 0.899 0
|
||||
2012 5 17 -4.086 8.456 4.370 1.535 0
|
||||
2012 5 18 -2.892 8.133 5.241 1.827 0
|
||||
2012 5 19 -3.103 9.789 6.686 2.036 0
|
||||
2012 5 20 -3.446 10.774 7.328 1.722 0
|
||||
2012 5 21 -1.290 8.958 7.668 0.755 0
|
||||
2012 5 22 2.787 3.587 6.373 1.697 0
|
||||
2012 5 23 -0.447 9.872 9.425 1.763 0
|
||||
2012 5 24 0.187 10.434 10.622 2.221 0
|
||||
2012 5 25 -1.949 10.115 8.166 2.603 0
|
||||
2012 5 26 0.660 5.055 5.715 1.618 0
|
||||
2012 5 27 2.652 3.893 6.545 1.588 0
|
||||
2012 5 28 1.376 4.117 5.492 0.978 0
|
||||
2012 5 29 1.416 4.619 6.035 1.400 0
|
||||
2012 5 30 2.294 4.686 6.981 1.480 0
|
||||
2012 5 31 4.244 2.414 6.659 1.549 0
|
||||
2012 6 1 5.654 1.717 7.371 1.859 0
|
||||
2012 6 2 -0.535 6.426 5.891 0.618 0
|
||||
2012 6 3 -2.344 10.030 7.686 2.302 0
|
||||
2012 6 4 1.526 5.390 6.916 1.171 0
|
||||
2012 6 5 3.911 2.762 6.673 1.908 0
|
||||
2012 6 6 -2.767 7.480 4.713 1.747 0
|
||||
2012 6 7 -0.002 5.994 5.993 2.189 0
|
||||
2012 6 8 -1.293 8.200 6.907 2.516 0
|
||||
2012 6 9 2.902 3.437 6.339 0.607 0
|
||||
2012 6 10 1.859 5.307 7.167 1.120 0
|
||||
2012 6 11 2.909 4.120 7.030 0.814 0
|
||||
2012 6 12 1.635 7.776 9.411 0.162 0
|
||||
2012 6 13 3.300 9.112 12.413 1.079 0
|
||||
2012 6 14 -0.500 13.424 12.924 2.230 0
|
||||
2012 6 15 -0.555 13.719 13.164 2.650 0
|
||||
2012 6 16 -2.240 15.315 13.075 2.788 0
|
||||
2012 6 17 -3.710 15.421 11.711 3.815 0
|
||||
2012 6 18 -1.316 13.615 12.299 3.467 0
|
||||
2012 6 19 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 6 20 0.835 9.146 9.981 2.682 0
|
||||
2012 6 21 -3.757 11.764 8.007 2.801 0
|
||||
2012 6 22 -3.178 9.991 6.813 1.756 0
|
||||
2012 6 23 -2.973 11.667 8.695 2.479 0
|
||||
2012 6 24 -1.681 8.276 6.595 2.378 0
|
||||
2012 6 25 1.698 4.862 6.559 0.469 0
|
||||
2012 6 26 -0.333 8.257 7.924 2.947 0
|
||||
2012 6 27 -1.240 9.078 7.839 2.568 0
|
||||
2012 6 28 -2.438 8.591 6.153 2.323 0
|
||||
2012 6 29 -0.041 6.786 6.745 2.320 0
|
||||
2012 6 30 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 1 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 2 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 3 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 4 -1.694 7.565 5.871 2.055 0
|
||||
2012 7 5 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 6 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 7 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 8 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 7 9 0.081 8.633 8.714 1.883 0
|
||||
2012 7 10 5.480 4.571 10.050 2.978 0
|
||||
2012 7 11 3.540 6.345 9.885 2.251 0
|
||||
2012 7 12 3.573 6.518 10.092 2.055 0
|
||||
2012 7 13 0.738 6.337 7.074 0.663 0
|
||||
2012 7 14 2.392 5.352 7.744 1.730 0
|
||||
2012 7 15 2.621 3.246 5.867 0.517 0
|
||||
2012 7 16 0.002 5.766 5.768 2.395 0
|
||||
2012 7 17 2.181 4.233 6.414 2.290 0
|
||||
2012 7 18 0.333 5.522 5.855 2.121 0
|
||||
2012 7 19 2.896 4.745 7.641 1.881 0
|
||||
2012 7 20 -4.409 12.188 7.779 2.913 0
|
||||
2012 7 21 2.161 4.473 6.635 0.085 0
|
||||
2012 7 22 -1.966 9.473 7.507 1.158 0
|
||||
2012 7 23 -3.943 12.987 9.044 2.395 0
|
||||
2012 7 24 -1.126 11.111 9.984 1.840 0
|
||||
2012 7 25 0.630 9.271 9.901 1.197 0
|
||||
2012 7 26 0.641 10.025 10.666 2.289 0
|
||||
2012 7 27 -3.677 14.036 10.359 3.401 0
|
||||
2012 7 28 4.881 6.944 11.825 2.951 0
|
||||
2012 7 29 -0.567 10.221 9.654 2.393 0
|
||||
2012 7 30 -5.159 13.376 8.217 2.932 0
|
||||
2012 7 31 -1.854 11.970 10.116 2.514 0
|
||||
2012 8 1 -2.916 12.214 9.298 3.764 0
|
||||
2012 8 2 0.390 8.301 8.691 2.852 0
|
||||
2012 8 3 -3.120 12.612 9.492 2.479 0
|
||||
2012 8 4 -0.243 9.906 9.662 3.369 0
|
||||
2012 8 5 0.921 7.809 8.730 2.621 0
|
||||
2012 8 6 1.958 7.150 9.108 2.832 0
|
||||
2012 8 7 -3.802 12.456 8.654 2.834 0
|
||||
2012 8 8 -3.271 10.859 7.588 1.917 0
|
||||
2012 8 9 -2.539 10.918 8.379 1.708 0
|
||||
2012 8 10 -4.573 13.220 8.647 2.166 0
|
||||
2012 8 11 -1.417 7.881 6.464 0.969 0
|
||||
2012 8 12 -5.064 11.249 6.185 2.064 0
|
||||
2012 8 13 -3.401 10.948 7.547 1.999 0
|
||||
2012 8 14 -4.735 11.421 6.685 2.658 0
|
||||
2012 8 15 -1.630 9.253 7.623 2.609 0
|
||||
2012 8 16 -0.523 9.221 8.698 2.449 0
|
||||
2012 8 17 1.732 5.620 7.352 1.526 0
|
||||
2012 8 18 1.792 5.627 7.419 1.600 0
|
||||
2012 8 19 1.106 5.309 6.415 1.804 0
|
||||
2012 8 20 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 8 21 -1.427 6.966 5.539 1.564 0
|
||||
2012 8 22 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 8 23 1.842 3.369 5.211 1.107 0
|
||||
2012 8 24 -9999.000 -9999.000 -9999.000 -9999.000 1
|
||||
2012 8 25 0.752 4.044 4.796 1.564 0
|
||||
2012 8 26 3.442 2.638 6.080 0.522 0
|
||||
2012 8 27 4.227 2.070 6.297 1.209 0
|
||||
2012 8 28 2.774 2.543 5.317 0.935 0
|
||||
2012 8 29 0.889 6.332 7.221 1.144 0
|
||||
2012 8 30 1.106 5.600 6.705 0.831 0
|
||||
2012 8 31 1.499 4.726 6.225 0.397 0
|
||||
2012 9 1 5.480 0.607 6.087 0.086 0
|
||||
2012 9 2 4.770 3.085 7.854 1.212 0
|
||||
2012 9 3 1.925 4.683 6.608 1.032 0
|
||||
2012 9 4 1.147 4.621 5.768 0.847 0
|
||||
2012 9 5 0.741 4.361 5.102 1.092 0
|
||||
2012 9 6 0.236 3.269 3.505 0.792 0
|
||||
2012 9 7 0.763 2.721 3.484 0.940 0
|
||||
2012 9 8 1.173 3.364 4.537 1.023 0
|
||||
2012 9 9 0.653 4.112 4.765 1.027 0
|
||||
2012 9 10 0.912 4.461 5.373 0.874 0
|
||||
2012 9 11 1.132 4.765 5.898 0.767 0
|
||||
2012 9 12 1.016 5.574 6.589 0.666 0
|
||||
2012 9 13 4.085 0.392 4.477 0.011 0
|
||||
2012 9 14 3.004 2.271 5.276 0.517 0
|
||||
2012 9 15 2.511 3.204 5.715 0.893 0
|
||||
2012 9 16 1.539 4.356 5.896 0.949 0
|
||||
2012 9 17 1.364 4.156 5.520 1.255 0
|
||||
2012 9 18 2.299 4.659 6.957 0.954 0
|
||||
2012 9 19 0.491 5.345 5.836 0.542 0
|
||||
2012 9 20 1.374 4.325 5.699 1.097 0
|
||||
2012 9 21 0.522 3.115 3.637 0.972 0
|
||||
2012 9 22 0.051 3.473 3.524 1.001 0
|
||||
2012 9 23 -0.100 2.702 2.602 0.878 0
|
||||
2012 9 24 0.966 2.419 3.385 0.719 0
|
||||
2012 9 25 1.793 2.237 4.030 1.720 0
|
||||
2012 9 26 1.756 2.586 4.342 1.772 0
|
||||
2012 9 27 0.954 3.168 4.122 0.882 0
|
||||
2012 9 28 0.857 3.393 4.250 1.065 0
|
||||
2012 9 29 1.165 3.372 4.537 0.451 0
|
||||
2012 9 30 -0.759 5.569 4.811 0.830 0
|
||||
2012 10 1 0.207 4.616 4.823 0.919 0
|
||||
2012 10 2 2.516 1.735 4.251 0.041 0
|
||||
2012 10 3 -1.047 4.089 3.042 0.614 0
|
||||
2012 10 4 -1.631 4.975 3.343 0.784 0
|
||||
2012 10 5 -1.277 4.647 3.369 0.901 0
|
||||
2012 10 6 -1.711 5.633 3.922 0.899 0
|
||||
2012 10 7 -1.559 5.570 4.011 0.717 0
|
||||
2012 10 8 -2.029 5.085 3.056 0.904 0
|
||||
2012 10 9 -1.604 5.274 3.671 0.692 0
|
||||
2012 10 10 0.803 1.903 2.705 0.122 0
|
||||
2012 10 11 -2.131 4.498 2.367 0.456 0
|
||||
2012 10 12 0.644 2.323 2.966 0.063 0
|
||||
2012 10 13 0.037 2.745 2.783 0.162 0
|
||||
2012 10 14 -1.170 4.054 2.884 0.115 0
|
||||
2012 10 15 -2.453 5.964 3.511 0.608 0
|
||||
2012 10 16 0.666 1.569 2.235 0.361 0
|
||||
2012 10 17 -2.423 5.213 2.790 0.140 0
|
||||
2012 10 18 -2.999 7.236 4.237 0.575 0
|
||||
2012 10 19 -2.974 6.842 3.869 0.509 0
|
||||
2012 10 20 -0.961 6.009 5.047 0.313 0
|
||||
2012 10 21 -1.929 6.137 4.208 0.308 0
|
||||
2012 10 22 -1.843 7.383 5.540 0.478 0
|
||||
2012 10 23 0.129 4.387 4.516 0.030 0
|
||||
2012 10 24 1.710 3.265 4.975 0.073 0
|
||||
2012 10 25 1.606 3.260 4.866 0.060 0
|
||||
2012 10 26 0.887 2.925 3.811 0.051 0
|
||||
2012 10 27 -1.423 4.769 3.346 0.060 0
|
||||
2012 10 28 0.073 2.014 2.088 0.099 0
|
||||
2012 10 29 0.697 0.838 1.535 0.002 0
|
||||
2012 10 30 -0.362 1.947 1.585 0.214 0
|
||||
2012 10 31 -0.675 2.402 1.727 0.288 0
|
||||
2012 11 1 0.985 0.571 1.556 0.159 0
|
||||
2012 11 2 0.282 1.449 1.731 0.123 0
|
||||
2012 11 3 -1.547 3.771 2.224 0.479 0
|
||||
2012 11 4 -1.364 4.402 3.038 0.569 0
|
||||
2012 11 5 1.604 0.670 2.273 0.159 0
|
||||
2012 11 6 0.679 2.410 3.089 0.170 0
|
||||
2012 11 7 -0.727 2.904 2.176 0.374 0
|
||||
2012 11 8 -0.928 3.313 2.385 0.377 0
|
||||
2012 11 9 -0.790 2.533 1.743 0.293 0
|
||||
2012 11 10 -0.660 2.691 2.031 0.184 0
|
||||
2012 11 11 -0.739 2.588 1.850 0.136 0
|
||||
2012 11 12 2.039 0.224 2.263 0.002 0
|
||||
2012 11 13 1.237 2.104 3.341 0.052 0
|
||||
2012 11 14 0.073 2.379 2.452 0.243 0
|
||||
2012 11 15 -1.381 3.138 1.757 0.207 0
|
||||
2012 11 16 0.103 1.772 1.875 0.067 0
|
||||
2012 11 17 -0.843 2.621 1.778 0.094 0
|
||||
2012 11 18 0.383 1.353 1.736 0.017 0
|
||||
2012 11 19 1.891 0.365 2.256 0.007 0
|
||||
2012 11 20 0.456 1.504 1.960 0.027 0
|
||||
2012 11 21 0.973 1.028 2.002 0.011 0
|
||||
2012 11 22 1.407 0.499 1.905 0.014 0
|
||||
2012 11 23 0.676 1.122 1.798 0.011 0
|
||||
2012 11 24 -0.320 2.203 1.883 0.023 0
|
||||
2012 11 25 0.519 1.067 1.586 0.024 0
|
||||
2012 11 26 0.191 1.449 1.640 0.067 0
|
||||
2012 11 27 -0.142 2.655 2.512 0.536 0
|
||||
2012 11 28 -0.100 2.787 2.686 0.361 0
|
||||
2012 11 29 -0.291 2.827 2.536 0.099 0
|
||||
2012 11 30 1.480 0.791 2.271 0.216 0
|
||||
2012 12 1 -0.573 1.355 0.782 0.104 0
|
||||
2012 12 2 1.006 0.284 1.290 0.009 0
|
||||
2012 12 3 0.518 1.285 1.803 0.211 0
|
||||
2012 12 4 0.150 1.210 1.360 0.035 0
|
||||
2012 12 5 0.435 1.623 2.058 0.033 0
|
||||
2012 12 6 0.319 0.842 1.161 0.022 0
|
||||
2012 12 7 0.430 0.904 1.334 0.080 0
|
||||
2012 12 8 1.286 0.000 1.286 0.012 0
|
||||
2012 12 9 0.610 0.205 0.815 0.104 0
|
||||
2012 12 10 0.676 0.293 0.969 0.087 0
|
||||
2012 12 11 0.656 0.223 0.878 0.034 0
|
||||
2012 12 12 0.418 0.242 0.660 0.101 0
|
||||
2012 12 13 0.494 0.000 0.494 0.042 0
|
||||
2012 12 14 0.662 0.316 0.978 0.005 0
|
||||
2012 12 15 0.458 0.707 1.164 0.006 0
|
||||
2012 12 16 0.185 0.889 1.073 0.005 0
|
||||
2012 12 17 0.743 0.345 1.088 0.044 0
|
||||
2012 12 18 0.764 0.111 0.875 0.009 0
|
||||
2012 12 19 0.554 0.677 1.231 0.044 0
|
||||
2012 12 20 0.308 0.775 1.083 0.028 0
|
||||
2012 12 21 0.439 0.496 0.934 0.044 0
|
||||
2012 12 22 0.141 0.800 0.941 0.005 0
|
||||
2012 12 23 0.146 0.846 0.992 0.044 0
|
||||
2012 12 24 -0.763 1.761 0.999 0.066 0
|
||||
2012 12 25 0.390 1.345 1.735 0.131 0
|
||||
2012 12 26 1.101 0.369 1.470 0.015 0
|
||||
2012 12 27 -0.462 1.742 1.280 0.048 0
|
||||
2012 12 28 0.525 0.520 1.045 0.044 0
|
||||
2012 12 29 -0.086 0.827 0.740 0.060 0
|
||||
2012 12 30 -0.044 0.648 0.604 0.056 0
|
||||
2012 12 31 -0.040 0.731 0.692 0.092 0
|
||||
119
RBBGCMuso/inst/examples/hhs/Ndep.txt
Normal file
119
RBBGCMuso/inst/examples/hhs/Ndep.txt
Normal file
@ -0,0 +1,119 @@
|
||||
1900 0.0003911
|
||||
1901 0.0003922
|
||||
1902 0.0003952
|
||||
1903 0.0003982
|
||||
1904 0.0004012
|
||||
1905 0.0004043
|
||||
1906 0.0004073
|
||||
1907 0.0004103
|
||||
1908 0.0004133
|
||||
1909 0.0004164
|
||||
1910 0.0004224
|
||||
1911 0.0004267
|
||||
1912 0.0004310
|
||||
1913 0.0004353
|
||||
1914 0.0004396
|
||||
1915 0.0004439
|
||||
1916 0.0004482
|
||||
1917 0.0004525
|
||||
1918 0.0004568
|
||||
1919 0.0004611
|
||||
1920 0.0004697
|
||||
1921 0.0004741
|
||||
1922 0.0004786
|
||||
1923 0.0004830
|
||||
1924 0.0004875
|
||||
1925 0.0004919
|
||||
1926 0.0004964
|
||||
1927 0.0005008
|
||||
1928 0.0005053
|
||||
1929 0.0005097
|
||||
1930 0.0005186
|
||||
1931 0.0005214
|
||||
1932 0.0005243
|
||||
1933 0.0005271
|
||||
1934 0.0005299
|
||||
1935 0.0005327
|
||||
1936 0.0005356
|
||||
1937 0.0005384
|
||||
1938 0.0005412
|
||||
1939 0.0005440
|
||||
1940 0.0005497
|
||||
1941 0.0005600
|
||||
1942 0.0005703
|
||||
1943 0.0005806
|
||||
1944 0.0005909
|
||||
1945 0.0006013
|
||||
1946 0.0006116
|
||||
1947 0.0006219
|
||||
1948 0.0006322
|
||||
1949 0.0006425
|
||||
1950 0.0006632
|
||||
1951 0.0006775
|
||||
1952 0.0006919
|
||||
1953 0.0007063
|
||||
1954 0.0007207
|
||||
1955 0.0007350
|
||||
1956 0.0007494
|
||||
1957 0.0007638
|
||||
1958 0.0007782
|
||||
1959 0.0007925
|
||||
1960 0.0008213
|
||||
1961 0.0008407
|
||||
1962 0.0008601
|
||||
1963 0.0008795
|
||||
1964 0.0008989
|
||||
1965 0.0009183
|
||||
1966 0.0009378
|
||||
1967 0.0009572
|
||||
1968 0.0009766
|
||||
1969 0.0009960
|
||||
1970 0.0010348
|
||||
1971 0.0010591
|
||||
1972 0.0010465
|
||||
1973 0.0010524
|
||||
1974 0.0010582
|
||||
1975 0.0010641
|
||||
1976 0.0010699
|
||||
1977 0.0010758
|
||||
1978 0.0010816
|
||||
1979 0.0010875
|
||||
1980 0.0010933
|
||||
1981 0.0010992
|
||||
1982 0.0011050
|
||||
1983 0.0011109
|
||||
1984 0.0011167
|
||||
1985 0.0011226
|
||||
1986 0.0011284
|
||||
1987 0.0011343
|
||||
1988 0.0011401
|
||||
1989 0.0011460
|
||||
1990 0.0011519
|
||||
1991 0.0011577
|
||||
1992 0.0011636
|
||||
1993 0.0011694
|
||||
1994 0.0011753
|
||||
1995 0.0011811
|
||||
1996 0.0011870
|
||||
1997 0.0011928
|
||||
1998 0.0011987
|
||||
1999 0.0012045
|
||||
2000 0.0012104
|
||||
2001 0.0012239
|
||||
2002 0.0012347
|
||||
2003 0.0012654
|
||||
2004 0.0012762
|
||||
2005 0.0012870
|
||||
2006 0.0012977
|
||||
2007 0.0013085
|
||||
2008 0.0013192
|
||||
2009 0.0013200
|
||||
2010 0.0013407
|
||||
2011 0.0013515
|
||||
2012 0.0013722
|
||||
2013 0.0013830
|
||||
2014 0.0013938
|
||||
2015 0.0014010
|
||||
2016 0.0014020
|
||||
2017 0.0014040
|
||||
2018 0.0014050
|
||||
@ -1,180 +0,0 @@
|
||||
ECOPHYS FILE - C3 grass muso5
|
||||
----------------------------------------------------------------------------------------
|
||||
FLAGS
|
||||
0 (flag) biome type flag (1 = WOODY 0 = NON-WOODY)
|
||||
0 (flag) woody type flag (1 = EVERGREEN 0 = DECIDUOUS)
|
||||
1 (flag) photosyn. type flag (1 = C3 PSN 0 = C4 PSN)
|
||||
1 (flag) phenology flag (1 = MODEL PHENOLOGY 0 = USER-SPECIFIED PHENOLOGY)
|
||||
0 (flag) transferGDD flag (1= transfer calc. from GDD 0 = transfer calc. from EPC)
|
||||
1 (flag) q10 flag (1 = temperature dependent q10 value; 0= constans q10 value)
|
||||
0 (flag) acclimation flag (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) CO2 conductance reduction flag (0: no effect, 1: multiplier)
|
||||
1 (flag) use GSI index to calculate growing season (0: no GSI, 1: GSI)
|
||||
0 (flag) soil temperature calculation method (0: Zheng, 1: DSSAT)
|
||||
1 (flag) soil hydrological calculation method (0: Richards, 1: tipping DSSAT)
|
||||
0 (int) discretization level of SWC calculation (0: low, 1: medium, 2: high)
|
||||
0 (flag) photosynthesis calculation method (0: Farquhar, 1: DSSAT)
|
||||
0 (flag) evapotranspiration calculation method (0: Penman-Montieth, 1: Priestly-Taylor)
|
||||
0 (flag) radiation calculation method (0: SWabs, 1: Rn)
|
||||
----------------------------------------------------------------------------------------
|
||||
PLANT FUNCTIONING PARAMETERS
|
||||
0 (yday) yearday to start new growth (when phenology flag = 0)
|
||||
364 (yday) yearday to end litterfall (when phenology flag = 0)
|
||||
0.5 (prop.) transfer growth period as fraction of growing season (when transferGDD_flag = 0)
|
||||
0.5 (prop.) litterfall as fraction of growing season (when transferGDD_flag = 0)
|
||||
5 (Celsius) base temperature
|
||||
-9999 (Celsius) minimum temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) optimal1 temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) optimal2 temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) maxmimum temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) minimum temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) optimal1 temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) optimal2 temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) maxmimum temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
1.0 (1/yr) annual leaf and fine root turnover fraction
|
||||
0.00 (1/yr) annual live wood turnover fraction
|
||||
0.01 (1/yr) annual whole-plant mortality fraction
|
||||
0.0 (1/yr) annual fire mortality fraction
|
||||
36.6 (kgC/kgN) C:N of leaves
|
||||
45.0 (kgC/kgN) C:N of leaf litter, after retranslocation
|
||||
50.0 (kgC/kgN) C:N of fine roots
|
||||
36.6 *(kgC/kgN) C:N of fruit
|
||||
36.6 (kgC/kgN) C:N of soft stem
|
||||
0.0 *(kgC/kgN) C:N of live wood
|
||||
0.0 *(kgC/kgN) C:N of dead wood
|
||||
0.68 (DIM) leaf litter labile proportion
|
||||
0.23 (DIM) leaf litter cellulose proportion
|
||||
0.34 (DIM) fine root labile proportion
|
||||
0.44 (DIM) fine root cellulose proportion
|
||||
0.68 *(DIM) fruit litter labile proportion
|
||||
0.23 *(DIM) fruit litter cellulose proportion
|
||||
0.68 (DIM) soft stem litter labile proportion
|
||||
0.23 (DIM) soft stem litter cellulose proportion
|
||||
0.00 *(DIM) dead wood cellulose proportion
|
||||
0.01 (1/LAI/d) canopy water interception coefficient
|
||||
0.63 (DIM) canopy light extinction coefficient
|
||||
2.0 (g/MJ) potential radiation use efficiency
|
||||
0.781 (DIM) radiation parameter1 (Jiang et al.2015)
|
||||
-13.596 (DIM) radiation parameter2 (Jiang et al.2015)
|
||||
2.0 (DIM) all-sided to projected leaf area ratio
|
||||
2.0 (DIM) ratio of shaded SLA:sunlit SLA
|
||||
0.2 (DIM) fraction of leaf N in Rubisco
|
||||
0.03 (DIM) fraction of leaf N in PEP Carboxylase
|
||||
0.004 (m/s) maximum stomatal conductance (projected area basis)
|
||||
0.00006 (m/s) cuticular conductance (projected area basis)
|
||||
0.039 (m/s) boundary layer conductance (projected area basis)
|
||||
1.00 (prop) relative SWC (prop. to FC) to calc. soil moisture limit 1 (-9999: not used)
|
||||
0.99 (prop) relative SWC (prop. to SAT) to calc. soil moisture limit 2 (-9999: not used)
|
||||
-9999 (prop) relative PSI (prop. to FC) to calc. soil moisture limit 1 (-9999: not used)
|
||||
-9999 (prop) relative PSI (prop. to SAT) to calc. soil moisture limit 2 (-9999: not used)
|
||||
1000 (Pa) vapor pressure deficit: start of conductance reduction
|
||||
5000 (Pa) vapor pressure deficit: complete conductance reduction
|
||||
1.5 (m) maximum height of plant
|
||||
250 *(kgC/m2) stem weight at which maximum height attended
|
||||
1.0 (m) maximum depth of rooting zone
|
||||
3.67 (DIM) root distribution parameter
|
||||
0.4 (kgC/m2) rootlenght parameter 1 (estimated max root weight)
|
||||
0.5 (prop.) rootlenght parameter 2 (slope)
|
||||
0.3 (prop.) growth resp per unit of C grown
|
||||
0.195 (kgC/kgN/d) maintenance respiration in kgC/day per kg of tissue N
|
||||
0.1 (DIM) theoretical maximum prop. of non-structural and structural carbohydrates
|
||||
0.24 (DIM) prop. of non-structural carbohydrates available for maintanance respiration
|
||||
0.0048 (kgN/m2/yr) symbiotic+asymbiotic fixation of N
|
||||
----------------------------------------------------------------------------------------
|
||||
CROP SPECIFIC PARAMETERS
|
||||
0 (DIM) number of phenophase of germination (from 1 to 7; 0: NO specific)
|
||||
0 (DIM) number of phenophase of emergence (from 1 to 7; 0: NO specific)
|
||||
0.5 (prop.) critical relative SWC (prop. to FC) in germination
|
||||
-9999 (DIM) number of phenophase of photoperiodic slowing effect (from 1 to 7; -9999: NO effect)
|
||||
20 (hour) critical photoslow daylength
|
||||
0.005 (DIM) slope of relative photoslow development rate
|
||||
-9999 (DIM) number of phenophase of vernalization (from 1 to 7; -9999: NO)
|
||||
0 (Celsius) critical vernalization temperature 1
|
||||
5 (Celsius) critical vernalization temperature 2
|
||||
8 (Celsius) critical vernalization temperature 3
|
||||
15 (Celsius) critical vernalization temperature 4
|
||||
0.04 (DIM) slope of relative vernalization development rate
|
||||
50 (n) required vernalization days (in vernalization development rate)
|
||||
-9999 (DIM) number of flowering phenophase (from 1 to 7; -9999: NO effect)
|
||||
35 (Celsius) critical flowering heat stress temperature 1
|
||||
40 (Celsius) critical flowering heat stress temperature 2
|
||||
0.2 (prop.) mortality parameter of flowering thermal stress
|
||||
----------------------------------------------------------------------------------------
|
||||
SENESCENCE AND SOIL PARAMETERS
|
||||
0.1 (prop.) maximum senescence mortality coefficient of aboveground plant material
|
||||
0.05 (prop.) maximum senescence mortality coefficient of belowground plant material
|
||||
0.0 (prop.) maximum senescence mortality coefficient of non-structured plant material
|
||||
2 (prop) effect of extreme high temperature on senesncene mortality
|
||||
30 (Celsius) lower limit extreme high temperature effect on senescence mortality
|
||||
40 (Celsius) upper limit extreme high temperature effect on senescence mortality
|
||||
-9999 (Celsius) maximal lifetime of plant tissue (-9999: no genetically programmed senescence)
|
||||
0.01 (prop.) turnover rate of wilted standing biomass to litter
|
||||
0.047 (prop.) turnover rate of non-woody cut-down biomass to litter
|
||||
0.01 (prop.) turnover rate of woody cut-down biomass to litter
|
||||
17 (prop.) drought tolerance parameter (critical value of DSWS)
|
||||
0.02 (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.5 (prop.) proprortion of NH4 flux of N-deposition
|
||||
0.5 (prop.) NH4 mobilen proportion
|
||||
1.0 (prop.) NO3 mobilen proportion
|
||||
10 (m) e-folding depth of decomposition rate's depth scalar
|
||||
0.001 (prop.) fraction of dissolved part of SOIL1 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL2 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL3 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL4 organic matter
|
||||
0.6 (DIM) ratio of bare soil evaporation and pot.evaporation
|
||||
----------------------------------------------------------------------------------------
|
||||
RATE SCALARS
|
||||
0.39 (DIM) respiration fractions for fluxes between compartments (l1s1)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (l2s2)
|
||||
0.29 (DIM) respiration fractions for fluxes between compartments (l4s3)
|
||||
0.28 (DIM) respiration fractions for fluxes between compartments (s1s2)
|
||||
0.46 (DIM) respiration fractions for fluxes between compartments (s2s3)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (s3s4)
|
||||
0.7 (DIM) rate constant scalar of labile litter pool
|
||||
0.07 (DIM) rate constant scalar of cellulose litter pool
|
||||
0.014 (DIM) rate constant scalar of lignin litter pool
|
||||
0.07 (DIM) rate constant scalar of fast microbial recycling pool
|
||||
0.014 (DIM) rate constant scalar of medium microbial recycling pool
|
||||
0.0014 (DIM) rate constant scalar of slow microbial recycling pool
|
||||
0.0001 (DIM) rate constant scalar of recalcitrant SOM (humus) pool
|
||||
0.001 (DIM) rate constant scalar of physical fragmentation of coarse woody debris
|
||||
----------------------------------------------------------------------------------------
|
||||
GROWING SEASON PARAMETERS
|
||||
5 (kg/m2) crit. amount of snow limiting photosyn.
|
||||
20 (Celsius) limit1 (under:full constrained) of HEATSUM index
|
||||
60 (Celsius) limit2 (above:unconstrained) of HEATSUM index
|
||||
0 (Celsius) limit1 (under:full constrained) of TMIN index
|
||||
5 (Celsius) limit2 (above:unconstrained) of TMIN index
|
||||
4000 (Pa) limit1 (above:full constrained) of VPD index
|
||||
1000 (Pa) limit2 (under:unconstrained) of VPD index
|
||||
0 (s) limit1 (under:full constrained) of DAYLENGTH index
|
||||
0 (s) limit2 (above:unconstrained) of DAYLENGTH index
|
||||
10 (day) moving average (to avoid the effects of extreme events)
|
||||
0.10 (dimless) GSI limit1 (greater that limit -> start of vegper)
|
||||
0.01 (dimless) GSI limit2 (less that limit -> end of vegper)
|
||||
----------------------------------------------------------------------------------------
|
||||
CH4 PARAMETERS
|
||||
212.5 (DIM) param1 for CH4 calculations (empirical function of BD)
|
||||
1.81 (DIM) param2 for CH4 calculations (empirical function of BD)
|
||||
-1.353 (DIM) param1 for CH4 calculations (empirical function of VWC)
|
||||
0.2 (DIM) param2 for CH4 calculations (empirical function of VWC)
|
||||
1.781 (DIM) param3 for CH4 calculations (empirical function of VWC)
|
||||
6.786 (DIM) param4 for CH4 calculations (empirical function of VWC)
|
||||
0.010 (DIM) param1 for CH4 calculations (empirical function of Tsoil)
|
||||
----------------------------------------------------------------------------------------
|
||||
PHENOLOGICAL (ALLOCATION) PARAMETERS (7 phenological phases)
|
||||
phase1 phase2 phase3 phase4 phase5 phase6 phase7 (text) name of the phenophase
|
||||
500 200 500 200 400 200 100 (Celsius) length of phenophase (GDD)
|
||||
0.4 0.4 0.4 0.4 0.4 0.4 0.4 (ratio) leaf ALLOCATION
|
||||
0.4 0.4 0.4 0.4 0.4 0.4 0.4 (ratio) fine root ALLOCATION
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 (ratio) fruit ALLOCATION
|
||||
0.2 0.2 0.2 0.2 0.2 0.2 0.2 (ratio) soft stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live coarse root ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead coarse root ALLOCATION
|
||||
49 49 49 49 49 49 49 (m2/kgC) canopy average specific leaf area (projected area basis)
|
||||
0.37 0.37 0.37 0.37 0.37 0.37 0.37 (prop.) current growth proportion
|
||||
139
RBBGCMuso/inst/examples/hhs/c3grass_muso6.epc
Normal file
139
RBBGCMuso/inst/examples/hhs/c3grass_muso6.epc
Normal file
@ -0,0 +1,139 @@
|
||||
ECOPHYS FILE - C3 grass muso6
|
||||
----------------------------------------------------------------------------------------
|
||||
FLAGS
|
||||
0 (flag) biome type flag (1 = WOODY 0 = NON-WOODY)
|
||||
0 (flag) woody type flag (1 = EVERGREEN 0 = DECIDUOUS)
|
||||
1 (flag) photosyn. type flag (1 = C3 PSN 0 = C4 PSN)
|
||||
----------------------------------------------------------------------------------------
|
||||
PLANT FUNCTIONING PARAMETERS
|
||||
0 (yday) yearday to start new growth (when phenology flag = 0)
|
||||
364 (yday) yearday to end litterfall (when phenology flag = 0)
|
||||
1.0 (prop.) transfer growth period as fraction of growing season (when transferGDD_flag = 0)
|
||||
1.0 (prop.) litterfall as fraction of growing season (when transferGDD_flag = 0)
|
||||
0 (Celsius) base temperature
|
||||
-9999 (Celsius) minimum temperature for growth displayed on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) optimal1 temperature for growth displayed on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) optimal2 temperature for growth displayed on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) maxmimum temperature for growth displayed on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) minimum temperature for carbon assimilation on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) optimal1 temperature for carbon assimilation on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) optimal2 temperature for carbon assimilation on current day (-9999: no T-dependence)
|
||||
-9999 (Celsius) maxmimum temperature for carbon assimilation on current day (-9999: no T-dependence)
|
||||
1.0 (1/yr) annual leaf and fine root turnover fraction
|
||||
0.00 (1/yr) annual live wood turnover fraction
|
||||
0.0 (1/yr) annual fire mortality fraction
|
||||
0.01 (1/vegper) whole-plant mortality fraction in vegetation period
|
||||
36.6 (kgC/kgN) C:N of leaves
|
||||
45.0 (kgC/kgN) C:N of leaf litter, after retranslocation
|
||||
50.0 (kgC/kgN) C:N of fine roots
|
||||
36.6 *(kgC/kgN) C:N of fruit
|
||||
36.6 (kgC/kgN) C:N of soft stem
|
||||
0.0 *(kgC/kgN) C:N of live wood
|
||||
0.0 *(kgC/kgN) C:N of dead wood
|
||||
0.4 (kgC/kgDM) dry matter carbon content of leaves
|
||||
0.4 (kgC/kgDM) dry matter carbon content of leaf litter
|
||||
0.4 (kgC/kgDM) dry matter carbon content of fine roots
|
||||
0.4 *(kgC/kgDM) dry matter carbon content of fruit
|
||||
0.4 (kgC/kgDM) dry matter carbon content of soft stem
|
||||
0.4 *(kgC/kgDM) dry matter carbon content of live wood
|
||||
0.4 *(kgC/kgDM) dry matter carbon content of dead wood
|
||||
0.68 (DIM) leaf litter labile proportion
|
||||
0.23 (DIM) leaf litter cellulose proportion
|
||||
0.34 (DIM) fine root labile proportion
|
||||
0.44 (DIM) fine root cellulose proportion
|
||||
0.68 *(DIM) fruit litter labile proportion
|
||||
0.23 *(DIM) fruit litter cellulose proportion
|
||||
0.68 (DIM) soft stem litter labile proportion
|
||||
0.23 (DIM) soft stem litter cellulose proportion
|
||||
0.00 *(DIM) dead wood cellulose proportion
|
||||
0.01 (1/LAI/d) canopy water interception coefficient
|
||||
0.7 (DIM) canopy light extinction coefficient
|
||||
0.6 (g/MJ) potential radiation use efficiency
|
||||
0.781 (DIM) radiation parameter1 (Jiang et al.2015)
|
||||
-13.596 (DIM) radiation parameter2 (Jiang et al.2015)
|
||||
2.0 (DIM) all-sided to projected leaf area ratio
|
||||
2.0 (DIM) ratio of shaded SLA:sunlit SLA
|
||||
0.3 (DIM) fraction of leaf N in Rubisco
|
||||
0.03 (DIM) fraction of leaf N in PEP Carboxylase
|
||||
0.002 (m/s) maximum stomatal conductance (projected area basis)
|
||||
0.00006 (m/s) cuticular conductance (projected area basis)
|
||||
0.039 (m/s) boundary layer conductance (projected area basis)
|
||||
1.0 (m) maximum height of plant
|
||||
0.8 (kgC) stem weight corresponding to maximum height
|
||||
0.5 (dimless) plant height function shape parameter (slope)
|
||||
1.0 (m) maximum depth of rooting zone
|
||||
2.67 (DIM) root distribution parameter
|
||||
0.4 (kgC) root weight corresponding to max root depth
|
||||
0.5 (dimless) root depth function shape parameter (slope)
|
||||
1000 (m/kg) root weight to rooth length conversion factor
|
||||
0.3 (prop.) growth resp per unit of C grown
|
||||
0.195 (kgC/kgN/d) maintenance respiration in kgC/day per kg of tissue N
|
||||
0.1 (DIM) theoretical maximum prop. of non-structural and structural carbohydrates
|
||||
0.24 (DIM) prop. of non-structural carbohydrates available for maintanance respiration
|
||||
0.0048 (kgN/m2/yr) symbiotic+asymbiotic fixation of N
|
||||
0 (day) time delay for temperature in photosynthesis acclimation
|
||||
----------------------------------------------------------------------------------------
|
||||
CROP SPECIFIC PARAMETERS
|
||||
0 (DIM) number of phenophase of germination (from 1 to 7; 0: NO specific)
|
||||
0 (DIM) number of phenophase of emergence (from 1 to 7; 0: NO specific)
|
||||
0.5 (prop.) critical VWCratio (prop. to FC-WP) in germination
|
||||
0 (DIM) number of phenophase of photoperiodic slowing effect (from 1 to 7; 0: NO effect)
|
||||
20 (hour) critical photoslow daylength
|
||||
0.005 (DIM) slope of relative photoslow development rate
|
||||
0 (DIM) number of phenophase of vernalization (from 1 to 7; 0: NO effect)
|
||||
0 (Celsius) critical vernalization temperature 1
|
||||
5 (Celsius) critical vernalization temperature 2
|
||||
8 (Celsius) critical vernalization temperature 3
|
||||
15 (Celsius) critical vernalization temperature 4
|
||||
0.04 (DIM) slope of relative vernalization development rate
|
||||
50 (n) required vernalization days (in vernalization development rate)
|
||||
0 (DIM) number of flowering phenophase (from 1 to 7;0: NO effect)
|
||||
35 (Celsius) critical flowering heat stress temperature 1
|
||||
40 (Celsius) critical flowering heat stress temperature 2
|
||||
0.2 (prop.) theoretical maximum of flowering thermal stress mortality parameter
|
||||
----------------------------------------------------------------------------------------
|
||||
STRESS AND SENESCENCE PARAMETERS
|
||||
1.0 (prop) VWC ratio to calc. soil moisture limit 1 (prop. to FC-WP)
|
||||
0.95 (prop) VWC ratio to calc. soil moisture limit 2 (prop. to SAT-FC)
|
||||
0.4 (prop) minimum of soil moisture limit2 multiplicator (full anoxic stress value)
|
||||
1000 (Pa) vapor pressure deficit: start of conductance reduction
|
||||
2800 (Pa) vapor pressure deficit: complete conductance reduction
|
||||
0.03 (prop.) maximum senescence mortality coefficient of aboveground plant material
|
||||
0.02 (prop.) maximum senescence mortality coefficient of belowground plant material
|
||||
0.01 (prop.) maximum senescence mortality coefficient of non-structured plant material
|
||||
35 (Celsius) lower limit extreme high temperature effect on senescence mortality
|
||||
40 (Celsius) upper limit extreme high temperature effect on senescence mortality
|
||||
0.01 (prop.) turnover rate of wilted standing biomass to litter
|
||||
0.047 (prop.) turnover rate of non-woody cut-down biomass to litter
|
||||
0.01 (prop.) turnover rate of woody cut-down biomass to litter
|
||||
30 (nday) drought tolerance parameter (critical value of DSWS)
|
||||
0.2 (dimless) effect of soilstress factor on photosynthesis (1: full effect, 0: no effect)
|
||||
----------------------------------------------------------------------------------------
|
||||
GROWING SEASON PARAMETERS
|
||||
5 (kg/m2) crit. amount of snow limiting photosyn.
|
||||
20 (Celsius) limit1 (under:full constrained) of HEATSUM index
|
||||
60 (Celsius) limit2 (above:unconstrained) of HEATSUM index
|
||||
0 (Celsius) limit1 (under:full constrained) of TMIN index
|
||||
5 (Celsius) limit2 (above:unconstrained) of TMIN index
|
||||
4000 (Pa) limit1 (above:full constrained) of VPD index
|
||||
1000 (Pa) limit2 (under:unconstrained) of VPD index
|
||||
0 (s) limit1 (under:full constrained) of DAYLENGTH index
|
||||
0 (s) limit2 (above:unconstrained) of DAYLENGTH index
|
||||
10 (day) moving average (to avoid the effects of extreme events)
|
||||
0.10 (dimless) GSI limit1 (greater that limit -> start of vegper)
|
||||
0.01 (dimless) GSI limit2 (less that limit -> end of vegper)
|
||||
----------------------------------------------------------------------------------------
|
||||
PHENOLOGICAL (ALLOCATION) PARAMETERS (7 phenological phases)
|
||||
phase1 phase2 phase3 phase4 phase5 phase6 phase7 (text) name of the phenophase
|
||||
10000 200 500 200 400 200 100 (Celsius) length of phenophase (GDD)
|
||||
0.3 0.3 0.3 0.3 0.3 0.3 0.3 (ratio) leaf ALLOCATION
|
||||
0.5 0.5 0.5 0.5 0.5 0.5 0.5 (ratio) fine root ALLOCATION
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 (ratio) fruit ALLOCATION
|
||||
0.2 0.2 0.2 0.2 0.2 0.2 0.2 (ratio) soft stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live coarse root ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead coarse root ALLOCATION
|
||||
49 49 49 49 49 49 49 (m2/kgC) canopy average specific leaf area (projected area basis)
|
||||
0.37 0.37 0.37 0.37 0.37 0.37 0.37 (prop.) current growth proportion
|
||||
10000 10000 10000 10000 10000 10000 10000 (Celsius) maximal lifetime of plant tissue
|
||||
6
RBBGCMuso/inst/examples/hhs/compile_log_linux.txt
Normal file
6
RBBGCMuso/inst/examples/hhs/compile_log_linux.txt
Normal file
@ -0,0 +1,6 @@
|
||||
System: Linux meteor30 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
|
||||
Compilation time: Mon 02 Dec 2019 02:03:10 PM CET
|
||||
Compiler: gcc (Debian 8.3.0-6) 8.3.0
|
||||
Compiler flags:
|
||||
Model version: 6.0.3
|
||||
|
||||
@ -1,229 +0,0 @@
|
||||
BBGC_MuSo simulation (missing data: -9999)
|
||||
|
||||
MET_INPUT
|
||||
hhs_2013-2016.mtc43 (filename) met file name
|
||||
4 (int) number of header lines in met file
|
||||
365 (int) number of simdays in last simyear (truncated year: < 365)
|
||||
|
||||
RESTART
|
||||
1 (flag) 1 = read restart; 0 = dont read restart
|
||||
0 (flag) 1 = write restart; 0 = dont write restart
|
||||
0 (flag) 1 = use restart metyear; 0 = reset metyear
|
||||
hhs.endpoint (filename) name of the input restart file
|
||||
hhs.endpoint (filename) name of the output restart file
|
||||
|
||||
TIME_DEFINE
|
||||
4 (int) number of meteorological data years
|
||||
4 (int) number of simulation years
|
||||
2013 (int) first simulation year
|
||||
0 (flag) 1 = spinup run; 0 = normal run
|
||||
6000 (int) maximum number of spinup years
|
||||
|
||||
CLIM_CHANGE
|
||||
0.0 (degC) - offset for Tmax
|
||||
0.0 (degC) - offset for Tmin
|
||||
1.0 (degC) - multiplier for PRCP
|
||||
1.0 (degC) - multiplier for VPD
|
||||
1.0 (degC) - multiplier for RAD
|
||||
|
||||
CO2_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
395.0 (ppm) constant atmospheric CO2 concentration
|
||||
CO2_from2013.txt (filename) name of the CO2 file
|
||||
|
||||
NDEP_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
0.001400 (kgN/m2/yr) wet+dry atmospheric deposition of N
|
||||
Ndep_from2013.txt (filename) name of the N-dep file
|
||||
|
||||
SITE
|
||||
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
|
||||
248.0 (m) site elevation
|
||||
46.95 (degrees) site latitude (- for S.Hem.)
|
||||
0.20 (DIM) site shortwave albedo
|
||||
9.00 (Celsius) mean annual air temperature
|
||||
10.15 (Celsius) mean annual air temperature range
|
||||
20.00 (mm) maximum height of pond water
|
||||
-9999 (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
|
||||
|
||||
EPC_FILE
|
||||
maize.epc (filename) EPC file name
|
||||
|
||||
W_STATE
|
||||
0.0 (kg/m2) water stored in snowpack
|
||||
1.0 (DIM) initial soil water as a proportion of field capacity
|
||||
|
||||
CN_STATE
|
||||
0.001 (kgC/m2) first-year maximum leaf carbon
|
||||
0.001 (kgC/m2) first-year maximum fine root carbon
|
||||
0.001 (kgC/m2) first-year maximum fruit carbon
|
||||
0.001 (kgC/m2) first-year maximum softstem carbon
|
||||
0.001 (kgC/m2) first-year maximum live woody stem carbon
|
||||
0.001 (kgC/m2) first-year maximum live coarse root carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) coarse woody debris carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, unshielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, shielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, lignin pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, fast microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, medium microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, slow microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, recalcitrant SOM (slowest)
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) litter nitrogen, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NH4 pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NO3 pool
|
||||
|
||||
OUTPUT_CONTROL
|
||||
hegyhatsal (filename) output prefix
|
||||
1 (flag) writing daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing monthly average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual output (0 = no; 1 = binary; 2 = ascii)
|
||||
1 (flag) for on-screen progress indicator
|
||||
|
||||
DAILY_OUTPUT
|
||||
39 number of daily output variables
|
||||
49 1 tsoil[0]
|
||||
171 2 evapotranspiration
|
||||
159 3 soilw_evap
|
||||
397 4 litr1c_total
|
||||
398 5 litr2c_total
|
||||
399 6 litr3c_total
|
||||
400 7 litr4c_total
|
||||
518 8 soil1c_total
|
||||
519 9 soil2c_total
|
||||
520 10 soil3c_total
|
||||
521 11 soil4c_total
|
||||
313 12 fruitc
|
||||
552 13 HRV_transportC
|
||||
2520 14 proj_lai
|
||||
3017 15 total litterfall aboveground
|
||||
3018 16 total litterfall belowground
|
||||
2599 17 vwc[0] soilw layer1 first layer 0-2 cm
|
||||
2600 18 vwc[1] the second 2-5 cm
|
||||
2601 19 vwc[2] the third is at 5-10 cm
|
||||
2602 20 vwc[3] the fourth is at 10-20 cm
|
||||
2603 21 vwc[4] the fifth is at 20-50 cm
|
||||
2604 22 vwc[5] the sixth is at 50-100
|
||||
407 23 standing dead biomass
|
||||
3006 24 daily_npp
|
||||
3005 25 daily_nep
|
||||
3009 26 daily_gpp
|
||||
3010 27 daily_mr
|
||||
3011 28 daily_gr
|
||||
3012 29 daily_hr
|
||||
3051 30 litrc
|
||||
3052 31 soilc
|
||||
3037 32 cum_yieldC_HRV
|
||||
74 33 GDD
|
||||
1531 34 SUM of the soil mineral NH4 in the total soil [kgN/m2]
|
||||
1532 35 SUM of the soil mineral NO3 in the total soil [kgN/m2]
|
||||
3013 36 daily soil respiration
|
||||
307 37 leafC
|
||||
310 38 fine root C
|
||||
316 39 soft stem C
|
||||
|
||||
ANNUAL_OUTPUT
|
||||
12 number of annual output variables
|
||||
0 onday
|
||||
1 offday
|
||||
3000 annprcp
|
||||
3001 anntavg
|
||||
3002 annrunoff
|
||||
2765 ytd_maxplai
|
||||
3024 cum_nee
|
||||
3033 cum_Closs_THN_w
|
||||
3035 cum_Closs_MOW
|
||||
3037 cum_yieldC_HRV
|
||||
3059 NH4_top10
|
||||
3060 NO3_top10
|
||||
|
||||
-------------------
|
||||
MANAGEMENT_SECTION
|
||||
-------------------
|
||||
PLANTING
|
||||
1 (flag) do PLANTING? 0=no; 1=yes; filepath=reading from file
|
||||
121 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLANTING day
|
||||
0.05 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) germination depth
|
||||
7 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(n/m2) number of seedlings
|
||||
380 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(g/1000n) weight of 1000-seed
|
||||
40 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of seed
|
||||
100 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) emergence rate
|
||||
|
||||
THINNING
|
||||
0 (flag) do THINNING? 0=no; 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) THINNING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of non-woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of stem
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of leaf
|
||||
|
||||
MOWING
|
||||
0 (flag) do MOWING? 0=no; 1=yes; filepath=reading from file
|
||||
0 (flag) mowing method? 0 - fixday method, 1 - fixvalue method
|
||||
-9999 (m2/m2) fixed value of the LAI before MOWING (fixvalue method)
|
||||
-9999 (m2/m2) fixed value of the LAI after MOWING (fixvalue method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) MOWING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m2/m2) value of the LAI after MOWING (fixday method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
GRAZING
|
||||
0 (flag) do GRAZING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) first day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) last day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg/LSU) weight equivalent of one unit
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(LSU/ha) animal stocking rate: Livestock Units per hectare
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg dry matter/LSU) daily ingested dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) trampling effect (standing dead biome to litter)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of DM intake formed excrement
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of excrement returning to litter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) carbon content of dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) N content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) manure emission factor for direct N2O (T10.21)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/1000 kg animal mass/day) default N excretion rate (T10.19)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) manure emission factor for CH4 (T10.14)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) fermentation emission factor for CH4 (T10.11)
|
||||
|
||||
HARVESTING
|
||||
0 (flag) do HARVESTING? 0=no; 1=yes; filepath=reading from file
|
||||
275 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) HARVESTING day
|
||||
0.03 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/m2) soft stem C content after HARVESTING
|
||||
90 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
PLOUGHING
|
||||
0 (flag) do PLOUGHING? 0=no; 1=yes; filepath=reading from file
|
||||
110 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLOUGHING day
|
||||
0.3 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) PLOUGHING depth
|
||||
0.1 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) dissolving coefficient of ploughed biome to litter
|
||||
|
||||
FERTILIZING
|
||||
0 (flag) do FERTILIZING? 0=no; 1=yes; filepath=reading from file
|
||||
90 140 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) FERTILIZING day
|
||||
0.28 0.28 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) fertilizing depth
|
||||
120. 30. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN fertilizer/ha/day) amount of fertilizer
|
||||
100 100 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) dry matter content of fertilizer
|
||||
0.5 0.5 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) nitrate content of fertilizer
|
||||
0.5 0.5 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) ammonium content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) organic nitrogen content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/kg fertilizer) organic carbon content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) labile fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) unshielded cellulose fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) shielded cellulose fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) lignin fraction of fertilizer
|
||||
0.01 0.01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) emission factor for N-additions
|
||||
|
||||
IRRIGATION
|
||||
0 (flag) do IRRIGATION? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) IRRIGATION day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgH2O/m2/day) amount of water
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) utilization coefficient of water
|
||||
|
||||
END_INIT
|
||||
33
RBBGCMuso/inst/examples/hhs/hhs.mgm
Normal file
33
RBBGCMuso/inst/examples/hhs/hhs.mgm
Normal file
@ -0,0 +1,33 @@
|
||||
MANAGEMENT_INFORMATION MuSo6
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
PLANTING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
THINNING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
MOWING
|
||||
1 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
hhs.mow
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
GRAZING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
HARVESTING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
PLOUGHING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
FERTILIZING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
IRRIGATING
|
||||
0 (flag) flag of management action: 0 - no MGM, 1 - MGM information from file below
|
||||
none
|
||||
23
RBBGCMuso/inst/examples/hhs/hhs.mow
Normal file
23
RBBGCMuso/inst/examples/hhs/hhs.mow
Normal file
@ -0,0 +1,23 @@
|
||||
DATE afterLAI(m2/m2) transPART(%)
|
||||
2006.08.09 1 90
|
||||
2007.06.18 1 90
|
||||
2008.05.30 1 90
|
||||
2008.08.18 1 90
|
||||
2009.06.08 1 90
|
||||
2009.08.07 1 90
|
||||
2010.06.12 1 90
|
||||
2010.09.26 1 90
|
||||
2011.06.01 1 90
|
||||
2011.08.21 1 90
|
||||
2012.05.24 1 90
|
||||
2012.08.17 1 90
|
||||
2013.06.16 1 90
|
||||
2013.09.29 1 90
|
||||
2014.06.09 1 90
|
||||
2015.06.13 1 90
|
||||
2015.09.30 1 90
|
||||
2016.06.22 1 90
|
||||
2016.08.14 1 90
|
||||
2017.06.18 1 90
|
||||
2018.06.03 1 90
|
||||
2018.07.30 1 90
|
||||
42344
RBBGCMuso/inst/examples/hhs/hhs.mtc43
Normal file
42344
RBBGCMuso/inst/examples/hhs/hhs.mtc43
Normal file
File diff suppressed because it is too large
Load Diff
64
RBBGCMuso/inst/examples/hhs/hhs.soi
Normal file
64
RBBGCMuso/inst/examples/hhs/hhs.soi
Normal file
@ -0,0 +1,64 @@
|
||||
SOILPROP FILE - hhs muso6
|
||||
----------------------------------------------------------------------------------------
|
||||
NITROGEN AND DECOMPOSITION PARAMETERS
|
||||
0.1 (prop.) denitrification rate per g of CO2 respiration of SOM
|
||||
0.2 (prop.) nitrification coefficient 1
|
||||
0.1 (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.39 (DIM) respiration fractions for fluxes between compartments (l1s1)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (l2s2)
|
||||
0.29 (DIM) respiration fractions for fluxes between compartments (l4s3)
|
||||
0.28 (DIM) respiration fractions for fluxes between compartments (s1s2)
|
||||
0.46 (DIM) respiration fractions for fluxes between compartments (s2s3)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (s3s4)
|
||||
0.7 (DIM) rate constant scalar of labile litter pool
|
||||
0.07 (DIM) rate constant scalar of cellulose litter pool
|
||||
0.014 (DIM) rate constant scalar of lignin litter pool
|
||||
0.07 (DIM) rate constant scalar of fast microbial recycling pool
|
||||
0.014 (DIM) rate constant scalar of medium microbial recycling pool
|
||||
0.0014 (DIM) rate constant scalar of slow microbial recycling pool
|
||||
0.0001 (DIM) rate constant scalar of recalcitrant SOM (humus) pool
|
||||
0.001 (DIM) 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
|
||||
1.781 (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) limit of first stage evaporation
|
||||
5.00 (mm) maximum height of pond water
|
||||
1 (dimless) curvature of soil stress function
|
||||
-9999 (dimless) runoff curve number (-9999: no , model estimation)
|
||||
107 (s/m) aerodynamic resistance (Wallace and Holwill, 1997)
|
||||
----------------------------------------------------------------------------------------
|
||||
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
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,180 +0,0 @@
|
||||
ECOPHYS FILE - MAIZE
|
||||
----------------------------------------------------------------------------------------
|
||||
FLAGS
|
||||
0 (flag) biome type flag (1 = WOODY 0 = NON-WOODY)
|
||||
0 (flag) woody type flag (1 = EVERGREEN 0 = DECIDUOUS)
|
||||
0 (flag) photosyn. type flag (1 = C3 PSN 0 = C4 PSN)
|
||||
0 (flag) phenology flag (1 = MODEL PHENOLOGY 0 = USER-SPECIFIED PHENOLOGY)
|
||||
1 (flag) transferGDD flag (1= transfer calc. from GDD 0 = transfer calc. from EPC)
|
||||
1 (flag) q10 flag (1 = temperature dependent q10 value; 0= constans q10 value)
|
||||
0 (flag) acclimation flag (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) CO2 conductance reduction flag (0: no effect, 1: multiplier)
|
||||
0 (flag) use GSI index to calculate growing season (0: no GSI, 1: GSI)
|
||||
0 (flag) soil temperature calculation method (0: Zheng, 1: DSSAT)
|
||||
1 (flag) soil hydrological calculation method (0: Richards, 1: tipping DSSAT)
|
||||
0 (int) discretization level of SWC calculation (0: low, 1: medium, 2: high)
|
||||
0 (flag) photosynthesis calculation method (0: Farquhar, 1: DSSAT)
|
||||
0 (flag) evapotranspiration calculation method (0: Penman-Montieth, 1: Priestly-Taylor)
|
||||
0 (flag) radiation calculation method (0: SWabs, 1: Rn)
|
||||
----------------------------------------------------------------------------------------
|
||||
PLANT FUNCTIONING PARAMETERS
|
||||
0 (yday) yearday to start new growth (when phenology flag = 0)
|
||||
364 (yday) yearday to end litterfall (when phenology flag = 0)
|
||||
0.4 (prop.) transfer growth period as fraction of growing season
|
||||
0. (prop.) litterfall as fraction of growing season
|
||||
8 (Celsius) base temperature
|
||||
-9999 (Celsius) minimum temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) optimal1 temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) optimal2 temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) maxmimum temperature for growth displayed on current day (-9999: no T-dependence of allocation)
|
||||
-9999 (Celsius) minimum temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) optimal1 temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) optimal2 temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
-9999 (Celsius) maxmimum temperature for carbon assimilation displayed on current day (-9999: no limitation)
|
||||
1.0 (1/yr) annual leaf and fine root turnover fraction
|
||||
0.00 (1/yr) annual live wood turnover fraction
|
||||
0.0 (1/yr) annual whole-plant mortality fraction
|
||||
0.0 (1/yr) annual fire mortality fraction
|
||||
40.0 (kgC/kgN) C:N of leaves
|
||||
65.0 (kgC/kgN) C:N of leaf litter, after retranslocation ion
|
||||
42.0 (kgC/kgN) C:N of fine roots
|
||||
50.0 *(kgC/kgN) C:N of fruit
|
||||
50.0 (kgC/kgN) C:N of soft stem
|
||||
0.0 (kgC/kgN) C:N of live wood
|
||||
0.0 (kgC/kgN) C:N of dead wood
|
||||
0.68 (DIM) leaf litter labile proportion
|
||||
0.23 (DIM) leaf litter cellulose proportion
|
||||
0.34 (DIM) fine root labile proportion
|
||||
0.44 (DIM) fine root cellulose proportion
|
||||
0.68 *(DIM) fruit litter labile proportion
|
||||
0.23 *(DIM) fruit litter cellulose proportion
|
||||
0.68 (DIM) soft stem litter labile proportion
|
||||
0.23 (DIM) soft stem litter cellulose proportion
|
||||
0.00 *(DIM) dead wood cellulose proportion
|
||||
0.01 (1/LAI/d) canopy water interception coefficient
|
||||
0.69 (DIM) canopy light extinction coefficient
|
||||
2.0 (g/MJ) potential radiation use efficiency
|
||||
0.781 (DIM) radiation parameter1 (Jiang et al.2015)
|
||||
-13.596 (DIM) radiation parameter2 (Jiang et al.2015)
|
||||
2.0 (DIM) all-sided to projected leaf area ratio
|
||||
2.0 (DIM) ratio of shaded SLA:sunlit SLA
|
||||
0.14 (DIM) fraction of leaf N in Rubisco CLM alapjan
|
||||
0.0424 (DIM) fraction of leaf N in PEP Carboxylase
|
||||
0.012 (m/s) maximum stomatal conductance (projected area basis)
|
||||
0.00006 (m/s) cuticular conductance (projected area basis)
|
||||
0.04 (m/s) boundary layer conductance (projected area basis)
|
||||
0.99 (prop) relative SWC (prop. to FC) to calc. soil moisture limit 1 (-9999: not used)
|
||||
1.0 (prop) relative SWC (prop. to SAT) to calc. soil moisture limit 2 (-9999: not used)
|
||||
-9999 (prop) relative PSI (prop. to FC) to calc. soil moisture limit 1 (-9999: not used)
|
||||
-9999 (prop) relative PSI (prop. to SAT) to calc. soil moisture limit 2 (-9999: not used)
|
||||
1000 (Pa) vapor pressure deficit: start of conductance reduction
|
||||
5000 (Pa) vapor pressure deficit: complete conductance reduction
|
||||
2.0 (m) maximum height of plant
|
||||
25 *(kgC/m2) stem weight at which maximum height attended
|
||||
1.7 (m) (m) maximum depth of rooting zonemaximum depth of rooting zone
|
||||
3.67 (DIM) root distribution parameter
|
||||
0.4 (kgC/m2) rootlenght parameter 1 (estimated max root weight)
|
||||
0.5 (prop.) rootlenght parameter 2 (slope)
|
||||
0.3 (prop.) growth resp per unit of C grown
|
||||
0.218 (kgC/kgN/d) maintenance respiration in kgC/day per kg of tissue N
|
||||
0.1 (DIM) theoretical maximum prop. of non-structural and structural carbohydrates
|
||||
0.3 (DIM) prop. of non-structural carbohydrates available for maintanance respiration
|
||||
0.0005 (kgN/m2/yr) symbiotic+asymbiotic fixation of N
|
||||
----------------------------------------------------------------------------------------
|
||||
CROP SPECIFIC PARAMETERS
|
||||
2 (DIM) number of the first phenophase when germination is complete (from 2 to 7; 0: NO specific)
|
||||
3 (DIM) number of the first phenophase when emergence is complete (from 3 to 7; 0: NO specific)
|
||||
0.5 (prop.) critical relative SWC (prop. to FC) in germination
|
||||
-9999 (DIM) number of phenophase of photoperiodic slowing effect (from 1 to 7; -9999: NO)
|
||||
16 (hour) critical photoslow daylength
|
||||
0.005 (DIM) slope of relative photoslow development rate
|
||||
-9999 (DIM) number of phenophase of vernalization (from 1 to 7; -9999: NO)
|
||||
0 (Celsius) critical vernalization temperature 1
|
||||
5 (Celsius) critical vernalization temperature 2
|
||||
8 (Celsius) critical vernalization temperature 3
|
||||
15 (Celsius) critical vernalization temperature 4
|
||||
0.04 (DIM) slope of relative vernalization development rate
|
||||
50 (n) required vernalization days (in vernalization development rate)
|
||||
5 (DIM) number of flowering phenophase (from 1 to 7; -9999: NO)
|
||||
35 (Celsius) critical flowering heat stress temperature 1
|
||||
40 (Celsius) critical flowering heat stress temperature 2
|
||||
0.2 (prop.) mortality parameter of flowering thermal stress
|
||||
----------------------------------------------------------------------------------------
|
||||
SENESCENCE AND SOIL PARAMETERS
|
||||
0.01 (prop.) maximum senescence mortality coefficient of aboveground plant material
|
||||
0.01 (prop.) maximum senescence mortality coefficient of belowground plant material
|
||||
0.0 (prop.) maximum senescence mortality coefficient of non-structured plant material
|
||||
2 (prop) effect of extreme high temperature on senesncene mortality
|
||||
35 (Celsius) lower limit extreme high temperature effect on senescence mortality
|
||||
40 (Celsius) upper limit extreme high temperature effect on senescence mortality
|
||||
1000 (Celsius) maximal lifetime of plant tissue (-9999: no genetically programmed senescence)
|
||||
0.01 (prop.) turnover rate of wilted standing biomass to litter
|
||||
0.05 (prop.) turnover rate of non-woody cut-down biomass to litter
|
||||
0.01 (prop.) turnover rate of woody cut-down biomass to litter
|
||||
30 (prop.) drought tolerance parameter (critical value of DSWS)
|
||||
0.02 (prop.) denitrification rate per g of CO2 respiration of SOM
|
||||
0.5 (prop.) nitrification coefficient 1
|
||||
0.4 (prop.) nitrification coefficient 2
|
||||
0.02 (prop.) coefficient of N2O emission of nitrification
|
||||
0.5 (prop.) proprortion of NH4 flux of N-deposition
|
||||
0.5 (prop.) NH4 mobilen proportion
|
||||
1.0 (prop.) NO3 mobilen proportion
|
||||
10 (m) e-folding depth of decomposition rate's depth scalar
|
||||
0.001 (prop.) fraction of dissolved part of SOIL1 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL2 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL3 organic matter
|
||||
0.001 (prop.) fraction of dissolved part of SOIL4 organic matter
|
||||
0.6 (DIM) ratio of bare soil evaporation and pot.evaporation
|
||||
----------------------------------------------------------------------------------------
|
||||
RATE SCALARS
|
||||
0.39 (DIM) respiration fractions for fluxes between compartments (l1s1)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (l2s2)
|
||||
0.29 (DIM) respiration fractions for fluxes between compartments (l4s3)
|
||||
0.28 (DIM) respiration fractions for fluxes between compartments (s1s2)
|
||||
0.46 (DIM) respiration fractions for fluxes between compartments (s2s3)
|
||||
0.55 (DIM) respiration fractions for fluxes between compartments (s3s4)
|
||||
0.7 (DIM) rate constant scalar of labile litter pool
|
||||
0.07 (DIM) rate constant scalar of cellulose litter pool
|
||||
0.014 (DIM) rate constant scalar of lignin litter pool
|
||||
0.07 (DIM) rate constant scalar of fast microbial recycling pool
|
||||
0.014 (DIM) rate constant scalar of medium microbial recycling pool
|
||||
0.0014 (DIM) rate constant scalar of slow microbial recycling pool
|
||||
0.0001 (DIM) rate constant scalar of recalcitrant SOM (humus) pool
|
||||
0.001 (DIM) rate constant scalar of physical fragmentation of coarse woody debris
|
||||
----------------------------------------------------------------------------------------
|
||||
GROWING SEASON PARAMETERS
|
||||
5 (kg/m2) crit. amount of snow limiting photosyn.
|
||||
20 (Celsius) limit1 (under:full constrained) of HEATSUM index
|
||||
60 (Celsius) limit2 (above:unconstrained) of HEATSUM index
|
||||
0 (Celsius) limit1 (under:full constrained) of TMIN index
|
||||
5 (Celsius) limit2 (above:unconstrained) of TMIN index
|
||||
4000 (Pa) limit1 (above:full constrained) of VPD index
|
||||
1000 (Pa) limit2 (under:unconstrained) of VPD index
|
||||
0 (s) limit1 (under:full constrained) of DAYLENGTH index
|
||||
0 (s) limit2 (above:unconstrained) of DAYLENGTH index
|
||||
10 (day) moving average (to avoid the effects of extreme events)
|
||||
0.10 (dimless) GSI limit1 (greater that limit -> start of vegper)
|
||||
0.01 (dimless) GSI limit2 (less that limit -> end of vegper)
|
||||
----------------------------------------------------------------------------------------
|
||||
CH4 PARAMETERS
|
||||
212.5 (DIM) param1 for CH4 calculations (empirical function of BD)
|
||||
1.81 (DIM) param2 for CH4 calculations (empirical function of BD)
|
||||
-1.353 (DIM) param1 for CH4 calculations (empirical function of VWC)
|
||||
0.2 (DIM) param2 for CH4 calculations (empirical function of VWC)
|
||||
1.781 (DIM) param3 for CH4 calculations (empirical function of VWC)
|
||||
6.786 (DIM) param4 for CH4 calculations (empirical function of VWC)
|
||||
0.010 (DIM) param1 for CH4 calculations (empirical function of Tsoil)
|
||||
----------------------------------------------------------------------------------------
|
||||
PHENOLOGICAL (ALLOCATION) PARAMETERS (7 phenological phases)
|
||||
germination emergence leafunfold leafunfoldlin flowering grainfilling maturity (text) name of the phenophase
|
||||
0 45 225 630 90 730 10000 (Celsius) length of phenophase (GDD)
|
||||
0.0 0.5 0.60 0.30 0.05 0.0 0. (ratio) leaf ALLOCATION
|
||||
0.0 0.5 0.35 0.25 0.20 0.15 0. (ratio) fine root ALLOCATION
|
||||
0.0 0. 0.0 0.0 0.05 0.65 1. (ratio) fruit ALLOCATION
|
||||
0.0 0. 0.05 0.45 0.70 0.20 0. (ratio) soft stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead woody stem ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) live coarse root ALLOCATION
|
||||
0 0 0 0 0 0 0 (ratio) dead coarse root ALLOCATION
|
||||
50 50 50 50 50 50 50 (m2/kgC) canopy average specific leaf area (projected area basis)
|
||||
1.0 1.0 1.0 1.0 1.0 1.0 1.0 (prop.) current growth proportion
|
||||
Binary file not shown.
Binary file not shown.
@ -1,229 +1,147 @@
|
||||
BBGC_MuSo simulation (missing data: -9999)
|
||||
|
||||
MET_INPUT
|
||||
hhs_2013-2016.mtc43 (filename) met file name
|
||||
4 (int) number of header lines in met file
|
||||
365 (int) number of simdays in last simyear (truncated year: < 365)
|
||||
|
||||
RESTART
|
||||
1 (flag) 1 = read restart; 0 = dont read restart
|
||||
0 (flag) 1 = write restart; 0 = dont write restart
|
||||
0 (flag) 1 = use restart metyear; 0 = reset metyear
|
||||
hhs.endpoint (filename) name of the input restart file
|
||||
hhs.endpoint (filename) name of the output restart file
|
||||
|
||||
TIME_DEFINE
|
||||
4 (int) number of meteorological data years
|
||||
4 (int) number of simulation years
|
||||
2013 (int) first simulation year
|
||||
0 (flag) 1 = spinup run; 0 = normal run
|
||||
6000 (int) maximum number of spinup years
|
||||
|
||||
CLIM_CHANGE
|
||||
0.0 (degC) - offset for Tmax
|
||||
0.0 (degC) - offset for Tmin
|
||||
1.0 (degC) - multiplier for PRCP
|
||||
1.0 (degC) - multiplier for VPD
|
||||
1.0 (degC) - multiplier for RAD
|
||||
|
||||
CO2_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
395.0 (ppm) constant atmospheric CO2 concentration
|
||||
CO2_from2013.txt (filename) name of the CO2 file
|
||||
|
||||
NDEP_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
0.001400 (kgN/m2/yr) wet+dry atmospheric deposition of N
|
||||
Ndep_from2013.txt (filename) name of the N-dep file
|
||||
|
||||
SITE
|
||||
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
|
||||
248.0 (m) site elevation
|
||||
46.95 (degrees) site latitude (- for S.Hem.)
|
||||
0.20 (DIM) site shortwave albedo
|
||||
9.00 (Celsius) mean annual air temperature
|
||||
10.15 (Celsius) mean annual air temperature range
|
||||
20.00 (mm) maximum height of pond water
|
||||
-9999 (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
|
||||
|
||||
EPC_FILE
|
||||
maize.epc (filename) EPC file name
|
||||
|
||||
W_STATE
|
||||
0.0 (kg/m2) water stored in snowpack
|
||||
1.0 (DIM) initial soil water as a proportion of field capacity
|
||||
|
||||
CN_STATE
|
||||
0.001 (kgC/m2) first-year maximum leaf carbon
|
||||
0.001 (kgC/m2) first-year maximum fine root carbon
|
||||
0.001 (kgC/m2) first-year maximum fruit carbon
|
||||
0.001 (kgC/m2) first-year maximum softstem carbon
|
||||
0.001 (kgC/m2) first-year maximum live woody stem carbon
|
||||
0.001 (kgC/m2) first-year maximum live coarse root carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) coarse woody debris carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, unshielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, shielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, lignin pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, fast microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, medium microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, slow microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, recalcitrant SOM (slowest)
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) litter nitrogen, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NH4 pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NO3 pool
|
||||
|
||||
OUTPUT_CONTROL
|
||||
hegyhatsal (filename) output prefix
|
||||
1 (flag) writing daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing monthly average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual output (0 = no; 1 = binary; 2 = ascii)
|
||||
1 (flag) for on-screen progress indicator
|
||||
|
||||
DAILY_OUTPUT
|
||||
39 number of daily output variables
|
||||
49 1 tsoil[0]
|
||||
171 2 evapotranspiration
|
||||
159 3 soilw_evap
|
||||
397 4 litr1c_total
|
||||
398 5 litr2c_total
|
||||
399 6 litr3c_total
|
||||
400 7 litr4c_total
|
||||
518 8 soil1c_total
|
||||
519 9 soil2c_total
|
||||
520 10 soil3c_total
|
||||
521 11 soil4c_total
|
||||
313 12 fruitc
|
||||
552 13 HRV_transportC
|
||||
2520 14 proj_lai
|
||||
3017 15 total litterfall aboveground
|
||||
3018 16 total litterfall belowground
|
||||
2599 17 vwc[0] soilw layer1 first layer 0-2 cm
|
||||
2600 18 vwc[1] the second 2-5 cm
|
||||
2601 19 vwc[2] the third is at 5-10 cm
|
||||
2602 20 vwc[3] the fourth is at 10-20 cm
|
||||
2603 21 vwc[4] the fifth is at 20-50 cm
|
||||
2604 22 vwc[5] the sixth is at 50-100
|
||||
407 23 standing dead biomass
|
||||
3006 24 daily_npp;
|
||||
3005 25 daily_nep
|
||||
3009 26 daily_gpp
|
||||
3010 27 daily_mr
|
||||
3011 28 daily_gr
|
||||
3012 29 daily_hr
|
||||
3051 30 litrc
|
||||
3052 31 soilc
|
||||
3037 32 cum_yieldC_HRV (kgC/m2)
|
||||
74 33 GDD
|
||||
1531 34 SUM of the soil mineral NH4 in the total soil [kgN/m2]
|
||||
1532 35 SUM of the soil mineral NO3 in the total soil [kgN/m2]
|
||||
3013 36 daily soil respiration
|
||||
307 37 leafC
|
||||
310 38 fine root C
|
||||
316 39 soft stem C
|
||||
|
||||
ANNUAL_OUTPUT
|
||||
12 number of annual output variables
|
||||
0 onday
|
||||
1 offday
|
||||
3000 annprcp
|
||||
3001 anntavg
|
||||
3002 annrunoff
|
||||
2765 ytd_maxplai
|
||||
3024 cum_nee
|
||||
3033 cum_Closs_THN_w
|
||||
3035 cum_Closs_MOW
|
||||
3037 cum_yieldC_HRV
|
||||
3059 NH4_top10
|
||||
3060 NO3_top10
|
||||
|
||||
-------------------
|
||||
MANAGEMENT_SECTION
|
||||
-------------------
|
||||
PLANTING
|
||||
1 (flag) do PLANTING? 0=no; 1=yes; filepath=reading from file
|
||||
121 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLANTING day
|
||||
0.05 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) germination depth
|
||||
7 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(n/m2) number of seedlings
|
||||
380 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(g/1000n) weight of 1000-seed
|
||||
40 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of seed
|
||||
100 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) emergence rate
|
||||
|
||||
THINNING
|
||||
0 (flag) do THINNING? 0=no; 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) THINNING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of non-woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of stem
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of leaf
|
||||
|
||||
MOWING
|
||||
0 (flag) do MOWING? 0=no; 1=yes; filepath=reading from file
|
||||
0 (flag) mowing method? 0 - fixday method, 1 - fixvalue method
|
||||
-9999 (m2/m2) fixed value of the LAI before MOWING (fixvalue method)
|
||||
-9999 (m2/m2) fixed value of the LAI after MOWING (fixvalue method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) MOWING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m2/m2) value of the LAI after MOWING (fixday method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
GRAZING
|
||||
0 (flag) do GRAZING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) first day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) last day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg/LSU) weight equivalent of one unit
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(LSU/ha) animal stocking rate: Livestock Units per hectare
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg dry matter/LSU) daily ingested dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) trampling effect (standing dead biome to litter)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of DM intake formed excrement
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of excrement returning to litter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) carbon content of dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) N content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) manure emission factor for direct N2O (T10.21)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/1000 kg animal mass/day) default N excretion rate (T10.19)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) manure emission factor for CH4 (T10.14)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) fermentation emission factor for CH4 (T10.11)
|
||||
|
||||
HARVESTING
|
||||
1 (flag) do HARVESTING? 0=no; 1=yes; filepath=reading from file
|
||||
275 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) HARVESTING day
|
||||
0.03 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/m2) soft stem C content after HARVESTING
|
||||
90 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
PLOUGHING
|
||||
1 (flag) do PLOUGHING? 0=no; 1=yes; filepath=reading from file
|
||||
110 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLOUGHING day
|
||||
0.3 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) PLOUGHING depth
|
||||
0.1 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) dissolving coefficient of ploughed biome to litter
|
||||
|
||||
FERTILIZING
|
||||
1 (flag) do FERTILIZING? 0=no; 1=yes; filepath=reading from file
|
||||
90 140 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) FERTILIZING day
|
||||
0.28 0.28 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) fertilizing depth
|
||||
120. 30. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN fertilizer/ha/day) amount of fertilizer
|
||||
100 100 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) dry matter content of fertilizer
|
||||
0.5 0.5 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) nitrate content of fertilizer
|
||||
0.5 0.5 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) ammonium content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) organic nitrogen content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/kg fertilizer) organic carbon content of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) labile fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) unshielded cellulose fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) shielded cellulose fraction of fertilizer
|
||||
0. 0. -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) lignin fraction of fertilizer
|
||||
0.01 0.01 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) emission factor for N-additions
|
||||
|
||||
IRRIGATION
|
||||
0 (flag) do IRRIGATION? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) IRRIGATION day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgH2O/m2/day) amount of water
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) utilization coefficient of water
|
||||
|
||||
END_INIT
|
||||
BBGCMuSo simulation
|
||||
|
||||
MET_INPUT
|
||||
hhs.mtc43 (filename) met file name
|
||||
4 (int) number of header lines in met file
|
||||
365 (int) number of simdays in last simyear (truncated year: <= 365)
|
||||
|
||||
RESTART
|
||||
1 (flag) 1 = read restart; 0 = dont read restart
|
||||
0 (flag) 1 = write restart; 0 = dont write restart
|
||||
hhs_MuSo6.endpoint (filename) name of the input restart file
|
||||
hhs_MuSo6.endpoint (filename) name of the output restart file
|
||||
|
||||
TIME_DEFINE
|
||||
9 (int) number of simulation years
|
||||
2007 (int) first simulation year
|
||||
0 (flag) 1 = spinup run; 0 = normal run
|
||||
6000 (int) maximum number of spinup years
|
||||
|
||||
CO2_CONTROL
|
||||
1 (flag) 0=constant; 1=vary with file
|
||||
395.0 (ppm) constant atmospheric CO2 concentration
|
||||
CO2.txt (filename) name of the CO2 file
|
||||
|
||||
NDEP_CONTROL
|
||||
1 (flag) 0=constant; 1=vary with file
|
||||
0.001400 (kgN/m2/yr) wet+dry atmospheric deposition of N
|
||||
Ndep.txt (filename) name of the N-dep file
|
||||
|
||||
SITE
|
||||
248.0 (m) site elevation
|
||||
46.95 (degrees) site latitude (- for S.Hem.)
|
||||
0.20 (DIM) site shortwave albedo
|
||||
9.00 (Celsius) mean annual air temperature
|
||||
10.15 (Celsius) mean annual air temperature range
|
||||
0.50 (prop.) proprortion of NH4 flux of N-deposition
|
||||
|
||||
SOIL_FILE
|
||||
hhs.soi (filename) SOIL filename
|
||||
|
||||
EPC_FILE
|
||||
c3grass_muso6.epc (filename) EPC filename
|
||||
|
||||
MANAGEMENT_FILE
|
||||
hhs.mgm (filename) MGM filename (or "none")
|
||||
|
||||
SIMULATION_CONTROL
|
||||
1 (flag) phenology flag (1 = MODEL PHENOLOGY 0 = USER-SPECIFIED PHENOLOGY)
|
||||
1 (flag) vegper calculation method if MODEL PHENOLOGY is used (0: original, 1: GSI)
|
||||
0 (flag) transferGDD flag (1= transfer calc. from GDD 0 = transfer calc. from EPC)
|
||||
1 (flag) q10 flag (1 = temperature dependent q10 value; 0= constans q10 value)
|
||||
1 (flag) acclimation flag of photosynthesis (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) acclimation flag of respiration (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) CO2 conductance reduction flag (0: no effect, 1: multiplier)
|
||||
0 (flag) soil temperature calculation method (0: Zheng, 1: DSSAT)
|
||||
1 (flag) soil hydrological calculation method (0: Richards, 1: tipping DSSAT)
|
||||
0 (int) discretization level of soil hydr.calc.[Richards-method] (0: low, 1: medium, 2: high)
|
||||
0 (flag) photosynthesis calculation method (0: Farquhar, 1: DSSAT)
|
||||
0 (flag) evapotranspiration calculation method (0: Penman-Montieth, 1: Priestly-Taylor)
|
||||
0 (flag) radiation calculation method (0: SWabs, 1: Rn)
|
||||
0 (flag) soilstress calculation method (0: based on VWC, 1: based on transp. demand)
|
||||
|
||||
W_STATE
|
||||
0.0 (kg/m2) water stored in snowpack
|
||||
1.0 (DIM) initial soil water as a proportion of field capacity
|
||||
|
||||
CN_STATE
|
||||
0.001 (kgC/m2) first-year maximum leaf carbon
|
||||
0.001 (kgC/m2) first-year maximum fine root carbon
|
||||
0.001 (kgC/m2) first-year maximum fruit carbon
|
||||
0.001 (kgC/m2) first-year maximum softstem carbon
|
||||
0.001 (kgC/m2) first-year maximum live woody stem carbon
|
||||
0.001 (kgC/m2) first-year maximum live coarse root carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) coarse woody debris carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, unshielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, shielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, lignin pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, fast microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, medium microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, slow microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, recalcitrant SOM (slowest)
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) litter nitrogen, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NH4 pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NO3 pool
|
||||
|
||||
CLIM_CHANGE
|
||||
0.0 (degC) - offset for Tmax
|
||||
0.0 (degC) - offset for Tmin
|
||||
1.0 (degC) - multiplier for PRCP
|
||||
1.0 (degC) - multiplier for VPD
|
||||
1.0 (degC) - multiplier for RAD
|
||||
|
||||
CONDITIONAL_MANAGEMENT_STRATEGIES
|
||||
0 (flag) conditional mowing ? 0 - no, 1 - yes
|
||||
0.0 (m2/m2) fixed value of the LAI before MOWING
|
||||
0.0 (m2/m2) fixed value of the LAI after MOWING
|
||||
0.0 (%) transported part of plant material after MOWING
|
||||
0 (flag) conditional irrigation? 0 - no, 1 - yes
|
||||
0.0 (prop) SMSI before cond. IRRIGATION (-9999: SWCratio is used)
|
||||
0.0 (prop) SWCratio of rootzone before cond. IRRIGATION (-9999: SMSI is used)
|
||||
0.0 (prop) SWCratio of rootzone after cond. IRRIGATION
|
||||
0.0 (kgH2O/m2) maximum amount of irrigated water
|
||||
|
||||
OUTPUT_CONTROL
|
||||
hhs_MuSo6 (filename) output prefix
|
||||
1 (flag) writing daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
0 (flag) writing monthly average of daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
0 (flag) writing annual average of daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
0 (flag) writing annual output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
1 (flag) for on-screen progress indicator
|
||||
|
||||
DAILY_OUTPUT
|
||||
12 number of daily output variables
|
||||
2520 proj_lai
|
||||
3009 daily_GPP
|
||||
3014 daily_Reco
|
||||
171 evapotransp
|
||||
2502 n_actphen
|
||||
2603 vwc00-03cm
|
||||
2604 vwc03-10cm
|
||||
2605 vwc10-30cm
|
||||
75 GDD
|
||||
2636 rooting_depth
|
||||
2716 m_soilstress
|
||||
671 m_vegc_to_SNSC
|
||||
|
||||
ANNUAL_OUTPUT
|
||||
16 number of annual output variables
|
||||
3000 annprcp
|
||||
3001 anntavg
|
||||
3002 annrunoff
|
||||
3003 annoutflow
|
||||
2734 annmax_lai
|
||||
3031 cum_Closs_MGM
|
||||
3032 cum_Cplus_MGM
|
||||
3045 cum_Closs_SNSC
|
||||
3046 cum_Cplus_STDB
|
||||
3058 vegc
|
||||
3064 totalc
|
||||
3066 SOM_C_top30
|
||||
3070 SOM_C_30to60
|
||||
3071 SOM_C_60to90
|
||||
3068 NH4_top30
|
||||
3069 NO3_top30
|
||||
|
||||
END_INIT
|
||||
|
||||
@ -1,16 +1,15 @@
|
||||
NAME,INDEX,MIN,MAX
|
||||
BASETEMP,25,3,9
|
||||
WPM,36,0,1
|
||||
EMERGENCE,170.61,0,1000
|
||||
CN_lv,38,10,50
|
||||
CN_li,39,32,70
|
||||
CN_root,40,20,90
|
||||
CN_fruit,41,0,200
|
||||
CN_stem,42,0,200
|
||||
CLEC,55,0.4,0.8
|
||||
FLNR,61,0.05,0.8
|
||||
STOMA,63,0.003,0.015
|
||||
ROOTDEPTH,74,0.3,2.
|
||||
SWCGERMIN,87,0.2,0.9
|
||||
MAXLIFETIME,110,500,1500
|
||||
NH4MOBILEPROP,120,0.05,0.7
|
||||
ABREVIATION,INDEX,min,max MuSo6
|
||||
TRANSFERGROWTHP,11,0.1,1
|
||||
T_BASE,13,0,8
|
||||
WPM,25,0,0.1
|
||||
CN_leaf,26,14.3,58.8
|
||||
CWIC,49,0.01,0.07
|
||||
CLEC,50,0.3,0.8
|
||||
FLNR,56,0.1,0.2
|
||||
MSTOMACOND,58,0.001,0.007
|
||||
ROOTDEPTH,64,0.5,3
|
||||
ROOTDISTRIB,65,0.2,5
|
||||
RELSWCCRIT1,96,0.97,1
|
||||
RELSWCCRIT2,97,0.4,1
|
||||
SENESCENCABG,101,0,0.1
|
||||
SLA,137.60,10,60
|
||||
|
||||
|
@ -1,204 +1,147 @@
|
||||
BBGC_MuSo simulation (missing data: -9999)
|
||||
|
||||
MET_INPUT
|
||||
hhs_1961-2014.mtc43 (filename) met file name
|
||||
4 (int) number of header lines in met file
|
||||
365 (int) number of simdays in last simyear (truncated year: < 365)
|
||||
|
||||
RESTART
|
||||
0 (flag) 1 = read restart; 0 = dont read restart
|
||||
1 (flag) 1 = write restart; 0 = dont write restart
|
||||
0 (flag) 1 = use restart metyear; 0 = reset metyear
|
||||
hhs.endpoint (filename) name of the input restart file
|
||||
hhs.endpoint (filename) name of the output restart file
|
||||
|
||||
TIME_DEFINE
|
||||
54 (int) number of meteorological data years
|
||||
54 (int) number of simulation years
|
||||
1961 (int) first simulation year
|
||||
1 (flag) 1 = spinup run; 0 = normal run
|
||||
6000 (int) maximum number of spinup years
|
||||
|
||||
CLIM_CHANGE
|
||||
0.0 (degC) - offset for Tmax
|
||||
0.0 (degC) - offset for Tmin
|
||||
1.0 (degC) - multiplier for PRCP
|
||||
1.0 (degC) - multiplier for VPD
|
||||
1.0 (degC) - multiplier for RAD
|
||||
|
||||
CO2_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
290.0 (ppm) constant atmospheric CO2 concentration
|
||||
CO2_from1961.txt (filename) name of the CO2 file
|
||||
|
||||
NDEP_CONTROL
|
||||
0 (flag) 0=constant; 1=vary with file
|
||||
0.000200 (kgN/m2/yr) wet+dry atmospheric deposition of N
|
||||
Ndep_from1961.txt (filename) name of the N-dep file
|
||||
|
||||
SITE
|
||||
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
|
||||
248.0 (m) site elevation
|
||||
46.95 (degrees) site latitude (- for S.Hem.)
|
||||
0.20 (DIM) site shortwave albedo
|
||||
9.00 (Celsius) mean annual air temperature
|
||||
10.15 (Celsius) mean annual air temperature range
|
||||
20.00 (mm) maximum height of pond water
|
||||
-9999 (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
|
||||
|
||||
EPC_FILE
|
||||
c3grass.epc (filename) EPC file name
|
||||
|
||||
W_STATE
|
||||
0.0 (kg/m2) water stored in snowpack
|
||||
1.0 (DIM) initial soil water as a proportion of field capacity
|
||||
|
||||
CN_STATE
|
||||
0.001 (kgC/m2) first-year maximum leaf carbon
|
||||
0.001 (kgC/m2) first-year maximum fine root carbon
|
||||
0.001 (kgC/m2) first-year maximum fruit carbon
|
||||
0.001 (kgC/m2) first-year maximum softstem carbon
|
||||
0.001 (kgC/m2) first-year maximum live woody stem carbon
|
||||
0.001 (kgC/m2) first-year maximum live coarse root carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) coarse woody debris carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, unshielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, shielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, lignin pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, fast microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, medium microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, slow microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, recalcitrant SOM (slowest)
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) litter nitrogen, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NH4 pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NO3 pool
|
||||
|
||||
OUTPUT_CONTROL
|
||||
spinup_ (filename) output prefix
|
||||
0 (flag) writing daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing monthly average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual average of daily output (0 = no; 1 = binary; 2 = ascii)
|
||||
0 (flag) writing annual output (0 = no; 1 = binary; 2 = ascii)
|
||||
1 (flag) for on-screen progress indicator
|
||||
|
||||
DAILY_OUTPUT
|
||||
14 number of daily output variables
|
||||
49 tsoil_2cm
|
||||
52 tsoil_20cm
|
||||
2599 vwc_2cm
|
||||
2602 vwc_20cm
|
||||
2751 m_soilstress
|
||||
671 vegc_to_SNSC
|
||||
171 evapotransp
|
||||
2520 proj_LAI
|
||||
407 STDBc_above
|
||||
3004 daily_n2o
|
||||
3008 daily_nbp
|
||||
3009 daily_gpp
|
||||
3014 daily_tr
|
||||
2502 n_actphen
|
||||
|
||||
ANNUAL_OUTPUT
|
||||
12 number of annual output variables
|
||||
0 onday
|
||||
1 offday
|
||||
3000 annprcp
|
||||
3001 anntavg
|
||||
3002 annrunoff
|
||||
2765 ytd_maxplai
|
||||
3024 cum_nee
|
||||
3033 cum_Closs_THN_w
|
||||
3035 cum_Closs_MOW
|
||||
3037 cum_yieldC_HRV
|
||||
3059 NH4_top10
|
||||
3060 NO3_top10
|
||||
|
||||
-------------------
|
||||
MANAGEMENT_SECTION
|
||||
-------------------
|
||||
PLANTING
|
||||
0 (flag) do PLANTING? 0=no; 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLANTING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) germination depth
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(n/m2) number of seedlings
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(g/1000n) weight of 1000-seed
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of seed
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) emergence rate
|
||||
|
||||
THINNING
|
||||
0 (flag) do THINNING? 0=no; 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) THINNING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) thinning rate of non-woody plant material
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of stem
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of leaf
|
||||
|
||||
MOWING
|
||||
0 (flag) do MOWING? 0=no; 1=yes; filepath=reading from file
|
||||
0 (flag) mowing method? 0 - fixday method, 1 - fixvalue method
|
||||
-9999 (m2/m2) fixed value of the LAI before MOWING (fixvalue method)
|
||||
-9999 (m2/m2) fixed value of the LAI after MOWING (fixvalue method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) MOWING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m2/m2) value of the LAI after MOWING (fixday method)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
GRAZING
|
||||
0 (flag) do GRAZING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) first day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) last day of GRAZING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg/LSU) weight equivalent of one unit
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(LSU/ha) animal stocking rate: Livestock Units per hectare
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kg dry matter/LSU) daily ingested dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) trampling effect (standing dead biome to litter)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of DM intake formed excrement
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) ratio of excrement returning to litter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) carbon content of dry matter
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) N content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) C content of manure
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) manure emission factor for direct N2O (T10.21)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/1000 kg animal mass/day) default N excretion rate (T10.19)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) manure emission factor for CH4 (T10.14)
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgCH4/LSU/yr*) fermentation emission factor for CH4 (T10.11)
|
||||
|
||||
HARVESTING
|
||||
0 (flag) do HARVESTING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) HARVESTING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/m2) soft stem C content after HARVESTING
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) transported part of plant material
|
||||
|
||||
PLOUGHING
|
||||
0 (flag) do PLOUGHING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) PLOUGHING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) PLOUGHING depth
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(prop) dissolving coefficient of ploughed biome to litter
|
||||
|
||||
FERTILIZING
|
||||
0 (flag) do FERTILIZING? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) FERTILIZING day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(m) fertilizing depth
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN fertilizer/ha/day) amount of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) dry matter content of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) nitrate content of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) ammonium content of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN/kg fertilizer) organic nitrogen content of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgC/kg fertilizer) organic carbon content of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) labile fraction of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) unshielded cellulose fraction of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) shielded cellulose fraction of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) lignin fraction of fertilizer
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgN2O-N:kgN) emission factor for N-additions
|
||||
|
||||
IRRIGATION
|
||||
0 (flag) do IRRIGATION? 0=no, 1=yes; filepath=reading from file
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(yday) IRRIGATION day
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(kgH2O/m2/day) amount of water
|
||||
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 *(%) utilization coefficient of water
|
||||
|
||||
END_INIT
|
||||
BBGCMuSo simulation
|
||||
|
||||
MET_INPUT
|
||||
hhs.mtc43 (filename) met file name
|
||||
4 (int) number of header lines in met file
|
||||
365 (int) number of simdays in last simyear (truncated year: <= 365)
|
||||
|
||||
RESTART
|
||||
0 (flag) 1 = read restart; 0 = dont read restart
|
||||
1 (flag) 1 = write restart; 0 = dont write restart
|
||||
hhs_MuSo6.endpoint (filename) name of the input restart file
|
||||
hhs_MuSo6.endpoint (filename) name of the output restart file
|
||||
|
||||
TIME_DEFINE
|
||||
54 (int) number of simulation years
|
||||
1961 (int) first simulation year
|
||||
1 (flag) 1 = spinup run; 0 = normal run
|
||||
6000 (int) maximum number of spinup years
|
||||
|
||||
CO2_CONTROL
|
||||
1 (flag) 0=constant; 1=vary with file
|
||||
290.0 (ppm) constant atmospheric CO2 concentration
|
||||
CO2.txt (filename) name of the CO2 file
|
||||
|
||||
NDEP_CONTROL
|
||||
1 (flag) 0=constant; 1=vary with file
|
||||
0.000200 (kgN/m2/yr) wet+dry atmospheric deposition of N
|
||||
Ndep.txt (filename) name of the N-dep file
|
||||
|
||||
SITE
|
||||
248.0 (m) site elevation
|
||||
46.95 (degrees) site latitude (- for S.Hem.)
|
||||
0.20 (DIM) site shortwave albedo
|
||||
9.00 (Celsius) mean annual air temperature
|
||||
10.15 (Celsius) mean annual air temperature range
|
||||
0.50 (prop.) proprortion of NH4 flux of N-deposition
|
||||
|
||||
SOIL_FILE
|
||||
hhs.soi (filename) SOIL filename
|
||||
|
||||
EPC_FILE
|
||||
c3grass_muso6.epc (filename) EPC filename
|
||||
|
||||
MANAGEMENT_FILE
|
||||
none (filename) MGM filename (or "none")
|
||||
|
||||
SIMULATION_CONTROL
|
||||
1 (flag) phenology flag (1 = MODEL PHENOLOGY 0 = USER-SPECIFIED PHENOLOGY)
|
||||
1 (flag) vegper calculation method if MODEL PHENOLOGY is used (0: original, 1: GSI)
|
||||
0 (flag) transferGDD flag (1= transfer calc. from GDD 0 = transfer calc. from EPC)
|
||||
1 (flag) q10 flag (1 = temperature dependent q10 value; 0= constans q10 value)
|
||||
1 (flag) acclimation flag of photosynthesis (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) acclimation flag of respiration (1 = acclimation 0 = no acclimation)
|
||||
1 (flag) CO2 conductance reduction flag (0: no effect, 1: multiplier)
|
||||
0 (flag) soil temperature calculation method (0: Zheng, 1: DSSAT)
|
||||
1 (flag) soil hydrological calculation method (0: Richards, 1: tipping DSSAT)
|
||||
0 (int) discretization level of soil hydr.calc.[Richards-method] (0: low, 1: medium, 2: high)
|
||||
0 (flag) photosynthesis calculation method (0: Farquhar, 1: DSSAT)
|
||||
0 (flag) evapotranspiration calculation method (0: Penman-Montieth, 1: Priestly-Taylor)
|
||||
0 (flag) radiation calculation method (0: SWabs, 1: Rn)
|
||||
0 (flag) soilstress calculation method (0: based on VWC, 1: based on transp. demand)
|
||||
|
||||
W_STATE
|
||||
0.0 (kg/m2) water stored in snowpack
|
||||
1.0 (DIM) initial soil water as a proportion of field capacity
|
||||
|
||||
CN_STATE
|
||||
0.001 (kgC/m2) first-year maximum leaf carbon
|
||||
0.001 (kgC/m2) first-year maximum fine root carbon
|
||||
0.001 (kgC/m2) first-year maximum fruit carbon
|
||||
0.001 (kgC/m2) first-year maximum softstem carbon
|
||||
0.001 (kgC/m2) first-year maximum live woody stem carbon
|
||||
0.001 (kgC/m2) first-year maximum live coarse root carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) coarse woody debris carbon
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, unshielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, shielded cellulose pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) litter carbon, lignin pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, fast microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, medium microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, slow microbial recycling pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgC/m2) soil carbon, recalcitrant SOM (slowest)
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) litter nitrogen, labile pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NH4 pool
|
||||
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (kgN/m2) soil mineralized nitrogen, NO3 pool
|
||||
|
||||
CLIM_CHANGE
|
||||
0.0 (degC) - offset for Tmax
|
||||
0.0 (degC) - offset for Tmin
|
||||
1.0 (degC) - multiplier for PRCP
|
||||
1.0 (degC) - multiplier for VPD
|
||||
1.0 (degC) - multiplier for RAD
|
||||
|
||||
CONDITIONAL_MANAGEMENT_STRATEGIES
|
||||
0 (flag) conditional mowing ? 0 - no, 1 - yes
|
||||
0.0 (m2/m2) fixed value of the LAI before MOWING
|
||||
0.0 (m2/m2) fixed value of the LAI after MOWING
|
||||
0.0 (%) transported part of plant material after MOWING
|
||||
0 (flag) conditional irrigation? 0 - no, 1 - yes
|
||||
0.0 (prop) SMSI before cond. IRRIGATION (-9999: SWCratio is used)
|
||||
0.0 (prop) SWCratio of rootzone before cond. IRRIGATION (-9999: SMSI is used)
|
||||
0.0 (prop) SWCratio of rootzone after cond. IRRIGATION
|
||||
0.0 (kgH2O/m2) maximum amount of irrigated water
|
||||
|
||||
OUTPUT_CONTROL
|
||||
hhs_MuSo6_Spinup (filename) output prefix
|
||||
0 (flag) writing daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
0 (flag) writing monthly average of daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
0 (flag) writing annual average of daily output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
2 (flag) writing annual output (0 = no; 1 = binary; 2 = ascii; 3 = on-screen)
|
||||
1 (flag) for on-screen progress indicator
|
||||
|
||||
DAILY_OUTPUT
|
||||
12 number of daily output variables
|
||||
2502 n_actphen
|
||||
2603 vwc00-03cm
|
||||
2604 vwc03-10cm
|
||||
2605 vwc10-30cm
|
||||
75 GDD
|
||||
2636 rooting_depth
|
||||
2716 m_soilstress
|
||||
671 m_vegc_to_SNSC
|
||||
171 evapotransp
|
||||
3009 daily_gpp
|
||||
3014 daily_tr
|
||||
2520 proj_lai
|
||||
|
||||
ANNUAL_OUTPUT
|
||||
16 number of annual output variables
|
||||
3000 annprcp
|
||||
3001 anntavg
|
||||
3002 annrunoff
|
||||
3003 annoutflow
|
||||
2734 annmax_lai
|
||||
3031 cum_Closs_MGM
|
||||
3032 cum_Cplus_MGM
|
||||
3045 cum_Closs_SNSC
|
||||
3046 cum_Cplus_STDB
|
||||
3058 vegc
|
||||
3064 totalc
|
||||
3066 SOM_C_top30
|
||||
3070 SOM_C_30to60
|
||||
3071 SOM_C_60to90
|
||||
3068 NH4_top30
|
||||
3069 NO3_top30
|
||||
|
||||
END_INIT
|
||||
|
||||
BIN
RBBGCMuso/inst/mtclim43
Normal file
BIN
RBBGCMuso/inst/mtclim43
Normal file
Binary file not shown.
BIN
RBBGCMuso/inst/mtclim43.exe
Normal file
BIN
RBBGCMuso/inst/mtclim43.exe
Normal file
Binary file not shown.
@ -4,9 +4,16 @@
|
||||
\alias{alignData}
|
||||
\title{alignData}
|
||||
\usage{
|
||||
alignData(mdata, dataCol, modellSettings = NULL, startDate = NULL,
|
||||
endDate = NULL, formatString = "\%Y-\%m-\%d", leapYear = TRUE,
|
||||
continious = TRUE)
|
||||
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
|
||||
|
||||
42
RBBGCMuso/man/calibrateMuso.Rd
Normal file
42
RBBGCMuso/man/calibrateMuso.Rd
Normal file
@ -0,0 +1,42 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/calibrateMuso.R
|
||||
\name{calibrateMuso}
|
||||
\alias{calibrateMuso}
|
||||
\title{calibrateMuso}
|
||||
\usage{
|
||||
calibrateMuso(
|
||||
measuredData,
|
||||
parameters = NULL,
|
||||
startDate = NULL,
|
||||
endDate = NULL,
|
||||
formatString = "\%Y-\%m-\%d",
|
||||
dataVar,
|
||||
outLoc = "./calib",
|
||||
preTag = "cal-",
|
||||
settings = setupMuso(),
|
||||
outVars = NULL,
|
||||
iterations = 100,
|
||||
skipSpinup = TRUE,
|
||||
plotName = "calib.jpg",
|
||||
modifyOriginal = TRUE,
|
||||
likelihood,
|
||||
uncertainity = NULL,
|
||||
naVal = NULL,
|
||||
postProcString = NULL,
|
||||
thread_prefix = "thread",
|
||||
numCores = (parallel::detectCores() - 1),
|
||||
pb = txtProgressBar(min = 0, max = iterations, style = 3),
|
||||
maxLikelihoodEpc = TRUE,
|
||||
pbUpdate = setTxtProgressBar,
|
||||
method = "GLUE",
|
||||
lg = FALSE,
|
||||
w = NULL,
|
||||
...
|
||||
)
|
||||
}
|
||||
\description{
|
||||
This funtion uses the Monte Carlo technique to uniformly sample the parameter space from user defined parameters of the Biome-BGCMuSo model. The sampling algorithm ensures that the parameters are constrained by the model logic which means that parameter dependencies are fully taken into account (parameter dependency means that e.g leaf C:N ratio must be smaller than C:N ratio of litter; more complicated rules apply to the allocation parameters where the allocation fractions to different plant compartments must sum up 1). This function implements a mathematically correct solution to provide uniform distriution for all selected parameters.
|
||||
}
|
||||
\author{
|
||||
Roland HOLLOS
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/RcppExports.R
|
||||
\name{changeMusoC}
|
||||
\alias{changeMusoC}
|
||||
\title{changeMusoC}
|
||||
\usage{
|
||||
changeMusoC(inFile, outFile, inMat)
|
||||
}
|
||||
\arguments{
|
||||
\item{inFile}{is the big matrix}
|
||||
|
||||
\item{outFile}{is the small matrix}
|
||||
}
|
||||
\description{
|
||||
This function is fastly randomize values based on min and max values
|
||||
}
|
||||
@ -2,10 +2,9 @@
|
||||
% Please edit documentation in R/changeMuso.R
|
||||
\name{changemulline}
|
||||
\alias{changemulline}
|
||||
\title{This is the function which is capable to change multiple specific lines to others using their row numbers.}
|
||||
\title{changemulline}
|
||||
\usage{
|
||||
changemulline(filePaths, calibrationPar, contents, fileOut, fileToChange,
|
||||
modifyOriginal = FALSE)
|
||||
changemulline(filePaths, calibrationPar, contents, src, outFiles = filePaths)
|
||||
}
|
||||
\description{
|
||||
The function uses the previous changspecline function to operate.
|
||||
@ -13,4 +12,3 @@ The function uses the previous changspecline function to operate.
|
||||
\author{
|
||||
Roland Hollos
|
||||
}
|
||||
\keyword{internal}
|
||||
|
||||
33
RBBGCMuso/man/checkMeteoBGC.Rd
Normal file
33
RBBGCMuso/man/checkMeteoBGC.Rd
Normal file
@ -0,0 +1,33 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/checkMeteoBGC.R
|
||||
\name{checkMeteoBGC}
|
||||
\alias{checkMeteoBGC}
|
||||
\title{checkMeteoBGC}
|
||||
\usage{
|
||||
checkMeteoBGC(
|
||||
settings = NULL,
|
||||
skip = 4,
|
||||
numericReport = FALSE,
|
||||
type = "normal"
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{settings}{The output of setupMuso}
|
||||
|
||||
\item{skip}{Number of header lines in meteorology file.}
|
||||
|
||||
\item{numericReport}{If numericReport is set to FALSE, the function returns with a text report. If numericReport is set to TRUE, the function returns with a numeric report.}
|
||||
|
||||
\item{type}{meteorology for spinup or normal run}
|
||||
|
||||
\item{metFileName}{The name of the meteorology file (mtc43).}
|
||||
}
|
||||
\value{
|
||||
It depends on the numericReport parameter. The function returns with a text report, or with a numeric report.
|
||||
}
|
||||
\description{
|
||||
This function calculates the daily and yearly statistics for a given meteorology file (mtc43).
|
||||
}
|
||||
\author{
|
||||
Erzsebet Kristof
|
||||
}
|
||||
@ -4,9 +4,15 @@
|
||||
\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.}
|
||||
|
||||
11
RBBGCMuso/man/createSoilFile.Rd
Normal file
11
RBBGCMuso/man/createSoilFile.Rd
Normal file
@ -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
|
||||
}
|
||||
14
RBBGCMuso/man/getAnnualOutputList.Rd
Normal file
14
RBBGCMuso/man/getAnnualOutputList.Rd
Normal file
@ -0,0 +1,14 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/getOutPutList.R
|
||||
\name{getAnnualOutputList}
|
||||
\alias{getAnnualOutputList}
|
||||
\title{getAnnualOutputList}
|
||||
\usage{
|
||||
getAnnualOutputList(settings = NULL)
|
||||
}
|
||||
\arguments{
|
||||
\item{settings}{bla}
|
||||
}
|
||||
\description{
|
||||
bla bla
|
||||
}
|
||||
19
RBBGCMuso/man/getConstMatrix.Rd
Normal file
19
RBBGCMuso/man/getConstMatrix.Rd
Normal file
@ -0,0 +1,19 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/otherUsefullFunctions.R
|
||||
\name{getConstMatrix}
|
||||
\alias{getConstMatrix}
|
||||
\title{getConstMatrix}
|
||||
\usage{
|
||||
getConstMatrix(
|
||||
filetype = "epc",
|
||||
version = as.character(getOption("RMuso_version"))
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{filetype}{It can be "epc" or "soil".}
|
||||
|
||||
\item{version}{The version of the MuSo environment}
|
||||
}
|
||||
\description{
|
||||
getConstMatrix is a function whith wich you can get the default constrain matrix for your choosen type and version.
|
||||
}
|
||||
14
RBBGCMuso/man/getDailyOutputList.Rd
Normal file
14
RBBGCMuso/man/getDailyOutputList.Rd
Normal file
@ -0,0 +1,14 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/getOutPutList.R
|
||||
\name{getDailyOutputList}
|
||||
\alias{getDailyOutputList}
|
||||
\title{getDailyOutputList}
|
||||
\usage{
|
||||
getDailyOutputList(settings = NULL)
|
||||
}
|
||||
\arguments{
|
||||
\item{settings}{bla}
|
||||
}
|
||||
\description{
|
||||
bla bla
|
||||
}
|
||||
11
RBBGCMuso/man/getSoilDataFull.Rd
Normal file
11
RBBGCMuso/man/getSoilDataFull.Rd
Normal file
@ -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
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/RcppExports.R
|
||||
\name{mtclim}
|
||||
\alias{mtclim}
|
||||
\title{mtclim}
|
||||
\usage{
|
||||
mtclim(iniFile)
|
||||
}
|
||||
\arguments{
|
||||
\item{iniFile}{is the name of the inifile}
|
||||
}
|
||||
\description{
|
||||
This is the core mtclim function
|
||||
}
|
||||
\keyword{internal}
|
||||
@ -4,8 +4,14 @@
|
||||
\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
|
||||
|
||||
24
RBBGCMuso/man/musoGlue.Rd
Normal file
24
RBBGCMuso/man/musoGlue.Rd
Normal file
@ -0,0 +1,24 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/calibration.R
|
||||
\name{musoGlue}
|
||||
\alias{musoGlue}
|
||||
\title{musoGlue}
|
||||
\usage{
|
||||
musoGlue(
|
||||
presCalFile,
|
||||
w,
|
||||
delta = 0.17,
|
||||
settings = setupMuso(),
|
||||
parameters = read.csv("parameters.csv", stringsAsFactors = FALSE),
|
||||
lg = FALSE
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{plotName}{u}
|
||||
}
|
||||
\description{
|
||||
This function calculates the -users specified- likelihood for random model input.
|
||||
}
|
||||
\author{
|
||||
Roland HOLLOS
|
||||
}
|
||||
@ -4,11 +4,27 @@
|
||||
\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, ...)
|
||||
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,
|
||||
modifyOut = TRUE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\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.}
|
||||
|
||||
@ -4,9 +4,19 @@
|
||||
\alias{musoQuickEffect}
|
||||
\title{musoQuickEffect}
|
||||
\usage{
|
||||
musoQuickEffect(settings = NULL, calibrationPar = NULL, startVal,
|
||||
endVal, nSteps = 1, fileToChange = "epc", outVar,
|
||||
parName = "parVal")
|
||||
musoQuickEffect(
|
||||
settings = setupMuso(),
|
||||
calibrationPar = NULL,
|
||||
startVal,
|
||||
endVal,
|
||||
nSteps = 1,
|
||||
fileToChange = "epc",
|
||||
modifyOriginal = TRUE,
|
||||
outVar,
|
||||
parName = "parVal",
|
||||
yearNum = 1,
|
||||
year = (settings$startYear + yearNum - 1)
|
||||
)
|
||||
}
|
||||
\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.}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
\alias{musoRand}
|
||||
\title{musoRand}
|
||||
\usage{
|
||||
musoRand(parameters, constrains = NULL, iterations = 3000)
|
||||
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.}
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/RcppExports.R
|
||||
\name{musoRandomizer}
|
||||
\alias{musoRandomizer}
|
||||
\title{musoRandomizer}
|
||||
\usage{
|
||||
musoRandomizer(A, B)
|
||||
}
|
||||
\arguments{
|
||||
\item{A}{is the big matrix}
|
||||
|
||||
\item{B}{is the small matrix}
|
||||
}
|
||||
\description{
|
||||
This function is fastly randomize values based on min and max values,
|
||||
and row indexes.
|
||||
}
|
||||
@ -4,12 +4,27 @@
|
||||
\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, 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,
|
||||
modifyOut = TRUE,
|
||||
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.}
|
||||
|
||||
@ -4,13 +4,29 @@
|
||||
\alias{optiMuso}
|
||||
\title{optiMuso}
|
||||
\usage{
|
||||
optiMuso(measuredData, parameters = NULL, startDate, endDate,
|
||||
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",
|
||||
dataVar,
|
||||
outLoc = "./calib",
|
||||
preTag = "cal-",
|
||||
settings = setupMuso(),
|
||||
outVars = NULL,
|
||||
iterations = 30,
|
||||
skipSpinup = TRUE,
|
||||
plotName = "calib.jpg",
|
||||
modifyOriginal = TRUE,
|
||||
likelihood,
|
||||
uncertainity = NULL,
|
||||
naVal = NULL,
|
||||
postProcString = NULL,
|
||||
w = NULL,
|
||||
lg = FALSE,
|
||||
parallel = TRUE
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{parameters}{b}
|
||||
@ -29,8 +45,6 @@ optiMuso(measuredData, parameters = NULL, startDate, endDate,
|
||||
|
||||
\item{skipSpinup}{a}
|
||||
|
||||
\item{constrains}{d}
|
||||
|
||||
\item{plotName}{u}
|
||||
|
||||
\item{likelihood}{d}
|
||||
@ -49,6 +63,8 @@ optiMuso(measuredData, parameters = NULL, startDate, endDate,
|
||||
|
||||
\item{calPar}{a}
|
||||
|
||||
\item{constrains}{d}
|
||||
|
||||
\item{leapYear}{b}
|
||||
}
|
||||
\description{
|
||||
|
||||
@ -4,9 +4,14 @@
|
||||
\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}
|
||||
|
||||
12
RBBGCMuso/man/postProcMuso.Rd
Normal file
12
RBBGCMuso/man/postProcMuso.Rd
Normal file
@ -0,0 +1,12 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/postProcString.R
|
||||
\name{postProcMuso}
|
||||
\alias{postProcMuso}
|
||||
\title{postProcMuso}
|
||||
\usage{
|
||||
postProcMuso(modelData, procString)
|
||||
}
|
||||
\description{
|
||||
This is a function wich provides some minimal post processing capabilities
|
||||
}
|
||||
\keyword{internal}
|
||||
@ -4,8 +4,13 @@
|
||||
\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}
|
||||
|
||||
@ -4,11 +4,19 @@
|
||||
\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
|
||||
|
||||
@ -10,14 +10,10 @@ keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=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.}
|
||||
|
||||
\item{parameters}{Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4).}
|
||||
|
||||
\item{timee}{The required timesteps in the model output. It can be "d", if it is daily, "m", if it is monthly, "y" if it is yearly. It is recommended to use daily data, as the yearly and monthly data is not well-tested yet.}
|
||||
|
||||
\item{debugging}{If debugging is set to TRUE, after model execution the function copies the Biome-BGCMuSo log file into a LOG directory to stores it for further processing. If debugging is set to STAMPLOG instead of TRUE, it concatenates a number before the logfile, which is one plus the maximum of those present in the LOG directory. In each case the log files will be saved.}
|
||||
|
||||
\item{logfilename}{If you would like to set a specific name for your logfiles you can set this via the logfile parameter.}
|
||||
|
||||
\item{keepEpc}{If keepEpc is set to TRUE, the function keeps the EPC file and stamps it, and then copies it to the EPCS directory. If debugging is set to TRUE, it copies the wrong EPC files to the wrong epc directory.}
|
||||
|
||||
\item{export}{If it is set to YES or you define a filename here, the function converts the output to the specific file format. For example, if you set export to "example.csv", it converts the output to "csv". If you set it to "example.xls" it converts the output to example.xls with the xlsx package. If the Excel converter package is not installed it gives back a warning message and converts the results to csv.}
|
||||
@ -26,6 +22,10 @@ keepEpc=FALSE, export=FALSE, silent=FALSE, aggressive=FALSE, leapYear=FALSE)
|
||||
|
||||
\item{aggressive}{It deletes all previous model-outputs from previous model runs.}
|
||||
|
||||
\item{parameters}{Using normalMuso it is possible to change some of the EPC parameters prior to model execution. This can be achieved with this option. In the parameters variable you have set the row indices of the variables that you wish to change. In this parameters you can give an exact value for them in a vector form like c(1,2,3,4).}
|
||||
|
||||
\item{logfilename}{If you would like to set a specific name for your logfiles you can set this via the logfile parameter.}
|
||||
|
||||
\item{leapYear}{Should the function do a leapyear correction on the output data? If TRUE, then the result for 31 December will be doubled in leap years which means that the results for the leap year will cover all 366 days. See the model's User's Guide for notes on leap years.}
|
||||
|
||||
\item{keepBinary}{By default RBBGCMuso keeps the working environment as clean as possible, thus deletes all the regular output files. The results are directly written to the standard output (e.g. to the screen), but you can redirect it and save them to a variable. Alternatively, you can export your results to the desired destination in a desired format. Through the keepBinary parameter you can set RBBGCMuso to keep the binary output files. If you would like to set the location of the binary output, please take a look at the binaryPlace argument.}
|
||||
|
||||
@ -4,9 +4,15 @@
|
||||
\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.}
|
||||
|
||||
@ -4,8 +4,15 @@
|
||||
\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.}
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
\alias{updateMusoMapping}
|
||||
\title{updateMusoMapping}
|
||||
\usage{
|
||||
updateMusoMapping(output_map_init="output_map_init.c")
|
||||
updateMusoMapping(excelName, dest = "./", version = getOption("RMuso_version"))
|
||||
}
|
||||
\arguments{
|
||||
\item{output_map_init}{The output code-variable bindings are described in output_map_init.c file that is part of the Biome-BGCMuSo source code. Using this function the user can read the output_map_init.c file and pass it to RBBGCMuso for further work.}
|
||||
\item{excelName}{Name of the excelfile which contains the parameters}
|
||||
}
|
||||
\value{
|
||||
The output code-variable matrix, and also the function changes the global variable
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
|
||||
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
|
||||
|
||||
#include <Rcpp.h>
|
||||
|
||||
using namespace Rcpp;
|
||||
|
||||
// mtclim
|
||||
void mtclim(std::string iniFile);
|
||||
RcppExport SEXP _RBBGCMuso_mtclim(SEXP iniFileSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< std::string >::type iniFile(iniFileSEXP);
|
||||
mtclim(iniFile);
|
||||
return R_NilValue;
|
||||
END_RCPP
|
||||
}
|
||||
// getWritePositions
|
||||
IntegerVector getWritePositions(double a);
|
||||
RcppExport SEXP _RBBGCMuso_getWritePositions(SEXP aSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RObject rcpp_result_gen;
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< double >::type a(aSEXP);
|
||||
rcpp_result_gen = Rcpp::wrap(getWritePositions(a));
|
||||
return rcpp_result_gen;
|
||||
END_RCPP
|
||||
}
|
||||
// changeMusoC
|
||||
void changeMusoC(std::string inFile, std::string outFile, NumericMatrix inMat);
|
||||
RcppExport SEXP _RBBGCMuso_changeMusoC(SEXP inFileSEXP, SEXP outFileSEXP, SEXP inMatSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< std::string >::type inFile(inFileSEXP);
|
||||
Rcpp::traits::input_parameter< std::string >::type outFile(outFileSEXP);
|
||||
Rcpp::traits::input_parameter< NumericMatrix >::type inMat(inMatSEXP);
|
||||
changeMusoC(inFile, outFile, inMat);
|
||||
return R_NilValue;
|
||||
END_RCPP
|
||||
}
|
||||
// randTypeOne
|
||||
NumericMatrix randTypeOne(NumericMatrix m);
|
||||
RcppExport SEXP _RBBGCMuso_randTypeOne(SEXP mSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RObject rcpp_result_gen;
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< NumericMatrix >::type m(mSEXP);
|
||||
rcpp_result_gen = Rcpp::wrap(randTypeOne(m));
|
||||
return rcpp_result_gen;
|
||||
END_RCPP
|
||||
}
|
||||
// randTypeTwo
|
||||
NumericMatrix randTypeTwo(NumericMatrix m);
|
||||
RcppExport SEXP _RBBGCMuso_randTypeTwo(SEXP mSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RObject rcpp_result_gen;
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< NumericMatrix >::type m(mSEXP);
|
||||
rcpp_result_gen = Rcpp::wrap(randTypeTwo(m));
|
||||
return rcpp_result_gen;
|
||||
END_RCPP
|
||||
}
|
||||
// musoRandomizer
|
||||
NumericMatrix musoRandomizer(NumericMatrix A, NumericMatrix B);
|
||||
RcppExport SEXP _RBBGCMuso_musoRandomizer(SEXP ASEXP, SEXP BSEXP) {
|
||||
BEGIN_RCPP
|
||||
Rcpp::RObject rcpp_result_gen;
|
||||
Rcpp::RNGScope rcpp_rngScope_gen;
|
||||
Rcpp::traits::input_parameter< NumericMatrix >::type A(ASEXP);
|
||||
Rcpp::traits::input_parameter< NumericMatrix >::type B(BSEXP);
|
||||
rcpp_result_gen = Rcpp::wrap(musoRandomizer(A, B));
|
||||
return rcpp_result_gen;
|
||||
END_RCPP
|
||||
}
|
||||
|
||||
static const R_CallMethodDef CallEntries[] = {
|
||||
{"_RBBGCMuso_mtclim", (DL_FUNC) &_RBBGCMuso_mtclim, 1},
|
||||
{"_RBBGCMuso_getWritePositions", (DL_FUNC) &_RBBGCMuso_getWritePositions, 1},
|
||||
{"_RBBGCMuso_changeMusoC", (DL_FUNC) &_RBBGCMuso_changeMusoC, 3},
|
||||
{"_RBBGCMuso_randTypeOne", (DL_FUNC) &_RBBGCMuso_randTypeOne, 1},
|
||||
{"_RBBGCMuso_randTypeTwo", (DL_FUNC) &_RBBGCMuso_randTypeTwo, 1},
|
||||
{"_RBBGCMuso_musoRandomizer", (DL_FUNC) &_RBBGCMuso_musoRandomizer, 2},
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
RcppExport void R_init_RBBGCMuso(DllInfo *dll) {
|
||||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
|
||||
R_useDynamicSymbols(dll, FALSE);
|
||||
}
|
||||
@ -1,156 +0,0 @@
|
||||
/*
|
||||
ini.h
|
||||
Peter Thornton, NTSG
|
||||
8/6/93
|
||||
|
||||
Header file for functions that read *.ini files and either
|
||||
store values in variables or open files for input or output
|
||||
General *.ini file format:
|
||||
value/string (whitespace) comment, not required (\n)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* structure definition for filename handling */
|
||||
typedef struct {
|
||||
char name[128];
|
||||
FILE *ptr;
|
||||
} file;
|
||||
|
||||
/* function prototypes */
|
||||
int file_open (file *target, char mode);
|
||||
int scan_value (file ini, void *var, char mode);
|
||||
int scan_open (file ini,file *target,char mode);
|
||||
|
||||
|
||||
/* file_open is the generic file opening routine using the file structure
|
||||
defined above */
|
||||
int file_open (file *target, char mode)
|
||||
/* Possible values for mode
|
||||
'r' for read binary
|
||||
'i' for read ascii
|
||||
'w' for write binary
|
||||
'o' for write ascii
|
||||
*/
|
||||
{
|
||||
int ok=1;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case 'r':
|
||||
if ((target->ptr = fopen(target->name,"rb")) == NULL)
|
||||
{
|
||||
printf("Can't open %s for binary read ... Exiting\n",target->name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
if ((target->ptr = fopen(target->name,"r")) == NULL)
|
||||
{
|
||||
printf("Can't open %s for ascii read ... Exiting\n",target->name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
if ((target->ptr = fopen(target->name,"wb")) == NULL)
|
||||
{
|
||||
printf("Can't open %s for binary write ... Exiting\n",target->name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if ((target->ptr = fopen(target->name,"w")) == NULL)
|
||||
{
|
||||
printf("Can't open %s for ascii write ... Exiting\n",target->name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Invalid mode specification for file_open ... Exiting\n");
|
||||
ok=0;
|
||||
}
|
||||
return(!ok);
|
||||
}
|
||||
|
||||
|
||||
/* scan_value is the generic ascii input function for use with text
|
||||
initialization files. Reads the first whitespace delimited word on a line,
|
||||
and discards the remainder of the line. Returns a value depending on the
|
||||
specified scan type */
|
||||
int scan_value (file ini, void *var, char type)
|
||||
/* Possible values for type
|
||||
'i' for integer
|
||||
'd' for double
|
||||
's' for string
|
||||
*/
|
||||
|
||||
{
|
||||
int ok_scan;
|
||||
int ok=1;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 'i':
|
||||
ok_scan = fscanf(ini.ptr, "%d%*[^\n]",(int*)var);
|
||||
if (ok_scan == 0 || ok_scan == EOF)
|
||||
{
|
||||
printf("Error reading int value from %s ... exiting\n",ini.name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
ok_scan = fscanf(ini.ptr, "%lf%*[^\n]",(double*)var);
|
||||
if (ok_scan == 0 || ok_scan == EOF)
|
||||
{
|
||||
printf("Error reading double value from %s... exiting\n",ini.name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
ok_scan = fscanf(ini.ptr, "%s%*[^\n]",(char*)var);
|
||||
if (ok_scan == 0 || ok_scan == EOF)
|
||||
{
|
||||
printf("Error reading string value from %s... exiting\n",ini.name);
|
||||
ok=0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Invalid type specifier for scan_value ... Exiting\n");
|
||||
ok=0;
|
||||
}
|
||||
return(!ok);
|
||||
}
|
||||
|
||||
/* combines scan_value with file_open for reading a filename from an
|
||||
initialization file and then opening it with a specified access mode */
|
||||
int scan_open (file ini,file *target,char mode)
|
||||
/* Possible values for mode
|
||||
'r' for read binary
|
||||
'i' for read ascii
|
||||
'w' for write binary
|
||||
'o' for write ascii
|
||||
*/
|
||||
{
|
||||
int ok=1;
|
||||
|
||||
if (scan_value(ini,target->name,'s'))
|
||||
{
|
||||
printf("Error reading filename from %s... Exiting\n",ini.name);
|
||||
ok=0;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
if (file_open(target,mode))
|
||||
{
|
||||
ok=0;
|
||||
}
|
||||
}
|
||||
return(!ok);
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
#include <Rcpp.h>
|
||||
#include <numeric>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <ctime>
|
||||
|
||||
|
||||
using namespace Rcpp;
|
||||
using namespace std;
|
||||
extern "C" {
|
||||
void mtc(char*);
|
||||
};
|
||||
|
||||
//' mtclim
|
||||
//'
|
||||
//' This is the core mtclim function
|
||||
//' @importFrom Rcpp evalCpp
|
||||
//' @useDynLib RBBGCMuso
|
||||
//' @param iniFile is the name of the inifile
|
||||
//' @keywords internal
|
||||
//' @export
|
||||
// [[Rcpp::export]]
|
||||
void mtclim(std::string iniFile){
|
||||
char *y = new char[iniFile.length() + 1]; // Allocate memory for char array input
|
||||
std::strcpy(y, iniFile.c_str()); // Copy c++ string to that input.
|
||||
mtc(y);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,29 +0,0 @@
|
||||
/*
|
||||
mtclim43_constants.h
|
||||
physical constants for MTCLIM 4.3
|
||||
|
||||
Peter Thornton
|
||||
NTSG, School of Forestry
|
||||
University of Montana
|
||||
1/20/2000
|
||||
|
||||
(dim) stands for dimensionless values
|
||||
*/
|
||||
|
||||
#define SECPERRAD 13750.9871 /* seconds per radian of hour angle */
|
||||
#define RADPERDAY 0.017214 /* radians of Earth orbit per julian day */
|
||||
#define RADPERDEG 0.01745329 /* radians per degree */
|
||||
#define MINDECL -0.4092797 /* minimum declination (radians) */
|
||||
#define DAYSOFF 11.25 /* julian day offset of winter solstice */
|
||||
#define SRADDT 600.0 /* timestep for radiation routine (seconds) */
|
||||
|
||||
#define MA 28.9644e-3 /* (kg mol-1) molecular weight of air */
|
||||
#define MW 18.0148e-3 /* (kg mol-1) molecular weight of water */
|
||||
#define R 8.3143 /* (m3 Pa mol-1 K-1) gas law constant */
|
||||
#define G_STD 9.80665 /* (m s-2) standard gravitational accel. */
|
||||
#define P_STD 101325.0 /* (Pa) standard pressure at 0.0 m elevation */
|
||||
#define T_STD 288.15 /* (K) standard temp at 0.0 m elevation */
|
||||
#define CP 1010.0 /* (J kg-1 K-1) specific heat of air */
|
||||
#define LR_STD 0.0065 /* (-K m-1) standard temperature lapse rate */
|
||||
#define EPS 0.62196351 /* (MW/MA) unitless ratio of molec weights */
|
||||
#define PI 3.14159265 /* pi */
|
||||
@ -1,35 +0,0 @@
|
||||
/*
|
||||
mtclim43_parameters.h
|
||||
model parameters for MTCLIM 4.3
|
||||
|
||||
Some model parameters are set in the *.ini file. Others are set here.
|
||||
|
||||
Peter Thornton
|
||||
NTSG, School of Forestry
|
||||
University of Montana
|
||||
1/20/2000
|
||||
|
||||
(dim) stands for dimensionless values
|
||||
*/
|
||||
|
||||
/* parameters for the Tair algorithm */
|
||||
#define TDAYCOEF 0.45 /* (dim) daylight air temperature coefficient (dim) */
|
||||
|
||||
/* parameters for the snowpack algorithm */
|
||||
#define SNOW_TCRIT -6.0 /* (deg C) critical temperature for snowmelt */
|
||||
#define SNOW_TRATE 0.042 /* (cm/degC/day) snowmelt rate */
|
||||
|
||||
/* parameters for the radiation algorithm */
|
||||
#define TBASE 0.870 /* (dim) max inst. trans., 0m, nadir, dry atm */
|
||||
#define ABASE -6.1e-5 /* (1/Pa) vapor pressure effect on transmittance */
|
||||
#define C 1.5 /* (dim) radiation parameter */
|
||||
#define B0 0.013 /* (dim) radiation parameter */
|
||||
#define B1 0.201 /* (dim) radiation parameter */
|
||||
#define B2 0.185 /* (dim) radiation parameter */
|
||||
#define RAIN_SCALAR 0.75 /* (dim) correction to trans. for rain day */
|
||||
#define DIF_ALB 0.6 /* (dim) diffuse albedo for horizon correction */
|
||||
#define SC_INT 1.32 /* (MJ/m2/day) snow correction intercept */
|
||||
#define SC_SLOPE 0.096 /* (MJ/m2/day/cm) snow correction slope */
|
||||
|
||||
/* output file extension */
|
||||
#define POSTFIX ".mtc43" /* extension added to output filename prefix */
|
||||
@ -1,138 +0,0 @@
|
||||
#include <Rcpp.h>
|
||||
#include <numeric>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <new>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <ctime>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
using namespace Rcpp;
|
||||
using namespace std;
|
||||
// [[Rcpp::plugins(cpp11)]]
|
||||
|
||||
// [[Rcpp::export]]
|
||||
IntegerVector getWritePositions(double a){
|
||||
//getWritePositions returns abstract rownumbers to rownumbers and other indexek
|
||||
// getWritePositions(173.62) = c(173,7,3) // it supports up to 10 subvalues
|
||||
IntegerVector outVec(3); // outVec is vector of rowIndex, colNumber, choosen Index
|
||||
a = a * 100;
|
||||
a = round(a); //without this line 155.92 ~= 155.9199999999, (int) 155.9199999999*100 = 15591
|
||||
outVec[0] = (int)a / 100;
|
||||
outVec[1] = ((int)a /10) % 10 + 1;
|
||||
outVec[2] = (int)a % 10;
|
||||
|
||||
|
||||
return outVec;
|
||||
}
|
||||
|
||||
IntegerMatrix getPositions(NumericVector v){
|
||||
|
||||
int numVari = v.size();
|
||||
IntegerMatrix indexek(numVari,3);
|
||||
IntegerVector positions(3);
|
||||
for(int i = 0; i < numVari; ++i){
|
||||
positions = getWritePositions(v[i]);
|
||||
indexek(i,_) = positions;
|
||||
}
|
||||
return indexek;
|
||||
}
|
||||
|
||||
|
||||
void goNextLine(std::ifstream& fin){
|
||||
char c='a';
|
||||
while((c!='\n')&&(fin.get(c))){}
|
||||
}
|
||||
|
||||
#define NEXT goNextLine(fin)
|
||||
int fileChanger(std::string inFile, std::string outFile, IntegerVector linum, NumericVector num, IntegerVector colnum, IntegerVector colindex){
|
||||
std::ifstream fin(inFile);
|
||||
if (!fin.is_open()) {
|
||||
stop("Cannot open " + inFile + " for read");
|
||||
}
|
||||
std::ofstream fot(outFile);
|
||||
|
||||
if (!fot.is_open()) {
|
||||
stop("Cannot open " + outFile + " for read");
|
||||
}
|
||||
string tempString;
|
||||
|
||||
int counter = 1;
|
||||
int counterV = 0;
|
||||
while (!fin.eof()) {
|
||||
|
||||
|
||||
if(counter == linum[counterV]){
|
||||
if(colnum[counterV]==1){
|
||||
fot << num[counterV] << "\n";
|
||||
NEXT;
|
||||
} else {
|
||||
double * elements;
|
||||
elements = new double [colnum[counterV]];
|
||||
if(linum[counterV]!=linum[counterV+1]){
|
||||
for(int i=0;i<colnum[counterV];++i){
|
||||
|
||||
fin >> elements[i];
|
||||
|
||||
if(i==colindex[counterV]){
|
||||
elements[i]=num[counterV];
|
||||
}
|
||||
// std::cout << colnum[counterV] << " " << colindex[counterV] << " " << elements[i] << " "<< i <<"\n";
|
||||
// std::cout << colindex[counterV] << getWritePositions(155.92) <<"\n";
|
||||
// std::cout << "======================== \n";
|
||||
fot << elements[i] << '\t';
|
||||
}
|
||||
} else {
|
||||
int k=0;
|
||||
for(int i=0;i<colnum[counterV];++i){
|
||||
|
||||
fin >> elements[i];
|
||||
if(i==colindex[counterV + k]){
|
||||
elements[i]=num[counterV + k];
|
||||
if(linum[counterV +k]==linum[counterV + k + 1]){
|
||||
++k;
|
||||
}
|
||||
}
|
||||
fot << elements[i] << '\t';
|
||||
|
||||
}
|
||||
counterV = counterV + k;
|
||||
}
|
||||
|
||||
fot << "\n";
|
||||
delete [] elements;
|
||||
NEXT;
|
||||
}
|
||||
++counterV;
|
||||
} else {
|
||||
getline(fin,tempString);
|
||||
fot << tempString << "\n";
|
||||
}
|
||||
++counter;
|
||||
if(counter > 1000){
|
||||
stop("You modified a line which has not as many columns as you specified.");
|
||||
}
|
||||
}
|
||||
fin.close();
|
||||
fot.close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//' changeMusoC
|
||||
//'
|
||||
//' This function is fastly randomize values based on min and max values
|
||||
//' @importFrom Rcpp evalCpp
|
||||
//' @useDynLib RBBGCMuso
|
||||
//' @param inFile is the big matrix
|
||||
//' @param outFile is the small matrix
|
||||
//' @export
|
||||
// [[Rcpp::export]]
|
||||
void changeMusoC(std::string inFile, std::string outFile, NumericMatrix inMat){
|
||||
int numChanges = inMat.nrow();
|
||||
IntegerMatrix indexes(numChanges,3);
|
||||
indexes = getPositions(inMat(_,0));
|
||||
fileChanger(inFile,outFile,indexes(_,0),inMat(_,1),indexes(_,1),indexes(_,2));
|
||||
}
|
||||
@ -1,245 +0,0 @@
|
||||
#include <Rcpp.h>
|
||||
#include <numeric>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <ctime>
|
||||
|
||||
|
||||
using namespace Rcpp;
|
||||
using namespace std;
|
||||
// [[Rcpp::plugins(cpp11)]]
|
||||
|
||||
|
||||
|
||||
NumericMatrix randTypeZero(NumericMatrix m){
|
||||
/*
|
||||
A typical matrix like m:
|
||||
|
||||
| INDEX | DEPENDENCE | MIN | MAX |
|
||||
|-------+------------+------+------|
|
||||
| 21 | 0 | 0 | 364 |
|
||||
| 57 | 0 | bkla | asdf |
|
||||
|
||||
This randomization type is the easiest,
|
||||
the function produces a matrix which first
|
||||
column contains the indexes, and the second contains
|
||||
random numbers, which was drawn from uniform distribution
|
||||
with the corresponding min and max parameters, specified
|
||||
by the matrix m.
|
||||
|
||||
*/
|
||||
int n=m.nrow()-1;
|
||||
NumericMatrix M(n+1,2);
|
||||
M(_,0)=m(_,0);
|
||||
for(int i=0;i<=n;++i){
|
||||
double min=m(i,2);
|
||||
double max=m(i,3);
|
||||
M(i,1)=runif(1,min,max)[0];
|
||||
}
|
||||
return M;
|
||||
}
|
||||
|
||||
// [[Rcpp::export]]
|
||||
NumericMatrix randTypeOne(NumericMatrix m){
|
||||
/*
|
||||
The stucture of matrix m here is the same
|
||||
as in randTypeZero.
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
NumericVector dependence=m(_,2);
|
||||
int n=m.nrow()-1;
|
||||
NumericMatrix M(n+1,2);
|
||||
M(_,0)=m(_,0);
|
||||
M(0,1)=runif(1,m(0,2),m(0,3))[0];
|
||||
for(int i=1;i<=n;++i){
|
||||
int dep=m(i,1)-1;
|
||||
double min=max(M(dep,1),m(i,2));
|
||||
double max=m(i,3);
|
||||
M(i,1)=runif(1,min,max)[0];
|
||||
}
|
||||
return M;
|
||||
}
|
||||
|
||||
|
||||
|
||||
IntegerVector orderDec(NumericVector v){
|
||||
//This function is order a vector decreasingly
|
||||
Function f("order");
|
||||
return f(v,_["decreasing"]=1);
|
||||
}
|
||||
|
||||
// NumericMatrix randTypeTwo(NumericMatrix m){
|
||||
// int n=m.nrow()-1;
|
||||
// int N=n-1;
|
||||
// NumericMatrix mv=m(Range(0,(n-1)),_);
|
||||
// NumericVector dependence=m(_,2);
|
||||
// NumericMatrix M(n+1,2);
|
||||
// M(_,0)=m(_,0);
|
||||
// IntegerVector indexes=orderDec(mv(_,2));
|
||||
// NumericVector sorban=mv(_,2);
|
||||
// sorban.sort(true);
|
||||
// NumericVector sor=cumsum(sorban);
|
||||
// sor.sort(true);
|
||||
// for(int i=0;i<=N;++i){
|
||||
// if(i!=N){
|
||||
// mv((indexes[i]-1),3)-= sor[i+1];
|
||||
// }
|
||||
// }
|
||||
|
||||
// double rollingNumber=0;
|
||||
|
||||
// for(int i=0;i<=N;++i){
|
||||
// double minimum=mv((indexes[i]-1),2);
|
||||
// double maximum=mv((indexes[i]-1),3)-rollingNumber;
|
||||
// M(i,1)=runif(1,minimum,maximum)[0];
|
||||
// rollingNumber+=M(i,1);
|
||||
// // cout << "minimum:\t" << minimum << endl;
|
||||
// // cout << "maximum:\t" << maximum << endl;
|
||||
// // cout << "indexes:\t" << indexes[i] << endl;
|
||||
// // cout << "rollingNumber:\t" << rollingNumber << endl;
|
||||
// // cout << "choosen:\t" << M(i,1) <<endl;
|
||||
// // cout << "sor:\t" << sor <<endl;
|
||||
// // cout << "\n\n\n" << mv;
|
||||
// }
|
||||
// M(n,1)=1-rollingNumber;
|
||||
// return M;
|
||||
// }
|
||||
|
||||
|
||||
//[[Rcpp::export]]
|
||||
NumericMatrix randTypeTwo(NumericMatrix m){
|
||||
int n = m.nrow()-1; //Just for optimalization (indexing from 0)
|
||||
int N = n-1; //Just for optimalization (indexing from 0)
|
||||
NumericMatrix mv = m(Range(0,(n-1)),_); // We take off the first n-1 element. What about the last element?????????
|
||||
NumericVector dependence = m(_,2); // Th dependence vector represent the matrix and other information for function based on the elements.
|
||||
NumericMatrix M(n+1,2); // M is the randomizated matrix. It will have n+1 rows (identical to m).
|
||||
M(_,0) = m(_,0); //Insert the indexes
|
||||
IntegerVector indexes = orderDec(mv(_,2)); // Why not use the dependence variable?
|
||||
NumericVector sorban = mv(_,2); // Original ordering of the dependence variable?
|
||||
sorban.sort(true); // With the previous line, it sorts the dependence variable.
|
||||
NumericVector sor=cumsum(sorban); // ?????
|
||||
sor.sort(true); // ??????
|
||||
for(int i=0;i<=N;++i){
|
||||
if(i!=N){
|
||||
mv((indexes[i]-1),3)-= sor[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
double rollingNumber=0;
|
||||
|
||||
for(int i=0;i<=N;++i){
|
||||
double minimum=mv((indexes[i]-1),2);
|
||||
double maximum=mv((indexes[i]-1),3)-rollingNumber;
|
||||
M(i,1)=runif(1,minimum,maximum)[0];
|
||||
rollingNumber+=M(i,1);
|
||||
// cout << "minimum:\t" << minimum << endl;
|
||||
// cout << "maximum:\t" << maximum << endl;
|
||||
// cout << "indexes:\t" << indexes[i] << endl;
|
||||
// cout << "rollingNumber:\t" << rollingNumber << endl;
|
||||
// cout << "choosen:\t" << M(i,1) <<endl;
|
||||
// cout << "sor:\t" << sor <<endl;
|
||||
// cout << "\n\n\n" << mv;
|
||||
}
|
||||
M(n,1)=1-rollingNumber;
|
||||
return M;
|
||||
}
|
||||
|
||||
NumericMatrix randTypeThree(NumericMatrix m){
|
||||
int n=m.nrow()-1;
|
||||
int N=n-1;
|
||||
NumericMatrix mv=m(Range(0,(n-1)),_);
|
||||
NumericVector dependence=m(_,2);
|
||||
NumericMatrix M(n+1,2);
|
||||
M(_,0)=m(_,0);
|
||||
IntegerVector indexes=orderDec(mv(_,2));
|
||||
NumericVector sorban=mv(_,2);
|
||||
sorban.sort(true);
|
||||
NumericVector sor=cumsum(sorban);
|
||||
sor.sort(true);
|
||||
for(int i=0;i<=N;++i){
|
||||
if(i!=N){
|
||||
mv((indexes[i]-1),3)-= sor[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
double rollingNumber=0;
|
||||
|
||||
for(int i=0;i<=N;++i){
|
||||
double minimum=mv((indexes[i]-1),2);
|
||||
double maximum=mv((indexes[i]-1),3)-rollingNumber;
|
||||
M(i,1)=runif(1,minimum,maximum)[0];
|
||||
rollingNumber+=M(i,1);
|
||||
// cout << "minimum:\t" << minimum << endl;
|
||||
// cout << "maximum:\t" << maximum << endl;
|
||||
// cout << "indexes:\t" << indexes[i] << endl;
|
||||
// cout << "rollingNumber:\t" << rollingNumber << endl;
|
||||
// cout << "choosen:\t" << M(i,1) <<endl;
|
||||
// cout << "sor:\t" << sor <<endl;
|
||||
// cout << "\n\n\n" << mv;
|
||||
}
|
||||
M(n,1)=1-rollingNumber;
|
||||
return M;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NumericMatrix copyMatSpec(NumericMatrix A, NumericMatrix B, int u, int v){
|
||||
int k=0;
|
||||
for(int i=u;i<=v;++i){
|
||||
A(i,_)=B(k,_);
|
||||
k+=1;
|
||||
}
|
||||
return A;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//' musoRandomizer
|
||||
//'
|
||||
//' This function is fastly randomize values based on min and max values,
|
||||
//' and row indexes.
|
||||
//' @importFrom Rcpp evalCpp
|
||||
//' @useDynLib RBBGCMuso
|
||||
//' @param A is the big matrix
|
||||
//' @param B is the small matrix
|
||||
//' @export
|
||||
// [[Rcpp::export]]
|
||||
NumericMatrix musoRandomizer(NumericMatrix A, NumericMatrix B){
|
||||
NumericMatrix M(A.nrow(),2);
|
||||
int nGroup = B.nrow()-1;
|
||||
int k=0;
|
||||
for(int i=0;i<=nGroup;++i)
|
||||
{
|
||||
int b=B(i,0)-1;
|
||||
int till=b+k;
|
||||
int t=B(i,1);
|
||||
// cout << b << "\t" << t <<endl;
|
||||
switch(t){
|
||||
case 0:
|
||||
M=copyMatSpec(M,randTypeZero(A(Range(k,till),_)),k,till);
|
||||
// cout << M << endl;
|
||||
break;
|
||||
case 1:
|
||||
M=copyMatSpec(M,randTypeOne(A(Range(k,till),_)),k,till);
|
||||
// cout << M << endl;
|
||||
break;
|
||||
case 2:
|
||||
M=copyMatSpec(M,randTypeTwo(A(Range(k,till),_)),k,till);
|
||||
// cout << M << endl;
|
||||
break;
|
||||
}
|
||||
k=till+1;
|
||||
// cout << k << endl;
|
||||
}
|
||||
return M;
|
||||
}
|
||||
|
||||
std::string concatenate(std::string A, std::string B){
|
||||
std::string C = A + B;
|
||||
return C;
|
||||
}
|
||||
140
README.org
140
README.org
@ -5,9 +5,9 @@
|
||||
* The RBBGCMuso Package
|
||||
#+AUTHOR: Roland HOLLÓS, Dóra HIDY, Zoltán BARCZA
|
||||
|
||||
*Current version: 0.6.3.0*
|
||||
*Current version: 0.7.0*
|
||||
|
||||
RBBGCMuso is an R package which supports the easy but powerful application of the [[http://agromo.agrar.mta.hu/bbgc/][Biome-BGCMuSo]] biogeochemical model in R environment. It also provides some additional tools for the model such as Biome-BGCMuSo optimized Monte-Carlo simulation and global sensitivity analysis. If you would like to use the framework, please read the following description.
|
||||
RBBGCMuso is an R package which supports the easy but powerful application of the [[http://agromo.agrar.mta.hu/bbgc/][Biome-BGCMuSo]] biogeochemical model in R environment. It also provides some additional tools for the model such as Biome-BGCMuSo optimized Monte-Carlo simulation and global sensitivity analysis. If you would like to use the framework, please read the following description. Note that we recommend to use [[http://agromo.agrar.mta.hu/bbgc/download.html][Biome-BGCMuSo v6.1]] with RBBGCMuSo.
|
||||
|
||||
** Installation
|
||||
You can install the RBBGCMuso package in several ways depending on the operating system you use. Up to now RBBGCMuso was tested only in Linux and MS Windows environment, so Mac OS X compatibility cannot be guaranteed yet. In MS Windows you can install the package from binary or from source installer. In Linux you can only install the software from source.
|
||||
@ -16,24 +16,24 @@ You can install the RBBGCMuso package in several ways depending on the operating
|
||||
*Note that in MS Windows first you have to install the [[https://cran.r-project.org/bin/windows/Rtools/][Rtools]] Windows software.*
|
||||
If you would like to install the RBBGCMuso package from Source, you have two options.
|
||||
a) Clone this repository, then build and run the package (further information is available here: [[http://kbroman.org/pkg_primer/pages/build.html][package build and install]])
|
||||
OR
|
||||
b) Install the devtools package first:
|
||||
or
|
||||
b) Install the devtools package first (recommended):
|
||||
#+BEGIN_SRC R :eval no
|
||||
install.packages("devtools")
|
||||
#+END_SRC
|
||||
|
||||
Then copy the following line into the R session and execute it:
|
||||
#+BEGIN_SRC R :eval no
|
||||
devtools::install_github("hollorol/RBBGCMuso/RBBGCMuso")
|
||||
devtools::install_github("hollorol/RBBGCMuso/RBBGCMuso",upgrade="never")
|
||||
#+END_SRC
|
||||
|
||||
In Debian (version 8+) you can automate the whole installation process with curl via copying the following line into the Linux terminal:
|
||||
If you use Linux, with Debian (version 8+) you can automate the whole installation process with curl via copying the following line into the Linux terminal:
|
||||
#+BEGIN_SRC bash :eval no
|
||||
bash <(curl -s https://raw.githubusercontent.com/hollorol/RBBGCMuso/Documentation/debianInstaller.sh)
|
||||
#+END_SRC
|
||||
|
||||
*** Installation in MS Windows
|
||||
You can also install the latest RBBGCMuso by copying the following line into the R console (using R or RStudio):
|
||||
*** Installation in MS Windows (only for experts)
|
||||
Alternatively, you can also install the latest RBBGCMuso by copying the following line into the R console (using R or RStudio):
|
||||
#+BEGIN_SRC R :eval no
|
||||
source("https://raw.githubusercontent.com/hollorol/RBBGCMuso/master/installWin.R")
|
||||
#+END_SRC
|
||||
@ -46,7 +46,7 @@ To start using RBBGCMuso you have to load the package in R with the following co
|
||||
library(RBBGCMuso)
|
||||
#+END_SRC
|
||||
|
||||
In order to use the RBBGCMuso framework, you have to set up the environment, as you would normally do if you use the model without the RBBGCMuso framework. It means that according to the Biome-BGCMuSo terminology you have to have the proper INI file set, the meteorology input file, and the ecophysiological constants file (EPC) as minimum input. Additional files might be included by the user including nitrogen deposition, management handlers, etc. Please read the corresponding documentation in the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v5.pdf][actual Biome-BGCMuSo User's Guide]].
|
||||
In order to use the RBBGCMuso framework, you have to set up the environment, as you would normally do when you use the model without the RBBGCMuso framework. It means that according to the Biome-BGCMuSo terminology you have to have the proper INI file set, the meteorology input file, the soil input file, and the ecophysiological constants file (EPC) as minimum input. Additional files might be included by the user including nitrogen deposition, management handlers, etc. Please read the corresponding documentation in the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v6.1.pdf][actual Biome-BGCMuSo User's Guide]].
|
||||
|
||||
If you do not yet have a complete, operational model input dataset, you may want to use the so-called copyMusoExampleTo function (part of RBBGCMuso) which downloads a complete sample simulation set to your hard drive:
|
||||
|
||||
@ -54,22 +54,23 @@ If you do not yet have a complete, operational model input dataset, you may want
|
||||
copyMusoExampleTo()
|
||||
#+END_SRC
|
||||
|
||||
Once this command is executed in R it will invoke a small Graphical User Interface (GUI) where you can select the target site for the sample simulation. At present only "hhs" site is available, which is the abbreviation of the Hegyhátsál eddy covariance station in Hungary. After selecting the site (hhs in this example) the GUI will ask the user to specify a directory (=folder) where the dataset will be stored. In this example we suppose that the user works under MS Windows, and he/she created a directory called C:\model as target directory. It means that after selection of the site the user will select the C:\model directory.
|
||||
Once this command is executed in R, it will invoke a small Graphical User Interface (GUI) where you can select the target site for the sample simulation. At present only the "hhs" site is available, which is the abbreviation of the Hegyhátsál eddy covariance station in Hungary. After selecting the site (hhs in this example) the GUI will ask the user to specify a directory (=folder) where the dataset will be stored. In this example we suppose that the user works under MS Windows, and he/she created a directory called C:\model as target directory. It means that after selection of the site the user will select the C:\model directory.
|
||||
Once the copyMusoExampleTo command is finished, the model input dataset and the model executable (called muso.exe and cygwin1.dll) are available in the C:\model folder. The user might check the content of the files using his/her favourite text editor (we propose Editpad Lite as it can handle both Windows and Linux text files). Note that file extension might be hidden by Windows which could cause problems, so we propose to adjust Windows so that file extensions are visible. Visit [[https://www.thewindowsclub.com/show-file-extensions-in-windows][this website]] to learn how to show file extensions in Windows.
|
||||
|
||||
In this example the C:\model directory will contain the following files:
|
||||
- muso.exe - this is the Biome-BGCMuSo 5.0 model executable for Windows (version might change in the future)
|
||||
- muso - this is the model executable for Linux
|
||||
- muso.exe - this is the Biome-BGCMuSo 6.1 model executable for Windows (version might change in the future)
|
||||
- cygwin1.dll - a so-called DLL file that supports the model execution under Windows
|
||||
- c3grass.epc - ecophysiological constants input file for the model (C3 grass in this case)
|
||||
- maize.epc - another ecophysiological constants input file (C4 maize in this case)
|
||||
- c3grass_muso6.epc - ecophysiological constants input file for the model (C3 grass in this case)
|
||||
- n.ini - initialization file for the model, normal mode (INI file controls the entire simulation)
|
||||
- grass_normal.ini - another initialization file for the model, for the C3 grass simulation
|
||||
- s.ini - initialization file for the model spinup (also known as self-initialization or equilibrium run)
|
||||
- parameters.csv - a simple text file to support parameter sweep and sensitivity analysis (see below)
|
||||
- hhs_1961-2014.mtc43 - meteorology input file; in this example this file is used for spinup simulation
|
||||
- hhs_2013-2016.mtc43 - meteorology input file for the normal simulation
|
||||
- CO2_from1961.txt - CO_{2} file for the transient simulation
|
||||
- hhs.soi - soil file for the Hegyhátsál simulation
|
||||
- hhs.mtc43 - meteorology input file
|
||||
- hhs.mgm - management definition file for the simulation
|
||||
- hhs.mow - ancillary management file for mowing
|
||||
- Ndep.txt - Nitrogen deposition file for the simulation
|
||||
- CO2.txt - CO_{2} file for the simulation
|
||||
- parameters.csv - parameter interval file for the sensitivity analysis and optimization
|
||||
- HU-He2_2012_MEASURED.txt - sample observation file for the Hegyhátsál site (eddy covariance data for 2012)
|
||||
|
||||
In the followings we will demonstrate the usability of RBBGCMuso with the hhs example dataset. If you have your own model input data set, you might need to change the commands accordingly.
|
||||
|
||||
@ -86,7 +87,7 @@ In our example s.ini and n.ini follows this convention, so by default RBBGCMuso
|
||||
|
||||
*** Running the model
|
||||
|
||||
Now as we have a complete set of input data, we are ready to run the model. You can run the model in spinup model, in normal mode, or in both phases (including the so-called transient run; see the Biome-BGCMuSo User's Guide). Using the runMuso functcion (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase, and you can also simplify the execution of both phases consecutively. Note that runMuso is the same as the obsolete calibMuso function.
|
||||
Now as we have a complete set of input data, we are ready to run the model. You can run the model in spinup mode, in normal mode, or in both phases (including the so-called transient run; see the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v6.1.pdf][Biome-BGCMuSo User's Guide]]). Using the runMuso function (that is part of RBBGCMuso) you will be able to execute the the model in both spinup or normal phase, and you can also simplify the execution of both phases consecutively. (Note that runMuso is the same as the obsolete calibMuso function.)
|
||||
|
||||
In order to execute the simulation, first you have to set the working directory in R so that RBBGCMuso will find the model and the input files. In our example this is as follows:
|
||||
|
||||
@ -96,33 +97,33 @@ setwd("c:/model")
|
||||
|
||||
(Note the "/" symbol which is different from the "\\" that is typically used in Windows!)
|
||||
|
||||
In order to run the model as it is provided simply use the following command in R or RStudio:
|
||||
In order to run the model as it is provided, simply use the following command in R or RStudio:
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
runMuso(skipSpinup = FALSE)
|
||||
#+END_SRC
|
||||
|
||||
Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. Note that according to the naming convention described above the model will use s.ini and n.ini for spinup and normal phase, repsectively (this can be changed with the parameters of runMuso). It means that the 3rd ini file is not used in this case (grass_normal.ini). As n.ini represents a maize simulation, the results will provide simulation data on C4 maize monoculture with predefined management defined by the n.ini file.
|
||||
Note that by default runMuso skips the spinup simulation (in order to speed up the model execution), but in our case we do not yet have the result of the spinup run (the so-called endpoint file which is the initial condition for the normal simulation), so spinup simulation is obligatory. This is performed with the skipSpinup=FALSE parameter. Note that according to the naming convention described above, the model will use s.ini and n.ini for spinup and normal phase, repsectively (this can be changed with the parameters of runMuso if needed). As n.ini represents a grass simulation, the results will provide simulation data on C3 grass ecosystem with management defined by the hhs.mgm file.
|
||||
|
||||
If the simulation is successful, the results can be found in the C:\model directory. In our example two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run. (Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. Also note that in the hhs example file set binary daily output is created and further processed by RBBGCMuso. One of the most attractive features of RBBGCMuso is that the model output is handled by the package which means that it will be directly available for the user as a variable for further processing in R.
|
||||
If the simulation is successful, the results can be found in the C:\model directory. In our example two files were created with .log extension that contain some information about the spinup and the normal phase. The hhs.endpoint file is the result of the spinup (and optional transient) run, and can be considered as initial conditions for the normal run. (Here we have to note that now runMuso can be called without the skipSpinup parameter which means that the simulation will be restricted to the normal phase only.) The results of the simulation (carbon fluxes, state variables, whatever was set by the user in the DAILY_OUTPUT block of the normal INI file) are available in the file hegyhatsal.dayout. Note that annual output was not requested in this case. Also note that in the hhs example file set binary daily output is created and further processed by RBBGCMuso. One of the most attractive features of RBBGCMuso is that the model output is handled by the package which means that it will be directly available for the user as a variable for further processing in R environment.
|
||||
|
||||
*** Visualization of the model output
|
||||
|
||||
Once the simulation is completed (hopefully without errors), we can visualize the results. Biome-BGCMuSo provides large flexibility on model output selection, which means that the results will depend on the settings of the user in the normal INI file (DAILY_OUTPUT block). In our hhs example 39 variables are calculated in daily resolution. As the model is run for 4 years by the normal INI file, each output variable will be available for 4x365 days (note the handling of leap years in the Biome-BGCMuSo User's Guide).
|
||||
Once the simulation is completed (hopefully without errors), we can visualize the results. Biome-BGCMuSo provides large flexibility on model output selection, which means that the results will depend on the settings of the user in the normal INI file (DAILY_OUTPUT block; see below). In our hhs example 12 variables are calculated in daily resolution. As the model is run for 9 years by the normal INI file, each output variable will be available for 9x365 days (note the handling of leap years in the [[http://agromo.agrar.mta.hu/bbgc/files/Manual_BBGC_MuSo_v6.1.pdf][Biome-BGCMuSo User's Guide]]).
|
||||
|
||||
Assume that we would like to visualize Gross Primary Production (GPP) for one simulation year (this is the 26th variable in the n.ini file). This can be achieved by the following commands. First we re-run the normal phase and redirect the output to the R variable called 'results':
|
||||
Assume that we would like to visualize Gross Primary Production (GPP) for one simulation year (this is the 2nd variable in the n.ini file; see below). This can be achieved by the following commands. First we re-run the normal phase and redirect the output to the R variable called 'results':
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
results<-runMuso()
|
||||
#+END_SRC
|
||||
|
||||
Now we extract the 26th variable from the complete output set and call this R variable as gpp:
|
||||
Now we extract the 2nd variable from the complete output set and call this R variable as gpp:
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
gpp<-results[,26]
|
||||
gpp<-results[,2]
|
||||
#+END_SRC
|
||||
|
||||
Now we are ready to visualize the results, first for all 4 years:
|
||||
Now we are ready to visualize the results, first for all 9 years:
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
plot(gpp*1000)
|
||||
@ -145,20 +146,89 @@ plot(gpp4*1000,type="l")
|
||||
|
||||
Advanced visualization of the results is possible with plotMuso.
|
||||
|
||||
*** Selection of output variables
|
||||
|
||||
The visualization example above used the Hegyhátsál sample simulation with the predefined output variables that we included in the initialization file of the normal phase. The available output variables can be checked by the user by opening the n.ini file (normal phase initialization file) with a text editor (e.g. Notepad, or our favourite EditPad Lite). Check the DAILY_OUTPUT block within the n.ini. This should look like this (with more spaces between the numbers and the descriptors):
|
||||
|
||||
#+BEGIN_SRC text
|
||||
DAILY_OUTPUT
|
||||
12 number of daily output variables
|
||||
2520 proj_lai
|
||||
3009 daily_GPP
|
||||
3014 daily_Reco
|
||||
171 evapotransp
|
||||
2502 n_actphen
|
||||
2603 vwc00-03cm
|
||||
2604 vwc03-10cm
|
||||
2605 vwc10-30cm
|
||||
75 GDD
|
||||
2636 rooting_depth
|
||||
2716 m_soilstress
|
||||
671 m_vegc_to_SNSC
|
||||
#+END_SRC
|
||||
|
||||
Note the number right below the DAILY_OUTPUT line that indicates the number of selected output variables. If you decide to change the number of output variables, the number (currently 12) should be adjusted accordingly. At present the R package handles only daily output data, but the user should acknowledge the optional annual output set in the ini file as well.
|
||||
Biome-BGCMuSo offers a large number of posible output variables. The full list of variables are available at the website of the model as an Excel file: http://agromo.agrar.mta.hu/bbgc/files/MUSO6.1_variables.xlsx
|
||||
|
||||
Selection of output variables is primarily driven by the need of the user: it depends on the process that the user would like to study. We made an effort to provide all possible variables that are comparable with the observations.
|
||||
One might be interested in carbon fluxes like Net Ecosystem Exchange (NEE), Gross Primary Production (GPP), total ecosystem respiation (Reco, all comparable with eddy covariance measurements), evapotransporation (ET), Net Primary Production (NPP), soil organic carbon (SOC) content, leaf area index (LAI), aboveground woody biomass and coarse woody debris in forests, crop yield, rooting depth, aoveground or total biomass for herbaceous vegetation, litter, soil respiration, soil water content for 10 soil layers, soil N2O efflux, etc.
|
||||
|
||||
Below we list the most common output variables that can be calculated by the model.
|
||||
|
||||
#+BEGIN_SRC text
|
||||
50 tsoil[0] - soil temperature of the topmost soil layer (0-3 cm) [Celsius]
|
||||
171 evapotranspiration [kgH2O/m2/day, equivalent with mm/day]
|
||||
518 soil1c_total - total soil organic carbon content in the 1st soil pool [kgC/m2]
|
||||
519 soil2c_total - total soil organic carbon content in the 2nd soil pool [kgC/m2]
|
||||
520 soil3c_total - total soil organic carbon content in the 3rd soil pool [kgC/m2]
|
||||
521 soil4c_total - total carbon content in the recalcitrant SOC pool [kgC/m2]
|
||||
3061 total soilc - total SOC pool [kgC/m2]
|
||||
313 fruitc - carbon content of the fruit/yield pool [kgC/m2] (this is used for frop yield estimation)
|
||||
2527 plant height [m]
|
||||
2528 NDVI [dimless]
|
||||
2520 proj_lai - this is what we typically refer as Leaf Area Index (LAI) [m2/m2]
|
||||
2603 vwc[0] - volumetric soil water content of the 1st layer (0-3 cm) [m3/m3]
|
||||
2604 vwc[1] - volumetric soil water content of the 2nd layer (3-10 cm) [m3/m3]
|
||||
2605 vwc[2] - volumetric soil water content of the 3rd layer (10-30 cm) [m3/m3]
|
||||
2606 vwc[3] - volumetric soil water content of the 4th layer (30-60 cm) [m3/m3]
|
||||
2607 vwc[4] - volumetric soil water content of the 5th layer (60-90 cm) [m3/m3]
|
||||
2608 vwc[5] - volumetric soil water content of the 6th layer (90-120 cm) [m3/m3]
|
||||
2609 vwc[6] - volumetric soil water content of the 7th layer (120-150 cm) [m3/m3]
|
||||
3006 daily_npp - daily Net Primary Production [kgC/m2/day]
|
||||
3005 daily_nep - daily Net Ecosystem Production (estimated by -NEE) [kgC/m2/day]
|
||||
3009 daily_gpp - daily Gross Primary Production [kgC/m2/day]
|
||||
3037 cum_yieldC_HRV - harvested fruit that is crop yield in case of croplands [kgC/m2]
|
||||
75 GDD - growing degree day, used for the phenophase length calculations
|
||||
1531 SUM of the soil mineral NH4+ in the total soil column [kgN/m2]
|
||||
1532 SUM of the soil mineral NO3- in the total soil column [kgN/m2]
|
||||
3013 daily soil respiration [kgC/m2/day]
|
||||
307 leafC - total leaf carbon content [kgC/m2]
|
||||
310 fine root C - total fine root carbon content [kgC/m2]
|
||||
316 soft stem C - total soft stem carbon content [kgC/m2] (only for herbaceous vegetation)
|
||||
407 standing dead biomass [kgC/m2] - that is the inactive standing plant pool not yet part of the litter pool
|
||||
319 livestemC - aboveground live woody biomass [kgC/m2]
|
||||
322 deadstemC - aboveground dead woody biomass [kgC/m2]
|
||||
3160 total abovegound woody biomass C [kgC/m2]
|
||||
401 CWD - coarse woody debris [kgC/m2]
|
||||
#+END_SRC
|
||||
|
||||
A note from the Biome-BGC User's Guide: "Livewood is defined as the actively respiring woody tissue, that is, the lateral sheathing meristem of phloem tissue, plus any ray parenchyma extending radially into thexylem tissue. Deadwood consists of all the other woody material, including the heartwood, the xylem, and the bark." In this sense aboveground woody biomass can be calculated as the sum of output variables 319 and 322 (plus the corresponding storage/transfer pools). For convenience, variable 3160 can be used as it represents the sum of 319 and 322 plus the related storage/transfer pools.
|
||||
|
||||
|
||||
*** Perform Quick experiments
|
||||
|
||||
Assume that we would like to dig a bit deeper with the model and understand the effect of changing ecophysiological variables on the model results. This can easily be performed with RBBGCMuso. Execute the following command in R/RStudio:
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
musoQuickEffect(calibrationPar = 25, startVal = 0, endVal = 9, nSteps = 5, outVar = 3009)
|
||||
musoQuickEffect(calibrationPar = 13, startVal = 0, endVal = 9, nSteps = 5, outVar = 3009)
|
||||
#+END_SRC
|
||||
|
||||
This command selects the 25th line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 26th variable), so the effect of varying base temperature on GPP is calculated using 5 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values.
|
||||
This command selects the 13th line in the ecophysiological constants (EPC) file (this is base temperature), then it starts to replace the original value from 0 to 9 in 5 consecutive steps. In this example GPP is selected (variable number 3009, which is the 2nd variable), so the effect of varying base temperature on GPP is calculated using 5 simulations. The result is a spectacular plot where color coding is used distinguish the parameter values.
|
||||
At present musoQuickEffect is not usable for the allocation parameters due to restrictions of the allocation fractions.
|
||||
|
||||
*** Study the effect of ecophysiological parameters using paramSweep
|
||||
|
||||
The paramSweep function is the extension of the musoQuickEffect. It can test the effect of the multiple selected parameters on the model results in once. The result of the paramSweep function is a single HTML file with embedded images. paramSweep needs a csv file called parameters.csv which defines the parameters of interest and the corresponding parameter intervals. In case of the hhs sample dataset there is an example parameters/csv file (please open it and check). The structure of the parameters.csv file is simple. First, parameter name is needed (it can be anything but should refer to the parameter), then the line number of the EPC file is provided, then the possible minimum and maximum value of the parameter is given. Note that there is a tricky part in the parameters.csv as the parameter selection is not straightforward in case of multiple columns (see the end of the EPC file). The logic is that fractinal part of a number is used to select the appropriate parameter from multiple columns. In the provided example "emergence,170.61,0,1000" means that in the 170th line of the EPC file there are 7 columns (numbering starts from 0, so it is 6), and we would like to adjust the 2nd column (marked by 1), which ends up with 170.61. 0,1000 means that sweep starts at 0 and ends with 1000. Invoke the paramSweep with simply issuing this command:
|
||||
The paramSweep function is the extension of the musoQuickEffect. It can test the effect of the multiple selected parameters on the model results in once. The result of the paramSweep function is a single HTML file with embedded images. paramSweep needs a csv file called parameters.csv which defines the parameters of interest and the corresponding parameter intervals. In case of the hhs sample dataset there is an example parameters.csv file (please open it and check). The structure of the parameters.csv file is simple. First, parameter name is needed (it can be anything but should refer to the parameter), then the line number of the EPC file is provided, then the possible minimum and maximum value of the parameter is given. Note that there is a tricky part in the parameters.csv as the parameter selection is not straightforward in case of multiple columns (see the end of the EPC file!). The logic is that fractinal part of a number is used to select the appropriate parameter from multiple columns. For example, "emergence,127.61,0,1000" means that in the 127th line of the EPC file there are 7 columns (numbering starts from 0, so it is 6), and we would like to adjust the 2nd column (marked by 1), which ends up with 127.61. 0,1000 means that sweep starts at 0 and ends with 1000. Invoke the paramSweep with simply issuing this command:
|
||||
|
||||
#+BEGIN_SRC R :eval no
|
||||
paramSweep()
|
||||
@ -169,14 +239,18 @@ In advanced mode there is possibility to select the parameters.csv file using th
|
||||
|
||||
*** Sensitivity analysis
|
||||
|
||||
Advanced sensitivity analysis is possible with the musoSensi function of RBBGCMuso. [[http://agromo.agrar.mta.hu/files/musoSensi_usage_v6_FINAL.pdf][See this link to read the manual of the sensitivity analysis.]]
|
||||
Advanced sensitivity analysis is possible with the musoSensi function of RBBGCMuso. [[http://agromo.agrar.mta.hu/files/musoSensi_usage.html][Visit this link to read the manual of the sensitivity analysis.]]
|
||||
Note that parameters.csv is provided in the hhs example dataset, so you don't have to create it manually.
|
||||
|
||||
*IMPORTANT NOTE: If the result file contains only NAs it means that none of the parameters affected the output variable of interest. In this case you need to adjust the output parameter selection or the EPC parameter list. A simple example for this is soil temperature which is not affected by some of the plant parameters. [[https://github.com/hollorol/RBBGCMuso/issues/3][See this link for further details.]]
|
||||
|
||||
*** Parameter estimation (calibration)
|
||||
|
||||
RBBGCMuso supports parameter estimation (also called as model optimization or calibration) based on the so-called GLUE method. GLUE uses observations and the optimization is driven by the parameter intervals file that is described above (parameters.csv). Detailed description of the GLUE based optimization method will be published soon. Please contact the authors of the package for sample R scripts that executes the GLUE-based parameter estimation.
|
||||
|
||||
*** Contact
|
||||
|
||||
E-mail: hollorol@gmail.com
|
||||
E-mail: Roland HOLLÓS: hollorol@gmail.com; Zoltán BARCZA: zoltan.barcza@ttk.elte.hu
|
||||
|
||||
** Acknowledgements
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user