commit bedd672cc8bc64cbbb68ad717b963d2391e6b881
parent 289da8a97695063b56b4ceb0f34e8e57ebafc8c3
Author: Anders Damsgaard <andersd@riseup.net>
Date: Tue, 25 Apr 2017 15:13:37 -0400
move paranthesis, add time range tests
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ocean.jl b/src/ocean.jl
@@ -188,7 +188,7 @@ function interpolateOceanState(ocean::Ocean, t::float)
break
end
- return ocean.u[:,:,:,i]*(1. - rel_time + ocean.u[:,:,:,i+1]*rel_time),
+ return ocean.u[:,:,:,i]*(1. - rel_time) + ocean.u[:,:,:,i+1]*rel_time,
ocean.v[:,:,:,i]*(1. - rel_time) + ocean.v[:,:,:,i+1]*rel_time,
ocean.h[:,:,:,i]*(1. - rel_time) + ocean.h[:,:,:,i+1]*rel_time,
ocean.e[:,:,:,i]*(1. - rel_time) + ocean.e[:,:,:,i+1]*rel_time
diff --git a/test/netcdf.jl b/test/netcdf.jl
@@ -16,3 +16,7 @@ ocean = SeaIce.readOceanNetCDF("Baltic/00010101.ocean_month.nc",
@test size(ocean.v) == (24, 15, 63, 5)
@test size(ocean.h) == (23, 14, 63, 5)
@test size(ocean.e) == (23, 14, 64, 5)
+
+info("Testing ocean state interpolation")
+@test_throws ErrorException SeaIce.findContacts!(ocean, time=0.)
+@test_throws ErrorException SeaIce.findContacts!(ocean, time=1.e34)