oasis package

Submodules

oasis.oasis module

Copyright 2017 ARC Centre of Excellence for Climate Systems Science

author: Scott Wales <scott.wales@unimelb.edu.au>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class oasis.oasis.Oasis(name, coupled=True)[source]

Bases: object

An Oasis coupled model connection

May be used as a context manager to automatically terminate the coupling:

with Oasis('atmos') as o:
    o.register(partition)
    o.register(grid)
    o.register(variable)

    variable.put(t, data)
    variable.get(t, data)
enddef()[source]

End the definition phase

Must be called before Variable.put() or Variable.get()

register(obj)[source]

Register a partition, grid or variable with Oasis

Must be called before Oasis.enddef()

terminate()[source]

Terminate the Oasis session

oasis.partition module

Copyright 2017 ARC Centre of Excellence for Climate Systems Science

author: Scott Wales <scott.wales@unimelb.edu.au>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class oasis.partition.Apple(name, global_size, local_size, offset)[source]

Bases: oasis.partition.Partition

class oasis.partition.Partition(name, global_size=0, partition=[0])[source]

Bases: object

local_size()[source]
class oasis.partition.Serial(name, global_size)[source]

Bases: oasis.partition.Partition

oasis.variable module

Copyright 2017 ARC Centre of Excellence for Climate Systems Science

author: Scott Wales <scott.wales@unimelb.edu.au>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class oasis.variable.Variable(name, partition, shape, type, inout)[source]

Bases: object

Oasis’ view of a model variable

Should be registered with the Oasis singleton before calling Oasis.enddef()

get(date, array)[source]

Get data from the coupler. If there is no coupling at this date according to the namcouple file this function will be a no-op.

Parameters:
  • date (int) – Date at the start of the timestep, in seconds since the model start
  • array (numpy.Array) – Data array to send (1 or 2D)
put(date, array)[source]

Send data to the coupler. If there is no coupling at this date according to the namcouple file this function will be a no-op.

Parameters:
  • date (int) – Date at the start of the timestep, in seconds since the model start
  • array (numpy.Array) – Data array to send (1 or 2D)

Module contents