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
b4b2afdc
Commit
b4b2afdc
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Use procedures `config_graph` and `read_grid`
parent
dc8d3a70
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
Overlap/Tests/test_overlap.f90
+7
-34
7 additions, 34 deletions
Overlap/Tests/test_overlap.f90
with
7 additions
and
34 deletions
Overlap/Tests/test_overlap.f90
+
7
−
34
View file @
b4b2afdc
...
...
@@ -3,12 +3,13 @@ program test_overlap
use
,
intrinsic
::
ISO_FORTRAN_ENV
! Libraries:
use
jumble
,
only
:
get_command_arg_dyn
,
read_opcol
,
new_unit
,
ediff1d
,
&
deg_to_rad
,
assert
use
jumble
,
only
:
get_command_arg_dyn
,
read_opcol
,
new_unit
,
ediff1d
,
assert
use
shapelib_03
,
only
:
dbf_read_attribute_03
use
config_graph_m
,
only
:
config_graph
,
copy
,
max_delta
,
cyclone
use
derived_types
,
only
:
snapshot
,
shpc_slice_handler
,
shpc_slice_meta
use
overlap_m
,
only
:
overlap
use
read_grid_m
,
only
:
read_grid
use
read_snapshot_m
,
only
:
read_snapshot
use
shpc_close_m
,
only
:
shpc_close
use
shpc_open_m
,
only
:
shpc_open
...
...
@@ -18,53 +19,25 @@ program test_overlap
character
(
len
=
:),
allocatable
::
shpc_dir
integer
::
k_test_1
=
0
,
k_test_2
=
1
integer
unit
,
i
,
copy
,
n_dates
integer
unit
,
i
,
n_dates
type
(
snapshot
),
allocatable
::
flow
(:)
! (max_delta + 1)
TYPE
(
shpc_slice_handler
)
hshp
type
(
shpc_slice_meta
)
ssm
real
::
corner_deg
(
2
)
=
[
huge
(
0.
),
huge
(
0.
)],
corner
(
2
)
! longitude and latitude of the corner of the whole grid, in degrees
! and in rad
real
::
step_deg
(
2
)
=
[
huge
(
0.
),
huge
(
0.
)],
step
(
2
)
! longitude and latitude steps, in degrees and in rad
logical
periodic
! grid is periodic in longitude
integer
::
nlon
=
-
1
,
nlat
=
-
1
,
max_delta
=
1
integer
e_overestim
! over-estimation of the number of eddies at each date
logical
::
cyclone
=
.true.
integer
::
dist_lim
=
12
! We look for an overlapping eddy at dist_lim (in grid points) of
! the first extremum.
namelist
/
grid_nml
/
corner_deg
,
step_deg
,
nlon
,
nlat
namelist
/
main_nml
/
dist_lim
,
max_delta
,
k_test_1
,
k_test_2
,
cyclone
namelist
/
main_nml
/
k_test_1
,
k_test_2
!-------------------------------------------------------------------------
call
get_command_arg_dyn
(
1
,
shpc_dir
,
"Required argument: SHPC-directory"
)
call
new_unit
(
unit
)
open
(
unit
,
file
=
shpc_dir
//
"/grid_nml.txt"
,
status
=
"old"
,
&
action
=
"read"
,
position
=
"rewind"
)
read
(
unit
,
nml
=
grid_nml
)
close
(
unit
)
call
read_grid
(
rank
=
0
,
shpc_dir
=
shpc_dir
)
call
config_graph
(
rank
=
0
)
write
(
unit
=
error_unit
,
nml
=
main_nml
)
write
(
unit
=
error_unit
,
fmt
=
*
)
"Enter namelist main_nml."
read
(
unit
=
*
,
nml
=
main_nml
)
write
(
unit
=
*
,
nml
=
main_nml
)
! As we are requiring the grid spacing to be uniform, the value of
! "periodic" may be deduced from the values of step_deg(1) and nlon:
periodic
=
nint
(
360.
/
step_deg
(
1
))
==
nlon
print
*
,
"periodic = "
,
periodic
if
(
periodic
)
call
assert
(
2
*
dist_lim
*
step_deg
(
1
)
<
180.
,
&
"test_overlap dist_lim"
)
copy
=
merge
(
dist_lim
,
0
,
periodic
)
corner
=
corner_deg
*
deg_to_rad
step
=
step_deg
*
deg_to_rad
allocate
(
flow
(
max_delta
+
1
))
call
shpc_open
(
hshp
,
trim
(
shpc_dir
),
cyclone
,
slice
=
0
,
pszaccess
=
"rb"
)
call
dbf_read_attribute_03
(
ssm
%
d0
,
hshp
%
extremum
,
hshp
%
extr_date
,
ishape
=
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