From 07deceb7de864451b1134edea2a2688776a9ae0f Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:14:59 +0200 Subject: [PATCH] Update src/WaterFlow.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/WaterFlow.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WaterFlow.jl b/src/WaterFlow.jl index bdb13e21..d35bd599 100644 --- a/src/WaterFlow.jl +++ b/src/WaterFlow.jl @@ -13,10 +13,10 @@ Computes the spacing with central differences function spacing(lon,lat) dlon = zero(size(lon.val)[1:2]) dlat = zero(size(lat.val)[1:2]) - dlon[2:end-1,:] = (lon.val[3:end,:,1] - lon.val[1:end-2,:,1])/2 - dlon[1,:], dlon[end,:] = dlon[2,:], dlon[end-1,:] - dlat[:,2:end-1] = (lat.val[:,3:end,1] - lat.val[:,1:end-2,1])/2 - dlat[:,1], dlat[:,end] = dlat[:,2], dlat[:,end-1] + @views dlon[2:end-1,:] = (lon.val[3:end,:,1] - lon.val[1:end-2,:,1])/2 + @views dlon[1,:], dlon[end,:] = dlon[2,:], dlon[end-1,:] + @views dlat[:,2:end-1] = (lat.val[:,3:end,1] - lat.val[:,1:end-2,1])/2 + @views dlat[:,1], dlat[:,end] = dlat[:,2], dlat[:,end-1] return dlon, dlat end