diff --git a/Inst_eddies/Tests/CMakeLists.txt b/Inst_eddies/Tests/CMakeLists.txt index e2f42889870ce8e57d82f6096ce089a95498c78c..68a562f5e25bdbbff2c41ba97e28a4b402d441a9 100644 --- a/Inst_eddies/Tests/CMakeLists.txt +++ b/Inst_eddies/Tests/CMakeLists.txt @@ -57,7 +57,7 @@ add_executable(test_mean_speed mean_speed.f90 ${CMAKE_CURRENT_LIST_DIR}/test_mean_speed.f90) target_link_libraries(test_mean_speed numer_rec_95 NetCDF95::netcdf95 - shapelib_03 contour_531 nr_util NetCDF_Fortran::NetCDF_Fortran gpc_f) + shapelib_03 contour_531 nr_util NetCDF_Fortran::NetCDF_Fortran gpc_f jumble) target_include_directories(test_mean_speed PRIVATE ${fortrangis_INCLUDE_DIR}) diff --git a/Inst_eddies/Tests/short_tests.json b/Inst_eddies/Tests/short_tests.json index a56d814c2e1bbd01a27ce1d374a63fdc337c5db0..53ebee4b513cfc0d57e8c691ab4e18ca940e6fb9 100644 --- a/Inst_eddies/Tests/short_tests.json +++ b/Inst_eddies/Tests/short_tests.json @@ -177,32 +177,25 @@ "input": "&main_nml /\n", "title": "Mean_speed", "required": [ - ["$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "uv.nc"], - ["$PWD/Get_1_outerm/SHPC/outermost_contour.shp", "contour.shp"], - ["$PWD/Get_1_outerm/SHPC/outermost_contour.dbf", "contour.dbf"], - ["$PWD/Get_1_outerm/SHPC/outermost_contour.shx", "contour.shx"] + ["$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "uv.nc"] ], - "command": "$build_dir/Inst_eddies/test_mean_speed" + "command": + [ + "$build_dir/Inst_eddies/test_mean_speed", + "$PWD/Get_1_outerm/SHPC/outermost_contour" + ] }, { "input": "&main_nml /\n", "title": "Mean_speed_alt", "required": [ - ["$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "uv.nc"], - [ - "$src_dir/Inst_eddies/Tests/Input/outermost_contour_alt.shp", - "contour.shp" - ], - [ - "$src_dir/Inst_eddies/Tests/Input/outermost_contour_alt.dbf", - "contour.dbf" - ], - [ - "$src_dir/Inst_eddies/Tests/Input/outermost_contour_alt.shx", - "contour.shx" - ] + ["$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "uv.nc"] ], - "command": "$build_dir/Inst_eddies/test_mean_speed" + "command": + [ + "$build_dir/Inst_eddies/test_mean_speed", + "$src_dir/Inst_eddies/Tests/Input/outermost_contour_alt" + ] }, { "required": diff --git a/Inst_eddies/Tests/test_mean_speed.f90 b/Inst_eddies/Tests/test_mean_speed.f90 index 3d6aca0d0aba5bcfcfd51c970074707b25d53c87..f7cc86964db9e61ff3b9b784ea8a907071bfb901 100644 --- a/Inst_eddies/Tests/test_mean_speed.f90 +++ b/Inst_eddies/Tests/test_mean_speed.f90 @@ -4,6 +4,7 @@ program test_mean_speed ! Libraries: use gpc_f, only: shpobj2pol, polygon + use jumble, only: get_command_arg_dyn use netcdf, only: nf90_nowrite use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var, & find_coord, nf95_inquire_dimension @@ -23,11 +24,13 @@ program test_mean_speed TYPE(shpfileobject) hshp TYPE(shpobject) psobject type(polygon) p + character(len = :), allocatable:: contour_filename namelist /main_nml/ center !--------------------------------------------------------------------- + call get_command_arg_dyn(1, contour_filename, "Required argument: shapefile") write(unit = error_unit, nml = main_nml) write(unit = error_unit, fmt = *) "Enter namelist main_nml." read(unit = *, nml = main_nml) @@ -53,7 +56,7 @@ program test_mean_speed call nf95_close(ncid) - call shp_open_03(hshp, "contour", "rb") + call shp_open_03(hshp, contour_filename, "rb") call shp_read_object_03(hshp, 0, psobject) CALL shpclose(hshp) p = shpobj2pol(psobject)