Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WRFChem_for_PALM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MBEES
WRFChem_for_PALM
Commits
089af80b
Commit
089af80b
authored
2 years ago
by
David Jean du Preez (local)
Browse files
Options
Downloads
Patches
Plain Diff
fix outspcies typo
parent
9fe2dba2
No related branches found
Branches containing commit
No related tags found
1 merge request
!26
fix outspcies typo
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dynamic/palm_dynamic.py
+6
-4
6 additions, 4 deletions
dynamic/palm_dynamic.py
dynamic/palm_dynamic_output.py
+1
-1
1 addition, 1 deletion
dynamic/palm_dynamic_output.py
dynamic/palm_wrf_utils.py
+2
-3
2 additions, 3 deletions
dynamic/palm_wrf_utils.py
with
9 additions
and
8 deletions
dynamic/palm_dynamic.py
+
6
−
4
View file @
089af80b
...
...
@@ -214,7 +214,7 @@ print('cent_lon, cent_lat:', cent_lon, cent_lat)
irange
=
origin_x
+
dx
*
(
np
.
arange
(
nx
,
dtype
=
'
f8
'
)
+
.
5
)
jrange
=
origin_y
+
dy
*
(
np
.
arange
(
ny
,
dtype
=
'
f8
'
)
+
.
5
)
palm_grid_y
,
palm_grid_x
=
np
.
meshgrid
(
jrange
,
irange
,
indexing
=
'
ij
'
)
transformer2
=
Transformer
.
from_crs
(
inproj
,
lonlatproj
,
always_xy
=
True
)
transformer2
=
Transformer
.
from_crs
(
inproj
,
lonlatproj
,
always_xy
=
True
)
palm_grid_lon
,
palm_grid_lat
=
transformer2
.
transform
(
palm_grid_x
,
palm_grid_y
)
######################################
...
...
@@ -360,13 +360,15 @@ for wrf_file in wrf_files_proc:
# create list of variables
# dynamical variables
wrfchem_dynamic
=
[
'
PH
'
,
'
PHB
'
,
'
HGT
'
,
'
T
'
,
'
W
'
,
'
TSLB
'
,
'
SMOIS
'
,
'
MU
'
,
'
MUB
'
,
'
P
'
,
'
PB
'
,
'
PSFC
'
]
# add chemical species if included
if
len
(
wrfchem_spec
)
>
0
:
wrfchem_variables
=
wrfchem_dynamic
+
wrfchem_spec
# add aerosol species if included
N_avr
=
6.022e23
# Avargardo constant
inv_den
=
f_wrf
.
variables
[
'
ALT
'
][
0
]
# inverse density
N_avr
=
6.022e23
# Avargardo constant
inv_den
=
f_wrf
.
variables
[
'
ALT
'
][
0
]
# Inverse density
t00
=
f_wrf
.
variables
[
'
T00
'
][
0
]
# Perturbation pt to standard (T00 wrf-chem variable)
for
varname
in
wrfchem_variables
:
# gaseous aerosols
...
...
@@ -487,7 +489,7 @@ for wrf_file in wrf_files_proc:
print
(
'
Vertical interpolation...
'
)
palm_wrf_utils
.
palm_wrf_vertical_interp
(
hinterp_file
,
vinterp_file
,
wrf_file
,
z_levels
,
z_levels_stag
,
z_soil_levels
,
origin_z
,
terrain
,
wrf_hybrid_levs
,
vinterp_terrain_smoothing
,
nz
,
ny
,
nx
)
wrf_hybrid_levs
,
vinterp_terrain_smoothing
,
nz
,
ny
,
nx
,
t00
)
if
radiation_from_wrf
:
print
(
'
Start processing of radiation inputs from the WRF radiation files.
'
)
...
...
This diff is collapsed.
Click to expand it.
dynamic/palm_dynamic_output.py
+
1
−
1
View file @
089af80b
...
...
@@ -325,7 +325,7 @@ def palm_dynamic_output(wrf_files, interp_files, dynamic_driver_file, times_sec,
if
(
var
==
'
soil_m
'
or
var
==
'
soil_t
'
or
var
==
'
u
'
or
var
==
'
v
'
or
var
==
'
w
'
):
continue
else
:
if
(
var
==
'
h2so4
'
or
var
==
'
hno3
'
or
var
==
'
nh3
'
or
var
==
'
ocnv
'
or
var
==
'
ocsv
'
):
if
(
var
==
'
h2so4
'
or
var
==
'
hno3
'
or
var
==
'
nh3
'
or
var
==
'
ocnv
'
or
var
==
'
ocsv
'
or
var
==
'
no
'
or
var
==
'
no2
'
or
var
==
'
no3
'
):
var
=
var
.
upper
()
init_var
=
infile
.
variables
[
'
init_atmosphere_
'
+
var
.
lower
()]
...
...
This diff is collapsed.
Click to expand it.
dynamic/palm_wrf_utils.py
+
2
−
3
View file @
089af80b
...
...
@@ -219,7 +219,7 @@ def calc_gp(f, ph):
return
np
.
array
(
gp
)
def
palm_wrf_vertical_interp
(
infile
,
outfile
,
wrffile
,
z_levels
,
z_levels_stag
,
z_soil_levels
,
origin_z
,
terrain
,
wrf_hybrid_levs
,
vinterp_terrain_smoothing
,
nz
,
ny
,
nx
):
z_soil_levels
,
origin_z
,
terrain
,
wrf_hybrid_levs
,
vinterp_terrain_smoothing
,
nz
,
ny
,
nx
,
t00_raw
):
zdim
=
len
(
z_levels
)
zwdim
=
len
(
z_levels_stag
)
...
...
@@ -232,7 +232,6 @@ def palm_wrf_vertical_interp(infile, outfile, wrffile, z_levels, z_levels_stag,
os
.
remove
(
infile
+
'
_vinterp.log
'
)
except
:
pass
nc_infile
=
netCDF4
.
Dataset
(
infile
,
'
r
'
)
nc_wrf
=
netCDF4
.
Dataset
(
wrffile
,
'
r
'
)
nc_outfile
=
netCDF4
.
Dataset
(
outfile
,
"
w
"
,
format
=
"
NETCDF4
"
)
...
...
@@ -303,7 +302,7 @@ def palm_wrf_vertical_interp(infile, outfile, wrffile, z_levels, z_levels_stag,
vdata
=
nc_outfile
.
createVariable
(
'
init_atmosphere_qv
'
,
"
f4
"
,
(
"
Time
"
,
"
z
"
,
"
south_north
"
,
"
west_east
"
))
vdata
[
0
,:,:,:]
=
init_atmosphere_qv
# ======================= POTENTIAL TEMPERATURE ==========================
pt_raw
=
nc_infile
.
variables
[
'
T
'
][
0
]
+
290.
# from perturbation pt to standard (T00 wrf-chem variable)
pt_raw
=
nc_infile
.
variables
[
'
T
'
][
0
]
+
t00_raw
pt_raw
=
np
.
r_
[
pt_raw
[
0
:
1
],
pt_raw
]
init_atmosphere_pt
=
interpolate_1d
(
z_levels
,
height
,
pt_raw
)
...
...
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