Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RoutingPP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
IPSL
LMD
InTro
RoutingPP
Commits
02825e89
Commit
02825e89
authored
5 years ago
by
POLCHER Jan
Browse files
Options
Downloads
Patches
Plain Diff
Plot of graphs improved but still not perfect.
parent
f3fb2def
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Diags/plotgraphs.py
+25
-7
25 additions, 7 deletions
Diags/plotgraphs.py
run.def
+0
-28
0 additions, 28 deletions
run.def
with
25 additions
and
35 deletions
Diags/plotgraphs.py
+
25
−
7
View file @
02825e89
...
@@ -4,6 +4,7 @@ import matplotlib.pyplot as plt
...
@@ -4,6 +4,7 @@ import matplotlib.pyplot as plt
from
mpl_toolkits.basemap
import
Basemap
,
cm
from
mpl_toolkits.basemap
import
Basemap
,
cm
import
numpy
as
np
import
numpy
as
np
from
netCDF4
import
Dataset
from
netCDF4
import
Dataset
import
sys
NCfile
=
"
../MEDCORDEX_test_graph.nc
"
NCfile
=
"
../MEDCORDEX_test_graph.nc
"
GraphicFile
=
"
test.png
"
GraphicFile
=
"
test.png
"
...
@@ -39,6 +40,12 @@ lat_bnd = nc.variables["lat_bnd"][:,:,:]
...
@@ -39,6 +40,12 @@ lat_bnd = nc.variables["lat_bnd"][:,:,:]
land
=
nc
.
variables
[
"
land
"
][:,:]
land
=
nc
.
variables
[
"
land
"
][:,:]
routetogrid
=
nc
.
variables
[
"
routetogrid
"
][:,:,:]
routetogrid
=
nc
.
variables
[
"
routetogrid
"
][:,:,:]
routetohtu
=
nc
.
variables
[
"
routetobasin
"
][:,:,:]
routetohtu
=
nc
.
variables
[
"
routetobasin
"
][:,:,:]
#
# Coding for routetobasin :
# nbasmax + 1 = Returnflow to the grid
# nbasmax + 2 = Coastal flow
# nbasmax + 3 = River flow
#
cglon
=
nc
.
variables
[
"
CG_lon
"
][:,:,:]
cglon
=
nc
.
variables
[
"
CG_lon
"
][:,:,:]
cglat
=
nc
.
variables
[
"
CG_lat
"
][:,:,:]
cglat
=
nc
.
variables
[
"
CG_lat
"
][:,:,:]
...
@@ -46,7 +53,7 @@ nc.close()
...
@@ -46,7 +53,7 @@ nc.close()
nhtu
,
nj
,
ni
=
routetogrid
.
shape
nhtu
,
nj
,
ni
=
routetogrid
.
shape
landindex
=
LandGrid
(
land
)
landindex
=
LandGrid
(
land
)
print
"
Nb land points =
"
,
landindex
.
nbland
,
'
Nb HTU :
'
,
nhtu
print
(
"
Nb land points =
"
,
landindex
.
nbland
,
'
Nb HTU :
'
,
nhtu
)
#
#
# Get some average size of the grid boxes.
# Get some average size of the grid boxes.
...
@@ -75,6 +82,8 @@ m.drawmeridians(np.arange(-80.,80.,0.1),labels=[0,0,0,1]) # draw meridians
...
@@ -75,6 +82,8 @@ m.drawmeridians(np.arange(-80.,80.,0.1),labels=[0,0,0,1]) # draw meridians
cmap
=
'
RdBu
'
cmap
=
'
RdBu
'
cmap
=
'
Pastel1
'
cmap
=
'
Pastel1
'
cmap
=
'
prism
'
cmap
=
'
prism
'
lwidth
=
0.0005
markersize
=
5
#
#
#
#
#
#
...
@@ -90,24 +99,33 @@ for i in range(ni) :
...
@@ -90,24 +99,33 @@ for i in range(ni) :
#
#
for
il
in
range
(
landindex
.
nbland
)
:
for
il
in
range
(
landindex
.
nbland
)
:
j
,
i
=
landindex
.
land2ij
(
il
)
j
,
i
=
landindex
.
land2ij
(
il
)
print
il
,
"
== routetogrid ==
"
,
routetogrid
[:,
j
,
i
]
xt
,
yt
=
m
(
lon_full
[
j
,
i
],
lat_full
[
j
,
i
])
print
il
,
"
== routetohtu ==
"
,
routetohtu
[:,
j
,
i
]
plt
.
text
(
xt
,
yt
,
str
(
il
))
#
for
ih
in
range
(
nhtu
)
:
for
ih
in
range
(
nhtu
)
:
lo
=
cglon
[
ih
,
j
,
i
]
lo
=
cglon
[
ih
,
j
,
i
]
la
=
cglat
[
ih
,
j
,
i
]
la
=
cglat
[
ih
,
j
,
i
]
xl
,
yl
=
m
(
lo
,
la
)
xl
,
yl
=
m
(
lo
,
la
)
if
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
<
nhtu
:
if
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
<
nhtu
:
plt
.
plot
(
xl
,
yl
,
marker
=
11
)
plt
.
plot
(
xl
,
yl
,
ms
=
markersize
,
marker
=
11
)
elif
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
==
nhtu
+
1
:
plt
.
plot
(
xl
,
yl
,
ms
=
markersize
,
marker
=
"
x
"
)
elif
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
==
nhtu
+
2
:
plt
.
plot
(
xl
,
yl
,
ms
=
markersize
,
marker
=
"
o
"
)
elif
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
==
nhtu
+
3
:
plt
.
plot
(
xl
,
yl
,
ms
=
markersize
,
marker
=
"
p
"
)
else
:
else
:
plt
.
plot
(
xl
,
yl
,
marker
=
"
o
"
)
print
(
"
Unforseen coding of outlof HTU :
"
,
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
))
sys
.
exit
()
#
if
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
<
nhtu
:
if
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
<
nhtu
:
ile
=
int
(
routetogrid
[
ih
,
j
,
i
]
-
1
)
ile
=
int
(
routetogrid
[
ih
,
j
,
i
]
-
1
)
i
e
,
j
e
=
landindex
.
land2ij
(
ile
)
j
e
,
i
e
=
landindex
.
land2ij
(
ile
)
ihe
=
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
ihe
=
int
(
routetohtu
[
ih
,
j
,
i
]
-
1
)
loe
=
cglon
[
ihe
,
je
,
ie
]
loe
=
cglon
[
ihe
,
je
,
ie
]
lae
=
cglat
[
ihe
,
je
,
ie
]
lae
=
cglat
[
ihe
,
je
,
ie
]
xle
,
yle
=
m
(
loe
,
lae
)
xle
,
yle
=
m
(
loe
,
lae
)
plt
.
plot
([
xl
,
xle
],[
y
l
,
yle
]
,
color
=
"
b
"
)
plt
.
arrow
(
xl
,
yl
,
xle
-
x
l
,
yle
-
yl
,
color
=
"
b
"
,
width
=
lwidth
,
head_width
=
20
*
lwidth
,
length_includes_head
=
True
)
#
#
#
#
#
#
...
...
This diff is collapsed.
Click to expand it.
run.def
deleted
100644 → 0
+
0
−
28
View file @
f3fb2def
[OverAll]
#
#
EarthRadius = 6370000.
#
ModelGridFile = /home/polcher/WORK/Data/NewRouting/geo_em.d01.nc
# Mallorca
WEST_EAST = 2.3, 3.5
SOUTH_NORTH = 39.00, 40.1
HydroFile = /home/polcher/WORK/Data/NewRouting/routing_MED.nc
#
# FORTRAN interface parameters
#
Documentation = true
#
# Configuration for the graph to be generated
#
nbasmax = 35
#
# Output
#
GraphFile = MEDCORDEX_test_graph.nc
#
# Diagnostics
# You need to provide an interval in longitude and Latitude.
#
DiagLon = 2.3, 3.5
DiagLat = 39.0, 40.1
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