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
d26e421f
Commit
d26e421f
authored
5 years ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Clean up in RoutingPreProc
parent
09fbfb17
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
RoutingPreProc.py
+5
-19
5 additions, 19 deletions
RoutingPreProc.py
with
5 additions
and
19 deletions
RoutingPreProc.py
+
5
−
19
View file @
d26e421f
...
...
@@ -97,28 +97,14 @@ if not os.path.exists(wdir+"/"+wfile) :
area_in
[
index
[
0
],
index
[
1
]]
=
inter
.
area
()
*
(
EarthRadius
**
2
)
else
:
area_in
[
index
[
0
],
index
[
1
]]
=
(
4
*
np
.
pi
-
inter
.
area
())
*
(
EarthRadius
**
2
)
##############
# Because of an issue in spherical geometry we need to exclude points where
# the area of the intersecting polygone is not correctly computes.
# This is temporary while the spherical geometru code is corrected.
# We found that it only occurs on hydrogrids with very small overlap.
# Output of Overlap areas for each grid point
#
"""
if np.abs((area-np.sum(area_in))/area) > 0.05 :
print(
"
ERROR on overlap area of
"
, llinside,
"
:
"
, np.sum(area_in)/area)
print(
"
overlap area largest values :
"
,np.sort(area_in.flatten(),)[-6:])
jmax,imax = np.unravel_index(np.argmax(area_in), (hydrogrid.jjm,hydrogrid.iim))
print(
"
Coordinates of Max :
"
, hydrogrid.lon[jmax,imax], hydrogrid.lat[jmax,imax])
print(
"
============ Values around max(area_in) ================
"
)
print(area_in[jmax-1:jmax+2,imax-1:imax+2])
area_in[area_in > 10*(EarthRadius**2)] = 0.0
"""
##############
ncfile
=
"
Area_
"
+
str
(
"
%.2f
"
%
llinside
[
0
])
+
"
_
"
+
str
(
"
%.2f
"
%
llinside
[
1
])
+
"
_
"
+
str
(
rank
+
1
)
+
"
of
"
+
str
(
nbcore
)
+
"
.nc
"
RPP
.
dumpfield
(
area_in
,
hydrogrid
.
lon
,
hydrogrid
.
lat
,
ncfile
,
"
Intersect area
"
)
#ncfile="Area_"+str("%.2f"%llinside[0])+"_"+str("%.2f"%llinside[1])+"_"+str(rank+1)+"of"+str(nbcore)+".nc"
#RPP.dumpfield(area_in, hydrogrid.lon, hydrogrid.lat, ncfile, "Intersect area")
#
INFO
(
str
(
icell
)
+
"
Sum of overlap
"
+
str
(
np
.
sum
(
area_in
)
/
area
)
+
"
Nb of Hydro grid overlaping :
"
+
str
(
np
.
count_nonzero
(
area_in
)))
sub_index
.
append
(
np
.
where
(
area_in
>
0.0
))
...
...
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