Skip to content

Commit 0553bca

Browse files
authored
Merge pull request #725 from uaf-arctic-eco-modeling/general-documentation
Update docs: - add QuickStart section to Sphinx docs and Readme - improve plotting script to match documentation - fix attribution in MADS section
2 parents 6ffb49b + 593474c commit 0553bca

File tree

4 files changed

+85
-18
lines changed

4 files changed

+85
-18
lines changed

README.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,52 @@ The dvm-dos-tem (`dvmdostem`) model is a process based bio-geo-chemical
88
ecosystem model that focuses on C and N dynamics as well as soil thermal
99
dynamics in high latitude ecosystems.
1010

11-
[Complete Documentation](https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/index.html)
11+
For more information see the [User Guide](https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/index.html).
1212

13-
> **Whats with the name?**
14-
>
15-
> `dvm-dos-tem` is short for "Dynamic Vegetation \[Model\] Dynamic Organic Soil
16-
> Terrestrial Ecosystem Model". Orignally the model
17-
> was simply "TEM", and as more logic and capabilities have been added, the name
18-
> has grown. We still frequently use simply "TEM" because it is less cumbersome
19-
> for writing and typing.
13+
For questions and to get involved please see the [Github Issues](https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/issues) and [Github Discussions](https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/discussions).
2014

15+
> [!NOTE]
16+
> **Whats with the name?** `dvm-dos-tem` is short for "**D**ynamic
17+
> **V**egetation \[**M**odel\] **D**ynamic **O**rganic **S**oil **T**errestrial
18+
> **E**cosystem **M**odel". Orignally the model was simply "TEM", and as more
19+
> logic and capabilities have been added, the name has grown. We still
20+
> frequently use simply "TEM" because it is less cumbersome for writing and
21+
> typing. In most context TEM, dvmdostem, dvm-dos-tem, DVM-DOS-TEM and DMVDOSTEM
22+
> are synonomous and can be used interchangably.
2123
22-
> **Sept 2022**
23-
>
24-
> We are in the process of updating the entire documentation
24+
25+
## Quickstart
26+
27+
For users who have Docker and Git installed.
28+
29+
More details are available in the [User Guide - Basic Model Setup and Run](https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/examples_and_tutorials/basic_model_run.html#basic-model-setup-and-run).
30+
31+
The default settings will run the model in the source code directory, using the
32+
sample data that is included with the repository in the ``demo-data/`` directory.
33+
The run will output a single variable (GPP), and will run for 2 pixels.
34+
35+
- Clone the repository (``git clone https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem.git``).
36+
- Change into directory (``cd dvm-dos-tem``).
37+
- Get some input data (optional).
38+
- Build Docker images (``./docker-build-wrapper.sh cpp-dev && ./docker-build-wrapper.sh dev``).
39+
- Setup your environment variables in ``.env`` file for ``V_TAG``, ``DDT_INPUT_CATALOG``, and ``DDT_WORKFLOWS`` (optional).
40+
- Start Docker containers (``V_TAG=$(git describe) docker compose up -d dvmdostem-dev``).
41+
- Obtain shell in container (``docker compose exec dvmdostem-dev bash``)
42+
- Compile code (``develop@56ef79004e31:/work$ make``)
43+
- Setup working directory (optional).
44+
- Change into working directory (optional) .
45+
- Adjust as needed (optional):
46+
- Your run mask (``run-mask.nc``)
47+
- The outputs you would like to generate (``output_spec.csv``)
48+
- Any other configuration items (``config.js``)
49+
- Any custom parameters (``parameters/``)
50+
- Any custom target data (``calibration/calibration_targets.py``).
51+
- Start the model run (``develop@56ef79004e31:/work$ ./dvmdostem --log-level monitor -p 100 -e 1000 -s 250 -t 115 -n 85``).
52+
- Analyze run (``develop@56ef79004e31:/work ./scripts/plot_output_var.py --yx 0 0 --file output/GPP_yearly_tr.nc``).
53+
54+
55+
> [!WARNING]
56+
> Sept 2022 - We are in the process of updating the entire documentation
2557
> system. There is still info scattered across this README, the wiki, a Google
2658
> Doc and the Sphinx system but we are working on consolidating the info into
27-
> primarily the Sphinx system.
59+
> primarily the Sphinx system (the User Guide).

docs_src/sphinx/source/examples_and_tutorials/basic_model_run.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@ bunch of the supporting tools, including Docker, and Git. For post processing
1515
and visualization, see the :ref:`Plotting Example
1616
<examples_and_tutorials/plotting_discussion:Plotting>`.
1717

18+
.. hint:: Quickstart Summary
19+
20+
For users who have Docker and Git installed.
21+
22+
The default settings will run the model in the source code directory, using the
23+
sample data that is included with the repository in the ``demo-data/`` directory.
24+
The run will output a single variable (GPP), and will run for 2 pixels.
25+
26+
- Clone the repository (``git clone https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem.git``).
27+
- Change into directory (``cd dvm-dos-tem``).
28+
- Get some input data (optional).
29+
- Build Docker images (``./docker-build-wrapper.sh cpp-dev && ./docker-build-wrapper.sh dev``).
30+
- Setup your environment variables in ``.env`` file for ``V_TAG``, ``DDT_INPUT_CATALOG``, and ``DDT_WORKFLOWS`` (optional).
31+
- Start Docker containers (``V_TAG=$(git describe) docker compose up -d dvmdostem-dev``).
32+
- Obtain shell in container (``docker compose exec dvmdostem-dev bash``)
33+
- Compile code (``develop@56ef79004e31:/work$ make``)
34+
- Setup working directory (optional).
35+
- Change into working directory (optional) .
36+
- Adjust as needed (optional):
37+
38+
- Your run mask (``run-mask.nc``)
39+
- The outputs you would like to generate (``output_spec.csv``)
40+
- Any other configuration items (``config.js``)
41+
- Any custom parameters (``parameters/``)
42+
- Any custom target data (``calibration/calibration_targets.py``).
43+
44+
- Start the model run (``develop@56ef79004e31:/work$ ./dvmdostem --log-level monitor -p 100 -e 1000 -s 250 -t 115 -n 85``).
45+
- Analyze run (``develop@56ef79004e31:/work ./scripts/plot_output_var.py --yx 0 0 --file output/GPP_yearly_tr.nc``).
46+
1847
.. note::
1948

2049
This lab is more or less a duplicate of an existing wiki page:

docs_src/sphinx/source/examples_and_tutorials/mads_assisted_calibration.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ portions being done iteratively and or in an automated fashion.
1616

1717
.. note::
1818

19-
The MADS Assisted Calibration process has been a group effort led by `Elchin
20-
Jafarov <WCRCEJ_>`_ with contributions and testing from the team at
21-
`Woodwell Climate Research Center <WCRC_>`_ as well as the UAF Arctic
22-
Ecosystem Modeling group, including:
19+
The MADS Assisted Calibration process has been a group effort led by `Helene
20+
Genet <UAFHG_>`_ and `Elchin Jafarov <WCRCEJ_>`_ with contributions and
21+
testing from the team at `Woodwell Climate Research Center <WCRC_>`_ as well
22+
as the `UAF Arctic Ecosystem Modeling Group <UAFAEMG_>`_, including:
2323

2424
- Tobey Carman
25-
- Helene Genet
2625
- Ruth Rutter
2726
- Aiza Kabeer
2827
- Andrew Mullen
@@ -137,4 +136,6 @@ the optimization.
137136
.. _MADS: https://www.madsjulia.github.io
138137
.. _WCRC: https://www.woodwellclimate.org/
139138
.. _WCRCEJ: https://www.woodwellclimate.org/staff/elchin-jafarov/
139+
.. _UAFHG: https://www.uaf.edu/iab/people/faculty.php?who=Genet_Helene
140+
.. _UAFAEMG: https://github.com/uaf-arctic-eco-modeling
140141

scripts/plot_output_var.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@
124124
data = nc_data[:,Y,X]
125125
fig, axes = plt.subplots(1,1, sharex=args.sharex, sharey=args.sharey)
126126
axes.plot(time_range, data)
127+
axes.set_ylabel(f"{ncFile.variables[plotting_var].units}")
128+
fig.suptitle(f"{args.file}")
127129

128130

129131
# Variables by PFT, Compartment, or Layer
@@ -248,7 +250,10 @@
248250
manager = plt.get_current_fig_manager()
249251
manager.set_window_title(plotting_var)
250252
plt.xlabel("time")
251-
plt.savefig("SAMPLE_plot_output_var.png")
253+
254+
savename = f"{plotting_var}_plot_output_var.png"
255+
print(f"Saving file: {savename} ...")
256+
plt.savefig(savename)
252257
plt.show()
253258

254259

0 commit comments

Comments
 (0)