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
c0bc75b5
Commit
c0bc75b5
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Use procedures `config_graph` and `read_grid`
parent
5939685c
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
+2
-1
2 additions, 1 deletion
Overlap/CMakeLists.txt
Overlap/Tests/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Overlap/Tests/CMakeLists.txt
Overlap/Tests/test_read_snapshot.f90
+9
-37
9 additions, 37 deletions
Overlap/Tests/test_read_snapshot.f90
with
12 additions
and
38 deletions
Overlap/CMakeLists.txt
+
2
−
1
View file @
c0bc75b5
...
...
@@ -26,7 +26,8 @@ target_sources(test_spher_polygon_area PRIVATE spher_polygon_area.f90)
target_sources
(
test_nearby_extr PRIVATE read_grid.F90 read_snapshot.f90
read_eddy.f90
)
target_sources
(
test_set_max_speed PRIVATE read_eddy.f90
)
target_sources
(
test_read_snapshot PRIVATE read_snapshot.f90 read_eddy.f90
)
target_sources
(
test_read_snapshot PRIVATE read_snapshot.f90 read_eddy.f90
read_grid.F90 config_graph.F90
)
if
(
MPI_Fortran_HAVE_F08_MODULE
)
target_sources
(
test_send_recv PRIVATE send_snapshot.f90 recv_snapshot.f90
)
...
...
This diff is collapsed.
Click to expand it.
Overlap/Tests/CMakeLists.txt
+
1
−
0
View file @
c0bc75b5
...
...
@@ -10,6 +10,7 @@ target_sources(test_read_snapshot PRIVATE test_read_snapshot.f90
target_link_libraries
(
test_read_snapshot NetCDF95::netcdf95
Shapelib_03::shapelib_03 Contour_531::contour_531 gpc_f
Jumble::jumble NetCDF_Fortran::netcdff Numer_Rec_95::numer_rec_95
)
target_compile_definitions
(
test_read_snapshot PRIVATE CPP_SEQUENTIAL
)
# test_spher_polygon_area
add_executable
(
test_spher_polygon_area test_spher_polygon_area.f90
)
...
...
This diff is collapsed.
Click to expand it.
Overlap/Tests/test_read_snapshot.f90
+
9
−
37
View file @
c0bc75b5
...
...
@@ -3,11 +3,12 @@ program test_read_snapshot
use
,
intrinsic
::
ISO_FORTRAN_ENV
! Libraries:
use
jumble
,
only
:
get_command_arg_dyn
,
new_unit
,
deg_to_rad
,
assert
,
&
read_opcol
use
jumble
,
only
:
get_command_arg_dyn
,
new_unit
,
read_opcol
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
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
...
...
@@ -19,39 +20,20 @@ program test_read_snapshot
type
(
snapshot
)
s
TYPE
(
shpc_slice_handler
),
allocatable
::
hshp
(:)
! (n_slices)
type
(
shpc_slice_meta
),
allocatable
::
ssm
(:)
! (n_slices)
integer
copy
,
unit
,
k
,
i
,
iostat
integer
unit
,
k
,
i
,
iostat
integer
n_slices
! number of input SHPC directories
real
::
corner_deg
(
2
)
=
[
0.125
,
-
59.875
]
! longitude and latitude of the corner of the whole grid in input
! NetCDF, in degrees
real
::
step_deg
(
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.
namelist
/
main_nml
/
dist_lim
,
k
namelist
/
grid_nml
/
corner_deg
,
step_deg
,
nlon
,
nlat
namelist
/
main_nml
/
k
!-------------------------------------------------------------------------
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
)
! n_slices:
call
new_unit
(
unit
)
open
(
unit
,
file
=
shpc_dir
//
"/n_slices.txt"
,
status
=
"old"
,
&
action
=
"read"
,
position
=
"rewind"
,
iostat
=
iostat
)
...
...
@@ -81,17 +63,7 @@ program test_read_snapshot
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
*
,
"test_read_snapshot: periodic = "
,
periodic
if
(
periodic
)
call
assert
(
2
*
dist_lim
*
step_deg
(
1
)
<
180.
,
&
"test_read_snapshot dist_lim"
)
copy
=
merge
(
dist_lim
,
0
,
periodic
)
call
read_snapshot
(
s
,
hshp
,
ssm
,
nlon
,
nlat
,
k
,
&
corner
=
corner_deg
*
deg_to_rad
,
step
=
step_deg
*
deg_to_rad
,
&
copy
=
copy
)
call
read_snapshot
(
s
,
hshp
,
ssm
,
k
,
copy
)
do
i
=
1
,
n_slices
CALL
shpc_close
(
hshp
(
i
))
...
...
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