diff --git a/Inst_eddies/Tests/test_mean_speed.f90 b/Inst_eddies/Tests/test_mean_speed.f90 index 2acadb9ba033e24a55097534bbe49e7e76aaed12..01400aaa4afe06d9534b6672fe65426a16e772d6 100644 --- a/Inst_eddies/Tests/test_mean_speed.f90 +++ b/Inst_eddies/Tests/test_mean_speed.f90 @@ -1,6 +1,7 @@ program test_mean_speed ! Libraries: + use contour_531, only: convert_to_ind use gpc_f, only: shp_read_pol, polygon use jumble, only: get_command_arg_dyn, deg_to_rad, twopi, rad_to_deg use shapelib, only: shpclose, shpfileobject @@ -15,7 +16,6 @@ program test_mean_speed real:: center_deg(2) = [9.625, - 33.875] ! longitude and latitude, in degrees real center(2) ! longitude and latitude, in rad integer:: ishape = 0 - integer i real lon_max ! longitude, in rad real step(2) ! longitude and latitude steps, in rad @@ -26,10 +26,6 @@ program test_mean_speed real, allocatable:: u(:, :), v(:, :) ! (nlon, nlat) wind, in m s-1 TYPE(shpfileobject) hshp type(polygon) p - - real, allocatable:: points_xy(:, :) ! (2, p%part(1)%n_points) - ! Points given by projection coordinates. - character(len = :), allocatable:: contour_filename real min_lon_p ! minimum longitude of p, in rad logical periodic ! grid is periodic in longitude @@ -73,10 +69,8 @@ program test_mean_speed stop 1 end if - allocate(points_xy(2, p%part(1)%n_points)) - forall (i = 1:p%part(1)%n_points) points_xy(:, i) = (p%part(1)%points(:, i) & - - corner) / step + 1. - print *, "mean azimuthal speed = ", mean_speed(u, v, p%part(1), points_xy, & - center, corner, step), "m s-1" + print *, "mean azimuthal speed = ", mean_speed(u, v, p%part(1), & + convert_to_ind(p%part(1)%points, corner, step), center, corner, step), & + "m s-1" end program test_mean_speed