library(geotopbricks)
#Simulation working path
wpath <-
'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3'
## URL path (RAW VERSION) of
## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/panola13_run2xC_test3
## This step allows to put all keywords with their value in memory:
## it not mandataory but it can save running time in the session
inpts.frame <- declared.geotop.inpts.keywords(wpath=wpath)
cond.time <- system.time({
prefix <- get.geotop.inpts.keyword.value("SoilLiqWaterPressTensorFile",wpath=wpath,
inpts.frame=inpts.frame)
layers <- get.geotop.inpts.keyword.value("SoilLayerThicknesses",numeric=TRUE,wpath=wpath,
inpts.frame=inpts.frame)
names(layers) <- paste("L",1:length(layers),sep="",
inpts.frame=inpts.frame)
##### set van genuchten parameters to estimate water volume
theta_sat <- get.geotop.inpts.keyword.value("ThetaSat",numeric=TRUE,wpath=wpath,
inpts.frame=inpts.frame)
theta_res <- get.geotop.inpts.keyword.value("ThetaRes",numeric=TRUE,wpath=wpath,
inpts.frame=inpts.frame)
alphaVG <- get.geotop.inpts.keyword.value("AlphaVanGenuchten",
numeric=TRUE,wpath=wpath,inpts.frame=inpts.frame) # expressed in mm^-1
nVG <- get.geotop.inpts.keyword.value("NVanGenuchten",numeric=TRUE,wpath=wpath,
inpts.frame=inpts.frame)
##### end set van genuchten parameters to estimate water volume
})
cond2.time <- system.time({
if (cond.time[["elapsed"]]<0.01) {
# \donttest{
##### spatial gridded covarege data (raster)
slope <- get.geotop.inpts.keyword.value("SlopeMapFile",raster=TRUE,wpath=wpath,
inpts.frame=inpts.frame)
bedrock_depth <- get.geotop.inpts.keyword.value("BedrockDepthMapFile",raster=TRUE,
wpath=wpath,
inpts.frame=inpts.frame)
# }
}
})
cond3.time <- system.time({
if (cond2.time[["elapsed"]]<1) {
# \donttest{
##### meteo data
tz <- "Etc/GMT-1" ## See help(timezones) In particular:
## Most platforms support time zones of the form Etc/GMT+n
## and Etc/GMT-n (possibly also without prefix Etc/),
## which assume a fixed offset from UTC (hence no DST).
## Contrary to some expectations
## (but consistent with names such as PST8PDT), negative offsets are times ahead of (east of) UTC,
## positive offsets are times behind (west of) UTC.
start <- get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm",
date=TRUE,wpath=wpath,tz=tz,inpts.frame=inpts.frame)
end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm",
date=TRUE,wpath=wpath,tz=tz,inpts.frame=inpts.frame)
nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations",
numeric=TRUE,wpath=wpath,inpts.frame=inpts.frame)
level <- 1:nmeteo
## set meteo data
meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE,
level=level,start_date=start,end_date=end,tz=tz,inpts.frame=inpts.frame)
# }
##### end set meteo data
## IMPORTING AN OUTPUT SOIL MOISTURE PROFILE:
wpath <- paste0(
'https://raw.githubusercontent.com/ecor/geotopbricks_doc/',
'master/simulations/Muntatschini_pnt_1_225_B2_004')
## URL Path (RAW VERSION) of
## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/Muntatschini_pnt_1_225_B2_004
# \donttest{
SMC <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile",
wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.",
formatter="%04d")
SMCz <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile",
wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.",
formatter="%04d",zlayer.formatter="z%04d")
# }
}
})
Run the code above in your browser using DataLab