Skip to content

Commit

Permalink
Move glacier models to their own repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Maginor committed Feb 19, 2025
1 parent 7de27c2 commit e4b2d91
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 952 deletions.
4 changes: 1 addition & 3 deletions docs/mobius2docs/advanced_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ layer.water.temp[vert.top] # The temperature of the top layer of water
conc(layer.water.oc)[vert.below] # The concentration of dissolved organic carbon one layer below
```

An access using `top` or `bottom` loses its dependency on the grid index set for the given connection (since index is inferred from the access).
An access using `top` or `bottom` loses its dependency on the grid index set for the given connection (since index is inferred from the access). Inside a math expression, to check if you are at the `top` or `bottom` layer you can use `is_at`, e.g. `is_at[vert.top]`, which evaluates to a boolean.

A flux can have `top` and `bottom` restrictions in its source or target. For instance,

Expand All @@ -183,8 +183,6 @@ flux(river.water, layer.water[vert.specific], [m 3, s-1], "River discharge to la

In the above example, the river discharges to layer 5 of the lake. Specific accesses are currently a bit limited and may be redesigned in the future. The `@specific` code block is always cast to an integer, and is clamped so that it evaluates to a valid index.

To check if you are at the `top` or `bottom` layer you can use `is_at`, e.g. `is_at[vert.top]`, which evaluates to a boolean.

#### Flux aggregations for grids

### Directed graph connections
Expand Down
2 changes: 1 addition & 1 deletion docs/mobius2docs/declaration_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ euler : constant("Euler number", [], 2.71)
The `type` is one of the following
- A [token type](declaration_format.html#token-types), like `quoted_string`, `real`, `integer`, `boolean`. In this case, the argument must be a single literal value, e.g. `8`, `3.14`, `"Water"`, `true`.
- Another declaration type. In this case you must pass either the identifier of a declared entity of that type, or inline a declaration of that type.
- `location`. Here you must pass a [location](central_concepts.html#components-and-locations), e.g. `soil.water`. In some cases these can have bracketed restrictions (this will be documented separately). Alternatively, you can pass an entity of `loc` type.
- `location`. Here you must pass a [location](central_concepts.html#components-and-locations), e.g. `soil.water`. In some cases these can have [bracketed restrictions](advanced_concepts.html#location-restrictions-for-grids). Alternatively, you can pass an entity of `loc` type.
- `any`. Any argument type, but limitations may be specified in the text.

If an argument is literally called `name:quoted_string`, it has the formal semantics of an [entity name](central_concepts.html/names-and-identifiers).
Expand Down
4 changes: 2 additions & 2 deletions docs/mobius2docs/math_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ An \<identifier\> is either the identifier of a local variable, the identifier o

If you are in an expression with a *context location*, you can some times use shorthands for the location of a refereced state variable. For instance, if the context location is `river.water.oc`, and you try to access `temp`, if `temp` does not refer to a single value, Mobius2 will first look for `river.water.oc.temp`, then `river.water.temp` if the prior does not exist, and finally `river.temp`.

These have the units and types they are declared with. If a value is indexed over index sets, it will primarily be accessed using the same indexes as the current expression are evaluated with. (This causes expressions to propagate index set dependencies to one another and to put some restrictions on what can be accessed. See [separate documentation on distributions](advanced_concepts.html#index-set-distributions).
These have the units and types they are declared with. If a value is indexed over index sets, it will primarily be accessed using the same indexes as the current expression are evaluated with. (This causes expressions to propagate index set dependencies to one another and limit what can be accessed. See [separate documentation on distributions](advanced_concepts.html#index-set-distributions).

Note that the value you get when you access a parameter value in the model is the one provided in the data set (corresponding to the current index combination). The default value in the parameter declaration is just a helper for somebody who create a new data set.

Expand Down Expand Up @@ -143,7 +143,7 @@ Other special identifiers:
| Symbol | Comment |
| ------ | ------- |
| `no_override` | This can be used to cancel an @override or @override_conc expression of a `var` declaration. The compiler must be able to resolve to either `no_override` or not `no_override` at compile time, meaning any `if` branches to these can only rely on constants or constant parameters. (to be documented) |
| `is_at` | This can be used to determine location in a grid1d connection. Will be documented later. |
| `is_at` | This can be used to determine location in a grid1d connection. [Separately documented](advanced_concepts.html#location-restrictions-for-grids). |

Enum parameters: Enum parameters are accessed using `par_identifier.value_identifier`, where `value_identifier` is one of the declared possible values of this enum parameter. The expression evaluates to `true` if the parameter has the given value, and `false` otherwise.

Expand Down
2 changes: 1 addition & 1 deletion models/nivafjord_lake_simplytox_model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TODO: Maybe we want a simpler biochemistry model for this one, not the entire NI
load("modules/nivafjord/horizontal_fluxes.txt",
module("NIVAFjord simple realignment", basin, layer, water, dz, vert, dims))

load("modules/easylake/easychem.txt",
load("modules/rivertemp_o2.txt",
module("Simple River O₂", river, water, o2, temp))

solve(sol, sediment.water)
Expand Down
312 changes: 0 additions & 312 deletions models/simplyq_arctic_svalbard_fluxes.txt

This file was deleted.

Loading

0 comments on commit e4b2d91

Please sign in to comment.