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
Admin message
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
94c2b939
Commit
94c2b939
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Use procedures `config_graph` and `read_grid`
parent
b451a464
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_get_dispatch_snap.f90
+10
-36
10 additions, 36 deletions
Overlap/Tests/test_get_dispatch_snap.f90
with
10 additions
and
36 deletions
Overlap/Tests/test_get_dispatch_snap.f90
+
10
−
36
View file @
94c2b939
...
...
@@ -4,15 +4,16 @@ program test_get_dispatch_snap
! Libraries:
use
ezmpi
,
only
:
ezmpi_bcast
use
jumble
,
only
:
get_command_arg_dyn
,
read_opcol
,
new_unit
,
assert
,
&
deg_to_rad
use
jumble
,
only
:
get_command_arg_dyn
,
read_opcol
,
new_unit
use
mpi_f08
,
only
:
mpi_init
,
mpi_finalize
,
MPI_Comm_rank
,
MPI_Comm_world
,
&
MPI_Comm_size
,
mpi_abort
use
shapelib_03
,
only
:
dbf_read_attribute_03
use
config_graph_m
,
only
:
config_graph
,
copy
use
derived_types
,
only
:
snapshot
,
shpc_slice_handler
,
shpc_slice_meta
use
dispatch_snapshot_m
,
only
:
dispatch_snapshot
use
get_snapshot_m
,
only
:
get_snapshot
use
read_grid_m
,
only
:
read_grid
use
send_snapshot_m
,
only
:
send_snapshot
use
shpc_close_m
,
only
:
shpc_close
use
shpc_open_m
,
only
:
shpc_open
...
...
@@ -24,26 +25,11 @@ program test_get_dispatch_snap
type
(
snapshot
)
s
TYPE
(
shpc_slice_handler
)
hshp
type
(
shpc_slice_meta
)
ssm
integer
k_begin
,
copy
,
rank
,
n_proc
,
k_end
,
n_dates
integer
k_begin
,
rank
,
n_proc
,
k_end
,
n_dates
integer
unit_isolated
real
::
corner
(
2
)
=
[
0.125
,
-
59.875
]
! longitude and latitude of the corner of the whole grid in input
! NetCDF, in degrees
real
::
step
(
2
)
=
[
0.25
,
0.25
]
! longitude and latitude steps, in degrees
logical
periodic
! grid is periodic in longitude
integer
::
nlon
=
120
,
nlat
=
120
! size of ssh array in input NetCDF, assuming no repeated point if
! the grid is global
integer
::
dist_lim
=
12
! We look for an overlapping eddy at dist_lim (in grid points) of
! the first extremum.
integer
::
k
=
0
namelist
/
main_nml
/
corner
,
step
,
nlon
,
nlat
,
dist_lim
,
k
namelist
/
main_nml
/
k
!-------------------------------------------------------------------------
...
...
@@ -57,20 +43,14 @@ program test_get_dispatch_snap
end
if
call
get_command_arg_dyn
(
1
,
shpc_dir
,
"Required argument: SHPC-directory"
)
call
read_grid
(
rank
,
shpc_dir
)
call
config_graph
(
rank
)
if
(
rank
==
0
)
then
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(1) and nlon:
periodic
=
nint
(
360.
/
step
(
1
))
==
nlon
print
*
,
"periodic = "
,
periodic
if
(
periodic
)
call
assert
(
2
*
dist_lim
*
step
(
1
)
<
180.
,
&
"test_get_dispatch_snap dist_lim"
)
copy
=
merge
(
dist_lim
,
0
,
periodic
)
end
if
call
shpc_open
(
hshp
,
trim
(
shpc_dir
),
cyclone
=
.true.
,
slice
=
0
,
&
...
...
@@ -85,12 +65,7 @@ program test_get_dispatch_snap
action
=
"write"
)
end
if
call
ezmpi_bcast
(
corner
,
root
=
0
)
call
ezmpi_bcast
(
step
,
root
=
0
)
call
ezmpi_bcast
(
nlon
,
root
=
0
)
call
ezmpi_bcast
(
nlat
,
root
=
0
)
call
ezmpi_bcast
(
k
,
root
=
0
)
call
ezmpi_bcast
(
copy
,
root
=
0
)
call
ezmpi_bcast
(
n_dates
,
root
=
0
)
k_begin
=
ssm
%
d0
+
(
rank
*
n_dates
)
/
n_proc
...
...
@@ -100,13 +75,12 @@ program test_get_dispatch_snap
k_end
=
ssm
%
d0
+
n_dates
-
1
end
if
call
get_snapshot
(
s
,
nlon
,
nlat
,
corner
*
deg_to_rad
,
step
*
deg_to_rad
,
&
copy
,
[
hshp
],
[
ssm
],
k
,
k_end
,
rank
,
n_proc
,
max_delta
=
1
)
call
get_snapshot
(
s
,
[
hshp
],
[
ssm
],
k
,
k_end
,
rank
,
n_proc
)
CALL
shpc_close
(
hshp
)
call
dispatch_snapshot
(
s
,
unit_isolated
,
rank
,
k_begin
,
max_delta
=
1
,
k
=
k
)
call
dispatch_snapshot
(
s
,
unit_isolated
,
rank
,
k_begin
,
k
)
if
(
rank
==
0
)
then
call
save_snapshot
(
s
,
corner
,
step
,
nlon
,
nlat
,
copy
,
d
=
k
)
call
save_snapshot
(
s
,
copy
,
d
=
k
)
close
(
unit_isolated
)
end
if
...
...
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