Models and Forcing Configurations

model run sequence

class nemspy.configuration.RunSequence(interval: datetime.timedelta, **kwargs)

multi-model container for model entries, defining the sequence in which they run within the modeled time loop

NOTE: Currently, only one loop is supported. Nested loops will be implemented in a future version of NEMSpy.

Parameters

interval – time interval to repeat the main loop in modeled time

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

append(entry: nemspy.model.base.SequenceEntry)

add a sequence entry

extend(sequence: List[nemspy.model.base.SequenceEntry])

add several sequence entries

property sequence: List[nemspy.model.base.SequenceEntry]

list of sequence entries in order, including model entries and connections / mediations

connect(source: nemspy.model.base.EntryType, target: nemspy.model.base.EntryType, method: Optional[nemspy.model.base.GridRemapMethod] = None, **kwargs)

assign a simple connection (not a mediation) between two model entries within the sequence

property connections: List[Union[nemspy.model.base.ConnectionEntry, nemspy.model.base.MediationEntry]]

list of all connections in the sequence

property mediator: nemspy.model.base.MediatorEntry

shortcut property to the mediator entry

mediate(sources: Optional[List[nemspy.model.base.EntryType]] = None, functions: Optional[List[str]] = None, targets: Optional[List[nemspy.model.base.EntryType]] = None, method: Optional[nemspy.model.base.GridRemapMethod] = None, processors: Optional[int] = None, **attributes)

assign a mediation between two entries in the sequence

property mediations: List[nemspy.model.base.MediationEntry]

list of all mediations in the sequence

property earth: nemspy.configuration.Earth

Earth system assigned to the sequence

property processors: int

total number of processors assigned to sequence entries

link entries and assign processors

property models: List[nemspy.model.base.ModelEntry]

list of models in the run sequence

property sequence_entry: str

string representation of the sequence entry in nems.configure

ocean circulation models

class nemspy.model.ocean.OceanModelEntry(processors: int, **kwargs)

abstraction of a generic oceanic model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.ocean.ADCIRCEntry(processors: int, **kwargs)

Advanced Circulation (ADCIRC) model http://adcirc.org

>>> ocean_model = ADCIRCEntry(processors=11, Verbosity='max', DumpFields=False)

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.ocean.SCHISMEntry(processors: int, **kwargs)

Semi-implicit Cross-scale Hydroscience Integrated System Model (SCHISM) http://ccrm.vims.edu/schismweb/

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

atmospheric models

class nemspy.model.atmosphere.AtmosphericModelEntry(processors: int, **kwargs)

abstraction of a generic atmospheric model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.atmosphere.AtmosphericForcingEntry(filename: Optional[os.PathLike] = None, processors: Optional[int] = None, **kwargs)

file forcing entry for Atmospheric Mesh (ATMesh), which combines data from HRRR, GFS, etc.

>>> atmospheric_mesh = AtmosphericForcingEntry(filename='wind_atm_fin_ch_time_vec.nc', processors=1)

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.atmosphere.HWRFEntry(processors: int, **kwargs)

Hurricane Weather Research and Forecasting (HWRF) model https://en.wikipedia.org/wiki/Hurricane_Weather_Research_and_Forecasting_Model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

wave models

class nemspy.model.waves.WaveModelEntry(processors: int, **kwargs)

abstract implementation of a generic wave model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.waves.WaveWatch3ForcingEntry(filename: Optional[os.PathLike] = None, processors: Optional[int] = None, **kwargs)

file forcing entry for WaveWatch III data

>>> wave_mesh = WaveWatch3ForcingEntry(filename='ww3.Constant.20151214_sxy_ike_date.nc', processors=1)

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.waves.WaveWatch3Entry(processors: int, **kwargs)

WaveWatch III model https://polar.ncep.noaa.gov/waves/wavewatch/

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.waves.SWANEntry(processors: int, **kwargs)

SWAN wave model http://swanmodel.sourceforge.net/

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

terrestrial hydrology models

class nemspy.model.hydrology.HydrologicalModelEntry(processors: int, **kwargs)

abstraction of a generic hydrological model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.hydrology.NationalWaterModelEntry(processors: int, **kwargs)

National Water Model https://water.noaa.gov/about/nwm

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

sea ice models

class nemspy.model.ice.IceModelEntry(processors: int, **kwargs)

abstraction of a generic ice model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.ice.IceForcingEntry(filename: Optional[os.PathLike] = None, processors: Optional[int] = None, **kwargs)

file forcing entry of an ice model

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

coupled Earth system

class nemspy.configuration.Earth(**models)

multi-model coupling container representing the entire Earth system

Only one of each model type can be assigned to the Earth system model at a time.

Parameters
  • atm – atmospheric wind model

  • wav – oceanic wave model

  • ocn – oceanic circulation model

  • hyd – terrestrial water model

  • med – model mediator

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property models

list of models comprising the Earth system

abstract classes

class nemspy.model.base.EntryType(value)

possible types of a configuration entry

class nemspy.model.base.VerbosityOption(value)

possible verbosity options for model entries

class nemspy.model.base.GridRemapMethod(value)

possible remapping methods (interpolation / redistribution) for translating coupled data from one grid to another

class nemspy.model.base.FileForcingEntry(entry_type: nemspy.model.base.EntryType, filename: Optional[os.PathLike] = None)

abstraction of a forcing entry in config.rc, defining the file path to a forcing file

Parameters
  • entry_type – type of file forcing (i.e. ATM, ICE, etc.)

  • filename – path to file

class nemspy.model.base.ConfigurationEntry

abstraction of an entry in a configuration file

abstract classmethod from_string(string: str, **kwargs) nemspy.model.base.ConfigurationEntry

parse entry information from a configuration entry string

class nemspy.model.base.AttributeEntry

abstraction of a configuration entry in nems.configure

entry_title

alias of NotImplementedError

__attributes

alias of NotImplementedError

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

class nemspy.model.base.SequenceEntry

abstraction of an entry within the run sequence in nems.configure

abstract property sequence_entry: str

string representation of the sequence entry in nems.configure

class nemspy.model.base.ModelEntry(processors: int, **attributes)

abstraction of a generic model implementing NEMS / NUOPC coupling

The model entry is represented in two places in nems.configure: once as a configuration entry with attributes, and once in the run sequence. The specific processors assigned to the model are defined by start and stop indices, which are determined on configuration write from the stop index of the previous entry in the run sequence.

Parameters

processors – number of processors to assign to this model

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property entry_title: str

Method or function hasn’t been implemented yet.

property processors: int

the number of processors assigned to this model

property start_processor: int

the first index in the processor series assigned to this model

property end_processor: int

the last index in the processor series assigned to this model

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property sequence_entry: str

string representation of the sequence entry in nems.configure

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

class nemspy.model.base.ConnectionEntry(source: nemspy.model.base.ModelEntry, target: nemspy.model.base.ModelEntry, method: Optional[nemspy.model.base.GridRemapMethod] = None)

a connection entry in nems.configure representing a simple coupling between two model entries

Parameters
  • source – source model entry

  • target – target model entry

  • method – remapping method with which to translate between differing grids (use redist for the same grid)

property models: List[nemspy.model.base.ModelEntry]

the source and target models in the coupling

property sequence_entry: str

string representation of the sequence entry in nems.configure

classmethod from_string(string: str, **kwargs) nemspy.model.base.ConnectionEntry

parse entry information from a configuration entry string

class nemspy.model.base.MediatorEntry(processors: Optional[int] = None, **attributes)

a special entry in nems.configure representing a coupler between two model entries with a dedicated coupling function

Parameters

processors – number of processors to assign to this mediator

property attributes: Dict[str, str]

attributes defining options for the configuration entry, such as verbosity

property end_processor: int

the last index in the processor series assigned to this model

property entry_title: str

Method or function hasn’t been implemented yet.

classmethod from_string(string: str, **kwargs) nemspy.model.base.ModelEntry

parse entry information from a configuration entry string

property next: nemspy.model.base.ModelEntry

the next entry in the run sequence

property previous: nemspy.model.base.ModelEntry

the previous entry in the run sequence

property processors: int

the number of processors assigned to this model

property sequence_entry: str

string representation of the sequence entry in nems.configure

property start_processor: int

the first index in the processor series assigned to this model

class nemspy.model.base.MediationFunctionEntry(name: str, mediator: nemspy.model.base.MediatorEntry)

the dedicated function of a mediation entry, applied to the coupling between two model entries in nems.configure

Parameters
  • name – name of function

  • mediator – mediator entry to host this function

property sequence_entry: str

string representation of the sequence entry in nems.configure

classmethod from_string(string: str, **kwargs) nemspy.model.base.MediationFunctionEntry

parse entry information from a configuration entry string

class nemspy.model.base.MediationEntry(mediator: nemspy.model.base.MediatorEntry, sources: Optional[List[nemspy.model.base.ModelEntry]] = None, functions: Optional[List[str]] = None, targets: Optional[List[nemspy.model.base.ModelEntry]] = None, method: Optional[nemspy.model.base.GridRemapMethod] = None)

an application of a mediator between model entries, with a dedicated coupling function

A Mediation can include multiple connections; for instance, an ICE model might connect to the mediation function, then the mediation function connects to the OCN model.

Parameters
  • mediator – mediator entry to host this mediation

  • sources – source models

  • functions – mediation functions to use

  • targets – target models

  • method – remapping method with which to translate between differing grids (use redist for the same grid)

property source_connections: List[nemspy.model.base.ConnectionEntry]

list of connections between the source(s) and the mediator

property target_connections: List[nemspy.model.base.ConnectionEntry]

list of connections between the mediator and the target(s)

property models: List[nemspy.model.base.ModelEntry]

list of model entries involved in the mediation

property sequence_entry: str

string representation of the sequence entry in nems.configure

classmethod from_string(string: str, **kwargs) nemspy.model.base.MediationEntry

parse entry information from a configuration entry string