dynacof_i.jl: Step-by-step 'dynacof.jl()'

Description Usage Arguments Value Fields Examples

View source: R/4-dynacof_julia.R

Description

Using DynACof one iteration after another using the julia version of DynACof, DynACof.jl. Allows to run a DynACof simulation with starting at age > 0 with initializations.

Usage

1

Arguments

i

Either an integer, or a range giving the day of simulation needed. Match the row index, so i=1 make a simulation for the first row of Sim and Met.

S

The simulation list, output of dynacof.jl(). It is mandatory that S come from a dynacof.jl() simulation because the parameters linked to a simulation have either R or Julia code affiliated to the simulation.

Value

The modified simulation list S

Fields

Careful

Always call dynacof.jl_setup() before runnning dynacof_i.jl. See example.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 
# Setting up julia + DynACof.jl:
dynacof.jl_setup()

# Making a regular simulation using example data:
# First, downloading an example meteorology file:
met_file= tempfile()
m= "https://raw.githubusercontent.com/VEZY/DynACof.jl_inputs/master/meteorology.txt"
download.file(m,met_file)


S= dynacof.jl(Inpath= dirname(met_file), FileName=list(Site="package",Meteo=basename(met_file),
                                                       Soil="package",Coffee="package",Tree=NULL))
unlink(met_file)

# Value of the maintenance respiration for coffee on day i=100:
i= 100
S$Sim$Rm[i]

# Changing the value of Tair in the meteorology for day 100:
S$Meteo$Tair[i]= S$Meteo$Tair[i]+10.0

S= dynacof_i(i,S)

# New value of the maintenance respiration for coffee:
S$Sim$Rm[i]

# To re-run DynACof for several days, use a range for i:
S= dynacof_i(i:(i+10),S)

## End(Not run)

VEZY/DynACof documentation built on Feb. 3, 2021, 8:52 p.m.