diff --git a/Inst_eddies/Tests/short_tests.json b/Inst_eddies/Tests/short_tests.json index 5891356c76a570eb7a9ed170cec4bce95e730d65..b9698263964cf689dd9fd0f554818515e612b7ef 100644 --- a/Inst_eddies/Tests/short_tests.json +++ b/Inst_eddies/Tests/short_tests.json @@ -3,7 +3,8 @@ "input": "&main_nml /\n20454\n", "create_file": ["config_nml.txt", "&config_nml /\n"], "title": "Get_1_outerm", - "symlink": [ + "symlink": + [ [ "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "h.nc" @@ -26,7 +27,8 @@ "input": "&main_nml /\n20454\n", "create_file": ["config_nml.txt", "&config_nml /\n"], "title": "Get_1_outerm_noise_2_8", - "symlink": [ + "symlink": + [ [ "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "h.nc" @@ -45,7 +47,8 @@ "input": "&main_nml /\n20454\n", "create_file": ["config_nml.txt", "&config_nml /\n"], "title": "Get_1_outerm_noise_2", - "symlink": [ + "symlink": + [ [ "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "h.nc" @@ -429,7 +432,7 @@ "$src_dir/Inst_eddies/Tests/Input/uv_2006_01_01_coarse.nc", "uv.nc" ] - ] + ] }, { "description": "Periodic domain.", diff --git a/Inst_eddies/Tests/test_get_1_outerm.f90 b/Inst_eddies/Tests/test_get_1_outerm.f90 index 0e6f6026b92dae16eb26a8a1ab8ce9718884d251..1516dfa61367c37dbb35fed9009b13065cfe660c 100644 --- a/Inst_eddies/Tests/test_get_1_outerm.f90 +++ b/Inst_eddies/Tests/test_get_1_outerm.f90 @@ -3,8 +3,7 @@ program test_get_1_outerm use, intrinsic:: ISO_FORTRAN_ENV ! Libraries: - use jumble, only: new_unit, count_lines - use jumble, only: deg_to_rad + use jumble, only: new_unit, count_lines, deg_to_rad use config_m, only: config use derived_types, only: eddy, shpc_slice_handler, null_ssh_contour, & @@ -17,13 +16,7 @@ program test_get_1_outerm implicit none - integer unit, n, l, date, nlon, nlat - - 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 unit, n, l, date real, allocatable:: ssh(:, :) ! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic @@ -39,8 +32,19 @@ program test_get_1_outerm real:: innermost_level = 0.2933 ! level of innermost contour, for each extremum - logical periodic ! grid is periodic in longitude 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(eddy) e @@ -53,15 +57,16 @@ program test_get_1_outerm !---------------------------------------------------------------- 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) write(unit = *, nml = main_nml) + print *, "test_get_1_outerm: date = ?" + read *, date call config(exist = .false.) call input_ssh(corner, step, nlon, nlat, periodic, ssh, u, v, corner_deg, & step_deg) - print *, "date = ?" - read *, date - print *, "Reading from outside_points.csv..." + print *, "test_get_1_outerm: Reading from outside_points.csv..." call new_unit(unit) open(unit, file = "outside_points.csv", status = "old", action = "read", & position = "rewind") @@ -94,9 +99,9 @@ program test_get_1_outerm call write_eddy(e, hshp, date, i = 1) write(hshp%unit, fmt = *) 0 CALL shpc_close(hshp) - print *, 'Created "SHPC".' + print *, 'test_get_1_outerm: Created "SHPC".' else - print *, "Could not find an outermost contour." + print *, "test_get_1_outerm: Could not find an outermost contour." end if end program test_get_1_outerm diff --git a/Inst_eddies/Tests/test_nearby_extr.f90 b/Inst_eddies/Tests/test_nearby_extr.f90 index b8022813ac7ade783b2cc0bdd43912d1ea1a63c4..1cd0fdb481a588f677d72b18e56a47e61b8c7bdc 100644 --- a/Inst_eddies/Tests/test_nearby_extr.f90 +++ b/Inst_eddies/Tests/test_nearby_extr.f90 @@ -1,8 +1,8 @@ program test_nearby_extr ! Libraries: - use jumble, only: get_command_arg_dyn, new_unit, read_opcol - use jumble, only: deg_to_rad, rad_to_deg + use jumble, only: get_command_arg_dyn, new_unit, read_opcol, deg_to_rad, & + rad_to_deg use shapelib_03, only: dbf_read_attribute_03 use derived_types, only: snapshot, shpc_slice_handler, shpc_slice_meta diff --git a/Inst_eddies/Tests/test_output.json b/Inst_eddies/Tests/test_output.json index 9645f4796a9b3141d870b6ad1dd1f8ef9b48c230..57bc29e701ef08c981a8823166c95a48b260e3a0 100644 --- a/Inst_eddies/Tests/test_output.json +++ b/Inst_eddies/Tests/test_output.json @@ -3,11 +3,7 @@ "title": "Medium_mix", "description": "Append to medium-sized SHPC, mixing output to the three shapefiles.", "input": "&main_nml /\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/n_dates_14/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -17,11 +13,7 @@ "title": "Small_mix", "description": "Append to small SHPC, mixing output to the three shapefiles.", "input": "&main_nml /\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/n_dates_1/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -30,11 +22,7 @@ "title": "Medium_sep", "description": "Append to medium-sized SHPC, separating output to the three shapefiles.", "input": "&main_nml mixed = f/\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/n_dates_14/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -43,11 +31,7 @@ "title": "Small_sep", "description": "Append to small SHPC, separating output to the three shapefiles.", "input": "&main_nml mixed = f/\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/n_dates_1/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -59,10 +43,7 @@ "commands" : [ ["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", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -74,10 +55,7 @@ "commands" : [ ["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", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -86,11 +64,7 @@ "title": "Big_mix", "description": "Append to big SHPC, mixing output to the three shapefiles.", "input": "&main_nml /\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] @@ -99,11 +73,7 @@ "title": "Big_sep", "description": "Append to big SHPC, separating output to the three shapefiles.", "input": "&main_nml mixed = f/\n", - "command" : - [ - "time", - "$build_dir/Inst_eddies/Tests/test_write_eddy" - ], + "command" : ["time", "$build_dir/Inst_eddies/Tests/test_write_eddy"], "copy": ["$PWD/Inst_eddies_9/SHPC_cyclo"], "stdout": "test_write_eddy_stdout.txt", "exclude_cmp": ["test_write_eddy_stderr.txt"] diff --git a/Inst_eddies/Tests/test_set_all_outerm.f90 b/Inst_eddies/Tests/test_set_all_outerm.f90 index a37e7ba6a1ef8f88f240b8756b42ec9dee496486..6c365f56a0052e9c1da1e4f641e0f1a5add8dd15 100644 --- a/Inst_eddies/Tests/test_set_all_outerm.f90 +++ b/Inst_eddies/Tests/test_set_all_outerm.f90 @@ -17,8 +17,13 @@ program test_set_all_outerm implicit none 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(:, :) ! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic @@ -28,11 +33,6 @@ program test_set_all_outerm ! (1 - max_radius(1):nlon + max_radius(1), nlat) if periodic, else ! (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 TYPE(shpc_slice_handler) hshp_cyclo, hshp_anti @@ -50,15 +50,15 @@ program test_set_all_outerm s%list(i)%radius4 = 0 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_anti, shpc_dir = "SHPC_anti", cyclone = .false.) 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_anti) - print *, 'Created shapefile collections in SHPC_cyclo and SHPC_anti.' - print *, "Average number of points per outermost contour: ", & - sum(s%list%out_cont%n_points) / real(s%number_extr) + print *, 'test_set_all_outerm: Created shapefile collections in ', & + 'SHPC_cyclo and SHPC_anti.' end program test_set_all_outerm