Skip to content
Snippets Groups Projects
Commit 51d5efbf authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent 11a0888a
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"input": "&main_nml /\n20454\n", "input": "&main_nml /\n20454\n",
"create_file": ["config_nml.txt", "&config_nml /\n"], "create_file": ["config_nml.txt", "&config_nml /\n"],
"title": "Get_1_outerm", "title": "Get_1_outerm",
"symlink": [ "symlink":
[
[ [
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"h.nc" "h.nc"
...@@ -26,7 +27,8 @@ ...@@ -26,7 +27,8 @@
"input": "&main_nml /\n20454\n", "input": "&main_nml /\n20454\n",
"create_file": ["config_nml.txt", "&config_nml /\n"], "create_file": ["config_nml.txt", "&config_nml /\n"],
"title": "Get_1_outerm_noise_2_8", "title": "Get_1_outerm_noise_2_8",
"symlink": [ "symlink":
[
[ [
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"h.nc" "h.nc"
...@@ -45,7 +47,8 @@ ...@@ -45,7 +47,8 @@
"input": "&main_nml /\n20454\n", "input": "&main_nml /\n20454\n",
"create_file": ["config_nml.txt", "&config_nml /\n"], "create_file": ["config_nml.txt", "&config_nml /\n"],
"title": "Get_1_outerm_noise_2", "title": "Get_1_outerm_noise_2",
"symlink": [ "symlink":
[
[ [
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"h.nc" "h.nc"
...@@ -429,7 +432,7 @@ ...@@ -429,7 +432,7 @@
"$src_dir/Inst_eddies/Tests/Input/uv_2006_01_01_coarse.nc", "$src_dir/Inst_eddies/Tests/Input/uv_2006_01_01_coarse.nc",
"uv.nc" "uv.nc"
] ]
] ]
}, },
{ {
"description": "Periodic domain.", "description": "Periodic domain.",
......
...@@ -3,8 +3,7 @@ program test_get_1_outerm ...@@ -3,8 +3,7 @@ program test_get_1_outerm
use, intrinsic:: ISO_FORTRAN_ENV use, intrinsic:: ISO_FORTRAN_ENV
! Libraries: ! Libraries:
use jumble, only: new_unit, count_lines use jumble, only: new_unit, count_lines, deg_to_rad
use jumble, only: deg_to_rad
use config_m, only: config use config_m, only: config
use derived_types, only: eddy, shpc_slice_handler, null_ssh_contour, & use derived_types, only: eddy, shpc_slice_handler, null_ssh_contour, &
...@@ -17,13 +16,7 @@ program test_get_1_outerm ...@@ -17,13 +16,7 @@ program test_get_1_outerm
implicit none implicit none
integer unit, n, l, date, nlon, nlat integer unit, n, l, date
real corner_deg(2), corner(2)
! longitude and latitude of the corner of the whole grid, in degrees
! and in rad
real step_deg(2), step(2) ! longitude and latitude steps, in degrees and rad
real, allocatable:: ssh(:, :) real, allocatable:: ssh(:, :)
! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic ! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic
...@@ -39,8 +32,19 @@ program test_get_1_outerm ...@@ -39,8 +32,19 @@ program test_get_1_outerm
real:: innermost_level = 0.2933 real:: innermost_level = 0.2933
! level of innermost contour, for each extremum ! level of innermost contour, for each extremum
logical periodic ! grid is periodic in longitude
logical:: cyclone = .true. logical:: cyclone = .true.
real corner_deg(2), corner(2)
! longitude and latitude of the corner of the whole grid, in degrees
! and in rad
real step_deg(2), step(2) ! longitude and latitude steps, in degrees and rad
integer nlon, nlat
! size of ssh array in input NetCDF, assuming no repeated point if
! the grid is global
logical periodic ! grid is periodic in longitude
TYPE(shpc_slice_handler) hshp TYPE(shpc_slice_handler) hshp
type(eddy) e type(eddy) e
...@@ -53,15 +57,16 @@ program test_get_1_outerm ...@@ -53,15 +57,16 @@ program test_get_1_outerm
!---------------------------------------------------------------- !----------------------------------------------------------------
write(unit = error_unit, nml = main_nml) write(unit = error_unit, nml = main_nml)
write(unit = error_unit, fmt = *) "Enter namelist main_nml." write(unit = error_unit, fmt = *) &
"test_get_1_outerm: Enter namelist main_nml."
read(unit = *, nml = main_nml) read(unit = *, nml = main_nml)
write(unit = *, nml = main_nml) write(unit = *, nml = main_nml)
print *, "test_get_1_outerm: date = ?"
read *, date
call config(exist = .false.) call config(exist = .false.)
call input_ssh(corner, step, nlon, nlat, periodic, ssh, u, v, corner_deg, & call input_ssh(corner, step, nlon, nlat, periodic, ssh, u, v, corner_deg, &
step_deg) step_deg)
print *, "date = ?" print *, "test_get_1_outerm: Reading from outside_points.csv..."
read *, date
print *, "Reading from outside_points.csv..."
call new_unit(unit) call new_unit(unit)
open(unit, file = "outside_points.csv", status = "old", action = "read", & open(unit, file = "outside_points.csv", status = "old", action = "read", &
position = "rewind") position = "rewind")
...@@ -94,9 +99,9 @@ program test_get_1_outerm ...@@ -94,9 +99,9 @@ program test_get_1_outerm
call write_eddy(e, hshp, date, i = 1) call write_eddy(e, hshp, date, i = 1)
write(hshp%unit, fmt = *) 0 write(hshp%unit, fmt = *) 0
CALL shpc_close(hshp) CALL shpc_close(hshp)
print *, 'Created "SHPC".' print *, 'test_get_1_outerm: Created "SHPC".'
else else
print *, "Could not find an outermost contour." print *, "test_get_1_outerm: Could not find an outermost contour."
end if end if
end program test_get_1_outerm end program test_get_1_outerm
program test_nearby_extr program test_nearby_extr
! Libraries: ! Libraries:
use jumble, only: get_command_arg_dyn, new_unit, read_opcol use jumble, only: get_command_arg_dyn, new_unit, read_opcol, deg_to_rad, &
use jumble, only: deg_to_rad, rad_to_deg rad_to_deg
use shapelib_03, only: dbf_read_attribute_03 use shapelib_03, only: dbf_read_attribute_03
use derived_types, only: snapshot, shpc_slice_handler, shpc_slice_meta use derived_types, only: snapshot, shpc_slice_handler, shpc_slice_meta
......
...@@ -3,11 +3,7 @@ ...@@ -3,11 +3,7 @@
"title": "Medium_mix", "title": "Medium_mix",
"description": "Append to medium-sized SHPC, mixing output to the three shapefiles.", "description": "Append to medium-sized SHPC, mixing output to the three shapefiles.",
"input": "&main_nml /\n", "input": "&main_nml /\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/n_dates_14/SHPC_cyclo"], "copy": ["$PWD/n_dates_14/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -17,11 +13,7 @@ ...@@ -17,11 +13,7 @@
"title": "Small_mix", "title": "Small_mix",
"description": "Append to small SHPC, mixing output to the three shapefiles.", "description": "Append to small SHPC, mixing output to the three shapefiles.",
"input": "&main_nml /\n", "input": "&main_nml /\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/n_dates_1/SHPC_cyclo"], "copy": ["$PWD/n_dates_1/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -30,11 +22,7 @@ ...@@ -30,11 +22,7 @@
"title": "Medium_sep", "title": "Medium_sep",
"description": "Append to medium-sized SHPC, separating output to the three shapefiles.", "description": "Append to medium-sized SHPC, separating output to the three shapefiles.",
"input": "&main_nml mixed = f/\n", "input": "&main_nml mixed = f/\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/n_dates_14/SHPC_cyclo"], "copy": ["$PWD/n_dates_14/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -43,11 +31,7 @@ ...@@ -43,11 +31,7 @@
"title": "Small_sep", "title": "Small_sep",
"description": "Append to small SHPC, separating output to the three shapefiles.", "description": "Append to small SHPC, separating output to the three shapefiles.",
"input": "&main_nml mixed = f/\n", "input": "&main_nml mixed = f/\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/n_dates_1/SHPC_cyclo"], "copy": ["$PWD/n_dates_1/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -59,10 +43,7 @@ ...@@ -59,10 +43,7 @@
"commands" : "commands" :
[ [
["mkdir", "SHPC_cyclo"], ["mkdir", "SHPC_cyclo"],
[ ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"]
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
]
], ],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -74,10 +55,7 @@ ...@@ -74,10 +55,7 @@
"commands" : "commands" :
[ [
["mkdir", "SHPC_cyclo"], ["mkdir", "SHPC_cyclo"],
[ ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"]
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
]
], ],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -86,11 +64,7 @@ ...@@ -86,11 +64,7 @@
"title": "Big_mix", "title": "Big_mix",
"description": "Append to big SHPC, mixing output to the three shapefiles.", "description": "Append to big SHPC, mixing output to the three shapefiles.",
"input": "&main_nml /\n", "input": "&main_nml /\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"], "copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
...@@ -99,11 +73,7 @@ ...@@ -99,11 +73,7 @@
"title": "Big_sep", "title": "Big_sep",
"description": "Append to big SHPC, separating output to the three shapefiles.", "description": "Append to big SHPC, separating output to the three shapefiles.",
"input": "&main_nml mixed = f/\n", "input": "&main_nml mixed = f/\n",
"command" : "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"],
[
"time",
"$build_dir/Inst_eddies/Tests/test_write_eddy"
],
"copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"], "copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"],
"stdout": "test_write_eddy_stdout.txt", "stdout": "test_write_eddy_stdout.txt",
"exclude_cmp": ["test_write_eddy_stderr.txt"] "exclude_cmp": ["test_write_eddy_stderr.txt"]
......
...@@ -17,8 +17,13 @@ program test_set_all_outerm ...@@ -17,8 +17,13 @@ program test_set_all_outerm
implicit none implicit none
type(snapshot) s type(snapshot) s
integer nlon, nlat
integer i real corner_deg(2), corner(2)
! longitude and latitude of the corner of the whole grid, in degrees
! and in rad
real step_deg(2), step(2) ! longitude and latitude steps, in degrees and rad
integer nlon, nlat, i
real, allocatable:: ssh(:, :) real, allocatable:: ssh(:, :)
! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic ! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic
...@@ -28,11 +33,6 @@ program test_set_all_outerm ...@@ -28,11 +33,6 @@ program test_set_all_outerm
! (1 - max_radius(1):nlon + max_radius(1), nlat) if periodic, else ! (1 - max_radius(1):nlon + max_radius(1), nlat) if periodic, else
! (nlon, nlat) wind, in m s-1 ! (nlon, nlat) wind, in m s-1
real corner_deg(2), corner(2)
! longitude and latitude of the corner of the whole grid, in degrees
! and in rad
real step_deg(2), step(2) ! longitude and latitude steps, in degrees and rad
logical periodic ! grid is periodic in longitude logical periodic ! grid is periodic in longitude
TYPE(shpc_slice_handler) hshp_cyclo, hshp_anti TYPE(shpc_slice_handler) hshp_cyclo, hshp_anti
...@@ -50,15 +50,15 @@ program test_set_all_outerm ...@@ -50,15 +50,15 @@ program test_set_all_outerm
s%list(i)%radius4 = 0 s%list(i)%radius4 = 0
end do end do
print *, "test_set_all_outerm: s%number_extr = ", s%number_extr
print *, "test_set_all_outerm: Average number of points per outermost ", &
"contour: ", sum(s%list%out_cont%n_points) / real(s%number_extr)
call shpc_create(hshp_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.) call shpc_create(hshp_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.)
call shpc_create(hshp_anti, shpc_dir = "SHPC_anti", cyclone = .false.) call shpc_create(hshp_anti, shpc_dir = "SHPC_anti", cyclone = .false.)
call write_snapshot(s, hshp_cyclo, hshp_anti, date = 1) call write_snapshot(s, hshp_cyclo, hshp_anti, date = 1)
print *, "s%number_extr = ", s%number_extr
CALL shpc_close(hshp_cyclo) CALL shpc_close(hshp_cyclo)
CALL shpc_close(hshp_anti) CALL shpc_close(hshp_anti)
print *, 'Created shapefile collections in SHPC_cyclo and SHPC_anti.' print *, 'test_set_all_outerm: Created shapefile collections in ', &
print *, "Average number of points per outermost contour: ", & 'SHPC_cyclo and SHPC_anti.'
sum(s%list%out_cont%n_points) / real(s%number_extr)
end program test_set_all_outerm end program test_set_all_outerm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment