tmove paranthesis, add time range tests - Granular.jl - Julia package for granu… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit bedd672cc8bc64cbbb68ad717b963d2391e6b881 | |
parent 289da8a97695063b56b4ceb0f34e8e57ebafc8c3 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 25 Apr 2017 15:13:37 -0400 | |
move paranthesis, add time range tests | |
Diffstat: | |
M src/ocean.jl | 2 +- | |
M test/netcdf.jl | 4 ++++ | |
2 files changed, 5 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/src/ocean.jl b/src/ocean.jl | |
t@@ -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 | |
t@@ -16,3 +16,7 @@ ocean = SeaIce.readOceanNetCDF("Baltic/00010101.ocean_month.… | |
@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) |