Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
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
Package Registry
Container 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
IPSL
LMD
DPAO
Detection eddies
Commits
f2a1ec62
Commit
f2a1ec62
authored
1 year ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Move code to new function `copy_shift`
Preparing for more complex association criterium.
parent
96cf3aeb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Overlap/CMakeLists.txt
+3
-2
3 additions, 2 deletions
Overlap/CMakeLists.txt
Overlap/copy_shift.f90
+30
-0
30 additions, 0 deletions
Overlap/copy_shift.f90
Overlap/overlap.f90
+5
-10
5 additions, 10 deletions
Overlap/overlap.f90
with
38 additions
and
12 deletions
Overlap/CMakeLists.txt
+
3
−
2
View file @
f2a1ec62
...
...
@@ -7,7 +7,8 @@ if(MPI_Fortran_HAVE_F08_MODULE)
add_executable
(
eddy_graph eddy_graph.f90 get_snapshot.f90 overlap.f90
dispatch_snapshot.f90 recv_snapshot.f90 candidate_overlap.f90
spher_polygon_area.f90 send_snapshot.f90 unit_edge_m.f90 config_graph.F90
read_grid.F90 read_snapshot.f90 read_eddy.f90 inters_lines.f90
)
read_grid.F90 read_snapshot.f90 read_eddy.f90 inters_lines.f90
copy_shift.f90
)
target_link_libraries
(
eddy_graph PRIVATE EZMPI::ezmpi Jumble::jumble
Shapelib_03::shapelib_03 Contour_531::contour_531 gpc_f Geometry::geometry
MPI::MPI_Fortran Numer_Rec_95::numer_rec_95
)
...
...
@@ -21,7 +22,7 @@ endif()
add_subdirectory
(
Tests
)
target_sources
(
test_overlap PRIVATE overlap.f90 spher_polygon_area.f90
candidate_overlap.f90 unit_edge_m.f90 config_graph.F90 read_grid.F90
read_snapshot.f90 read_eddy.f90 inters_lines.f90
)
read_snapshot.f90 read_eddy.f90 inters_lines.f90
copy_shift.f90
)
target_sources
(
test_spher_polygon_area PRIVATE spher_polygon_area.f90
)
target_sources
(
test_read_snapshot PRIVATE read_snapshot.f90 read_eddy.f90
read_grid.F90 config_graph.F90
)
...
...
This diff is collapsed.
Click to expand it.
Overlap/copy_shift.f90
0 → 100644
+
30
−
0
View file @
f2a1ec62
module
copy_shift_m
implicit
none
contains
function
copy_shift
(
p
,
delta_long
)
! Libraries:
use
contour_531
,
only
:
polyline
use
jumble
,
only
:
twopi
type
(
polyline
),
intent
(
in
)::
p
real
,
intent
(
in
)::
delta_long
! difference in longitude, in rad
type
(
polyline
)
copy_shift
!------------------------------------------------------------------
copy_shift
%
n_points
=
p
%
n_points
copy_shift
%
closed
=
p
%
closed
allocate
(
copy_shift
%
points
(
2
,
p
%
n_points
))
copy_shift
%
points
(
2
,
:)
=
p
%
points
(
2
,
:)
! Shift the longitudes of `p`:
copy_shift
%
points
(
1
,
:)
=
p
%
points
(
1
,
:)
&
+
floor
(
delta_long
/
twopi
+
0.5
)
*
twopi
end
function
copy_shift
end
module
copy_shift_m
This diff is collapsed.
Click to expand it.
Overlap/overlap.f90
+
5
−
10
View file @
f2a1ec62
...
...
@@ -13,9 +13,9 @@ contains
! Libraries:
use
contour_531
,
only
:
polyline
use
jumble
,
only
:
twopi
use
inters_lines_m
,
only
:
inters_lines
use
copy_shift_m
,
only
:
copy_shift
use
candidate_overlap_m
,
only
:
candidate_overlap
use
config_graph_m
,
only
:
dist_lim
,
min_inters_speed
use
derived_types
,
only
:
snapshot
...
...
@@ -86,19 +86,14 @@ contains
! Assertion: {e1%delta_out >= delta .or. e2%delta_in
! >= delta}
delta_long
=
e1
%
extr
%
coord
(
1
)
-
e2
%
extr
%
coord
(
1
)
if
(
e2
%
speed_cont
%
n_points
/
=
0
)
then
polyline_2
=
e2
%
speed_cont
%
polyline
polyline_2
=
copy_shift
(
e2
%
speed_cont
%
polyline
,
delta_long
)
else
polyline_2
=
e2
%
out_cont
%
polyline
polyline_2
=
copy_shift
(
e2
%
out_cont
%
polyline
,
delta_long
)
end
if
delta_long
=
e1
%
extr
%
coord
(
1
)
-
e2
%
extr
%
coord
(
1
)
! Shift the longitudes of polyline_2 to values close to the
! longitude of extremum i1:
polyline_2
%
points
(
1
,
:)
=
polyline_2
%
points
(
1
,
:)
&
+
floor
(
delta_long
/
twopi
+
0.5
)
*
twopi
assoc_eddies
=
inters_lines
(
polyline_1
,
polyline_2
,
&
min_inters_speed
)
...
...
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