forked from CW3E/GSI-WRF-Cycling-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rocoto_utilities.py
60 lines (49 loc) · 2.12 KB
/
rocoto_utilities.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##################################################################################
# License Statement:
#
# Copyright 2022 Colin Grudzien, [email protected]
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#
##################################################################################
# imports
import os
##################################################################################
# utility global variables
# path to .xml workflow
pathnam = "/cw3e/mead/projects/cwp106/scratch/cgrudzien/GSI-WRF-Cycling-Template"
# name of .xml workflow WITHOUT the extension
wrknam = "cycling"
# path to database
outnam = "/cw3e/mead/projects/cwp106/scratch/cgrudzien/" +\
"GSI-WRF-Cycling-Template/data"
# path to rocoto binary root directory
pathroc = "/cw3e/mead/projects/cwp106/scratch/cgrudzien/rocoto"
##################################################################################
# rocoto utility commands
def run_rocotorun():
run_cmd = pathroc + "/bin/rocotorun -w " +\
pathnam + "/" + wrknam + ".xml" +\
" -d " + outnam + "/workflow/" + wrknam + ".store -v 10"
os.system(run_cmd)
def run_rocotoboot(cycle, task_list):
boot_cmd = pathroc + "/bin/rocotoboot -w " +\
pathnam + "/" + wrknam + ".xml" +\
" -d " + outnam + "/workflow/" + wrknam + ".store" +\
" -c " + cycle + " -t " + task_list
os.system(boot_cmd)
def run_rocotostat():
stat_cmd = pathroc + "/bin/rocotostat -w " +\
pathnam + "/" + wrknam + ".xml" +\
" -d " + outnam + "/workflow/" + wrknam + ".store -c all"
os.system(stat_cmd)