Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Overview

TREES: The Terrestrial Regional Ecosystem Exchange Simulator (TREES) is a dynamic biophysical process based simulation model.

The current module was built from the TREES Workshop 2020. This site contains tutorial notes with examples, and additional documentation.

Using

Use the module name trees to discover versions available and to load the application.

Retrieving the 2020 Workshop:

You do not have to build the trees software as we have installed it as a module, but if you want to retrieve the workshop, that contains tutorials, examples and documentation, then from a folder of your choosing, from the command line you can git clone the repository. The example below demonstrates the output you should see, obviously the folder paths will be different, but gives you something to follow/compare.

[salexan5@tlog1 trees]$ pwd
/project/arcc/salexan5/apps/trees

[salexan5@tlog1 trees]$ git clone https://github.com/dscottmackay/TREES-Workshop-2020.git
Cloning into 'TREES-Workshop-2020'...
remote: Enumerating objects: 87, done.
remote: Counting objects: 100% (87/87), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 329 (delta 34), reused 25 (delta 10), pack-reused 242
Receiving objects: 100% (329/329), 21.67 MiB | 32.16 MiB/s, done.
Resolving deltas: 100% (123/123), done.

[salexan5@tlog1 trees]$ ls
TREES-Workshop-2020

[salexan5@tlog1 trees]$ cd TREES-Workshop-2020/
[salexan5@tlog1 TREES-Workshop-2020]$ ls
Documents  easyR_TREES  Examples  Graphics  Model-Code  README.md  Rscripts  TREES_tutorial_2021.docx  TREES_tutorial_2021.pdf

Running an Example

If you are following the tutorial, then the example below is slightly different. Since we have loaded trees3 as a module you do not have the make it (we’ve taken care of that for you), and the command is available on your general path so you do not have to add .. and forward slashes in your command line to run it.

[salexan5@tlog1 TREES-Workshop-2020]$ ls
Documents  easyR_TREES  Examples  Graphics  Model-Code  README.md  Rscripts  TREES_tutorial_2021.docx  TREES_tutorial_2021.pdf

[salexan5@tlog1 TREES-Workshop-2020]$ module load trees/3

[salexan5@tlog1 Brassica]$ ls
cc_lowN.p  cc.p  cc_ww_drivers_drought_validation.txt  covfile1  in_cc_lowN.txt  in_cc_ww.txt  param_mod  README

[salexan5@tlog1 Brassica]$ trees3 < in_cc_ww.txt
Input data file: Number of time steps to aggregate for MCMC evaluations (suggest 1, 2, 4, 6, 8, 12):cc_ww_drivers_drought_validation.txt contains 16 variables 768 data points
1 steps will be aggregated to produce 768 data points for evaluation
Parameter file: cc.p OK
Shoot and Root Modules File Name: Output file: cc_ww_drought_valid_expt
50      20      0.187881        34.9221 0.322119        0.07

>>> TREES, v. 3.1.4, deterministic mode with plant water balance <<<

leafBiomassCarbon = 15.9091
leafBiomassNitrogen = 1.06061
canopy_cover = 0.999997
rootDiamMultiplier = 1.4235
rootArea = 0.756928

-> Predawn: updating Weibulls with xylem loss = 1%

-------- 0:123 --------
target LAI = 0.183168; canopy PLC = 1.43335; N status (mol N+ mol organic N) = 1
Plant hydraulic status (Ks and Weibulls):
        Shoot:  axial Ks=27.3703, b=1.62, c=2.39; lateral Ks=11.4043, b=1.62, c=2.39
        Root(0) axial Ks=939.036, b=1.62, c=2.39; lateral Ks=1.49962, b=1.84, c=2.15155
        Root(1) axial Ks=375.615, b=1.62, c=2.39; lateral Ks=1.49963, b=1.84, c=2.15155
        Root(2) axial Ks=187.812, b=1.62, c=2.39; lateral Ks=2.24951, b=1.84, c=2.15155
        Root(3) axial Ks=93.9063, b=1.62, c=2.39; lateral Ks=1.12475, b=1.84, c=2.15155
        Root(4) axial Ks=46.9542, b=1.62, c=2.39; lateral Ks=1.12478, b=1.84, c=2.15155

-> Predawn: updating Weibulls with xylem loss = 1%
...
-------- 0:138 --------
target LAI = 1.01635; canopy PLC = 1.41347; N status (mol N+ mol organic N) = 0.49933
Plant hydraulic status (Ks and Weibulls):
        Shoot:  axial Ks=29.7757, b=1.62, c=2.39; lateral Ks=12.4065, b=1.62, c=2.39
        Root(0) axial Ks=1345.28, b=1.62, c=2.39; lateral Ks=1.27791, b=1.86, c=2.13998
        Root(1) axial Ks=592.611, b=1.62, c=2.39; lateral Ks=2.55582, b=1.86, c=2.13998
        Root(2) axial Ks=288.37, b=1.62, c=2.39; lateral Ks=3.8315, b=1.86, c=2.13998
        Root(3) axial Ks=128.407, b=1.62, c=2.39; lateral Ks=1.92127, b=1.86, c=2.13577
        Root(4) axial Ks=48.1908, b=1.62, c=2.39; lateral Ks=1.15445, b=1.84, c=2.15282

Simulated values in cc_ww_drought_valid_expt.sim

Hydraulic diagnostics in cc_ww_drought_valid_expt.hyd
Simulation completed

[salexan5@tlog1 Brassica]$ ls
cc_lowN.p  cc_ww_drivers_drought_validation.txt  cc_ww_drought_valid_expt.leaf  covfile1        in_cc_ww.txt  README
cc.p       cc_ww_drought_valid_expt.hyd          cc_ww_drought_valid_expt.sim   in_cc_lowN.txt  param_mod

After running the example above, we now have three additional 'cc_ww_drought_valid_expt.hyd' files with extensions .leaf, .hyd and .sim.

Using the R Scripts

The workshop details how to use trees3, and then uses R scripts to aggregate and plot the data. The following example demonstrates how to run these scripts using R3.6.3:

[salexan5@tlog1 TREES-Workshop-2020]$ module load gcc/7.3.0 r/3.6.1

[salexan5@tlog1 TREES-Workshop-2020]$ Rscript Rscripts/Aggregate_to_Daily.R

[salexan5@tlog1 TREES-Workshop-2020]$ Rscript Rscripts/Plot_TREES_results.R
null device
          1
There were 50 or more warnings (use warnings() to see the first 50)
null device
          1

[salexan5@tlog1 TREES-Workshop-2020]$ ls Graphics/
ccLeaf.pdf  cc.pdf  README

For both the Aggregate_to_Daily.R and Plot_TREES_results.R files I opened them up (using the command line text editor vim) and commented out the setwd line.

#setwd(paste("~/Downloads/TREES-workshop-2020-main/",sep=""))

If you have retrieved the workshop and it lives in your home /Downloads/ folder then you can leave this line in.

Viewing the PDFs

We have a very crude pdf viewer on teton that you can use to check the output pdf:

[salexan5@tlog1 TREES-Workshop-2020]$ cd Graphics/
[salexan5@tlog1 Graphics]$ gs cc.pdf

Slurm:

From what we can see, trees3 is not multi core, meaning it only uses a single core.

A simple template to submit a job to use trees3 would look something like below:

With respect to the workshop, this slurm bash script is being run directly from the /Examples/Brassica/ folder where the in_cc_ww.txt file exists:

#!/bin/bash
#SBATCH --job-name trees
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --time=01:00:00
#SBATCH --mail-type=ALL
#SBATCH --mail-user=<your-email-adress>
#SBATCH --account=<your-rpoject>
#SBATCH --output=trees_%A.out

module load trees/3

trees3 < in_cc_ww.txt

If you’re running the command from the command line please remember to use salloc to create an interactive session (and not run anything directly on the login nodes).

Depending on the size of your data set, if you find jobs are failing with Out-Of-Memory issues, then please explore using the --mem or --mem-per-cpu slurm options. Pages can be found on the Wiki about using slurm.

  • No labels