Skip to content
Snippets Groups Projects
Commit 364f3d64 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

In program test_max_speed_contour_ssh, read the whole domain of the

input NetCDF files rather than selecting a window. Clearer and easier
to set up new tests.
parent 7956cb54
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment