/
aadoc.R
314 lines (293 loc) · 10.6 KB
/
aadoc.R
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#### Documentation objects
#' Hector logging levels
#'
#' These functions return constants that can be used in
#' \code{\link{newcore}} to set the minimum logging level
#'
#' @name loglevels
NULL
#' Utility functions for Hector instances
#'
#' @param core Hector instance to operate on
#' @name hectorutil
NULL
#' Message type identifiers
#'
#' These identifiers indicate the type of a message so that the core can route
#' it to the correct method in the recipient.
#'
#' @section Note:
#' Because these identifiers are provided as \code{#define} macros in the hector code,
#' these identifiers are provided in the R interface as functions. Therefore,
#' these objects must be called to use them; \emph{e.g.}, \code{GETDATA()}
#' instead of the more natural looking \code{GETDATA}.
#'
#' @name msgtype
NULL
#' Identifiers for capabilities in the Hector forcing component
#'
#' These identifiers specify forcing values that can be provided by hector via
#' the forcing component. All of the values corresponding to these identifiers
#' are read-only (\emph{i.e.}, they can only appear in \code{\link{GETDATA}}
#' messages.)
#'
#' @inheritSection msgtype Note
#'
#' @name forcings
#' @seealso \link{haloforcings} for forcings from halocarbons and \link{rho} for
#' parameters related to radiative forcing efficiency.
#' @family capability identifiers
NULL
#' Identifiers for Hector forcing component parameters
#'
#' These identifiers specify radiative forcing efficiency in hector these values
#' can be read and/or set by hectors forcing and halocarbon components.
#' the forcing component.
#'
#' @inheritSection msgtype Note
#'
#' @name rho
#' @seealso \link{haloforcings} for forcings from halocarbons and \link{forcings} forcing
#' values provided from the hector forcing component.
#' @family capability identifiers
NULL
#' Identifiers for Hector forcing component parameters
#'
#' These identifiers specify the tropospheric adjustments for the
#' stratospheric-temperature adjusted radiative forcings.
#' These values must be a number between -1 and 1, and
#' can be read and/or set by hectors forcing and halocarbon components.
#'
#' @inheritSection msgtype Note
#'
#' @name delta
#' @seealso \link{haloforcings} for forcings from halocarbons and \link{forcings} forcing
#' values provided from the hector forcing component.
#' @family capability identifiers
NULL
#' Identifiers for variables in the Hector carbon cycle component
#'
#' These identifiers correspond to variables that can be read and/or set in the
#' carbon cycle
#'
#' @section Output variables:
#' These variables can be read using the \code{\link{GETDATA}} message type:
#' \describe{
#' \item{CONCENTRATIONS_CO2}{Atmospheric CO2 concentration}
#' \item{ATMOSPHERIC_CO2}{Atmospheric CO2 in units of C}
#' \item{NBP}{Net biome production. Annual global C flux from atmosphere into
#' the land. A positive value means a net flux from atmosphere into land
#' (i.e. land is a net carbon sink), while a negative value means a net flux
#' from land into the atmosphere (i.e. land is a net carbon source). Note
#' that despite the name--which follows disciplinary convention, see Chapin
#' et al. 2006--this is currently a globally-averaged variable.}
#' \item{FFI_EMISSIONS}{Fossil fuel and industrial emissions}
#' \item{LUC_EMISSIONS}{Land use change emissions}
#' \item{NPP}{Net primary production}
#' \item{RH}{Heterotrophic respiration}
#' \item{EARTH_C}{Earth pool}
#' }
#' @section Input variables:
#' \describe{
#' \item{FFI_EMISSIONS}{Fossil fuel and industrial emissions (\code{"Pg C/yr"})}
#' \item{LUC_EMISSIONS}{Land use change emissions (\code{"Pg C/yr"})}
#' \item{CO2_CONSTRAIN}{Prescribed atmospheric CO2 concentration (\code{"ppmv CO2"})}
#' \item{NBP_CONSTRAIN}{Prescribed net biome production (land-atmosphere C flux) (\code{"Pg C/yr"})}
#' \item{DACCS_UPTAKE}{Direct air carbon capture and storage}
#' \item{LUC_UPTAKE}{Land use change uptake}
#' }
#' @inheritSection msgtype Note
#' @name carboncycle
#' @seealso \link{concentrations} for other gas concentrations and
#' \link{emissions} for other gas emissions
#' @family capability identifiers
NULL
#' Identifiers for halocarbon forcings
#'
#' These identifiers specify forcing values that can be provided by hector via
#' one of the myriad halocarbon components. All of the values corresponding to
#' these identifiers are read-only (\emph{i.e.}, they can only appear in
#' \code{\link{GETDATA}} messages.) The forcings returned are the
#' \emph{relative} forcings, with the base year (typically 1750) values
#' subtracted off.
#'
#' @inheritSection msgtype Note
#'
#' @name haloforcings
#' @seealso \link{forcings} for forcings from other sources.
#' @family capability identifiers
NULL
#' Identifiers for halocarbon emissions
#'
#' These identifiers correspond to emissions values for halocarbons. They are
#' (for now) write only, meaning they can only appear in \code{\link{SETDATA}}
#' messages. In all cases, the expected input units are gigagrams
#' (\code{"Gg"}).
#'
#' @inheritSection msgtype Note
#'
#' @name haloemiss
#' @family capability identifiers
NULL
#' Identifiers for halocarbon concentration constraints
#'
#' These identifiers correspond to concentration constraints for halocarbons. In
#' all cases, the expected input units are volumetric parts per trillion
#' (\code{"ppvt"}).
#'
#' @inheritSection msgtype Note
#'
#' @name haloconstrain
#' @family capability identifiers
NULL
#' Identifiers for constraints
#'
#' These identifiers correspond to Hector's constraint capabilities
#'
#' @inheritSection msgtype Note
#'
#' @name constraints
#' @family capability identifiers
#' @seealso haloconstrains
NULL
#' Identifiers for quantities in the methane component
#'
#' These identifiers correspond to variables that can be read and/or set in the
#' methane component.
#'
#' @section Output variables:
#' These variables can be read from the methane component.
#' \describe{
#' \item{CONCENTRATIONS_CH4}{Atmospheric methane concentration}
#' \item{PREINDUSTRIAL_CH4}{Preindustrial methane concentration}
#' }
#'
#'
#' @section Input variables:
#' These variables can be set in the methane component. The expected units
#' string is given after each description.
#' \describe{
#' \item{EMISSIONS_CH4}{Methane emissions (\code{"Tg CH4"})}
#' \item{PREINDUSTRIAL_CH4}{Preindustrial methane concentration (\code{"ppbv CH4"})}
#' \item{CH4_CONSTRAIN}{N2O concentration constraint (\code{"ppbv CH4"})}
#' \item{NATURAL_CH4}{Natural methane emissions (\code{"Tg CH4"})}
#' \item{LIFETIME_SOIL}{Time scale for methane loss into soil (\code{"Years"})}
#' \item{LIFETIME_STRAT}{Time scale for methane loss into stratosphere (\code{"Years"})}
#' }
#'
#' @inheritSection msgtype Note
#'
#' @name methane
#' @family capability identifiers
NULL
#' Identifiers for quantities in the SO2 component
#'
#' These identifiers correspond to variables that can be read and/or set in the
#' SO2 component
#'
#' @section Output variables:
#' These variables can be read using the \code{\link{GETDATA}} message type.
#' \describe{
#' \item{NATURAL_SO2}{Natural SO2 emissions}
#' \item{Y2000_SO2}{Year 2000 SO2 emissions}
#' \item{EMISIONS_SO2}{Anthropogenic SO2 emissions}
#' \item{VOLCANIC_SO2}{Forcing due to volcanic SO2 emissions}
#' }
#'
#' @section Input variables:
#' These variables can be set using the \code{\link{SETDATA}} message type.
#' \describe{
#' \item{EMISSIONS_SO2}{Anthropogenic SO2 emissions (\code{"Gg S"})}
#' \item{VOLCANIC_SO2}{Forcing due to volcanic SO2 emissions (\code{"W/m2"})}
#' }
#'
#' @inheritSection msgtype Note
#'
#' @name so2
#' @family capability identifiers
NULL
#' Identifiers for quantities in the ocean component
#'
#' These identifiers correspond to variables that can be read from the ocean
#' component using the \code{\link{GETDATA}} message type.
#'
#' @inheritSection msgtype Note
#'
#' @name ocean
#' @family capability identifiers
NULL
#' Identifiers for miscellaneous concentrations not elsewhere described
#'
#' All of these variables can be read using the \code{\link{GETDATA}} message
#' type.
#'
#' @inheritSection msgtype Note
#' @name concentrations
#' @family capability identifiers
NULL
#' Identifiers for miscellaneous emissions not elsewhere described
#'
#' All of these variables can be set using the \code{\link{SETDATA}} message
#' type.
#'
#' @inheritSection msgtype Note
#' @name emissions
#' @family capability identifiers
NULL
#' Identifiers for model parameters
#'
#' These identifiers correspond to settable parameters that change the model
#' behavior and are subject to uncertainty. All of these can be set using the
#' \code{\link{SETDATA}} message type. Changing any of these parameters will
#' typically invalidate the hector core's internal state; therefore, after
#' setting one or more of these values you should call \code{\link{reset}} before
#' attempting to run the model again. This will rerun the spinup and produce a
#' new internally consistent state. Attempting to run the model without resetting
#' first will usually produce an error (often with a message about failing to
#' conserve mass).
#'
#' @inheritSection msgtype Note
#' @name parameters
#' @family capability identifiers
NULL
#' Identifiers for variables associated with the temperature component
#'
#' All of these variables can be read using the \code{\link{GETDATA}} message
#' type.
#'
#' @inheritSection msgtype Note
#' @name temperature
#' @family capability identifiers
NULL
#' A data.frame containing information on all of the Hector inputs listed in
#' an ini file created by save-input-params.R.
#'
#' @format A data.frame of 8 columns and 222 rows.
#' \describe{
#' \item{section}{String of the section of the ini file of a parameter}
#' \item{parameter}{String of the parameter name}
#' \item{biome.specific}{String of whether or not the parameter is biome-specific}
#' \item{time.variant}{String of whether or not the parameter is time-variant}
#' \item{required}{String of wheterh or not the parameter is required}
#' \item{default}{String of the default value of the parameter}
#' \item{units}{String of the parameter units}
#' \item{description}{String of a brief description of the parameter from the ini file}
#' }
"inputstable"
#' A data.frame containing information on all of the Hector variable created by units-data.R
#' used within the getunits function.
#'
#' @format A data.frame of 2 columns and 114 rows.
#' \describe{
#' \item{variable}{String of the hector variable}
#' \item{units}{String of the unit value}
#' }
"unitstable"
#' A data.frame containing information R hector function name and hector string names.
#'
#' @format A data.frame of 2 columns and 239 rows.
#' \describe{
#' \item{fxn}{String of the R hector function name}
#' \item{string}{String of variable name}
#' }
"fxntable"