diff --git a/Tests/short_tests.json b/Tests/short_tests.json index e0552b964bf8056316b7471cf81a7dba4358b3e1..bbb442a7966d946ecd551bdeed0382814f923a9e 100644 --- a/Tests/short_tests.json +++ b/Tests/short_tests.json @@ -73,17 +73,16 @@ }, { "args" : ["$compil_prod_dir/test_max_speed_contour_ssh", - "$large_input_dir/h_2006_01_01.nc", - "$large_input_dir/uv_2006_01_01.nc"], + "$input_dir/h_region_1.nc", "$input_dir/uv_region_1.nc"], "title" : "Max_speed_contour_ssh", "input" : "&main_nml /\n" }, { "args" : ["$compil_prod_dir/test_max_speed_contour_ssh", - "$large_input_dir/h_2006_01_01.nc", - "$large_input_dir/uv_2006_01_01.nc"], + "$input_dir/h_region_1.nc", "$input_dir/uv_region_1.nc"], "title" : "Max_speed_contour_ssh_north", - "stdin_filename" : "$input_dir/max_speed_contour_ssh_nml.txt" + "stdin_filename" : "$input_dir/max_speed_contour_ssh_nml.txt", + "description": "direction = 2" }, { "args" : "$compil_prod_dir/test_mean_speed", diff --git a/Tests/test_max_speed_contour_ssh.f b/Tests/test_max_speed_contour_ssh.f index 90f91304a1589eb5c5b6732194ab465a659be772..1192b0707d90c789e34c2d35b37a3fbfe6342afe 100644 --- a/Tests/test_max_speed_contour_ssh.f +++ b/Tests/test_max_speed_contour_ssh.f @@ -5,29 +5,27 @@ program test_max_speed_contour_ssh ! Libraries: 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 + use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var, & + nf95_gw_var use nr_util, only: assert use max_speed_contour_ssh_m, only: max_speed_contour_ssh implicit none - integer:: ilon_llc = 21, ilat_llc = 215 ! lower left corner - integer:: ilon_urc = 49, ilat_urc = 231 ! upper right corner integer n_lon, n_lat character(len = :), allocatable:: adt_file, velocity_file integer ncid, varid - real, allocatable:: ssh(:, :) ! (n_lon, n_lat) sea-surface height, in m + real, allocatable:: ssh(:, :, :) ! (n_lon, n_lat, 1) sea-surface height, in m real, allocatable:: u(:, :), v(:, :) ! (n_lon, n_lat) wind, in m s-1 integer:: ind_extr(2) = [19, 11] - ! indices in the two dimensions of the extremum, relative to lower - ! left corner + ! indices in the two dimensions of the extremum integer:: radius = 3 - namelist /main_nml/ ilon_llc, ilat_llc, ilon_urc, ilat_urc, ind_extr, radius + namelist /main_nml/ ind_extr, radius !---------------------------------------------------------------- @@ -41,31 +39,29 @@ program test_max_speed_contour_ssh read(unit = *, nml = main_nml) write(unit = *, nml = main_nml) - n_lon = ilon_urc - ilon_llc + 1 - n_lat = ilat_urc - ilat_llc + 1 - allocate(ssh(n_lon, n_lat)) print *, "Reading from ", adt_file, "..." call nf95_open(adt_file, nf90_nowrite, ncid) - call nf95_inq_varid(ncid, "adt", varid) - call nf95_get_var(ncid, varid, ssh, start = [ilon_llc, ilat_llc, 1]) - + call nf95_gw_var(ncid, varid, ssh) call nf95_close(ncid) + n_lon = size(ssh, 1) + n_lat = size(ssh, 2) allocate(u(n_lon, n_lat), v(n_lon, n_lat)) print *, "Reading from ", velocity_file, "..." call nf95_open(velocity_file, nf90_nowrite, ncid) call nf95_inq_varid(ncid, "u", varid) - call nf95_get_var(ncid, varid, u, start = [ilon_llc, ilat_llc, 1]) + call nf95_get_var(ncid, varid, u) call nf95_inq_varid(ncid, "v", varid) - call nf95_get_var(ncid, varid, v, start = [ilon_llc, ilat_llc, 1]) + call nf95_get_var(ncid, varid, v) call nf95_close(ncid) - print *, "level = ", max_speed_contour_ssh(ssh, u, v, ind_extr, radius) + print *, "level = ", max_speed_contour_ssh(ssh(:, :, 1), u, v, ind_extr, & + radius) end program test_max_speed_contour_ssh