Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change sphinx Example Experiment 0 to use demo data rather than from … #703

Merged
merged 5 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ folder and make some adjustments to the configuration file for the run.

Using the one-off command style, run the script. For this case we just
arbitrarily select a dataset from your input catalog. Don't worry if you have a
different dataset from the example shown here.
different dataset from the example shown here. If you don't have any input
datasets in your input-catalog, then use the demo-data that is included with the
repository.

.. code:: bash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ Here we have designed a small experiment with answers to the unknowns posed in
- **Answer**
* - | Where on your computer you want to store
| your model run(s)?
- ``/data/workflows/exp0_jan26_test``
- ``/work/testing-data/docs/example_experiment_0/``
* - | What spatial (geographic) area you want
| to run?
- | Toolik, pixels (0,0), (1,1), (2,2)
| ``/data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/``
| ``/work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/``
* - What variables you want to output?
- | GPP: monthly, by PFT
| RH, RG, RM: monthly
Expand Down Expand Up @@ -90,13 +90,61 @@ Here we have designed a small experiment with answers to the unknowns posed in
by-layer resolution is enforced internally in the C++ part of the model.


.. collapse:: Developer commands for working on documentation

Uncomment the following jupyter execute block if you need to actually run the
model for this experiment. This is useful if you are a developer working on
the documentation. Otherwise you can assume that the outputs needed for the
remainder of the exercise are in the ``testing-data/docs/example_experiment0``
directory.

.. jupyter-execute::

# import os
# import subprocess
# import shutil
#
# import setup_working_directory
# import outspec
# import runmask
#
# shutil.rmtree('/work/testing-data/docs/example_experiment_0/')
#
# args = '--input-data-path /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/ /work/testing-data/docs/example_experiment_0/'
# setup_working_directory.cmdline_entry(args.split(' '))
#
# os.chdir('/work/testing-data/docs/example_experiment_0/')
#
# outspec.cmdline_entry('config/output_spec.csv --on RH m'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on RG m'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on RM m'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on TLAYER l m'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on GPP m p'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on VEGC y'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on ALD y'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on CMTNUM y'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on SHLWC y l'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on SHLWDZ y l'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on DEEPC y l'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on DEEPDZ y l'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on MINEC y l'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on LAYERDZ y'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on LAYERDEPTH y'.split(' '))
# outspec.cmdline_entry('config/output_spec.csv --on LAYERTYPE y'.split(' '))
#
# runmask.cmdline_entry('--reset run-mask.nc'.split(' '))
# runmask.cmdline_entry('--yx 0 0 run-mask.nc'.split(' '))
#
# subprocess.call('dvmdostem -l fatal --force-cmt 5 -p 100 -s 250 -e 1000 -t 115 -n 85'.split(' '))


.. collapse:: Example commands for setting up
:class: working

.. code::
.. code::

$ ./scripts/setup_working_directory.py --input-data-path /data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10 /data/workflows/exp0_jan26_test
$ cd /data/workflows/exp0_jan26_test/
$ ./scripts/setup_working_directory.py --input-data-path /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/ /work/testing-data/docs/example_experiment_0/
$ cd /work/testing-data/docs/example_experiment_0/
$ outspec.py config/output_spec.csv --on RH m
$ outspec.py config/output_spec.csv --on RG m
$ outspec.py config/output_spec.csv --on RM m
Expand Down Expand Up @@ -156,7 +204,7 @@ differently, please adjust your paths accordingly.**

# This lets us work with shorter paths relative to the experiment
# directory
os.chdir('/data/workflows/exp0_jan26_test')
os.chdir('/work/testing-data/docs/example_experiment_0/')



Expand All @@ -175,16 +223,16 @@ information is used to set the number of transient and scenario years to run.

.. code::

$ ncdump -h /data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/historic-climate.nc | grep "time:units"
$ ncdump -h /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/historic-climate.nc | grep "time:units"
time:units = "days since 1901-1-1 0:0:0" ;

$ ncdump -h /data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/projected-climate.nc | grep "time:units"
$ ncdump -h /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/projected-climate.nc | grep "time:units"
time:units = "days since 2016-1-1 0:0:0" ;

$ ncdump -h /data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/historic-climate.nc | grep "time\ =\ "
$ ncdump -h /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/historic-climate.nc | grep "time\ =\ "
time = UNLIMITED ; // (1380 currently)

$ ncdump -h /data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/projected-climate.nc | grep "time\ =\ "
$ ncdump -h /work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/projected-climate.nc | grep "time\ =\ "
time = UNLIMITED ; // (1020 currently)

So ``1380/12 = 115``. Looks like 115 years for the historic and ``1020/85 =
Expand All @@ -208,7 +256,7 @@ information is used to set the number of transient and scenario years to run.

args = {
'command': 'climate-ts-plot',
'input_folder': '/data/input-catalog/cru-ts40_ar5_rcp85_ncar-ccsm4_TOOLIK_FIELD_STATION_10x10/',
'input_folder': '/work/demo-data/cru-ts40_ar5_rcp85_ncar-ccsm4_toolik_field_station_10x10/',
'stitch': False,
'type': 'spatial-temporal-summary',
}
Expand Down Expand Up @@ -250,10 +298,10 @@ ranges: [1990-1999], [2040-2049], [2090-2099].
.. code::

### Change into the experiment directory
cd /data/workflows/exp0_jan26_test
cd /work/testing-data/docs/example_experiment_0/

### Create a synthesis directory to store all the summary stats
mkdir /data/workflows/exp0_jan26_test/synthesis
mkdir /work/testing-data/docs/example_experiment_0//synthesis

### Compute the decadal means of vegetation carbon stocks
ncwa -O -d time,89,98 -d x,0 -d y,0 -y avg -v VEGC output/VEGC_yearly_tr.nc synthesis/VEGC_1990_1999.nc
Expand Down Expand Up @@ -373,10 +421,10 @@ simulations. Indicate how you formulated NEE.
.. code::

### Change into the experiment directory
cd /data/workflows/exp0_jan26_test
cd /work/testing-data/docs/example_experiment_0/

### Create a synthesis directory to store all the summary stats
mkdir /data/workflows/exp0_jan26_test/synthesis
mkdir /work/testing-data/docs/example_experiment_0/

### Sum up the GPP across PFTs
ncwa -O -h -v GPP -a pft -y total output/GPP_monthly_tr.nc synthesis/GPP_monthly_tr.nc
Expand Down
8 changes: 8 additions & 0 deletions docs_src/sphinx/source/software_development_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Dev Info
This chapter should include all the useful information that you will need to
make contributions to the ``dvmdostem`` project.

.. important::

In order to keep the base repository size from growing out of control, the
testing and sample data is tracked using `Git LFS <https://git-lfs.com>`_. If
you need to use the testing data (i.e. to run the tests, or to build the
documentation from source) then you should install Git LFS and run ``git lfs
pull`` to make sure that the actual data is downloaded.

******************************
Languages, Software Structure
******************************
Expand Down
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/ALD_SAMPLE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/NEE_SAMPLE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/config/config.js
Git LFS file not shown
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/config/output_spec.csv
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/output/restart-eq.nc
Git LFS file not shown
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/output/restart-pr.nc
Git LFS file not shown
3 changes: 3 additions & 0 deletions testing-data/docs/example_experiment_0/output/restart-sc.nc
Git LFS file not shown
Loading
Loading