map_variable
Stable function · Editing
Tier: stable · Kind: function · Topic: Editing
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
map_variable | mapVariable | not exported | not exported | MapVariable |
Julia
map_variable(file::EsmFile, from::String, to::String; transform)
map_variable(file::EsmFile, from::String, to::String; transform="identity") -> EsmFile
Convenience function to create a variable_map coupling entry that forwards a
variable reference from into to. transform names the transform function
(e.g. "identity", "affine") or is an ASTExpr operator node evaluated on the
source value (esm-spec §10.4 expression transform).
TypeScript
function mapVariable(file: EsmFile, from: string, to: string, transform?: CouplingVariableMap['transform']): EsmFile
Map a variable from one system to another with optional transformation
Parameters
file— ESM filefrom— Source variable referenceto— Target variable referencetransform— Optional transformation: one of the named transform strings, or an Expression operator node evaluated in the flattened coupled system’s scope (esm-spec §8.6 — the regridding form)
Returns
New ESM file with variable mapping coupling added
Python
Python does not export this function.
Rust
Rust does not export this function.
Go
func MapVariable(file ESMFile, from, to string, transform Expression) ESMFile
MapVariable returns a copy of file with a variable_map coupling entry forwarding from into to.
transform is either one of the named transform strings (“param_to_var”, “identity”, “additive”, “multiplicative”, “conversion_factor”) or an Expression operator node evaluated in the flattened coupled system’s scope (esm-spec §8.6 — the regridding form). Pass nil for the default, “param_to_var” — the default TypeScript uses.