NML
aed_nml
¶
AEDNML
¶
Bases: NML
NML
subclass for the aed
.NML file.
Attributes:
Name | Type | Description |
---|---|---|
blocks |
Dict[str, NMLBlock]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off block and parameter validation. |
__init__(aed_models=ModelsBlock(), aed_tracer=TracerBlock(), aed_noncohesive=NonCohesiveBlock(), aed_oxygen=OxygenBlock(), aed_carbon=CarbonBlock(), aed_sedflux=SedFluxBlock(), aed_sed_const2d=SedConst2DBlock(), aed_silica=SilicaBlock(), aed_nitrogen=NitrogenBlock(), aed_phosphorus=PhosphorusBlock(), aed_organic_matter=OrganicMatterBlock(), aed_phytoplankton=PhytoplanktonBlock(), aed_zooplankton=ZooplanktonBlock(), aed_macrophyte=MacrophyteBlock(), aed_bivalve=BivalveBlock(), aed_totals=TotalsBlock())
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aed_models |
ModelsBlock
|
|
ModelsBlock()
|
aed_tracer |
TracerBlock
|
|
TracerBlock()
|
aed_noncohesive |
NonCohesiveBlock
|
|
NonCohesiveBlock()
|
aed_oxygen |
OxygenBlock
|
|
OxygenBlock()
|
aed_carbon |
CarbonBlock
|
|
CarbonBlock()
|
aed_sedflux |
SedFluxBlock
|
|
SedFluxBlock()
|
aed_sed_const2d |
SedConst2DBlock
|
|
SedConst2DBlock()
|
aed_silica |
SilicaBlock
|
|
SilicaBlock()
|
aed_nitrogen |
NitrogenBlock
|
|
NitrogenBlock()
|
aed_phosphorus |
PhosphorusBlock
|
|
PhosphorusBlock()
|
aed_organic_matter |
OrganicMatterBlock
|
|
OrganicMatterBlock()
|
aed_phytoplankton |
PhytoplanktonBlock
|
|
PhytoplanktonBlock()
|
aed_zooplankton |
ZooplanktonBlock
|
|
ZooplanktonBlock()
|
aed_macrophyte |
MacrophyteBlock
|
|
MacrophyteBlock()
|
aed_bivalve |
BivalveBlock
|
|
BivalveBlock()
|
aed_totals |
TotalsBlock
|
|
TotalsBlock()
|
from_dict(nml_dict)
classmethod
¶
Initialise class instance from a dictionary.
Returns an instance of the class that has been initialised with a nested dictionary of NML parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_dict |
dict
|
A dictionary where the keys are the block names and the values are dictionaries of parameter names (keys) and parameter values (values). |
required |
from_file(nml_path)
classmethod
¶
Initialise class instance from a NML file.
Returns an instance of the class that has been initialised with parameters from a NML file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
dict
|
Path to the NML file. |
required |
get_block(block_name)
¶
Get a NML Block.
Returns an instance of a NMLBlock
subclass from the NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_block_names()
¶
List the block names.
Returns a list of the name
attribute for all NMLBlock
subclass instances.
get_param_names(block_name)
¶
List the parameter names in a block.
Returns a list of the name
attribute for all NMLParam
instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_param_units(block_name, param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(block_name, param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_blocks(*args)
¶
Populate the blocks
dictionary with instances of NMLBlock
subclasses.
is_none_nml()
¶
Test if all NML parameter values are None
.
Returns True
if is_none_block()
is True
for all
subclassed NMLBlock
instances in the blocks
dictionary.
iter_blocks()
¶
Iterate over all NMLBlock
objects.
iter_params()
¶
Iterate over all NMLParam
objects.
set_block(block_name, block)
¶
Set a NML Block.
Overrides, or adds a new block, to a NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
block |
NMLBlock
|
The block to set. |
required |
set_param_value(block_name, param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_blocks=True, none_params=True)
¶
Nested dictionary of parameters.
Returns a nested dictionary where the keys are the block names and the values a dictionary of parameter values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_blocks |
bool
|
Whether to include blocks where all parameter values are
|
True
|
none_params |
bool
|
Whether to include parameter values that are |
True
|
to_nml(nml_path='glm3.nml')
¶
Write a NML file.
Parameters with values of None
are omitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
str
|
Path to the NML file |
'glm3.nml'
|
BivalveBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_bivalve
block.
A model of one or more groups of benthic filter feeders, able to assimilate C, N and P and recycle filter material back to the water column and sediment.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_biv=None, the_biv=None, dbase=None, x_c=None, n_zones=None, active_zones=None, initfromdensity=None, simbivtracer=None, simbivfeedback=None, simstaticbiomass=None, bt_renewal=None, dn_target_variable=None, pn_target_variable=None, dp_target_variable=None, pp_target_variable=None, dc_target_variable=None, pc_target_variable=None, do_uptake_variable=None, ss_uptake_variable=None, simfixedenv=None, fixed_temp=None, fixed_oxy=None, fixed_food=None, extra_diag=None, diag_level=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_biv |
Union[int, None]
|
Number of zooplankton groups. |
None
|
the_biv |
Union[List[int], int, None]
|
List of IDs of groups in |
None
|
dbase |
Union[str, None]
|
|
None
|
x_c |
Union[float, None]
|
Undocumented parameter. |
None
|
n_zones |
Union[int, None]
|
Number of sediment zones where bivalves will be active. |
None
|
active_zones |
Union[List[int], int, None]
|
The vector of sediment zones to include. |
None
|
initfromdensity |
Union[bool, None]
|
Undocumented parameter, |
None
|
simbivtracer |
Union[bool, None]
|
Opton to include water column tracer tracking filtration amount. |
None
|
simbivfeedback |
Union[bool, None]
|
Switch to enable/disable feedbacks between bivalve metabolism and water column variable concentration. |
None
|
simstaticbiomass |
Union[bool, None]
|
Undocumented parameter. |
None
|
bt_renewal |
Union[float, None]
|
Undocumented parameter. |
None
|
dn_target_variable |
Union[str, None]
|
Water column variable to receive DON excretion. |
None
|
pn_target_variable |
Union[str, None]
|
Water column variable to receive PON egestion/mortality. |
None
|
dp_target_variable |
Union[str, None]
|
Water column variable to receive DOP excretion. |
None
|
pp_target_variable |
Union[str, None]
|
Water column variable to receive POP egestion/mortality. |
None
|
dc_target_variable |
Union[str, None]
|
Water column variable to receive DOC excretion. |
None
|
pc_target_variable |
Union[str, None]
|
Water column variable to receive POC egestion/mortality. |
None
|
do_uptake_variable |
Union[str, None]
|
Water column variable providing DO concentration. |
None
|
ss_uptake_variable |
Union[str, None]
|
Water column variable providing SS concentration. |
None
|
simfixedenv |
Union[bool, None]
|
Switch to enable/disable environmental variables to be fixed (for testing). |
None
|
fixed_temp |
Union[float, None]
|
Fixed temperature. |
None
|
fixed_oxy |
Union[float, None]
|
Fixed oxygen concentration. |
None
|
fixed_food |
Union[float, None]
|
Fixed food concentration. |
None
|
extra_diag |
Union[bool, None]
|
Switch to enable/disable extra diagnostics to be output. |
None
|
diag_level |
Union[int, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
CarbonBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_carbon
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(dic_initial=None, ph_initial=None, ch4_initial=None, co2_model=None, alk_mode=None, ionic=None, atm_co2=None, atm_ch4=None, co2_piston_model=None, ch4_piston_model=None, rch4ox=None, kch4ox=None, vtch4ox=None, methane_reactant_variable=None, fsed_dic=None, ksed_dic=None, theta_sed_dic=None, fsed_dic_variable=None, fsed_ch4=None, ksed_ch4=None, theta_sed_ch4=None, fsed_ch4_variable=None, ebb_model=None, fsed_ebb_variable=None, fsed_ch4_ebb=None, ch4_bub_all=None, ch4_bub_cll=None, ch4_bub_kll=None, ch4_bub_disf1=None, ch4_bub_disf2=None, ch4_bub_disdp=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dic_initial |
Union[float, None]
|
Initial DIC cooncentrations. |
None
|
ph_initial |
Union[float, None]
|
Initial pH values. |
None
|
ch4_initial |
Union[float, None]
|
Initial CH4 values. |
None
|
co2_model |
Union[int, None]
|
Selection of pCO2 model algorithms. |
None
|
alk_mode |
Union[int, None]
|
Selection of total alkalinity model algorithms. |
None
|
ionic |
Union[float, None]
|
Average ionic strength of the water column. |
None
|
atm_co2 |
Union[float, None]
|
Atmospheric CO2 concentration. |
None
|
atm_ch4 |
Union[float, None]
|
Atmospheric CH4 concentration. |
None
|
co2_piston_model |
Union[int, None]
|
Selection of air-water Co2 flux velocity method. |
None
|
ch4_piston_model |
Union[int, None]
|
Selection of air-water CH4 flux velocity method. |
None
|
rch4ox |
Union[float, None]
|
Maximum reaction rate of CH4 oxidation at 20C. |
None
|
kch4ox |
Union[float, None]
|
Half-saturation oxygen concentration for CH4 oxidation. |
None
|
vtch4ox |
Union[float, None]
|
Arrhenius temperature multiplier for CH4 oxidation. |
None
|
methane_reactant_variable |
Union[str, None]
|
State variable to be consumed during CH4 oxidation. |
None
|
fsed_dic |
Union[float, None]
|
Sediment CO2 flux. |
None
|
ksed_dic |
Union[float, None]
|
Half-saturation oxygen concentration controlling CO2 flux. |
None
|
theta_sed_dic |
Union[float, None]
|
Arrhenius temperature multiplier for sediment CO2 flux. |
None
|
fsed_dic_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
fsed_ch4 |
Union[float, None]
|
Sediment CH4 flux. |
None
|
ksed_ch4 |
Union[float, None]
|
Half-saturation oxygen concentration controlling CH4 flux. |
None
|
theta_sed_ch4 |
Union[float, None]
|
Arrhenius temperature multiplier for sediment CH4 flux. |
None
|
fsed_ch4_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zone. |
None
|
ebb_model |
Union[int, None]
|
Option to activate CH4 ebullition. |
None
|
fsed_ebb_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
fsed_ch4_ebb |
Union[float, None]
|
Undocumented parameter. |
None
|
ch4_bub_all |
Union[float, None]
|
Mean water depth. |
None
|
ch4_bub_cll |
Union[float, None]
|
Normalising constant. |
None
|
ch4_bub_kll |
Union[float, None]
|
Exponential factor from the depth-ebullition regression relation. |
None
|
ch4_bub_disf1 |
Union[float, None]
|
Bubble dissolution fraction (surface). |
None
|
ch4_bub_disf1 |
Union[float, None]
|
Bubble dissolution fraction (deep). |
None
|
ch4_bub_disdp |
Union[float, None]
|
Bubble dissolution fraction depth interface. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
MacrophyteBlock
¶
Bases: NMLBlock
aed_macrophyte
block.
Simulates benthic habitat and/or growth of macrophytes such as seagrasses in specified sediment zones.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_mphy=None, the_mphy=None, n_zones=None, active_zones=None, simstaticbiomass=None, simmacfeedback=None, dbase=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_mphy |
Union[int, None]
|
Undocumented parameter. |
None
|
the_mphy |
Union[List[int], None]
|
Undocumented parameter. |
None
|
n_zones |
Union[int, None]
|
Undocumented parameter. |
None
|
active_zones |
Union[List[int], None]
|
Undocumented parameter. |
None
|
simstaticbiomass |
Union[bool, None]
|
Undocumented parameter. |
None
|
simmacfeedback |
Union[bool, None]
|
Undocumented parameter. |
None
|
dbase |
Union[str, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
ModelsBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_models
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(models=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
models |
Union[List[str], None]
|
The AED modules to use. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
NitrogenBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_nitrogen
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(amm_initial=None, nit_initial=None, n2o_initial=None, no2_initial=None, rnitrif=None, knitrif=None, theta_nitrif=None, nitrif_reactant_variable=None, nitrif_ph_variable=None, simnitrfph=None, rnh4o2=None, rno2o2=None, simn2o=None, rn2o=None, kpart_ammox=None, kin_deamm=None, atm_n2o=None, n2o_piston_model=None, rnh4no2=None, kanammox=None, kanmx_nit=None, kanmx_amm=None, rdenit=None, kdenit=None, theta_denit=None, rdnra=None, kdnra_oxy=None, simdrydeposition=None, atm_din_dd=None, simwetdeposition=None, atm_din_conc=None, ksed_amm=None, ksed_nit=None, fsed_n2o=None, ksed_n2o=None, theta_sed_amm=None, theta_sed_nit=None, fsed_amm=None, fsed_nit=None, fsed_amm_variable=None, fsed_nit_variable=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amm_initial |
Union[float, None]
|
Initial CH4 concentrations. |
None
|
nit_initial |
Union[float, None]
|
Initial NO3 concentrations. |
None
|
n2o_initial |
Union[float, None]
|
Initial N2O concentrations. |
None
|
no2_initial |
Union[float, None]
|
Initial NO2 concentrations. |
None
|
rnitrif |
Union[float, None]
|
Maximum reaction rate of nitrification at 20C. |
None
|
knitrif |
Union[float, None]
|
Half-saturation oxygen concentration for nitrification. |
None
|
theta_nitrif |
Union[float, None]
|
Undocumented parameter. |
None
|
nitrif_reactant_variable |
Union[str, None]
|
State variable to be consumed during nitrifition. |
None
|
nitrif_ph_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
simnitrfph |
Union[bool, None]
|
Undocumented parameter. |
None
|
rnh4o2 |
Union[float, None]
|
Kinetic rate constant for nitratation. |
None
|
rno2o2 |
Union[float, None]
|
Kinetic rate constant for nitratation. |
None
|
simn2o |
Union[int, None]
|
Switch to use simple or advanced N reactions. |
None
|
rn2o |
Union[float, None]
|
Kinetic rate constant for N2O consumption |
None
|
kpart_ammox |
Union[float, None]
|
Partitioning parameter for the products of ammonium oxidation, based on O2 concentration. |
None
|
kin_deamm |
Union[float, None]
|
O2 concentration for inhibition of deammonification. |
None
|
atm_n2o |
Union[float, None]
|
Atmospheric N2O concentration. |
None
|
n2o_piston_model |
Union[int, None]
|
Undocumented parameter. |
None
|
rnh4no2 |
Union[float, None]
|
Kinetic rate constant for deammonification. |
None
|
kanammox |
Union[float, None]
|
Undocumented parameter. |
None
|
kanmx_nit |
Union[float, None]
|
Undocumented parameter. |
None
|
kanmx_amm |
Union[float, None]
|
Undocumented parameter. |
None
|
rdenit |
Union[float, None]
|
Maximum reaction rate of denitrification at 20C. |
None
|
kdenit |
Union[float, None]
|
Half-saturation oxygen concentration for denitrification. |
None
|
theta_denit |
Union[float, None]
|
Undocumented parameter. |
None
|
rdnra |
Union[float, None]
|
Undocumented parameter. |
None
|
kdnra_oxy |
Union[float, None]
|
Undocumented parameter. |
None
|
simdrydeposition |
Union[bool, None]
|
Undocumented parameter. |
None
|
atm_din_dd |
Union[float, None]
|
Undocumented parameter. |
None
|
simwetdeposition |
Union[bool, None]
|
Undocumented parameter. |
None
|
atm_din_conc |
Union[float, None]
|
Undocumented parameter. |
None
|
ksed_amm |
Union[float, None]
|
Undocumented parameter. |
None
|
ksed_nit |
Union[float, None]
|
Undocumented parameter. |
None
|
fsed_n2o |
Union[float, None]
|
Maximum N2O sediment flux rate. |
None
|
ksed_n2o |
Union[float, None]
|
O2 inhibition concentration parameter. |
None
|
theta_sed_amm |
Union[float, None]
|
Undocumented parameter. |
None
|
theta_sed_nit |
Union[float, None]
|
Undocumented parameter. |
None
|
fsed_amm |
Union[float, None]
|
Sediment NH4 flux. |
None
|
fsed_nit |
Union[float, None]
|
Undocumented parameter. |
None
|
fsed_amm_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
fsed_nit_variable |
Union[str, None]
|
|
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
NonCohesiveBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_noncohesive
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_ss=None, ss_initial=None, ke_ss=None, settling=None, w_ss=None, d_ss=None, rho_ss=None, resuspension=None, epsilon=None, tau_0=None, tau_r=None, ktau_0=None, macrophyte_link_var=None, simsedimentmass=None, fs=None, sed_porosity=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_ss |
Union[int, None]
|
Undocumented parameter. |
None
|
ss_initial |
Union[List[int], None]
|
Undocumented parameter. |
None
|
ke_ss |
Union[List[float], None]
|
Undocumented parameter. |
None
|
settling |
Union[int, None]
|
Undocumented parameter. |
None
|
w_ss |
Union[List[float], None]
|
Undocumented parameter. |
None
|
d_ss |
Union[List[float], None]
|
Undocumented parameter. |
None
|
rho_ss |
Union[List[float], None]
|
Undocumented parameter. |
None
|
resuspension |
Union[int, None]
|
Undocumented parameter. |
None
|
epsilon |
Union[float, None]
|
Undocumented parameter. |
None
|
tau_0 |
Union[List[float], None]
|
Undocumented parameter. |
None
|
tau_r |
Union[float, None]
|
Undocumented parameter. |
None
|
ktau_0 |
Union[float, None]
|
Undocumented parameter. |
None
|
macrophyte_link_var |
Union[str, None]
|
Undocumented parameter. |
None
|
simsedimentmass |
Union[bool, None]
|
Undocumented parameter. |
None
|
fs |
Union[List[float], None]
|
Undocumented parameter. |
None
|
sed_porosity |
Union[float, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
OrganicMatterBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_organic_matter
block.
Organic matter variables cover the C, N & P stored in the dissolved and particulate organic matter pools. This module optionally also supports depiction of “labile” vs “refractory” fractions of organic matter, including the breakdown and hydrolysis process, photo-degradation and mineralisation.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(poc_initial=None, doc_initial=None, pon_initial=None, don_initial=None, pop_initial=None, dop_initial=None, docr_initial=None, donr_initial=None, dopr_initial=None, cpom_initial=None, rdom_minerl=None, rdoc_minerl=None, rdon_minerl=None, rdop_minerl=None, rpoc_hydrol=None, rpon_hydrol=None, rpop_hydrol=None, theta_hydrol=None, theta_minerl=None, kpom_hydrol=None, kdom_minerl=None, simdenitrification=None, dom_miner_oxy_reactant_var=None, dom_miner_nit_reactant_var=None, dom_miner_no2_reactant_var=None, dom_miner_n2o_reactant_var=None, dom_miner_fe3_reactant_var=None, dom_miner_so4_reactant_var=None, dom_miner_ch4_reactant_var=None, doc_miner_product_variable=None, don_miner_product_variable=None, dop_miner_product_variable=None, f_an=None, k_nit=None, simrpools=None, rdomr_minerl=None, rcpom_bdown=None, x_cpom_n=None, x_cpom_p=None, kedom=None, kepom=None, kedomr=None, kecpom=None, simphotolysis=None, photo_c=None, settling=None, w_pom=None, d_pom=None, rho_pom=None, w_cpom=None, d_cpom=None, rho_cpom=None, resuspension=None, resus_link=None, sedimentomfrac=None, xsc=None, xsn=None, xsp=None, fsed_doc=None, fsed_don=None, fsed_dop=None, ksed_dom=None, theta_sed_dom=None, fsed_doc_variable=None, fsed_don_variable=None, fsed_dop_variable=None, diag_level=None, extra_diag=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
poc_initial |
Union[float, None]
|
Initial POC concentration. |
None
|
doc_initial |
Union[float, None]
|
Initial DOC concentration. |
None
|
pon_initial |
Union[float, None]
|
Initial PON concentration. |
None
|
don_initial |
Union[float, None]
|
Initial DON concentration. |
None
|
pop_initial |
Union[float, None]
|
Initial POP concentration. |
None
|
dop_initial |
Union[float, None]
|
Initial DOP concentration. |
None
|
docr_initial |
Union[float, None]
|
Initial DOCR concentration. Required if |
None
|
donr_initial |
Union[float, None]
|
Initial DONR concentration. Required if |
None
|
dopr_initial |
Union[float, None]
|
Initial DOPR concentration. Required if |
None
|
cpom_initial |
Union[float, None]
|
Initial CPOM concentration. Required if |
None
|
rdom_minerl |
Union[float, None]
|
Reference DOM mineralisation rate at 20C. |
None
|
rdoc_minerl |
Union[float, None]
|
Reference DOC mineralisation rate at 20C. |
None
|
rdon_minerl |
Union[float, None]
|
Reference DON mineralisation rate at 20C. |
None
|
rdop_minerl |
Union[float, None]
|
Reference DOP mineralisation rate at 20C. |
None
|
rpoc_hydrol |
Union[float, None]
|
Reference POC hydrolysis/breakdown rate at 20C. |
None
|
rpon_hydrol |
Union[float, None]
|
Reference PON hydrolysis/breakdown rate at 20C. |
None
|
rpop_hydrol |
Union[float, None]
|
Reference POP hydrolysis/breakdown rate at 20C. |
None
|
theta_hydrol |
Union[float, None]
|
Arrhenius temperature scaling coefficient for POC hydrolysis. |
None
|
theta_minerl |
Union[float, None]
|
Arrhenius temperature scaling coefficient for DOM mineralisation. |
None
|
kpom_hydrol |
Union[float, None]
|
Half-saturation O2 concentration for POM hydrolysis. |
None
|
kdom_minerl |
Union[float, None]
|
Half-saturation O2 concentration for DOM hydrolysis. |
None
|
simdenitrification |
Union[int, None]
|
Option to select denitrification sub-model. |
None
|
dom_miner_oxy_reactant_var |
Union[str, None]
|
State variable used to control aerobic mineralisation. |
None
|
dom_miner_nit_reactant_var |
Union[str, None]
|
State variable used to control nitrate reduction. |
None
|
dom_miner_no2_reactant_var |
Union[str, None]
|
State variable used to control nitrite reduction. |
None
|
dom_miner_n2o_reactant_var |
Union[str, None]
|
State variable used to control N2O reduction. |
None
|
dom_miner_fe3_reactant_var |
Union[str, None]
|
State variable used to control iron reduction. |
None
|
dom_miner_so4_reactant_var |
Union[str, None]
|
State variable used to control sulfate reduction. |
None
|
dom_miner_ch4_reactant_var |
Union[str, None]
|
State variable to receive methan. |
None
|
doc_miner_product_variable |
Union[str, None]
|
State variable to receive DIC. |
None
|
don_miner_product_variable |
Union[str, None]
|
State variable to receive NH4. |
None
|
dop_miner_product_variable |
Union[str, None]
|
State variable to receive PO4. |
None
|
f_an |
Union[float, None]
|
Undocumented parameter. |
None
|
k_nit |
Union[float, None]
|
Undocumented parameter. |
None
|
simrpools |
Union[bool, None]
|
Option to include refractory OM pools, including DOM_{R} and CPOM. |
None
|
rdomr_minerl |
Union[float, None]
|
Reference DOM_{R} mineralisation rate at 20C. |
None
|
rcpom_bdown |
Union[float, None]
|
Reference CPOM hydrolysis/breakdown rate at 20C. |
None
|
x_cpom_n |
Union[float, None]
|
CPOM nitrogen stoichiometry. |
None
|
x_cpom_p |
Union[float, None]
|
CPOM phosphorus stoichiometry. |
None
|
kedom |
Union[float, None]
|
Specific light attenuation coefficient for DOM. |
None
|
kepom |
Union[float, None]
|
Specific light attenuation coefficient for POM. |
None
|
kedomr |
Union[float, None]
|
Specific light attenuation coefficient for DOM_{R}. |
None
|
kecpom |
Union[float, None]
|
Specific light attenuation coefficient for CPOM. |
None
|
simphotolysis |
Union[bool, None]
|
Option to include photo-mineralisation of DOM_{R}. |
None
|
photo_c |
Union[float, None]
|
Photolysis constant. |
None
|
settling |
Union[int, None]
|
Option to set the method of settling for POM and CPOM. |
None
|
w_pom |
Union[float, None]
|
Sedimentation velocity of POM detrital particles. Used if
|
None
|
d_pom |
Union[float, None]
|
Diameter of POM detrital particles. Used if |
None
|
rho_pom |
Union[float, None]
|
Density of POM detrital particles. Used if |
None
|
w_cpom |
Union[float, None]
|
Sedimentation velocity of CPOM particles. Used if
|
None
|
d_cpom |
Union[float, None]
|
Diameter of CPOM particles. Used if |
None
|
rho_cpom |
Union[float, None]
|
Density of CPOM detrital particles. Used if |
None
|
resuspension |
Union[int, None]
|
Option to set the method of resuspension for POM and CPOM. |
None
|
resus_link |
Union[str, None]
|
Diagnostic variable to link to for resuspension rate. |
None
|
sedimentomfrac |
Union[float, None]
|
Fraction by weight of surficial sediment organic matter. |
None
|
xsc |
Union[float, None]
|
Stoichiometry of sedment particulate carbon. |
None
|
xsn |
Union[float, None]
|
Stoichiometry of sedment particulate nitrogen. |
None
|
xsp |
Union[float, None]
|
Stoichiometry of sedment particulate phosphorus. |
None
|
fsed_doc |
Union[float, None]
|
Reference sediment DOC flux at 20C. |
None
|
fsed_don |
Union[float, None]
|
Reference sediment DON flux at 20C. |
None
|
fsed_dop |
Union[float, None]
|
Reference sediment DOP flux at 20C. |
None
|
ksed_dom |
Union[float, None]
|
Half-saturation oxygen concentraion controlling DOM sediment flux. |
None
|
theta_sed_dom |
Union[float, None]
|
Arrhenius temperature multiplier for sediment DOM flux. |
None
|
fsed_doc_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
fsed_don_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
fsed_dop_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
diag_level |
Union[int, None]
|
Undocumented parameter. |
None
|
extra_diag |
Union[bool, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
OxygenBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_oxygen
block.
Dissolved oxygen (DO) dynamics are able to be simulated, accounting for atmospheric exchange and sediment oxygen demand, and through links to other modules will account for microbial use during organic matter mineralisation and nitrification, photosynthetic oxygen production and respiratory oxygen consumption, and respiration by other optional biotic components
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(oxy_initial=None, oxy_min=None, oxy_max=None, fsed_oxy=None, ksed_oxy=None, theta_sed_oxy=None, fsed_oxy_variable=None, oxy_piston_model=None, altitude=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
oxy_initial |
Union[float, None]
|
Initial O2 concentration. |
None
|
oxy_min |
Union[float, None]
|
Minimum O2 concentration. |
None
|
oxy_max |
Union[float, None]
|
Maximum O2 concentration. |
None
|
fsed_oxy |
Union[float, None]
|
Sediment O2 flux at 20C. |
None
|
ksed_oxy |
Union[float, None]
|
Arrhenius temperature multiplier for sediment O2 flux. |
None
|
fsed_oxy_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
oxy_piston_model |
Union[int, None]
|
Selection of air/water O2 flux velocity method. |
None
|
altitude |
Union[float, None]
|
Altitude of site above sea level. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
PhosphorusBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_phosphorus
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(frp_initial=None, frp_min=None, frp_max=None, fsed_frp=None, ksed_frp=None, theta_sed_frp=None, phosphorus_reactant_variable=None, fsed_frp_variable=None, simpo4adsorption=None, ads_use_external_tss=None, po4sorption_target_variable=None, po4adsorptionmodel=None, kpo4p=None, kadsratio=None, qmax=None, w_po4ads=None, ads_use_ph=None, ph_variable=None, simdrydeposition=None, atm_pip_dd=None, simwetdeposition=None, atm_frp_conc=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frp_initial |
Union[float, None]
|
Initial PO4 concentration. |
None
|
frp_min |
Union[float, None]
|
Minimum PO4 concentration. |
None
|
frp_max |
Union[float, None]
|
Maximum PO4 concentration. |
None
|
fsed_frp |
Union[float, None]
|
Sediment PO4 flux at 20C. |
None
|
ksed_frp |
Union[float, None]
|
Half-saturation oxygen concentration controlling O2 flux. |
None
|
theta_sed_frp |
Union[float, None]
|
Arrhenius temperature multiplier for sediment O2 flux. |
None
|
phosphorus_reactant_variable |
Union[str, None]
|
State variable used to control PO4 sediment release. |
None
|
fsed_frp_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
simpo4adsorption |
Union[bool, None]
|
Option to allow include absorption. |
None
|
ads_use_external_tss |
Union[bool, None]
|
Option to use externally simulated TSS concentration as sorbent. |
None
|
po4sorption_target_variable |
Union[str, None]
|
Variable name to link to for PO4 sorbent. |
None
|
po4adsorptionmodel |
Union[int, None]
|
Selection of PO4 sorption method. |
None
|
kpo4p |
Union[float, None]
|
Sorption partitioning coefficient. |
None
|
kadsratio |
Union[float, None]
|
Ratio of adsorption and desorp-tion rate coefficients (for
|
None
|
qmax |
Union[float, None]
|
Maximum adsorption capacity (for |
None
|
w_po4ads |
Union[float, None]
|
Sedimentation velocity of |
None
|
ads_use_ph |
Union[bool, None]
|
Option to include pH control on sorption coefficient. Function based on pH sorption control on Fe minerals. |
None
|
ph_variable |
Union[str, None]
|
Variable name to link to for pH to influence sorption. |
None
|
simdrydeposition |
Union[bool, None]
|
Option to include dry (particulate) deposition of P. |
None
|
atm_pip_dd |
Union[float, None]
|
|
None
|
simwetdeposition |
Union[bool, None]
|
Option to include wet deposition of P through rainfall. |
None
|
atm_frp_conc |
Union[float, None]
|
PO4 concentration in rainfall. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
PhytoplanktonBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_phytoplankton
block.
Highly customisable phytoplankton module for simulating change in algae, cyano-bacteria and chl-a, including phytoplankton production/respiration, nutrient uptake, excretion, vertical movement (eg buoyancy control), and grazing effects. Benthic phytoplankton may also be optionally configured.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_phytos=None, the_phytos=None, settling=None, do_mpb=None, r_mpbg=None, r_mpbr=None, i_kmpb=None, mpb_max=None, resuspension=None, n_zones=None, active_zones=None, resus_link=None, p_excretion_target_variable=None, n_excretion_target_variable=None, c_excretion_target_variable=None, si_excretion_target_variable=None, p_mortality_target_variable=None, n_mortality_target_variable=None, c_mortality_target_variable=None, si_mortality_target_variable=None, p1_uptake_target_variable=None, n1_uptake_target_variable=None, n2_uptake_target_variable=None, si_uptake_target_variable=None, do_uptake_target_variable=None, c_uptake_target_variable=None, dbase=None, min_rho=None, max_rho=None, diag_level=None, extra_diag=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_phytos |
Union[int, None]
|
Number of phytoplankton groups/species. |
None
|
the_phytos |
Union[List[int], int, None]
|
Set of chosen group IDs within the database file. |
None
|
settling |
Union[List[int], int, None]
|
Option to set the method of settling for PHY group alpha. |
None
|
do_mpb |
Union[int, None]
|
Option to include MPB as a simulated benthic variable. |
None
|
r_mpbg |
Union[float, None]
|
Maximum growth rate of MPB. |
None
|
r_mpbr |
Union[float, None]
|
Dark respiration rate of MPB. |
None
|
i_kmpb |
Union[float, None]
|
Half saturation constant for light limitation of growth. |
None
|
mpb_max |
Union[float, None]
|
Maximum biomass density of MPB. |
None
|
resuspension |
Union[float, None]
|
Fraction to set the amount of resuspension for PHY group alpha. |
None
|
n_zones |
Union[int, None]
|
Number of benthic zones where MPB is active. |
None
|
active_zones |
Union[int, None]
|
Set of benthic zones with MPB active. |
None
|
resus_link |
Union[str, None]
|
Undocumented parameter. |
None
|
p_excretion_target_variable |
Union[str, None]
|
State variable to add DOP excretion. |
None
|
n_excretion_target_variable |
Union[str, None]
|
State variable to add DON excretion. |
None
|
c_excretion_target_variable |
Union[str, None]
|
State variable to add DOC excretion. |
None
|
si_excretion_target_variable |
Union[str, None]
|
State variable to add Si excretion. |
None
|
p_mortality_target_variable |
Union[str, None]
|
State variable to add POP mortality |
None
|
n_mortality_target_variable |
Union[str, None]
|
State variable to add PON mortality. |
None
|
c_mortality_target_variable |
Union[str, None]
|
State variable to add POC mortality. |
None
|
si_mortality_target_variable |
Union[str, None]
|
State variable to add Si mortality. |
None
|
p1_uptake_target_variable |
Union[str, None]
|
State variable to provide FRP for growth. |
None
|
n1_uptake_target_variable |
Union[str, None]
|
State variable to provide NO3 for growth. |
None
|
n2_uptake_target_variable |
Union[str, None]
|
State variable to provide NH4 for growth. |
None
|
si_uptake_target_variable |
Union[str, None]
|
State variable to provide Si for growth. |
None
|
do_uptake_target_variable |
Union[str, None]
|
State variable to incremen during growth. |
None
|
c_uptake_target_variable |
Union[str, None]
|
State variable to provide DIC during growth. |
None
|
dbase |
Union[str, None]
|
Phytoplankton parameter database file. |
None
|
min_rho |
Union[float, None]
|
Minimum cellular density. Used if |
None
|
max_rho |
Union[float, None]
|
Maximum cellular density. Used if |
None
|
diag_level |
Union[int, None]
|
Extent of diagnostic output. |
None
|
extra_diag |
Union[bool, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
SedConst2DBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_sed_const2d
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(n_zones=None, active_zones=None, fsed_oxy=None, fsed_rsi=None, fsed_amm=None, fsed_nit=None, fsed_frp=None, fsed_pon=None, fsed_don=None, fsed_pop=None, fsed_dop=None, fsed_poc=None, fsed_doc=None, fsed_dic=None, fsed_ch4=None, fsed_feii=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_zones |
Union[int, None]
|
Number of zones. |
None
|
active_zones |
Union[int, None].
|
The zones to activate. |
None
|
fsed_oxy |
Union[List[float], None]
|
Sedimentation flux for oxygen. |
None
|
fsed_rsi |
Union[List[float], float, None]
|
Sedimentation flux for silica. |
None
|
fsed_amm |
Union[List[float], None]
|
Sedimentation flux for ammonia. |
None
|
fsed_nit |
Union[List[float], None]
|
Sedimentation flux for nitrogen. |
None
|
fsed_frp |
Union[List[float], None]
|
Sedimentation flux for phosphorus. |
None
|
fsed_pon |
Union[List[float], float, None]
|
Sedimentation flux for particulate organic nitrogen. |
None
|
fsed_don |
Union[List[float], float, None]
|
Sedimentation flux for dissolved organic nitrogen. |
None
|
fsed_pop |
Union[List[float], float, None]
|
Sedimentation flux for particulate organic phosphorus. |
None
|
fsed_dop |
Union[List[float], float, None]
|
Sedimentation flux for dissolved organic phosphorus. |
None
|
fsed_poc |
Union[List[float], float, None]
|
Sedimentation flux for particulate organic carbon. |
None
|
fsed_doc |
Union[List[float], float, None]
|
Sedimentation flux for dissolved organic carbon. |
None
|
fsed_dic |
Union[List[float], float, None]
|
Sedimentation flux for dissolved inorganic carbon. |
None
|
fsed_ch4 |
Union[List[float], None]
|
Sedimentation flux for methane. |
None
|
fsed_feii |
Union[List[float], float, None]
|
Sedimentation flux for iron. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
SedFluxBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_sedflux
block.
An interface module designed to provide spatially variable sediment flux settings to key modules (e.g., OXY, OGM, NUT), and/or link these variables to the dynamic sediment biogeochemistry model (SDG).
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(sedflux_model=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sedflux_model |
Union[str, None]
|
Controls the setup of zones and whether the flux is taken from a constant value or from CANDI-AED. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
SilicaBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_silica
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(rsi_initial=None, rsi_min=None, rsi_max=None, fsed_rsi=None, ksed_rsi=None, theta_sed_rsi=None, fsed_rsi_variable=None, silica_reactant_variable=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rsi_initial |
Union[float, None]
|
Initial RSi concentration. |
None
|
rsi_min |
Union[float, None]
|
Minimum RSi concentration. |
None
|
rsi_max |
Union[float, None]
|
Maximum RSi concentration. |
None
|
fsed_rsi |
Union[float, None]
|
Reference sediment RSi flux at 20C. |
None
|
ksed_rsi |
Union[float, None]
|
Half-saturation oxygen concentration controlling Si flux. |
None
|
theta_sed_rsi |
Union[float, None]
|
Arrhenius temperature multiplier for sediment Si flux. |
None
|
fsed_rsi_variable |
Union[str, None]
|
Variable name to link to for spatially resolved sediment zones. |
None
|
silica_reactant_variable |
Union[str, None]
|
State variable used to control Si sediment release. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
TotalsBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_totals
block.
aed_totals
is a summary module, allowing users to “sum-up”
component variables from other modules into a total, for example,
to compute TN, TP or TSS.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(outputlight=None, tn_vars=None, tn_varscale=None, tp_vars=None, tp_varscale=None, toc_vars=None, toc_varscale=None, tss_vars=None, tss_varscale=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outputlight |
Union[bool, None]
|
Undocumented parameter. |
None
|
tn_vars |
Union[List[str], str, None]
|
Undocumented parameter. |
None
|
tn_varscale |
Union[List[float], float, None]
|
Undocumented parameter. |
None
|
tp_vars |
Union[List[str], str, None]
|
Undocumented parameter. |
None
|
tp_varscale |
Union[List[float], float, None]
|
Undocumented parameter. |
None
|
toc_vars |
Union[List[str], str, None]
|
Undocumented parameter. |
None
|
toc_varscale |
Union[List[float], float, None]
|
Undocumented parameter. |
None
|
tss_vars |
Union[List[str], str, None]
|
Undocumented parameter. |
None
|
tss_varscale |
Union[List[float], float, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
TracerBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the aed_tracer
block.
Modellers can use the aed_tracer to simulate a dissolved or particulate tracer (subject to transport processes only), or this can be optionally configured to account for decay, sedimentation and/or resuspension. This module also include an option to simulate water “retention time” where the water age increments once enters into the waterbody.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(retention_time=None, num_tracers=None, decay=None, fsed=None, ke_ss=None, settling=None, w_ss=None, d_ss=None, rho_ss=None, resuspension=None, fs=None, epsilon=None, tau_0=None, tau_r=None, ktau_0=None, macrophyte_link_var=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
retention_time |
Union[bool, None]
|
Activates the retention time variable. |
None
|
num_tracers |
Union[int, None]
|
Number of tracers to model. |
None
|
decay |
Union[List[float], float, None]
|
Vector of decay rates for each simulated tracer group. |
None
|
fsed |
Union[List[float], None]
|
Vector of sediment flux rates for each simulated tracer group. |
None
|
ke_ss |
Union[List[float], float, None]
|
Vector of specific light attenuation constants for each simulated tracer group. |
None
|
settling |
Union[int, None]
|
Settling sub-model. |
None
|
w_ss |
Union[List[float], float, None]
|
Vector of sedimentation velocity. Used if |
None
|
d_ss |
Union[List[float], float, None]
|
Vector of particle diameter. Used if |
None
|
rho_ss |
Union[List[float], float, None]
|
Vector of particle density. Used if |
None
|
resuspension |
Union[int, None]
|
Resuspension sub-model. |
None
|
fs |
Union[List[float], float, None]
|
Vector of particle fraction within the sediment. Must be of
length |
None
|
epsilon |
Union[List[float], float, None]
|
Vector of resuspension rate coefficient. |
None
|
tau_0 |
Union[List[float], float, None]
|
Vector of critical shear stress for resuspension. |
None
|
tau_r |
Union[List[float], float, None]
|
Reference shear stress. |
None
|
ktau_0 |
Union[List[float], float, None]
|
Coefficient determining the effect of |
None
|
macrophyte_link_var |
Union[str, None]
|
AED2 benthic variable on which the critical shear stress depends. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
ZooplanktonBlock
¶
Bases: NMLBlock
aed_zooplankton
block.
Simulates different size classes of zooplankton, accounting for carbon and nutrient assimilation from grazing, carbon loss via respiration, excretion of DOM, faecal pellet production, mortality, and predation by larger organisms.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_zoops=None, the_zoops=None, dn_target_variable=None, pn_target_variable=None, dp_target_variable=None, pp_target_variable=None, dc_target_variable=None, pc_target_variable=None, dbase=None, simzoopfeedback=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_zoops |
Union[int, None]
|
Number of zooplankton groups. |
None
|
the_zoops |
Union[List[int], int, None]
|
List of ID's of groups in aed_zoo_pars database. Length
must equal |
None
|
dn_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
pn_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
dp_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
pp_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
dc_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
pc_target_variable |
Union[str, None]
|
Undocumented parameter. |
None
|
dbase |
Union[str, None]
|
Undocumented parameter. |
None
|
simzoopfeedback |
Union[bool, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
glm_nml
¶
BirdModelBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the bird_model
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(ap=None, oz=None, watvap=None, aod500=None, aod380=None, albedo=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ap |
Union[float, None]
|
Atmospheric pressure (hPa). |
None
|
oz |
Union[float, None]
|
Ozone concentration (atm-cm). |
None
|
watvap |
Union[float, None]
|
Total Precipitable water vapor (atm-cm). |
None
|
aod500 |
Union[float, None]
|
Dimensionless Aerosol Optical Depth at wavelength 500 nm. |
None
|
aod380 |
Union[float, None]
|
Dimensionless Aerosol Optical Depth at wavelength 380 nm. |
None
|
albedo |
Union[float, None]
|
Albedo of the surface used for Bird Model insolation calculation. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
GLMNML
¶
Bases: NML
NML
subclass for the glm
.NML file.
Attributes:
Name | Type | Description |
---|---|---|
blocks |
Dict[str, NMLBlock]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off block and parameter validation. |
__init__(glm_setup=GLMSetupBlock(), time=TimeBlock(), morphometry=MorphometryBlock(), init_profiles=InitProfilesBlock(), mixing=MixingBlock(), wq_setup=WQSetupBlock(), output=OutputBlock(), light=LightBlock(), bird_model=BirdModelBlock(), sediment=SedimentBlock(), snowice=SnowIceBlock(), meteorology=MeteorologyBlock(), inflow=InflowBlock(), outflow=OutflowBlock())
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
glm_setup |
GLMSetupBlock
|
|
GLMSetupBlock()
|
time |
TimeBlock
|
|
TimeBlock()
|
morphometry |
MorphometryBlock
|
|
MorphometryBlock()
|
init_profiles |
InitProfilesBlock
|
|
InitProfilesBlock()
|
mixing |
MixingBlock
|
|
MixingBlock()
|
wq_setup |
WQSetupBlock
|
|
WQSetupBlock()
|
output |
OutputBlock
|
|
OutputBlock()
|
light |
LightBlock
|
|
LightBlock()
|
bird_model |
BirdModelBlock
|
|
BirdModelBlock()
|
sediment |
SedimentBlock
|
|
SedimentBlock()
|
snowice |
SnowIceBlock
|
|
SnowIceBlock()
|
meteorology |
MeteorologyBlock
|
|
MeteorologyBlock()
|
inflow |
InflowBlock
|
|
InflowBlock()
|
outflow |
OutflowBlock
|
|
OutflowBlock()
|
from_dict(nml_dict)
classmethod
¶
Initialise class instance from a dictionary.
Returns an instance of the class that has been initialised with a nested dictionary of NML parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_dict |
dict
|
A dictionary where the keys are the block names and the values are dictionaries of parameter names (keys) and parameter values (values). |
required |
from_file(nml_path)
classmethod
¶
Initialise class instance from a NML file.
Returns an instance of the class that has been initialised with parameters from a NML file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
dict
|
Path to the NML file. |
required |
get_block(block_name)
¶
Get a NML Block.
Returns an instance of a NMLBlock
subclass from the NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_block_names()
¶
List the block names.
Returns a list of the name
attribute for all NMLBlock
subclass instances.
get_param_names(block_name)
¶
List the parameter names in a block.
Returns a list of the name
attribute for all NMLParam
instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_param_units(block_name, param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(block_name, param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_blocks(*args)
¶
Populate the blocks
dictionary with instances of NMLBlock
subclasses.
is_none_nml()
¶
Test if all NML parameter values are None
.
Returns True
if is_none_block()
is True
for all
subclassed NMLBlock
instances in the blocks
dictionary.
iter_blocks()
¶
Iterate over all NMLBlock
objects.
iter_params()
¶
Iterate over all NMLParam
objects.
set_block(block_name, block)
¶
Set a NML Block.
Overrides, or adds a new block, to a NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
block |
NMLBlock
|
The block to set. |
required |
set_param_value(block_name, param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_blocks=True, none_params=True)
¶
Nested dictionary of parameters.
Returns a nested dictionary where the keys are the block names and the values a dictionary of parameter values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_blocks |
bool
|
Whether to include blocks where all parameter values are
|
True
|
none_params |
bool
|
Whether to include parameter values that are |
True
|
to_nml(nml_path='glm3.nml')
¶
Write a NML file.
Parameters with values of None
are omitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
str
|
Path to the NML file |
'glm3.nml'
|
GLMSetupBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the glm_setup
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(sim_name=None, max_layers=None, min_layer_vol=None, min_layer_thick=None, max_layer_thick=None, density_model=None, non_avg=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sim_name |
Union[str, None]
|
Title of simulation. |
None
|
max_layers |
Union[int, None]
|
Maximum number of layers. |
None
|
min_layer_vol |
Union[float, None]
|
Minimum layer volume (m^3). |
None
|
min_layer_thick |
Union[float, None]
|
Minimum thickness of a layer (m). |
None
|
max_layer_thick |
Union[float, None]
|
Maximum thickness of a layer (m). |
None
|
density_model |
Union[int, None]
|
Switch to set the density equation. Options are |
None
|
non_avg |
Union[bool, None]
|
Switch to configure flow boundary condition temporal interpolation. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
InflowBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the inflow
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_inflows=None, names_of_strms=None, subm_flag=None, subm_elev=None, strm_hf_angle=None, strmbd_slope=None, strmbd_drag=None, coef_inf_entrain=None, inflow_factor=None, inflow_fl=None, inflow_varnum=None, inflow_vars=None, time_fmt=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_inflows |
Union[int, None]
|
Number of inflows to be simulated in this simulation. |
None
|
names_of_strms |
Union[List[str], str, None]
|
Names of each inflow. A list if |
None
|
subm_flag |
Union[List[bool], bool, None]
|
Switch indicating if the inflow is entering as a submerged
input. A list if |
None
|
subm_elev |
Union[List[float], float, None]
|
Elevation of the submerged inflow. A list if
|
None
|
strm_hf_angle |
Union[List[float], float, None]
|
Angle describing the width of an inflow river channel
("half angle"). A list if |
None
|
strmbd_slope |
Union[List[float], float, None]
|
Slope of the streambed / river thalweg for each river
(degrees). A list if |
None
|
strmbd_drag |
Union[List[float], float, None]
|
Drag coefficient of the river inflow thalweg, to calculate
entrainment during insertion. A list if |
None
|
coef_inf_entrain |
Union[List[float], float, None]
|
Undocumented parameter. A list if |
None
|
inflow_factor |
Union[List[float], float, None]
|
Scaling factor that can be applied to adjust the provided
input data. A list if |
None
|
inflow_fl |
Union[List[str], str, None]
|
Filename(s) of the inflow CSV boundary condition files. A
list if |
None
|
inflow_varnum |
Union[int, None]
|
Number of variables being listed in the columns of
|
None
|
inflow_vars |
Union[List[str], str, None]
|
Names of the variables in the |
None
|
time_fmt |
Union[str, None]
|
Time format of the 1st column in the |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
InitProfilesBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the init_profiles
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(lake_depth=None, num_depths=None, the_depths=None, the_temps=None, the_sals=None, num_wq_vars=None, wq_names=None, wq_init_vals=None, snow_thickness=None, white_ice_thickness=None, blue_ice_thickness=None, avg_surf_temp=None, restart_variables=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lake_depth |
Union[float, None]
|
Initial lake height/depth (m). |
None
|
num_depths |
Union[int, None]
|
Number of depths provided for initial profiles. |
None
|
the_depths |
Union[List[float], float, None]
|
The depths of the initial profile points (m). |
None
|
the_temps |
Union[List[float], float, None]
|
The temperature (°C) at each of the initial profile points. |
None
|
the_sals |
Union[List[float], float, None]
|
The salinity (ppt) at each of the initial profile points. |
None
|
num_wq_vars |
Union[int, None]
|
Number of non-GLM (i.e., FABM or AED2) variables to be initialised. |
None
|
wq_names |
Union[List[str], str, None]
|
Names of non-GLM (i.e., FABM or AED2) variables to be initialised. |
None
|
wq_init_vals |
Union[List[float], float, None]
|
List of water quality variable initial data. |
None
|
snow_thickness |
Union[float, None]
|
Thickness of snow (m). |
None
|
white_ice_thickness |
Union[float, None]
|
Thickness of white ice (m). |
None
|
blue_ice_thickness |
Union[float, None]
|
Thickness of blue ice (m). |
None
|
restart_variables |
Union[List[float], float, None]
|
Restart variables to restart model from a previous saved state. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
LightBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the light
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(light_mode=None, kw=None, kw_file=None, n_bands=None, light_extc=None, energy_frac=None, benthic_imin=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
light_mode |
Union[int, None]
|
Switch to configure the approach to light penetration.
Options are |
None
|
kw |
Union[float, None]
|
Light extinction coefficient (m^{-1}). Used when
|
None
|
kw_file |
Union[str, None]
|
Name of file with Kw time-series included. |
None
|
n_bands |
Union[int, None]
|
Number of light bandwidths to simulate. Used when
|
None
|
light_extc |
Union[List[float], float, None]
|
Comma-separated list of light extinction coefficients for each waveband. |
None
|
energy_frac |
Union[List[float], float, None]
|
Comma-separated list of energy fraction captured by each waveband. |
None
|
benthic_imin |
Union[float, None]
|
Critical fraction of incident light reaching the benthos. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
MeteorologyBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the meteorology
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(met_sw=None, meteo_fl=None, subdaily=None, time_fmt=None, rad_mode=None, albedo_mode=None, sw_factor=None, lw_type=None, cloud_mode=None, lw_factor=None, lw_offset=None, atm_stab=None, rh_factor=None, at_factor=None, ce=None, ch=None, rain_sw=None, rain_factor=None, catchrain=None, rain_threshold=None, runoff_coef=None, cd=None, wind_factor=None, fetch_mode=None, aws=None, xws=None, num_dir=None, wind_dir=None, fetch_scale=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
met_sw |
Union[bool, None]
|
Switch to enable the surface heating module. |
None
|
meteo_fl |
Union[str, None]
|
Filename of the meterological file. Include path and filename. |
None
|
subdaily |
Union[bool, None]
|
Switch to indicate the meteorological data is provided with
sub-daily resolution, at an interval equivalent to |
None
|
time_fmt |
Union[str, None]
|
Time format of the 1st column in the inflow_fl. For example,
'YYYY-MM-DD hh |
None
|
rad_mode |
Union[int, None]
|
Switch to configure which incoming radiation option to use.
Options are |
None
|
albedo_mode |
Union[int, None]
|
Switch to configure which albedo calculation option is
used. Options are |
None
|
sw_factor |
Union[float, None]
|
Scaling factor to adjust the shortwave radiation data
provided in the |
None
|
lw_type |
Union[str, None]
|
Switch to configure which input approach is being used for
longwave/cloud data in the |
None
|
cloud_mode |
Union[int, None]
|
Switch to configure which atmospheric emmissivity
calculation option is used. Options are |
None
|
lw_factor |
Union[float, None]
|
Scaling factor to adjust the longwave (or cloud) data
provided in the |
None
|
atm_stab |
Union[int, None]
|
Switch to configure which approach to atmospheric stability
is used. |
None
|
rh_factor |
Union[float, None]
|
Scaling factor to adjust the relative humidity data
provided in the |
None
|
at_factor |
Union[float, None]
|
Scaling factor to adjust the air temperature data provided
in the |
None
|
ce |
Union[float, None]
|
Bulk aerodynamic transfer coefficient for latent heat flux. |
None
|
ch |
Union[float, None]
|
Bulk aerodynamic transfer coefficient for sensible heat flux. |
None
|
rain_sw |
Union[bool, None]
|
Switch to configure rainfall input concentrations. |
None
|
rain_factor |
Union[float, None]
|
Scaling factor to adjust the rainfall data provided in the
|
None
|
catchrain |
Union[bool, None]
|
Switch that configures runoff from exposed banks of lake area. |
None
|
rain_threshold |
Union[float, None]
|
Daily rainfall amount (m) required before runoff from exposed banks occurs. |
None
|
runoff_coef |
Union[float, None]
|
Conversion fraction of infiltration excess rainfall to runoff in exposed lake banks. |
None
|
cd |
Union[float, None]
|
Bulk aerodynamic transfer coefficient for momentum. |
None
|
wind_factor |
Union[float, None]
|
Scaling factor to adjust the windspeed data provided in the
|
None
|
fetch_mode |
Union[int, None]
|
Switch to configure which wind-sheltering/fetch option to
use. Options are |
None
|
aws |
Union[float, None]
|
Undocumented parameter. Required if |
None
|
xws |
Union[float, None]
|
Undocumented parameter. Required if |
None
|
num_dir |
Union[int, None]
|
Number of wind direction reference points being read in.
Required if |
None
|
wind_dir |
Union[float, None]
|
Wind directions used for wind-sheltering effects. Required
if |
None
|
fetch_scale |
Union[float, None]
|
Direction specific wind-sheltering scaling factors.
Required if |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
MixingBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the mixing
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(surface_mixing=None, coef_mix_conv=None, coef_wind_stir=None, coef_mix_shear=None, coef_mix_turb=None, coef_mix_kh=None, deep_mixing=None, coef_mix_hyp=None, coef_mix_shreq=None, diff=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
surface_mixing |
Union[int, None]
|
Switch to select the options of the surface mixing model.
Options are |
None
|
coef_mix_conv |
Union[float, None]
|
Mixing efficiency - convective overturn. |
None
|
coef_wind_stir |
Union[float, None]
|
Mixing efficiency - wind stirring. |
None
|
coef_mix_shear |
Union[float, None]
|
Mixing efficiency - shear production. |
None
|
coef_mix_turb |
Union[float, None]
|
Mixing efficiency - unsteady turbulence effects. |
None
|
coef_mix_kh |
Union[float, None]
|
Mixing efficiency - Kelvin-Helmholtz billowing. |
None
|
deep_mixing |
Union[int, None]
|
Switch to select the options of the deep (hypolimnetic)
mixing model. Options are |
None
|
coef_mix_hyp |
Union[float, None]
|
Mixing efficiency - hypolimnetic turbulence. |
None
|
coef_mix_shreq |
Union[int, None]
|
Undocumented parameter. |
None
|
diff |
Union[float, None]
|
Background (molecular) diffusivity in the hypolimnion. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
MorphometryBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the morphometry
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(lake_name=None, latitude=None, longitude=None, base_elev=None, crest_elev=None, bsn_len=None, bsn_wid=None, bsn_vals=None, h=None, a=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lake_name |
Union[str, None]
|
Site name. |
None
|
latitude |
Union[float, None]
|
Latitude, positive North (°N). |
None
|
longitude |
Union[float, None]
|
Longitude, positive East (°E). |
None
|
base_elev |
Union[float, None]
|
Elevation of the bottom-most point of the lake (m above datum). |
None
|
crest_elev |
Union[float, None]
|
Elevation of a weir crest, where overflow begins (m above datum). |
None
|
bsn_len |
Union[float, None]
|
Length of the lake basin, at crest height (m). |
None
|
bsn_wid |
Union[float, None]
|
Width of the lake basin, at crest height (m). |
None
|
bsn_vals |
Union[int, None]
|
Number of points being provided to described the hyposgraphic details. |
None
|
h |
Union[List[float], None]
|
Comma-separated list of lake elevations (m above datum). |
None
|
a |
Union[List[float], None]
|
Comma-separated list of lake areas (m^2). |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
OutflowBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the outflow
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(num_outlet=None, outflow_fl=None, time_fmt=None, outflow_factor=None, outflow_thick_limit=None, single_layer_draw=None, flt_off_sw=None, outlet_type=None, outl_elvs=None, bsn_len_outl=None, bsn_wid_outl=None, crit_o2=None, crit_o2_dep=None, crit_o2_days=None, outlet_crit=None, o2name=None, o2idx=None, target_temp=None, min_lake_temp=None, fac_range_upper=None, fac_range_lower=None, mix_withdraw=None, coupl_oxy_sw=None, withdrtemp_fl=None, seepage=None, seepage_rate=None, crest_width=None, crest_factor=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_outlet |
Union[int, None]
|
Number of outflows (including withdrawals, outlets or offtakes) to be included in this simulation. |
None
|
outflow_fl |
Union[List[str], str, None]
|
Filename of the file containing the outflow time-series.
A list if |
None
|
time_fmt |
Union[str, None]
|
Time format of the 1st column in the |
None
|
outflow_factor |
Union[List[float], float, None]
|
Scaling factor used as a multiplier for outflows. A list if
|
None
|
outflow_thick_limit |
Union[List[float], float, None]
|
Maximum vertical limit of withdrawal entrainment. A list if
|
None
|
single_layer_draw |
Union[List[bool], bool, None]
|
Switch to only limit withdrawal entrainment and force
outflows from layer at the outlet elevation height. A list
if |
None
|
flt_off_sw |
Union[List[bool], bool, None]
|
Switch to indicate if the outflows are floating offtakes
(taking water from near the surface). A list if
|
None
|
outlet_type |
Union[List[int], int, None]
|
Switch to configure approach of each withdrawal. Options
are |
None
|
outl_elvs |
Union[List[float], float, None]
|
Outlet elevations (m). A list if |
None
|
bsn_len_outl |
Union[List[float], float, None]
|
Basin length at the outlet height(s) (m). A list if
|
None
|
bsn_wid_outl |
Union[List[float], float, None]
|
Basin width at the outlet heights (m). A list if
|
None
|
crit_o2 |
Union[int, None]
|
Undocumented parameter. |
None
|
crit_o2_dep |
Union[int, None]
|
Undocumented parameter. |
None
|
crit_o2_days |
Union[int, None]
|
Undocumented parameter. |
None
|
outlet_crit |
Union[int, None]
|
Undocumented parameter. |
None
|
o2name |
Union[str, None]
|
Undocumented parameter. |
None
|
o2idx |
Union[str, None]
|
Undocumented parameter. |
None
|
target_temp |
Union[float, None]
|
Undocumented parameter. |
None
|
min_lake_temp |
Union[float, None]
|
Undocumented parameter. |
None
|
fac_range_upper |
Union[float, None]
|
Undocumented parameter. |
None
|
fac_range_lower |
Union[float, None
|
Undocumented parameter. |
None
|
mix_withdraw |
Union[bool, None]
|
Undocumented parameter. |
None
|
coupl_oxy_sw |
Union[bool, None]
|
Undocumented parameter. |
None
|
withdrtemp_fl |
Union[str, None]
|
Filename of the file containing the temperature time-series
the adaptive withdrawal is targeting. Required if
|
None
|
seepage |
Union[bool, None]
|
Switch to enable the seepage of water from the lake bottom. |
None
|
seepage_rate |
Union[float, None]
|
Seepage rate of water, or, soil hydraulic conductivity (m day^{-1}). |
None
|
crest_width |
Union[float, None]
|
Width of weir (at crest height) where lake overflows (m). |
None
|
crest_factor |
Union[float, None]
|
Drag coefficient associated with the weir crest, used to compute the overflow discharge rate. Applies only when the crest elevation is configured to be less than the maximum elevation of the domain. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
OutputBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the output
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(out_dir=None, out_fn=None, nsave=None, csv_lake_fname=None, csv_point_nlevs=None, csv_point_fname=None, csv_point_frombot=None, csv_point_at=None, csv_point_nvars=None, csv_point_vars=None, csv_outlet_allinone=None, csv_outlet_fname=None, csv_outlet_nvars=None, csv_outlet_vars=None, csv_ovrflw_fname=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
out_dir |
Union[str, None]
|
Directory to write the output files. |
None
|
out_fn |
Union[str, None]
|
Filename of the main NetCDF output file. |
None
|
nsave |
Union[int, None]
|
Frequency to write to the NetCDF and CSV point files. |
None
|
csv_lake_fname |
Union[str, None]
|
Filename for the daily summary file. |
None
|
csv_point_nlevs |
Union[int, None]
|
Number of specific level/depth CSV files to be created. |
None
|
csv_point_fname |
Union[str, None]
|
Name to be appended to specified depth CSV files. |
None
|
csv_point_frombot |
Union[List[bool], bool, None]
|
Comma separated list identify whether each output point
listed in |
None
|
csv_point_at |
Union[List[float], float, None]
|
Height or Depth of points to output at (comma-separated list). |
None
|
csv_point_nvars |
Union[int, None]
|
Number of variables to output into the csv files. |
None
|
csv_point_vars |
Union[List[str], str, None]
|
Comma separated list of variable names. |
None
|
csv_outlet_allinone |
Union[bool, None]
|
Switch to create an optional outlet file combining all outlets. |
None
|
csv_outlet_fname |
Union[str, None]
|
Name to be appended to each of the outlet CSV files. |
None
|
csv_outlet_nvars |
Union[int, None]
|
Number of variables to be written into the outlet file(s). |
None
|
csv_outlet_vars |
Union[List[str], str, None]
|
Comma separated list of variable names to be included in the output file(s). |
None
|
csv_ovrflw_fname |
Union[str, None]
|
Filename to be used for recording the overflow details. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
SedimentBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the sediment
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(benthic_mode=None, sed_heat_model=None, n_zones=None, sed_heat_ksoil=None, sed_temp_depth=None, sed_temp_mean=None, sed_temp_amplitude=None, sed_temp_peak_doy=None, zone_heights=None, sed_reflectivity=None, sed_roughness=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
benthic_mode |
Union[int, None]
|
Switch to configure which mode of benthic interaction to
apply. Options are |
None
|
sed_heat_model |
Union[int, None]
|
Undocumented parameter. |
None
|
n_zones |
Union[int, None]
|
Number of sediment zones to simulate. Required if
|
None
|
sed_heat_ksoil |
Union[float, None]
|
Heat conductivity of soil/sediment. |
None
|
sed_temp_depth |
Union[float, None]
|
Depth of soil/sediment layer below the lake bottom, used for heat flux calculation. |
None
|
sed_temp_mean |
Union[List[float], float, None]
|
Annual mean sediment temperature. A list if |
None
|
sed_temp_amplitude |
Union[List[float], float, None]
|
Amplitude of temperature variation experienced in the
sediment over one year. A list if |
None
|
sed_temp_peak_doy |
Union[List[int], int, None]
|
Day of the year where the sediment temperature peaks. A
list if |
None
|
zone_heights |
Union[List[float], float, None]
|
Upper height of zone boundary. Required if |
None
|
sed_reflectivity |
Union[List[float], float, None]
|
Sediment reflectivity. |
None
|
sed_roughness |
Union[List[float], float, None]
|
Undocumented parameter. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
SnowIceBlock
¶
Bases: NMLBlock
snowice
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
__init__(snow_albedo_factor=None, snow_rho_min=None, snow_rho_max=None, min_ice_thickness=None, dt_iceon_avg=None, avg_surf_temp_thres=None)
¶
Paramters
snow_albedo_factor : Union[float, None] Scaling factor used to as a multiplier to scale the snow/ice albedo estimate. snow_rho_min : Union[float, None] Maximum snow density allowable (kg m^{-3}). snow_rho_max : Union[float, None] Minimum snow density allowable (kg m^{-3}). min_ice_thickness : Union[float, None] Undocumented parameter. dt_iceon_avg : Union[float, None] Undocumented parameter. avg_surf_temp_thres : Union[float, None] Undocumented parameter.
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
TimeBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the time
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(timefmt=None, start=None, stop=None, dt=None, num_days=None, timezone=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timefmt |
Union[int, None]
|
Time configuration switch. Options are |
None
|
start |
Union[str, None]
|
Start time/date of simulation in format
'yyyy-mm-dd hh |
None
|
stop |
Union[str, None]
|
End time/date of simulation in format
'yyyy-mm-dd hh |
None
|
dt |
Union[float, None]
|
Time step (seconds). |
None
|
num_days |
Union[int, None]
|
Number of days to simulate. Used when |
None
|
timezone |
Union[float, None]
|
UTC time zone. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
WQSetupBlock
¶
Bases: NMLBlock
NMLBlock
subclass for the wq_setup
block.
Attributes:
Name | Type | Description |
---|---|---|
params |
Dict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Switch to turn on or off parameter validation. |
__init__(wq_lib=None, wq_nml_file=None, bioshade_feedback=None, mobility_off=None, ode_method=None, split_factor=None, repair_state=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wq_lib |
Union[str, None]
|
Water quality model selection. Options are |
None
|
wq_nml_file |
Union[str, None]
|
Filename of water quality configuration file, e.g.,
|
None
|
bioshade_feedback |
Union[bool, None]
|
Switch to enable K_{w} to be updated by the WQ model. |
None
|
mobility_off |
Union[bool, None]
|
Switch to enable settling within the WQ model. |
None
|
ode_method |
Union[int, None]
|
Method to use for ODE solution of water quality module. |
None
|
split_factor |
Union[float, None]
|
Factor weighting implicit vs explicit numerical solution of
the WQ model. |
None
|
repair_state |
Union[bool, None]
|
Switch to correct negative or out of range WQ variables. |
None
|
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
nml
¶
NML
¶
Bases: ABC
Base class for all NML classes.
Attributes:
Name | Type | Description |
---|---|---|
blocks |
NMLDict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Toggles |
from_dict(nml_dict)
classmethod
¶
Initialise class instance from a dictionary.
Returns an instance of the class that has been initialised with a nested dictionary of NML parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_dict |
dict
|
A dictionary where the keys are the block names and the values are dictionaries of parameter names (keys) and parameter values (values). |
required |
from_file(nml_path)
classmethod
¶
Initialise class instance from a NML file.
Returns an instance of the class that has been initialised with parameters from a NML file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
dict
|
Path to the NML file. |
required |
get_block(block_name)
¶
Get a NML Block.
Returns an instance of a NMLBlock
subclass from the NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_block_names()
¶
List the block names.
Returns a list of the name
attribute for all NMLBlock
subclass instances.
get_param_names(block_name)
¶
List the parameter names in a block.
Returns a list of the name
attribute for all NMLParam
instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
get_param_units(block_name, param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(block_name, param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_blocks(*args)
¶
Populate the blocks
dictionary with instances of NMLBlock
subclasses.
is_none_nml()
¶
Test if all NML parameter values are None
.
Returns True
if is_none_block()
is True
for all
subclassed NMLBlock
instances in the blocks
dictionary.
iter_blocks()
¶
Iterate over all NMLBlock
objects.
iter_params()
¶
Iterate over all NMLParam
objects.
set_block(block_name, block)
¶
Set a NML Block.
Overrides, or adds a new block, to a NML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
block |
NMLBlock
|
The block to set. |
required |
set_param_value(block_name, param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_name |
str
|
The block name. |
required |
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_blocks=True, none_params=True)
¶
Nested dictionary of parameters.
Returns a nested dictionary where the keys are the block names and the values a dictionary of parameter values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_blocks |
bool
|
Whether to include blocks where all parameter values are
|
True
|
none_params |
bool
|
Whether to include parameter values that are |
True
|
to_nml(nml_path='glm3.nml')
¶
Write a NML file.
Parameters with values of None
are omitted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_path |
str
|
Path to the NML file |
'glm3.nml'
|
validate()
abstractmethod
¶
Validation tests for cross-block dependencies.
Must be implemented for all subclasses of NML
.
Implement your own validation tests or use available methods,
e.g.,val_required_block()
. Raise a ValueError
when
validation fails.
NMLBlock
¶
Bases: ABC
Base class for all NML block classes.
Attributes:
Name | Type | Description |
---|---|---|
params |
NMLDict[str, NMLParam]
|
Dictionary of |
strict |
bool
|
Toggles |
get_param_names()
¶
List the parameter names.
Returns a list of the name
attribute for all NMLParam
instances.
get_param_units(param_name)
¶
Get a parameter's units.
Returns the units
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
get_param_value(param_name)
¶
Get a parameter value.
Returns the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The name of the parameter to return the value for. |
required |
init_params(*args)
¶
Populate the params
dictionary with instances of NMLParam
.
is_none_block()
¶
Test if all NML parameter values are None
.
Returns True
if NMLParam.value is None
for all instances of
NMLParam
in the params
dictionary.
iter_params()
¶
Iterate over all NMLParam
objects.
set_param_value(param_name, value)
¶
Set a parameter value.
Sets the value
attribute of a NMLParam
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name |
str
|
The parameter name. |
required |
value |
Any
|
The parameter value to set. |
required |
to_dict(none_params=True)
¶
Dictionary of parameters.
Returns a dictionary of the block's parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
none_params |
bool
|
Whether to include parameter values that are |
True
|
validate()
abstractmethod
¶
Validation tests for cross-parameter dependencies.
Must be implemented for all subclasses of NMLBlock
.
Implement your own validation tests or use available methods,
e.g.,val_incompat_param_values()
and val_list_len_params()
.
Raise a ValueError
when validation fails.
NMLDict
¶
Bases: OrderedDict[K, T]
, Generic[K, T]
Ordered dictionary for storing collections of NMLParam
,
NMLBlock
, or NML
.
Attributes:
Name | Type | Description |
---|---|---|
strict |
bool
|
Set |
validate()
¶
Call validate
for each value in the dictionary.
NMLParam
¶
NML Parameter.
Class for representing an individual parameter in a NML file. Stores the parameter name, value, type, units, and value validation logic.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The parameter name. |
type |
Any
|
Expected data type of the parameter value. For list parameters,
|
value |
Any
|
The parameter value. |
units |
Union[str, None]
|
The parameter units. If the parameter is unitless, |
is_list |
bool
|
Whether the parameter value is a list of values. |
is_bcs_fl |
bool
|
Whether the parameter value represents a bcs file path. |
is_dbase_fl |
bool
|
Whether the parameter value represents a dbase file path. |
__init__(name, type, value=None, units=None, is_list=False, is_bcs_fl=False, is_dbase_fl=False, val_gt=None, val_gte=None, val_lt=None, val_lte=None, val_switch=None, val_datetime=None, val_type=True)
¶
Initialise a new NML parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The parameter name. |
required |
type |
Any
|
Expected data type of the parameter value. For list
parameters, |
required |
value |
Any
|
The parameter value. |
None
|
units |
Union[str, None]
|
The parameter units. If the parameter is unitless, |
None
|
is_list |
bool
|
Whether the parameter value is a list of elements. |
False
|
is_bcs_fl |
bool
|
Whether the parameter value represents a bcs file path. |
False
|
is_dbase_fl |
bool
|
Whether the parameter value represents a dbase file path. |
False
|
val_gt |
Union[None, int, float]
|
|
None
|
val_gte |
Union[None, int, float]
|
|
None
|
val_lt |
Union[None, int, float]
|
|
None
|
val_lte |
Union[None, int, float]
|
|
None
|
val_switch |
Union[None, List[Any]] = None
|
|
None
|
val_datetime |
Union[None, List[str]] = None
|
|
None
|
val_type |
bool
|
If |
True
|
validate()
¶
Validate parameter value.
Runs parameter value validation logic. If strict
is False
,
no validation occurs.
NMLReader
¶
Read a NML file.
Provides methods that convert a NML file, or a JSON representation
of a NML file, to either a dictionary or an instance of a NML
subclass.
Attributes:
Name | Type | Description |
---|---|---|
nml_path |
str
|
Path either a NML file or a JSON representation of a NML file. |
NMLRegistry
¶
Register NMLBlock
and NML
subclasses.
A registry that maps block_name
and nml_name
to the respective
NMLBlock
and NML
subclasses.
__init__(name)
¶
Initialise the registry.
Multiple instances of NMLRegistry
should not be needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the registry. |
required |
get_block_cls(nml_name, block_name)
¶
Return a registered NMLBlock
subclass type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_name |
str
|
Name of the NML. |
required |
block_name |
str
|
Name of the NML block. |
required |
get_nml_cls(nml_name)
¶
Return a registered NML
subclass type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_name |
str
|
Name of the NML. |
required |
register_block()
¶
Register a NMLBlock
subclass under the name cls.block_name
.
Used as a decorator.
register_nml()
¶
Register a NML
subclass under the name cls.nml_name
.
Used as a decorator.
NMLWriter
¶
Write a NML file.
Provides methods to write a dictionary as either a NML file or a JSON representation of a NML file.
Attributes:
Name | Type | Description |
---|---|---|
nml_dict |
dict
|
Nested dictionary of the NML file. Keys are the block names, values are dictionaries of parameter names/values. |