Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flex Extract
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Flexpart
Flex Extract
Commits
403cbf16
Commit
403cbf16
authored
6 years ago
by
Anne Philipp
Browse files
Options
Downloads
Patches
Plain Diff
added header writing to marsrequest file and corrected bug in normalexit call in submit
parent
2e62398d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/python/mods/get_mars_data.py
+18
-3
18 additions, 3 deletions
source/python/mods/get_mars_data.py
source/python/submit.py
+1
-1
1 addition, 1 deletion
source/python/submit.py
with
19 additions
and
4 deletions
source/python/mods/get_mars_data.py
+
18
−
3
View file @
403cbf16
...
@@ -73,6 +73,7 @@ from tools import (my_error, normal_exit, get_cmdline_arguments,
...
@@ -73,6 +73,7 @@ from tools import (my_error, normal_exit, get_cmdline_arguments,
read_ecenv
,
make_dir
)
read_ecenv
,
make_dir
)
from
classes.EcFlexpart
import
EcFlexpart
from
classes.EcFlexpart
import
EcFlexpart
from
classes.UioFiles
import
UioFiles
from
classes.UioFiles
import
UioFiles
from
classes.MarsRetrieval
import
MarsRetrieval
try
:
try
:
ecapi
=
True
ecapi
=
True
...
@@ -130,10 +131,24 @@ def get_mars_data(c):
...
@@ -130,10 +131,24 @@ def get_mars_data(c):
if
not
os
.
path
.
exists
(
c
.
inputdir
):
if
not
os
.
path
.
exists
(
c
.
inputdir
):
make_dir
(
c
.
inputdir
)
make_dir
(
c
.
inputdir
)
if
c
.
request
==
0
or
c
.
request
==
2
:
if
c
.
request
==
0
:
print
(
"
Retrieving EC data!
"
)
print
(
"
Retrieving EC data!
"
)
elif
c
.
request
==
1
:
else
:
if
c
.
request
==
1
:
print
(
"
Printing mars requests!
"
)
print
(
"
Printing mars requests!
"
)
elif
c
.
request
==
2
:
print
(
"
Retrieving EC data and printing mars request!
"
)
# first, write header with the mars parameter to file
# create a dummy MarsRetrieval to get parameter
MR
=
MarsRetrieval
(
None
,
None
)
attrs
=
vars
(
MR
).
copy
()
del
attrs
[
'
server
'
]
del
attrs
[
'
public
'
]
marsfile
=
os
.
path
.
join
(
c
.
inputdir
,
_config
.
FILE_MARS_REQUESTS
)
with
open
(
marsfile
,
'
w
'
)
as
f
:
f
.
write
(
'
request_number
'
+
'
,
'
)
f
.
write
(
'
,
'
.
join
(
str
(
key
)
for
key
in
sorted
(
attrs
.
iterkeys
())))
f
.
write
(
'
\n
'
)
print
(
"
start date %s
"
%
(
c
.
start_date
))
print
(
"
start date %s
"
%
(
c
.
start_date
))
print
(
"
end date %s
"
%
(
c
.
end_date
))
print
(
"
end date %s
"
%
(
c
.
end_date
))
...
...
This diff is collapsed.
Click to expand it.
source/python/submit.py
+
1
−
1
View file @
403cbf16
...
@@ -100,7 +100,7 @@ def main():
...
@@ -100,7 +100,7 @@ def main():
else
:
else
:
submit
(
args
.
job_template
,
c
,
args
.
queue
)
submit
(
args
.
job_template
,
c
,
args
.
queue
)
normal_exit
(
c
.
mailops
,
c
.
queue
,
exit_message
)
normal_exit
(
exit_message
)
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment