diff --git a/Inst_eddies/Tests/short_tests.json b/Inst_eddies/Tests/short_tests.json index 9be0bf7206aa5bf46415199d2cf7f5c1ec5b7aef..ff14f05291584fd693f7e5b1a13a3fa20ecd003c 100644 --- a/Inst_eddies/Tests/short_tests.json +++ b/Inst_eddies/Tests/short_tests.json @@ -205,7 +205,6 @@ "command": "$build_dir/Inst_eddies/test_mean_speed" }, { - "input": "&main_nml /\n", "required": [ [ @@ -226,7 +225,6 @@ ["$build_dir/Inst_eddies/test_set_max_speed", "$PWD/Get_1_outerm/SHPC"] }, { - "input": "&MAIN_NML IND_TARG_EXTR=19,11 /\n", "required": [ [ diff --git a/Inst_eddies/Tests/test_set_max_speed.f90 b/Inst_eddies/Tests/test_set_max_speed.f90 index 9c340fc38a6e78386d76cc557d8a7bd993d73985..ab84c7bcc01c7617685586f873600499ea2c53c0 100644 --- a/Inst_eddies/Tests/test_set_max_speed.f90 +++ b/Inst_eddies/Tests/test_set_max_speed.f90 @@ -27,11 +27,7 @@ program test_set_max_speed real, allocatable:: ssh(:, :) ! (nlon, nlat) sea-surface height, in m real, allocatable:: u(:, :), v(:, :) ! (nlon, nlat) wind, in m s-1 type(eddy) e - - integer:: ind_targ_extr(2) = [5, 4] - ! indices of the target extremum, relative to corner - - real corner(2) + real corner(2), step(2) ! in rad TYPE(shp_tr) hshp_in TYPE(shpfileobject) hshp integer ifield, ishape @@ -40,8 +36,6 @@ program test_set_max_speed real, allocatable:: outside_points(:, :) ! (2, :) longitude and ! latitude, in rad, of all the extrema except the target extremum - namelist /main_nml/ ind_targ_extr - !---------------------------------------------------------------- call mpi_init @@ -55,14 +49,11 @@ program test_set_max_speed call get_command_arg_dyn(1, shp_tr_dir, & "Required argument: SHP-triplet-directory") - 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) - print *, "Reading from h.nc..." call nf95_open("h.nc", nf90_nowrite, ncid) + ! Read corner: + call find_coord(ncid, dimid = dimid, varid = varid, std_name = "longitude") call nf95_inquire_dimension(ncid, dimid, nclen = nlon) call nf95_get_var(ncid, varid, corner(1)) @@ -71,6 +62,8 @@ program test_set_max_speed call nf95_inquire_dimension(ncid, dimid, nclen = nlat) call nf95_get_var(ncid, varid, corner(2)) + corner = corner * deg_to_rad + allocate(ssh(nlon, nlat)) call nf95_inq_varid(ncid, "adt", varid) call nf95_get_var(ncid, varid, ssh) @@ -112,9 +105,10 @@ program test_set_max_speed outside_points = outside_points * deg_to_rad close(unit) + step = 0.25 * deg_to_rad - call set_max_speed(e, ind_targ_extr, outside_points, ssh, u, v, & - corner * deg_to_rad, step = [0.25, 0.25] * deg_to_rad) + call set_max_speed(e, nint((e%coord_extr - corner) / step) + 1, & + outside_points, ssh, u, v, corner, step) call shp_create_03("test_set_max_speed", shpt_polygon, hshp) call dbf_add_field_03(ifield, hshp, 'ssh', ftdouble, nwidth = 13, &