eophis.coupling package
Submodules
eophis.coupling.namcouple module
Contains tools to create and manipulate OASIS namelist sections in right format.
- Copyright (c) 2023 IGE-MEOM
Eophis is released under an MIT License. See the LICENSE file for details.
- eophis.coupling.namcouple.close_tunnels(reread=True)
Namcouple API: terminates coupling environement if set up. Resets Namcouple with same initialization attributes.
- eophis.coupling.namcouple.init_namcouple(cpl_nml_tmp, cpl_nml)
Namcouple API: init and reads namcouple file. Completely reinit Namcouple if it is already instantiated.
- Parameters:
cpl_nml_tmp (string) – input namcouple file name
cpl_nml (string) – output namcouple file name
- Raises:
eophis.warning() – if Namcouple is already initialized
Notes
This function is automatically called when importing eophis package.
- eophis.coupling.namcouple.open_tunnels()
Namcouple API: starts coupling environment, creates OASIS objects in Tunnels.
- Raises:
eophis.abort() – if called in preproduction mode
- eophis.coupling.namcouple.register_tunnels(configs)
Namcouple API: updates namcouple content and init Tunnel.
- eophis.coupling.namcouple.tunnels_ready()
Namcouple API: checks if Tunnels are ready to start time loop. A Tunnel is ready if all the static exchanges have been done.
eophis.coupling.namelist module
Tools to manipulate namelist content.
- Copyright (c) 2023 IGE-MEOM
Eophis is released under an MIT License. See the LICENSE file for details.
- class eophis.coupling.namelist.FortranNamelist(file_path)
Bases:
objectThis class is a wrapper to manipulate formatted Fortran namelists.
- file_path
path to namelist file
- Type:
string
- formatted
content of the namelist file in Fortran format
- Type:
f90nml.namelist.Namelist
- get(*labels)
Accesses the values of variables labels contained in namelist.
- Parameters:
labels (string) – list of labels to find in namelist
- Returns:
values – List of values corresponding to labels
- Return type:
- write()
Writes namelist under Fortran format.
eophis.coupling.tunnel module
This module is a wrapper for python OASIS API.
- Copyright (c) 2023 IGE-MEOM
Eophis is released under an MIT License. See the LICENSE file for details.
- class eophis.coupling.tunnel.Tunnel(label, grids, exchs, geo_aliases, py_aliases)
Bases:
objectThis class gathers a set of OASIS objects created during an Eophis execution under a common entity. This allows to spread OASIS commands between different identified coupled geoscientific codes.
- label
Tunnel name
- Type:
string
- geo_aliases
Correspondence between Tunnel and namcouple fields names from geophysical side
- Type:
- arriving_list()
Returns list of non-static receiveable variables.
- departure_list()
Returns list of non-static sendable variables.
- receive(var_label, date=86579)
Requests a variable reception from geoscientific code.
- Parameters:
var_label (string) – variable name to receive
date (int) – current simulation time
- Raises:
eophis.warning() – if try to receive an already received static variable, then skip
- Returns:
rcv_fld – array sent by geoscientific code, None if date does not match frequency exchange
- Return type:
numpy.ndarray
- send(var_label, values, date=86579)
Sends variable value to geoscientific code if date does match frequency exchange, nothing otherwise.
- Parameters:
var_label (string) – variable name to send
date (int) – current simulation time
values (numpy.ndarray) – array to send through OASIS under var_label
- Raises:
eophis.warning() – if try to send an already sent static variable, then skip
eophis.abort() – if values does not match sending format
Module contents
coupling subpackage
- This subpackage contains wrappers for:
OASIS component initialization and termination
partitions and variables definition
steps to perform data exchanges with coupled geophysical code
tools to create and manipulate OASIS and Fortran namelists
- Copyright (c) 2023 IGE-MEOM
Eophis is released under an MIT License. See the LICENSE file for details.