Skip to content

Commit 9411752

Browse files
authored
Merge pull request #231 from UW-Hydro/develop
Update master in anticipation of v2.3.0
2 parents 5f443de + b9ed455 commit 9411752

File tree

13 files changed

+909
-222
lines changed

13 files changed

+909
-222
lines changed

docs/configuration.rst

Lines changed: 129 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Configuration Specifications
44
============================
55
This page documents the various options and
66
parameters that can be set in the configuration
7-
file.
7+
file. An example configuration file can be found on the examples page.
88

99
MetSim Section
1010
--------------
@@ -108,69 +108,63 @@ available at: `<https://zenodo.org/record/1402223#.XEI-mM2IZPY>`. For more
108108
information about the "triangle" method see :doc:`PtriangleMethod.pdf`.
109109

110110
For more information about input and output variables see the :ref:`data` page.
111+
::
112+
113+
# Comments begin with hashtags
114+
# The first non-comment line must begin with the following:
115+
Metsim:
116+
time_step: int
117+
start: YYYY-MM-DD
118+
stop: YYYY-MM-DD
119+
120+
# Paths to input files
121+
forcing: str
122+
domain: str
123+
state: str
124+
125+
# Output file specification
126+
out_dir: str
127+
out_prefix: str
128+
129+
# Algorithmic controls
130+
utc_offset: bool
131+
prec_type: str
132+
lw_type: str
133+
lw_cloud: str
134+
111135

112136
chunks section
113137
--------------
114138
The ``chunks`` section describes how parallel computation should be grouped
115139
in space. For example, to parallelize over 10 by 10 chunks of latitude and
116140
longitude (with netcdf dimensions named ``lat`` and ``lon``, respectively) you would use:
141+
::
117142

118-
.. code-block:: ini
119-
[chunks]
120-
lat = 10
121-
lon = 10
143+
chunks:
144+
lat: 10
145+
lon: 10
122146

123147
Alternatively, for an HRU based run chunked into 50 element jobs you would use:
148+
::
124149

125-
.. code-block:: ini
126-
[chunks]
127-
hru = 50
150+
chunks:
151+
hru: 50
128152

129153
As a general rule of thumb, try to evenly chunk the domain in such a way that
130154
the number of jobs to run is some multiple of the number of processors you wish
131155
to run on.
132156

133157
forcing_vars and state_vars section
134158
---------------
135-
The ``forcing_vars`` and ``state_vars`` sections are where you can specify which variables are in your
136-
input data, and the corresponding symbols which MetSim will recognize. The
137-
format of this section depends on the value given in the ``in_fmt`` entry in
138-
the ``MetSim`` section of the configuration file. See below for conventions for
139-
each input type.
140-
141-
142-
netcdf and data
143-
```````````````
144-
The ``in_vars`` section for NetCDF and xarray input acts as a mapping between the variable
159+
The ``forcing_vars`` and ``state_vars`` sections are where you can specify which
160+
variables are in your input data, and the corresponding symbols which MetSim will
161+
recognize. The ``in_vars`` section for acts as a mapping between the variable
145162
names in the input dataset to the variable names expected by MetSim. The format
146-
is given as ``metsim_varname = netcdf_varname``. The minimum required variables
163+
is given as ``metsim_varname: netcdf_varname``. The minimum required variables
147164
given have ``metsim_varname``\s corresponding to ``t_min``, ``t_max``, and
148165
``prec``; these variable names correspond to minimum daily temperature (Celcius),
149166
maximum daily temperature (Celcius), and precipitation (mm/day).
150167

151-
ascii
152-
`````
153-
The ``in_vars`` section for ASCII input acts similarly to the NetCDF input
154-
format, except for one key point. Variables should be given as a tautology: the
155-
format is given as ``metsim_varname = metsim_varname``. The order that the
156-
variables are given corresponds to the column numbers that they appear in the
157-
input files. The minimum required variables are ``t_min``, ``t_max``, and
158-
``prec``; these variable names correspond to minimum daily temperature (Celcius),
159-
maximum daily temperature (Celcius), and precipitation (mm/day).
160-
161-
binary
162-
``````
163-
This section has an input style for binary files that mimics the VIC version 4
164-
input style. Each line is specified as ``varname = scale cdatatype``, where
165-
``varname`` is the name that MetSim should use for the column, ``scale`` is a
166-
floating point scaling factor that should be applied after conversion from
167-
binary to floating point; the conversion applied by the ``scale`` is applied
168-
after the value in the input is converted from binary to the ``cdatatype``
169-
specified for each variable. Valid ``cdatatype``\s are ``signed`` and
170-
``unsigned``. ``signed`` values are interpreted as values which can be positive
171-
or negative, whereas ``unsigned`` values are interpreted as values that can only
172-
be greater than or equal to zero.
173-
174168
domain_vars section
175169
-------------------
176170
The ``domain_vars`` section is where information about the domain file is given.
@@ -184,26 +178,109 @@ a mask of valid cells in the domain, and the elevation given in meters. If
184178
including ``dur`` and ``t_pk`` for disaggregating daily precipitation according
185179
to the "triangle" method.
186180

181+
out_vars section
182+
----------------
183+
The ``out_vars`` section is where you can specify the output variables that you
184+
want to include. There are two formats for this section. The first is the old format,
185+
which we provide backwards compatibility for. You simply specify in the top level
186+
``[MetSim]`` section a list of output variables with the names used by MetSim. They
187+
will be written out with the same names used internally. Available options are
188+
dependent on whether daily or subdaily output is being generated. Options for
189+
daily output are:
190+
191+
- pet
192+
- shortwave
193+
- t_max
194+
- t_min
195+
- tskc
196+
197+
Options for subdaily output are:
198+
199+
- prec
200+
- shortwave
201+
- longwave
202+
- temp
203+
- vapor_pressure
204+
- air_pressure
205+
- tskc
206+
- rel_humid
207+
- spec_humid
208+
- wind
209+
210+
The syntax for output specification is as follows:
211+
::
212+
213+
out_vars:
214+
metsim_varname:
215+
out_name: str
216+
units: str
217+
218+
unit conversions
219+
================
220+
The ``out_vars`` section allows for specification of some simple unit conversions
221+
for MetSim output. The allowed options are as follows (invalid options will revert
222+
to the default after issuing a warning):
223+
224+
* prec
225+
- ``mm timestep-1`` (default)
226+
- ``mm s-1``
227+
- ``mm h-1``
228+
* pet (daily output only)
229+
- ``mm timestep-1`` (default)
230+
- ``mm s-1``
231+
- ``mm h-1``
232+
* t_max (daily output only)
233+
- ``C`` (default)
234+
- ``K``
235+
* t_min (daily output only)
236+
- ``C`` (default)
237+
- ``K``
238+
* temp
239+
- ``C`` (default)
240+
- ``K``
241+
* vapor_pressure
242+
- ``kPa`` (default)
243+
- ``hPa``
244+
- ``Pa``
245+
* air_pressure
246+
- ``kPa`` (default)
247+
- ``hPa``
248+
- ``Pa``
249+
* tskc (cloud fraction)
250+
- ``fraction`` (default)
251+
- ``%``
252+
* rel_humid
253+
- ``%`` (default)
254+
- ``fraction``
255+
187256
constant_vars section
188257
-------------------
189-
The ``constant_vars`` section is optional and allows you to set some of the
190-
forcing inputs to a constant value. The specification simply consists of entries
191-
of the form ``metsim_varname = value``, where ``value`` is a number that can be
192-
converted to a double. There can only be one entry per line. If the
258+
The ``constant_vars`` section is optional and allows you to set some of the
259+
forcing inputs to a constant value. The specification simply consists of entries
260+
of the form ``metsim_varname: value``, where ``value`` is a number that can be
261+
converted to a double. There can only be one entry per line. If the
193262
``metsim_varname`` corresponds to an entry that is already in the ``forcing_vars``
194-
section, then the constant value will take precedence. In the current
263+
section, then the constant value will take precedence. In the current
195264
implementation there must be at least one non-constant entry in ``forcings_vars``
196265
(i.e. at least one entry that is not also in ``constant_vars``).
197266

198267
For example:
199-
``wind = 2.0``
268+
::
269+
270+
constant_vars:
271+
wind: 2.0
272+
200273
will result in a constant wind field in the output file. In this case ``wind``
201274
does not need to be specified in the ``forcing_vars`` section. If it was, it
202275
will still be set to a constant value of 2 m/s.
203276

204277
Similarly:
205-
``t_max = 30
206-
t_min = 10``
278+
::
279+
280+
constant_vars:
281+
t_max = 30.0
282+
t_min = 10.0
283+
207284
will result in output with a diurnal cycle in which the temperature varies at
208-
all locations between 10C and 30C. However, all estimation and disaggregation
209-
routines are still evaluated, with constant ``t_max`` and ``t_min`` as input.
285+
all locations between 10C and 30C. However, all estimation and disaggregation
286+
routines are still evaluated, with constant ``t_max`` and ``t_min`` as input.

0 commit comments

Comments
 (0)