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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Flexpart
Flex Extract
Commits
1d15e270
Commit
1d15e270
authored
6 years ago
by
Anne Philipp
Browse files
Options
Downloads
Patches
Plain Diff
bug fix for missing variable in subfunction
parent
de4dc27d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/python/mods/get_mars_data.py
+7
-4
7 additions, 4 deletions
source/python/mods/get_mars_data.py
with
7 additions
and
4 deletions
source/python/mods/get_mars_data.py
+
7
−
4
View file @
1d15e270
...
@@ -148,7 +148,7 @@ def get_mars_data(c):
...
@@ -148,7 +148,7 @@ def get_mars_data(c):
# if data are to be retrieved, clean up any old grib files
# if data are to be retrieved, clean up any old grib files
if
c
.
request
==
0
or
c
.
request
==
2
:
if
c
.
request
==
0
or
c
.
request
==
2
:
remove_old
(
'
*grb
'
)
remove_old
(
'
*grb
'
,
c
.
inputdir
)
# -------------- flux data ------------------------------------------------
# -------------- flux data ------------------------------------------------
start
,
end
,
datechunk
=
mk_dates
(
c
,
fluxes
=
True
)
start
,
end
,
datechunk
=
mk_dates
(
c
,
fluxes
=
True
)
...
@@ -264,7 +264,7 @@ def mk_dates(c, fluxes):
...
@@ -264,7 +264,7 @@ def mk_dates(c, fluxes):
return
start
,
end
,
chunk
return
start
,
end
,
chunk
def
remove_old
(
pattern
):
def
remove_old
(
pattern
,
inputdir
):
'''
Deletes old retrieval files matching the pattern.
'''
Deletes old retrieval files matching the pattern.
Parameters
Parameters
...
@@ -272,13 +272,16 @@ def remove_old(pattern):
...
@@ -272,13 +272,16 @@ def remove_old(pattern):
pattern : :obj:`string`
pattern : :obj:`string`
The sub string pattern which identifies the files to be deleted.
The sub string pattern which identifies the files to be deleted.
inputdir : :obj:`string`, optional
Path to the directory where the retrieved data is stored.
Return
Return
------
------
'''
'''
print
(
'
... removing old content of
'
+
c
.
inputdir
)
print
(
'
... removing old content of
'
+
inputdir
)
tobecleaned
=
UioFiles
(
c
.
inputdir
,
pattern
)
tobecleaned
=
UioFiles
(
inputdir
,
pattern
)
tobecleaned
.
delete_files
()
tobecleaned
.
delete_files
()
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