Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christoph Heim
dyamond_mistral
Commits
6209befb
Commit
6209befb
authored
Apr 02, 2020
by
Christoph Heim
Browse files
Hopefully last updates from mistral
parent
517a0b1e
Changes
6
Hide whitespace changes
Inline
Side-by-side
01_nicam.py
View file @
6209befb
...
...
@@ -81,7 +81,7 @@ if __name__ == '__main__':
'PP'
]
# missing: TQV, CLCL, CLCT, and in NICAM-3.5 also SST
# missing: PS
#
var_names = ['
MSLP
']
var_names
=
[
'
TQI
'
]
"""
...
...
@@ -97,7 +97,7 @@ if __name__ == '__main__':
# model resolutions [km] of simulations
ress
=
[
7
,
3.5
]
ress
=
[
7
]
ress
=
[
3.5
]
#
ress = [3.5]
# date range
first_date
=
datetime
(
2016
,
8
,
1
)
...
...
05_mpas.py
View file @
6209befb
...
...
@@ -139,6 +139,7 @@ if __name__ == '__main__':
'LWUTOA'
,
'SWNDTOA'
,
'TQC'
,
'TQI'
,
'TQV'
,
'CLCT'
,
'PPCONV'
,
'PPGRID'
],
'2D'
:[
'TQV'
],
'3D'
:[
'U'
,
'P'
,
'V'
],
'3D'
:[
'P'
],
...
...
@@ -164,7 +165,7 @@ if __name__ == '__main__':
var_names
=
var_namess
[
run_var_type
]
#ress = [7.5, 3.75]
ress
=
[
7.5
]
#
ress = [7.5]
ress
=
[
3.75
]
i_bash_output
=
0
...
...
06_ifs.py
View file @
6209befb
...
...
@@ -97,6 +97,7 @@ if __name__ == '__main__':
'TQC'
,
'TQI'
,
'TQV'
,
'CLCL'
,
'CLCT'
,
'PPCONV'
,
'PPGRID'
]
# missing: P (derive with PS and vertical grid)
var_names
=
[
'V'
]
"""
parallel tasks:
...
...
07_geos.py
View file @
6209befb
...
...
@@ -4,7 +4,7 @@
description: Extract lat-lon box of data from model GEOS.
author: Christoph Heim
date created: 09.07.2019
date changed:
27
.0
2
.2020
date changed:
01
.0
4
.2020
usage: arguments:
1st: n jobs for multiprocessing pool
"""
...
...
@@ -15,13 +15,13 @@ from datetime import datetime, timedelta
from
multiprocessing
import
Pool
from
pathlib
import
Path
from
cdo
import
Cdo
from
package.utilities
import
Timer
,
cdo_mergetime
from
package.utilities
import
Timer
,
cdo_mergetime
,
write_grid_file
from
namelist
import
domain
,
padding
from
functions
import
paste_dir_names
###############################################################################
def
sellatlon_GEOS
(
inp_file
,
out_file
,
dt
,
box
,
options
,
var_name
,
var_dict
,
res
):
res
,
target_grid
):
TM
=
Timer
()
file_code
=
'{}km_{}_{:%Y%m%d%H%M}'
.
format
(
res
,
var_name
,
dt
)
...
...
@@ -33,6 +33,8 @@ def sellatlon_GEOS(inp_file, out_file, dt, box, options, var_name, var_dict,
else
:
print
(
'
\t\t
'
+
file_code
)
tmp_file
=
'{}.tmp'
.
format
(
out_file
)
# cdo
TM
.
start
(
'cdo'
)
ofile
=
cdo
.
sellonlatbox
(
...
...
@@ -42,7 +44,11 @@ def sellatlon_GEOS(inp_file, out_file, dt, box, options, var_name, var_dict,
str
(
box
[
'vert1'
])
+
' -selname,'
+
var_dict
[
var_name
][
'key'
]
+
' '
+
inp_file
),
output
=
out_file
)
output
=
tmp_file
)
ofile
=
cdo
.
remapbil
(
target_grid
,
input
=
tmp_file
,
output
=
out_file
)
os
.
remove
(
tmp_file
)
TM
.
stop
(
'cdo'
)
...
...
@@ -75,9 +81,8 @@ if __name__ == '__main__':
'SLHFLX'
,
'SSHFLX'
,
'TQC'
,
'TQI'
,
'TQV'
,
'PP'
]
#var_names = ['PP']
# missing: SST CLCL CLCT
#var_names = ['
P
']
#var_names = ['
V
']
"""
parallel tasks:
...
...
@@ -95,15 +100,18 @@ if __name__ == '__main__':
#last_date = datetime(2016,8,1)
#first_date = datetime(2016,8,1)
#last_date = datetime(2016,8,
10
)
#last_date = datetime(2016,8,
8
)
#first_date = datetime(2016,8,
11
)
#last_date = datetime(2016,8,
20
)
#first_date = datetime(2016,8,
9
)
#last_date = datetime(2016,8,
16
)
#first_date = datetime(2016,8,
2
1)
#last_date = datetime(2016,8,
30
)
#first_date = datetime(2016,8,1
7
)
#last_date = datetime(2016,8,
24
)
#first_date = datetime(2016,8,31)
#first_date = datetime(2016,8,25)
#last_date = datetime(2016,9,1)
#first_date = datetime(2016,9,2)
#last_date = datetime(2016,9,9)
# options for computation
...
...
@@ -215,6 +223,11 @@ if __name__ == '__main__':
shutil
.
rmtree
(
out_tmp_dir
)
Path
(
out_tmp_dir
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
# target grid on which to interpolate the model output
target_grid
=
os
.
path
.
join
(
'grids'
,
'latlon_{}km_dom_{}'
.
format
(
res
,
domain
[
'code'
]))
write_grid_file
(
box
,
target_grid
,
res
)
# find times and files that should be extracted
# and prepare arguments for function
args
=
[]
...
...
@@ -242,7 +255,7 @@ if __name__ == '__main__':
out_file
=
os
.
path
.
join
(
out_tmp_dir
,
var_name
+
'_{:%Y%m%d%H%M}'
.
format
(
dt
)
+
'.nc'
)
args
.
append
(
(
inp_file
,
out_file
,
dt
,
box
,
options
,
var_name
,
var_dict
,
res
)
)
var_dict
,
res
,
target_grid
)
)
# run function serial or parallel
if
n_tasks
>
1
:
...
...
09_fv3.py
View file @
6209befb
...
...
@@ -121,7 +121,7 @@ if __name__ == '__main__':
'CLCT'
,
'PP'
]
# missing: P (given in model output (vertical levels))
# missing: SST
#
var_names = ['
PS', 'TQI', 'TQV', 'CLCT
']
var_names
=
[
'
SWDSFC
'
]
"""
parallel tasks:
...
...
grids/latlon_3km_dom_DYAMOND_2
0 → 100644
View file @
6209befb
gridtype = lonlat
xsize = 2336
ysize = 1780
xname = lon
xlongname = "longitude"
xunits = "degrees_east"
yname = lat
ylongname = "latitude"
yunits = "degrees_north"
xfirst = -45
xinc = 0.027
yfirst = -30
yinc = 0.027
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment