source:
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/run.py
@
4132
Last change on this file since 4132 was 4127, checked in by andrewryan, 11 years ago | |
---|---|
File size: 629 bytes |
Line | |
---|---|
1 | """ |
2 | |
3 | The NEMO offline observation operator is built and runs similarly to the |
4 | online NEMO model. |
5 | |
6 | """ |
7 | import subprocess |
8 | import os |
9 | |
10 | class SubmitError(Exception): |
11 | pass |
12 | |
13 | def submit(): |
14 | """Simple function that runs the code. |
15 | |
16 | This can be customised based on the particular environment |
17 | used to submit MPI or serial tasks. For simplicity, this |
18 | function calls opa. |
19 | |
20 | By default, this program runs ``./opa``. |
21 | |
22 | :returns: retcode |
23 | """ |
24 | exe = "./opa" |
25 | if os.path.exists(exe): |
26 | retcode = subprocess.call([exe]) |
27 | else: |
28 | raise SubmitError("can not find {}".format(exe)) |
29 | return retcode |
30 |
Note: See TracBrowser
for help on using the repository browser.