source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/oasis3-mct/pyoasis/src/debug.py @ 5725

Last change on this file since 5725 was 5725, checked in by aclsce, 3 years ago

Added new oasis3-MCT version to be used to handle ensembles simulations with XIOS.

File size: 1.4 KB
Line 
1# pyOASIS - A Python wrapper for OASIS
2# Authors: Philippe Gambron, Rupert Ford
3# Copyright (C) 2019 UKRI - STFC
4
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as
7# published by the Free Software Foundation, either version 3 of the
8# License, or any later version.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU Lesser General Public License for more details.
14
15# A copy of the GNU Lesser General Public License, version 3, is supplied
16# with this program, in the file lgpl-3.0.txt. It is also available at
17# <https://www.gnu.org/licenses/lgpl-3.0.html>.
18
19
20import pyoasis.mod_oasis_auxiliary_routines
21
22import pyoasis.exception
23import pyoasis.checktypes
24
25
26def set_debug(debug):
27    pyoasis.check_types([int], [debug])
28    if debug < 0:
29        raise pyoasis.PyOasisException("Negative debug level")
30    error = pyoasis.mod_oasis_auxiliary_routines.set_debug(debug)
31    if error < 0:
32        raise pyoasis.OasisException("Error in setting debug level", error)
33
34
35def get_debug():
36    rv = pyoasis.mod_oasis_auxiliary_routines.get_debug()
37    error = rv[1]
38    if error < 0:
39        raise pyoasis.OasisException("Error in getting debug level", error)
40    debug = rv[0]
41    return debug
Note: See TracBrowser for help on using the repository browser.