Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Jan 11, 2024
1 parent aea6be5 commit a780310
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/src/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ AliasParamDict
create_toml_dict
get_parameter_values!
get_parameter_values
get_tagged_parameter_values
get_tagged_parameter_names
fuzzy_match
float_type
log_parameter_information
write_log_file
Expand Down
2 changes: 0 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ CLIMAParameters serve several functionalities and require certain attributes. A
- The parameter does not vary in time (per climate simulation)
- The parameter is a function of only constants other CLIMAParameters and or constants

In addition, CLIMAParameters have the flexibility of two important behaviors:

## Usage

See the [The TOML parameter file interface](@ref) and [Parameter Dictionaries](@ref) for usage examples.
Expand Down
25 changes: 24 additions & 1 deletion docs/src/toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ A parameter is determined by its unique name. It has possible attributes
3. `type`
4. `description`
5. `prior`
6. `transformation`
6. `tag`
7. `transformation`

!!! warn
Currently we support `Type` and `array{Type}` for the following Types: `float`, `integer`, `string` and `bool`.
Expand All @@ -35,6 +36,28 @@ type = "float"
description = "Molecular weight dry air (kg/mol)"
```

### Properly tagged parameter
To add a tag to a parameter, set the `tag` field with a list of tags.
Tags are an optional convenience and do not create a namespace. All parameter names must be unique.

As an initial convention, parameters will be tagged with the component(s) in which they are used.
This convention will be changed as we see how packages use tags.

```TOML
[prandtl_number_0_grachev]
alias = "Pr_0_Grachev"
value = 0.98
type = "float"
description = "Pr_0 for Grachev universal functions. From Grachev et al, 2007. DOI: 10.1007/s10546-007-9177-6"
tag = ["SurfaceFluxes"]
```
If this convention is followed, to obtain the parameters used to build tagged by "surfacefluxes", one could call for example:
```julia
surfacefluxes_params = get_tagged_parameter_values(toml_dict, "surfacefluxes")
```

When tags are matched, punctuation and capitalization is removed. For more information, see [`fuzzy_match`](@ref Main.fuzzy_match).

### A more complex parameter for calibration

```TOML
Expand Down

0 comments on commit a780310

Please sign in to comment.