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
38e83ba5
Commit
38e83ba5
authored
6 years ago
by
Anne Philipp
Browse files
Options
Downloads
Patches
Plain Diff
minor changes in comments
parent
ff2a11c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/python/mods/prepare_flexpart.py
+7
-5
7 additions, 5 deletions
source/python/mods/prepare_flexpart.py
with
7 additions
and
5 deletions
source/python/mods/prepare_flexpart.py
+
7
−
5
View file @
38e83ba5
...
@@ -125,7 +125,7 @@ def prepare_flexpart(ppid, c):
...
@@ -125,7 +125,7 @@ def prepare_flexpart(ppid, c):
------
------
'''
'''
# necessary only if script is running by itself
if
not
ppid
:
if
not
ppid
:
c
.
ppid
=
str
(
os
.
getppid
())
c
.
ppid
=
str
(
os
.
getppid
())
else
:
else
:
...
@@ -142,8 +142,9 @@ def prepare_flexpart(ppid, c):
...
@@ -142,8 +142,9 @@ def prepare_flexpart(ppid, c):
month
=
int
(
c
.
end_date
[
4
:
6
]),
month
=
int
(
c
.
end_date
[
4
:
6
]),
day
=
int
(
c
.
end_date
[
6
:]))
day
=
int
(
c
.
end_date
[
6
:]))
# if basetime is 00
# assign starting date minus 1 day
# assign starting date minus 1 day
# since
for basetime 00
we need the 12 hours upfront
# since we need the 12 hours upfront
# (the day before from 12 UTC to current day 00 UTC)
# (the day before from 12 UTC to current day 00 UTC)
if
c
.
basetime
==
'
00
'
:
if
c
.
basetime
==
'
00
'
:
start
=
start
-
datetime
.
timedelta
(
days
=
1
)
start
=
start
-
datetime
.
timedelta
(
days
=
1
)
...
@@ -163,7 +164,7 @@ def prepare_flexpart(ppid, c):
...
@@ -163,7 +164,7 @@ def prepare_flexpart(ppid, c):
flexpart
.
write_namelist
(
c
)
flexpart
.
write_namelist
(
c
)
flexpart
.
deacc_fluxes
(
inputfiles
,
c
)
flexpart
.
deacc_fluxes
(
inputfiles
,
c
)
# get a list of all
files from the root inputdir
# get a list of all
other files
inputfiles
=
UioFiles
(
c
.
inputdir
,
'
????__??.*
'
+
str
(
c
.
ppid
)
+
'
.*
'
)
inputfiles
=
UioFiles
(
c
.
inputdir
,
'
????__??.*
'
+
str
(
c
.
ppid
)
+
'
.*
'
)
# produce FLEXPART-ready GRIB files and process them -
# produce FLEXPART-ready GRIB files and process them -
...
@@ -171,9 +172,10 @@ def prepare_flexpart(ppid, c):
...
@@ -171,9 +172,10 @@ def prepare_flexpart(ppid, c):
flexpart
=
EcFlexpart
(
c
,
fluxes
=
False
)
flexpart
=
EcFlexpart
(
c
,
fluxes
=
False
)
flexpart
.
create
(
inputfiles
,
c
)
flexpart
.
create
(
inputfiles
,
c
)
flexpart
.
process_output
(
c
)
flexpart
.
process_output
(
c
)
# make use of a possible conversion to a
# specific flexpart binary format
if
c
.
grib2flexpart
:
if
c
.
grib2flexpart
:
# prepare environment for a FLEXPART run
# to convert grib to flexpart binary format
flexpart
.
prepare_fp_files
(
c
)
flexpart
.
prepare_fp_files
(
c
)
# check if in debugging mode, then store all files
# check if in debugging mode, then store all files
...
...
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